@messenger-box/platform-mobile 10.0.3-alpha.40 → 10.0.3-alpha.46

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 (54) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/compute.js +2 -3
  3. package/lib/index.js.map +1 -1
  4. package/lib/queries/inboxQueries.js +77 -0
  5. package/lib/queries/inboxQueries.js.map +1 -0
  6. package/lib/routes.json +2 -3
  7. package/lib/screens/inbox/DialogThreadMessages.js +3 -7
  8. package/lib/screens/inbox/DialogThreadMessages.js.map +1 -1
  9. package/lib/screens/inbox/DialogThreads.js +3 -7
  10. package/lib/screens/inbox/DialogThreads.js.map +1 -1
  11. package/lib/screens/inbox/components/DialogsListItem.js +47 -46
  12. package/lib/screens/inbox/components/DialogsListItem.js.map +1 -1
  13. package/lib/screens/inbox/components/GiftedChatInboxComponent.js +313 -0
  14. package/lib/screens/inbox/components/GiftedChatInboxComponent.js.map +1 -0
  15. package/lib/screens/inbox/components/ServiceDialogsListItem.js +72 -57
  16. package/lib/screens/inbox/components/ServiceDialogsListItem.js.map +1 -1
  17. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js +115 -14
  18. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js.map +1 -1
  19. package/lib/screens/inbox/components/SubscriptionHandler.js +24 -0
  20. package/lib/screens/inbox/components/SubscriptionHandler.js.map +1 -0
  21. package/lib/screens/inbox/containers/ConversationView.js +640 -493
  22. package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
  23. package/lib/screens/inbox/containers/Dialogs.js +100 -181
  24. package/lib/screens/inbox/containers/Dialogs.js.map +1 -1
  25. package/lib/screens/inbox/containers/ThreadConversationView.js +659 -245
  26. package/lib/screens/inbox/containers/ThreadConversationView.js.map +1 -1
  27. package/lib/screens/inbox/containers/ThreadsView.js +3 -3
  28. package/lib/screens/inbox/containers/ThreadsView.js.map +1 -1
  29. package/lib/screens/inbox/hooks/useInboxMessages.js +31 -0
  30. package/lib/screens/inbox/hooks/useInboxMessages.js.map +1 -0
  31. package/package.json +4 -4
  32. package/src/index.ts +2 -0
  33. package/src/queries/inboxQueries.ts +298 -0
  34. package/src/queries/index.d.ts +2 -0
  35. package/src/queries/index.ts +1 -0
  36. package/src/screens/inbox/DialogThreadMessages.tsx +3 -11
  37. package/src/screens/inbox/DialogThreads.tsx +3 -7
  38. package/src/screens/inbox/components/Actionsheet.tsx +30 -0
  39. package/src/screens/inbox/components/DialogsListItem.tsx +89 -148
  40. package/src/screens/inbox/components/ExpandableInput.tsx +460 -0
  41. package/src/screens/inbox/components/ExpandableInputActionSheet.tsx +518 -0
  42. package/src/screens/inbox/components/GiftedChatInboxComponent.tsx +411 -0
  43. package/src/screens/inbox/components/ServiceDialogsListItem.tsx +202 -221
  44. package/src/screens/inbox/components/SlackInput.tsx +23 -0
  45. package/src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx +216 -30
  46. package/src/screens/inbox/components/SubscriptionHandler.tsx +41 -0
  47. package/src/screens/inbox/components/SupportServiceDialogsListItem.tsx +6 -7
  48. package/src/screens/inbox/containers/ConversationView.tsx +1109 -669
  49. package/src/screens/inbox/containers/Dialogs.tsx +198 -342
  50. package/src/screens/inbox/containers/SupportServiceDialogs.tsx +2 -2
  51. package/src/screens/inbox/containers/ThreadConversationView.tsx +1141 -402
  52. package/src/screens/inbox/containers/ThreadsView.tsx +5 -5
  53. package/src/screens/inbox/hooks/useInboxMessages.ts +34 -0
  54. package/src/screens/inbox/machines/threadsMachine.ts +2 -2
@@ -1,4 +1,4 @@
1
- import React__default from'react';import {StyleSheet,TouchableHighlight,View,Text,Platform,Dimensions}from'react-native';import {MessageText,Time,utils}from'react-native-gifted-chat';import CachedImage from'../CachedImage/index.js';var __defProp = Object.defineProperty;
1
+ import React__default from'react';import {StyleSheet,View,TouchableHighlight,Text,Platform,Dimensions}from'react-native';import {MessageText,MessageImage,Time,utils}from'react-native-gifted-chat';import CachedImage from'../CachedImage/index.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -64,28 +64,109 @@ class Bubble extends React__default.Component {
64
64
  return null;
65
65
  }
66
66
  renderMessageImage() {
67
- if (this.props.currentMessage.image) {
68
- const _a = this.props, {
69
- containerStyle,
70
- wrapperStyle
71
- } = _a, messageImageProps = __objRest(_a, [
72
- "containerStyle",
73
- "wrapperStyle"
74
- ]);
67
+ const _a = this.props, {
68
+ currentMessage,
69
+ containerStyle,
70
+ wrapperStyle
71
+ } = _a, messageImageProps = __objRest(_a, [
72
+ "currentMessage",
73
+ "containerStyle",
74
+ "wrapperStyle"
75
+ ]);
76
+ if (currentMessage.images && Array.isArray(currentMessage.images) && currentMessage.images.length > 0) {
77
+ const validImages = currentMessage.images.filter((url) => url && typeof url === "string");
78
+ if (validImages.length === 0) {
79
+ return null;
80
+ }
81
+ return /* @__PURE__ */ React__default.createElement(View, { style: {
82
+ marginVertical: 0
83
+ } }, /* @__PURE__ */ React__default.createElement(View, { style: {
84
+ flexDirection: "row",
85
+ flexWrap: "wrap",
86
+ gap: 8
87
+ } }, validImages.map((imageUrl, index) => {
88
+ const isLocalImage = imageUrl.startsWith("file:") || imageUrl.startsWith("data:") || imageUrl.startsWith("content:") || !imageUrl.startsWith("http://") && !imageUrl.startsWith("https://");
89
+ const imageSize = validImages.length === 1 ? {
90
+ width: windowWidth * 0.6,
91
+ height: windowWidth * 0.4
92
+ } : {
93
+ width: windowWidth * 0.3,
94
+ height: windowWidth * 0.3
95
+ };
96
+ const isUploading = currentMessage.isUploading;
97
+ return /* @__PURE__ */ React__default.createElement(TouchableHighlight, { key: `image-${index}-${currentMessage._id}`, underlayColor: "transparent", onPress: () => {
98
+ if (isUploading)
99
+ return;
100
+ const imageObject = {
101
+ _id: `${currentMessage._id}-img-${index}`,
102
+ image: imageUrl
103
+ };
104
+ this.props.setImageViewer(imageObject, true);
105
+ } }, /* @__PURE__ */ React__default.createElement(View, { style: __spreadProps(__spreadValues({}, imageSize), {
106
+ maxHeight: 200,
107
+ borderRadius: 8,
108
+ overflow: "hidden",
109
+ borderWidth: 1,
110
+ borderColor: "#e0e0e0",
111
+ backgroundColor: "#f7f7f7"
112
+ }) }, isLocalImage ? /* @__PURE__ */ React__default.createElement(View, { style: {
113
+ width: "100%",
114
+ height: "100%"
115
+ } }, /* @__PURE__ */ React__default.createElement(MessageImage, __spreadProps(__spreadValues({}, messageImageProps), { currentMessage: __spreadProps(__spreadValues({}, currentMessage), {
116
+ image: imageUrl
117
+ }), imageStyle: {
118
+ width: "100%",
119
+ height: "100%",
120
+ borderRadius: 8
121
+ } })), isUploading && /* @__PURE__ */ React__default.createElement(View, { style: {
122
+ position: "absolute",
123
+ top: 0,
124
+ left: 0,
125
+ right: 0,
126
+ bottom: 0,
127
+ backgroundColor: "rgba(0,0,0,0.2)",
128
+ justifyContent: "center",
129
+ alignItems: "center"
130
+ } }, /* @__PURE__ */ React__default.createElement(Text, { style: {
131
+ color: "white",
132
+ fontWeight: "bold"
133
+ } }, "Uploading..."))) : /* @__PURE__ */ React__default.createElement(CachedImage, { style: [styles.slackImage, {
134
+ width: "100%",
135
+ height: "100%"
136
+ }], cacheKey: `${currentMessage._id}-img-${index}-slack-bubble-imageKey`, source: {
137
+ uri: imageUrl,
138
+ expiresIn: 86400
139
+ }, resizeMode: "cover", alt: "image", placeholderContent: /* @__PURE__ */ React__default.createElement(View, { style: [styles.slackImage, {
140
+ width: "100%",
141
+ height: "100%",
142
+ backgroundColor: "#e1e1e1",
143
+ justifyContent: "center",
144
+ alignItems: "center",
145
+ borderRadius: 8
146
+ }] }, /* @__PURE__ */ React__default.createElement(Text, null, isUploading ? "Uploading..." : "Loading...")) })));
147
+ })));
148
+ }
149
+ if (currentMessage.image) {
75
150
  if (this.props.renderMessageImage) {
76
151
  return this.props.renderMessageImage(messageImageProps);
77
152
  }
78
153
  const {
79
154
  image,
80
155
  _id
81
- } = messageImageProps == null ? void 0 : messageImageProps.currentMessage;
156
+ } = currentMessage;
82
157
  if (!image || typeof image !== "string") {
83
158
  return null;
84
159
  }
160
+ const isLocalImage = image.startsWith("file:") || image.startsWith("data:") || image.startsWith("content:") || !image.startsWith("http://") && !image.startsWith("https://");
161
+ const isUploading = currentMessage.isUploading;
85
162
  return /* @__PURE__ */ React__default.createElement(TouchableHighlight, { underlayColor: "transparent", style: {
86
163
  width: "100%",
87
- marginVertical: 5
88
- }, onPress: () => this.props.setImageViewer(messageImageProps == null ? void 0 : messageImageProps.currentMessage, true) }, /* @__PURE__ */ React__default.createElement(View, { style: {
164
+ marginVertical: 0
165
+ }, onPress: () => {
166
+ if (isUploading)
167
+ return;
168
+ this.props.setImageViewer(currentMessage, true);
169
+ } }, /* @__PURE__ */ React__default.createElement(View, { style: {
89
170
  width: windowWidth * 0.6,
90
171
  height: windowWidth * 0.4,
91
172
  maxHeight: 200,
@@ -94,7 +175,27 @@ class Bubble extends React__default.Component {
94
175
  borderWidth: 1,
95
176
  borderColor: "#e0e0e0",
96
177
  backgroundColor: "#f7f7f7"
97
- } }, /* @__PURE__ */ React__default.createElement(CachedImage, { style: [styles.slackImage, {
178
+ } }, isLocalImage ? /* @__PURE__ */ React__default.createElement(View, { style: {
179
+ width: "100%",
180
+ height: "100%",
181
+ position: "relative"
182
+ } }, /* @__PURE__ */ React__default.createElement(MessageImage, __spreadProps(__spreadValues({}, messageImageProps), { imageStyle: {
183
+ width: "100%",
184
+ height: "100%",
185
+ borderRadius: 8
186
+ } })), isUploading && /* @__PURE__ */ React__default.createElement(View, { style: {
187
+ position: "absolute",
188
+ top: 0,
189
+ left: 0,
190
+ right: 0,
191
+ bottom: 0,
192
+ backgroundColor: "rgba(0,0,0,0.2)",
193
+ justifyContent: "center",
194
+ alignItems: "center"
195
+ } }, /* @__PURE__ */ React__default.createElement(Text, { style: {
196
+ color: "white",
197
+ fontWeight: "bold"
198
+ } }, "Uploading..."))) : /* @__PURE__ */ React__default.createElement(CachedImage, { style: [styles.slackImage, {
98
199
  width: "100%",
99
200
  height: "100%"
100
201
  }], cacheKey: `${_id}-slack-bubble-imageKey`, source: {
@@ -107,7 +208,7 @@ class Bubble extends React__default.Component {
107
208
  justifyContent: "center",
108
209
  alignItems: "center",
109
210
  borderRadius: 8
110
- }] }, /* @__PURE__ */ React__default.createElement(Text, null, "Loading...")) })));
211
+ }] }, /* @__PURE__ */ React__default.createElement(Text, null, isUploading ? "Uploading..." : "Loading...")) })));
111
212
  }
112
213
  return null;
113
214
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SlackBubble.js","sources":["../../../../../src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx"],"sourcesContent":["/* eslint-disable no-underscore-dangle, no-use-before-define */\nimport React from 'react';\nimport { Text, StyleSheet, TouchableOpacity, TouchableHighlight, View, Platform, Dimensions } from 'react-native';\n\nimport { MessageText, MessageImage, Time, utils } from 'react-native-gifted-chat';\nimport CachedImage from '../CachedImage';\nconst { isSameUser, isSameDay } = utils;\nconst windowWidth = Dimensions.get('window').width;\nconst windowHeight = Dimensions.get('window').height;\n\nexport default class Bubble extends React.Component<any> {\n static defaultProps: {\n touchableProps: {};\n onLongPress: null;\n renderMessageImage: null;\n renderMessageText: null;\n renderCustomView: null;\n renderTime: null;\n currentMessage: { text: null; createdAt: null; image: null };\n nextMessage: {};\n previousMessage: {};\n containerStyle: {};\n wrapperStyle: {};\n tickStyle: {};\n containerToNextStyle: {};\n containerToPreviousStyle: {};\n isShowImageViewer: false;\n setImageViewer: (obj: any, v: boolean) => void;\n };\n static propTypes: any;\n constructor(props: any) {\n super(props);\n }\n\n renderMessageText() {\n if (this.props.currentMessage.text) {\n const { containerStyle, wrapperStyle, messageTextStyle, ...messageTextProps } = this.props;\n if (this.props.renderMessageText) {\n return this.props.renderMessageText(messageTextProps);\n }\n return (\n <MessageText\n {...messageTextProps}\n textStyle={{\n left: [\n styles.standardFont,\n styles.slackMessageText,\n messageTextProps.textStyle,\n messageTextStyle,\n ],\n }}\n />\n );\n }\n return null;\n }\n\n renderMessageImage() {\n if (this.props.currentMessage.image) {\n const { containerStyle, wrapperStyle, ...messageImageProps } = this.props;\n if (this.props.renderMessageImage) {\n return this.props.renderMessageImage(messageImageProps);\n }\n const { image, _id } = messageImageProps?.currentMessage;\n\n // Add validation for image URL\n if (!image || typeof image !== 'string') {\n return null;\n }\n\n // Class components can't use hooks like useMemo\n // Directly render the CachedImage instead\n return (\n <TouchableHighlight\n underlayColor={'transparent'}\n style={{ width: '100%', marginVertical: 5 }}\n onPress={() => this.props.setImageViewer(messageImageProps?.currentMessage, true)}\n >\n <View\n style={{\n width: windowWidth * 0.6, // 60% of screen width\n height: windowWidth * 0.4, // Maintain aspect ratio\n maxHeight: 200,\n borderRadius: 8,\n overflow: 'hidden',\n borderWidth: 1,\n borderColor: '#e0e0e0',\n backgroundColor: '#f7f7f7',\n }}\n >\n <CachedImage\n style={[styles.slackImage, { width: '100%', height: '100%' }]}\n cacheKey={`${_id}-slack-bubble-imageKey`}\n source={{\n uri: image,\n expiresIn: 86400,\n }}\n resizeMode={'cover'}\n alt={'image'}\n placeholderContent={\n <View\n style={[\n styles.slackImage,\n {\n width: '100%',\n height: '100%',\n backgroundColor: '#e1e1e1',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 8,\n },\n ]}\n >\n <Text>Loading...</Text>\n </View>\n }\n />\n </View>\n </TouchableHighlight>\n );\n }\n return null;\n }\n\n renderTicks() {\n const { currentMessage } = this.props;\n if (this.props.renderTicks) {\n return this.props.renderTicks(currentMessage);\n }\n if (currentMessage.user._id !== this.props.user._id) {\n return null;\n }\n if (currentMessage.sent || currentMessage.received) {\n return (\n <View style={[styles.headerItem, styles.tickView]}>\n {currentMessage.sent && (\n <Text style={[styles.standardFont, styles.tick, this.props.tickStyle]}>✓</Text>\n )}\n {currentMessage.received && (\n <Text style={[styles.standardFont, styles.tick, this.props.tickStyle]}>✓</Text>\n )}\n </View>\n );\n }\n return null;\n }\n\n renderUsername() {\n const username = this.props.currentMessage.user.name;\n if (username) {\n const { containerStyle, wrapperStyle, ...usernameProps } = this.props;\n if (this.props.renderUsername) {\n return this.props.renderUsername(usernameProps);\n }\n return (\n <Text style={[styles.standardFont, styles.headerItem, styles.username, this.props.usernameStyle]}>\n {username}\n </Text>\n );\n }\n return null;\n }\n\n renderTime() {\n if (this.props.currentMessage.createdAt) {\n const { containerStyle, wrapperStyle, ...timeProps }: any = this.props;\n if (this.props.renderTime) {\n return this.props.renderTime(timeProps);\n }\n return (\n <Time\n {...timeProps}\n containerStyle={{ left: [styles.timeContainer] }}\n textStyle={{\n left: [styles.standardFont, styles.headerItem, styles.time, timeProps.textStyle],\n }}\n />\n );\n }\n return null;\n }\n\n renderCustomView() {\n if (this.props.renderCustomView) {\n return this.props.renderCustomView(this.props);\n }\n return null;\n }\n\n render() {\n const isSameThread =\n isSameUser(this.props.currentMessage, this.props.previousMessage) &&\n isSameDay(this.props.currentMessage, this.props.previousMessage);\n\n const messageHeader = isSameThread ? null : (\n <View style={styles.headerView}>\n {this.renderUsername()}\n {this.renderTime()}\n {this.renderTicks()}\n </View>\n );\n\n return (\n <View style={[styles.container, this.props.containerStyle]}>\n <TouchableHighlight\n style={{ width: '100%' }}\n // underlayColor={'#c0c0c0'}\n underlayColor={'transparent'}\n disabled={true}\n accessibilityTraits=\"text\"\n {...this.props.touchableProps}\n >\n <View style={[styles.wrapper, this.props.wrapperStyle]}>\n <View>\n {this.renderCustomView()}\n {messageHeader}\n {this.renderMessageImage()}\n {this.renderMessageText()}\n </View>\n </View>\n </TouchableHighlight>\n </View>\n );\n }\n}\n\n// Note: Everything is forced to be \"left\" positioned with this component.\n// The \"right\" position is only used in the default Bubble.\nconst styles = StyleSheet.create({\n standardFont: {\n fontSize: 15,\n },\n slackMessageText: {\n marginLeft: 0,\n marginRight: 0,\n },\n container: {\n flex: 1,\n alignItems: 'flex-start',\n },\n wrapper: {\n marginRight: 60,\n minHeight: 20,\n justifyContent: 'flex-start',\n },\n username: {\n fontWeight: 'bold',\n top: 0,\n paddingTop: 0,\n marginTop: 0,\n },\n time: {\n textAlign: 'left',\n fontSize: 12,\n },\n timeContainer: {\n marginLeft: 0,\n marginRight: 0,\n marginBottom: 0,\n },\n headerItem: {\n marginRight: 10,\n },\n headerView: {\n // Try to align it better with the avatar on Android.\n marginTop: Platform.OS === 'android' ? -2 : 0,\n flexDirection: 'row',\n alignItems: 'baseline',\n },\n /* eslint-disable react-native/no-color-literals */\n tick: {\n backgroundColor: 'transparent',\n color: 'white',\n },\n /* eslint-enable react-native/no-color-literals */\n tickView: {\n flexDirection: 'row',\n },\n slackImage: {\n borderRadius: 3,\n marginLeft: 8,\n marginRight: 0,\n },\n});\n\n// Bubble.contextTypes = {\n// actionSheet: PropTypes.func,\n// };\n\nBubble.defaultProps = {\n touchableProps: {},\n onLongPress: null,\n renderMessageImage: null,\n renderMessageText: null,\n renderCustomView: null,\n renderTime: null,\n currentMessage: {\n text: null,\n createdAt: null,\n image: null,\n },\n nextMessage: {},\n previousMessage: {},\n containerStyle: {},\n wrapperStyle: {},\n tickStyle: {},\n containerToNextStyle: {},\n containerToPreviousStyle: {},\n isShowImageViewer: false,\n setImageViewer: (obj: any, v: boolean) => null,\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAA,EACJ,UAAA;AAAA,EACA;AACF,CAAI,GAAA,KAAA;AACJ,MAAM,WAAc,GAAA,UAAA,CAAW,GAAI,CAAA,QAAQ,CAAE,CAAA,KAAA;AACxB,UAAA,CAAW,GAAI,CAAA,QAAQ,CAAE,CAAA;AACzB,MAAA,MAAA,SAAeA,eAAM,SAAe,CAAA;AAAA,EAwBvD,YAAY,KAAY,EAAA;AACtB,IAAA,KAAA,CAAM,KAAK,CAAA;AAAA;AACb,EACA,iBAAoB,GAAA;AAClB,IAAI,IAAA,IAAA,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,IACjB,KAAO,EAAA;AAAA,GACT;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,YAAc,EAAA,CAAA;AAAA,IACd,UAAY,EAAA,CAAA;AAAA,IACZ,WAAa,EAAA;AAAA;AAEjB,CAAC,CAAA;AAMD,MAAA,CAAO,YAAe,GAAA;AAAA,EACpB,gBAAgB,EAAC;AAAA,EACjB,WAAa,EAAA,IAAA;AAAA,EACb,kBAAoB,EAAA,IAAA;AAAA,EACpB,iBAAmB,EAAA,IAAA;AAAA,EACnB,gBAAkB,EAAA,IAAA;AAAA,EAClB,UAAY,EAAA,IAAA;AAAA,EACZ,cAAgB,EAAA;AAAA,IACd,IAAM,EAAA,IAAA;AAAA,IACN,SAAW,EAAA,IAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACT;AAAA,EACA,aAAa,EAAC;AAAA,EACd,iBAAiB,EAAC;AAAA,EAClB,gBAAgB,EAAC;AAAA,EACjB,cAAc,EAAC;AAAA,EACf,WAAW,EAAC;AAAA,EACZ,sBAAsB,EAAC;AAAA,EACvB,0BAA0B,EAAC;AAAA,EAC3B,iBAAmB,EAAA,KAAA;AAAA,EACnB,cAAA,EAAgB,CAAC,GAAA,EAAU,CAAe,KAAA;AAC5C,CAAA"}
1
+ {"version":3,"file":"SlackBubble.js","sources":["../../../../../src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx"],"sourcesContent":["/* eslint-disable no-underscore-dangle, no-use-before-define */\nimport React from 'react';\nimport { Text, StyleSheet, TouchableOpacity, TouchableHighlight, View, Platform, Dimensions } from 'react-native';\n\nimport { MessageText, MessageImage, Time, utils } from 'react-native-gifted-chat';\nimport CachedImage from '../CachedImage';\nconst { isSameUser, isSameDay } = utils;\nconst windowWidth = Dimensions.get('window').width;\nconst windowHeight = Dimensions.get('window').height;\n\nexport default class Bubble extends React.Component<any> {\n static defaultProps: {\n touchableProps: {};\n onLongPress: null;\n renderMessageImage: null;\n renderMessageText: null;\n renderCustomView: null;\n renderTime: null;\n currentMessage: { text: null; createdAt: null; image: null };\n nextMessage: {};\n previousMessage: {};\n containerStyle: {};\n wrapperStyle: {};\n tickStyle: {};\n containerToNextStyle: {};\n containerToPreviousStyle: {};\n isShowImageViewer: false;\n setImageViewer: (obj: any, v: boolean) => void;\n };\n static propTypes: any;\n constructor(props: any) {\n super(props);\n }\n\n renderMessageText() {\n if (this.props.currentMessage.text) {\n const { containerStyle, wrapperStyle, messageTextStyle, ...messageTextProps } = this.props;\n if (this.props.renderMessageText) {\n return this.props.renderMessageText(messageTextProps);\n }\n return (\n <MessageText\n {...messageTextProps}\n textStyle={{\n left: [\n styles.standardFont,\n styles.slackMessageText,\n messageTextProps.textStyle,\n messageTextStyle,\n ],\n }}\n />\n );\n }\n return null;\n }\n\n renderMessageImage() {\n const { currentMessage, containerStyle, wrapperStyle, ...messageImageProps } = this.props;\n\n // Check if we have multiple images\n if (currentMessage.images && Array.isArray(currentMessage.images) && currentMessage.images.length > 0) {\n // Filter out any invalid or empty image URLs first\n const validImages = currentMessage.images.filter((url) => url && typeof url === 'string');\n\n // If no valid images after filtering, don't render anything\n if (validImages.length === 0) {\n return null;\n }\n\n // Render multiple images in a scrollable horizontal row\n return (\n <View style={{ marginVertical: 0 }}>\n <View\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n }}\n >\n {validImages.map((imageUrl, index) => {\n // Check if this is a local image\n const isLocalImage =\n imageUrl.startsWith('file:') ||\n imageUrl.startsWith('data:') ||\n imageUrl.startsWith('content:') ||\n (!imageUrl.startsWith('http://') && !imageUrl.startsWith('https://'));\n\n const imageSize =\n validImages.length === 1\n ? { width: windowWidth * 0.6, height: windowWidth * 0.4 }\n : { width: windowWidth * 0.3, height: windowWidth * 0.3 };\n\n // Show upload indicator if this message is uploading\n const isUploading = currentMessage.isUploading;\n\n return (\n <TouchableHighlight\n key={`image-${index}-${currentMessage._id}`}\n underlayColor={'transparent'}\n onPress={() => {\n // Don't allow viewing while uploading\n if (isUploading) return;\n\n // Create a message-like object with this image for the viewer\n const imageObject = {\n _id: `${currentMessage._id}-img-${index}`,\n image: imageUrl,\n };\n this.props.setImageViewer(imageObject, true);\n }}\n >\n <View\n style={{\n ...imageSize,\n maxHeight: 200,\n borderRadius: 8,\n overflow: 'hidden',\n borderWidth: 1,\n borderColor: '#e0e0e0',\n backgroundColor: '#f7f7f7',\n }}\n >\n {isLocalImage ? (\n // For local images, use direct Image component with no loading state\n <View style={{ width: '100%', height: '100%' }}>\n <MessageImage\n {...messageImageProps}\n currentMessage={{ ...currentMessage, image: imageUrl }}\n imageStyle={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n }}\n />\n\n {/* Show upload indicator if needed */}\n {isUploading && (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0,0,0,0.2)',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Text style={{ color: 'white', fontWeight: 'bold' }}>\n Uploading...\n </Text>\n </View>\n )}\n </View>\n ) : (\n // For remote images, use CachedImage with loading placeholder\n <CachedImage\n style={[styles.slackImage, { width: '100%', height: '100%' }]}\n cacheKey={`${currentMessage._id}-img-${index}-slack-bubble-imageKey`}\n source={{\n uri: imageUrl,\n expiresIn: 86400,\n }}\n resizeMode={'cover'}\n alt={'image'}\n placeholderContent={\n <View\n style={[\n styles.slackImage,\n {\n width: '100%',\n height: '100%',\n backgroundColor: '#e1e1e1',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 8,\n },\n ]}\n >\n <Text>{isUploading ? 'Uploading...' : 'Loading...'}</Text>\n </View>\n }\n />\n )}\n </View>\n </TouchableHighlight>\n );\n })}\n </View>\n </View>\n );\n }\n\n // Fall back to single image rendering if no images array\n if (currentMessage.image) {\n if (this.props.renderMessageImage) {\n return this.props.renderMessageImage(messageImageProps);\n }\n const { image, _id } = currentMessage;\n\n // Add validation for image URL\n if (!image || typeof image !== 'string') {\n return null;\n }\n\n // Check if this is a local image (from device camera/library)\n const isLocalImage =\n image.startsWith('file:') ||\n image.startsWith('data:') ||\n image.startsWith('content:') ||\n // Check if the image is a pendingUpload by checking if it doesn't start with http/https\n (!image.startsWith('http://') && !image.startsWith('https://'));\n\n // Check uploading state\n const isUploading = currentMessage.isUploading;\n\n // Class components can't use hooks like useMemo\n // Directly render the CachedImage instead\n return (\n <TouchableHighlight\n underlayColor={'transparent'}\n style={{ width: '100%', marginVertical: 0 }}\n onPress={() => {\n // Don't allow viewing while uploading\n if (isUploading) return;\n this.props.setImageViewer(currentMessage, true);\n }}\n >\n <View\n style={{\n width: windowWidth * 0.6, // 60% of screen width\n height: windowWidth * 0.4, // Maintain aspect ratio\n maxHeight: 200,\n borderRadius: 8,\n overflow: 'hidden',\n borderWidth: 1,\n borderColor: '#e0e0e0',\n backgroundColor: '#f7f7f7',\n }}\n >\n {isLocalImage ? (\n // For local images, use direct Image component with no loading state\n <View style={{ width: '100%', height: '100%', position: 'relative' }}>\n <MessageImage\n {...messageImageProps}\n imageStyle={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n }}\n />\n\n {/* Show upload indicator if needed */}\n {isUploading && (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0,0,0,0.2)',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Text style={{ color: 'white', fontWeight: 'bold' }}>Uploading...</Text>\n </View>\n )}\n </View>\n ) : (\n // For remote images, use CachedImage with loading placeholder\n <CachedImage\n style={[styles.slackImage, { width: '100%', height: '100%' }]}\n cacheKey={`${_id}-slack-bubble-imageKey`}\n source={{\n uri: image,\n expiresIn: 86400,\n }}\n resizeMode={'cover'}\n alt={'image'}\n placeholderContent={\n <View\n style={[\n styles.slackImage,\n {\n width: '100%',\n height: '100%',\n backgroundColor: '#e1e1e1',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 8,\n },\n ]}\n >\n <Text>{isUploading ? 'Uploading...' : 'Loading...'}</Text>\n </View>\n }\n />\n )}\n </View>\n </TouchableHighlight>\n );\n }\n\n return null;\n }\n\n renderTicks() {\n const { currentMessage } = this.props;\n if (this.props.renderTicks) {\n return this.props.renderTicks(currentMessage);\n }\n if (currentMessage.user._id !== this.props.user._id) {\n return null;\n }\n if (currentMessage.sent || currentMessage.received) {\n return (\n <View style={[styles.headerItem, styles.tickView]}>\n {currentMessage.sent && (\n <Text style={[styles.standardFont, styles.tick, this.props.tickStyle]}>✓</Text>\n )}\n {currentMessage.received && (\n <Text style={[styles.standardFont, styles.tick, this.props.tickStyle]}>✓</Text>\n )}\n </View>\n );\n }\n return null;\n }\n\n renderUsername() {\n const username = this.props.currentMessage.user.name;\n if (username) {\n const { containerStyle, wrapperStyle, ...usernameProps } = this.props;\n if (this.props.renderUsername) {\n return this.props.renderUsername(usernameProps);\n }\n return (\n <Text style={[styles.standardFont, styles.headerItem, styles.username, this.props.usernameStyle]}>\n {username}\n </Text>\n );\n }\n return null;\n }\n\n renderTime() {\n if (this.props.currentMessage.createdAt) {\n const { containerStyle, wrapperStyle, ...timeProps }: any = this.props;\n if (this.props.renderTime) {\n return this.props.renderTime(timeProps);\n }\n return (\n <Time\n {...timeProps}\n containerStyle={{ left: [styles.timeContainer] }}\n textStyle={{\n left: [styles.standardFont, styles.headerItem, styles.time, timeProps.textStyle],\n }}\n />\n );\n }\n return null;\n }\n\n renderCustomView() {\n if (this.props.renderCustomView) {\n return this.props.renderCustomView(this.props);\n }\n return null;\n }\n\n render() {\n const isSameThread =\n isSameUser(this.props.currentMessage, this.props.previousMessage) &&\n isSameDay(this.props.currentMessage, this.props.previousMessage);\n\n const messageHeader = isSameThread ? null : (\n <View style={styles.headerView}>\n {this.renderUsername()}\n {this.renderTime()}\n {this.renderTicks()}\n </View>\n );\n\n return (\n <View style={[styles.container, this.props.containerStyle]}>\n <TouchableHighlight\n style={{ width: '100%' }}\n // underlayColor={'#c0c0c0'}\n underlayColor={'transparent'}\n disabled={true}\n accessibilityTraits=\"text\"\n {...this.props.touchableProps}\n >\n <View style={[styles.wrapper, this.props.wrapperStyle]}>\n <View>\n {this.renderCustomView()}\n {messageHeader}\n {this.renderMessageImage()}\n {this.renderMessageText()}\n </View>\n </View>\n </TouchableHighlight>\n </View>\n );\n }\n}\n\n// Note: Everything is forced to be \"left\" positioned with this component.\n// The \"right\" position is only used in the default Bubble.\nconst styles = StyleSheet.create({\n standardFont: {\n fontSize: 15,\n },\n slackMessageText: {\n marginLeft: 0,\n marginRight: 0,\n },\n container: {\n flex: 1,\n alignItems: 'flex-start',\n },\n wrapper: {\n marginRight: 60,\n minHeight: 20,\n justifyContent: 'flex-start',\n },\n username: {\n fontWeight: 'bold',\n top: 0,\n paddingTop: 0,\n marginTop: 0,\n },\n time: {\n textAlign: 'left',\n fontSize: 12,\n },\n timeContainer: {\n marginLeft: 0,\n marginRight: 0,\n marginBottom: 0,\n },\n headerItem: {\n marginRight: 10,\n },\n headerView: {\n // Try to align it better with the avatar on Android.\n marginTop: Platform.OS === 'android' ? -2 : 0,\n flexDirection: 'row',\n alignItems: 'baseline',\n },\n /* eslint-disable react-native/no-color-literals */\n tick: {\n backgroundColor: 'transparent',\n color: 'white',\n },\n /* eslint-enable react-native/no-color-literals */\n tickView: {\n flexDirection: 'row',\n },\n slackImage: {\n borderRadius: 3,\n marginLeft: 8,\n marginRight: 0,\n },\n});\n\n// Bubble.contextTypes = {\n// actionSheet: PropTypes.func,\n// };\n\nBubble.defaultProps = {\n touchableProps: {},\n onLongPress: null,\n renderMessageImage: null,\n renderMessageText: null,\n renderCustomView: null,\n renderTime: null,\n currentMessage: {\n text: null,\n createdAt: null,\n image: null,\n },\n nextMessage: {},\n previousMessage: {},\n containerStyle: {},\n wrapperStyle: {},\n tickStyle: {},\n containerToNextStyle: {},\n containerToPreviousStyle: {},\n isShowImageViewer: false,\n setImageViewer: (obj: any, v: boolean) => null,\n};\n"],"names":["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AA;AAAA,GACf;AAAA,EACA,UAAY,EAAA;AAAA,IAEV,SAAW,EAAA,QAAA,CAAS,EAAO,KAAA,SAAA,GAAY,EAAK,GAAA,CAAA;AAAA,IAC5C,aAAe,EAAA,KAAA;AAAA,IACf,UAAY,EAAA;AAAA,GACd;AAAA,EAEA,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA,aAAA;AAAA,IACjB,KAAO,EAAA;AAAA,GACT;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,YAAc,EAAA,CAAA;AAAA,IACd,UAAY,EAAA,CAAA;AAAA,IACZ,WAAa,EAAA;AAAA;AAEjB,CAAC,CAAA;AAMD,MAAA,CAAO,YAAe,GAAA;AAAA,EACpB,gBAAgB,EAAC;AAAA,EACjB,WAAa,EAAA,IAAA;AAAA,EACb,kBAAoB,EAAA,IAAA;AAAA,EACpB,iBAAmB,EAAA,IAAA;AAAA,EACnB,gBAAkB,EAAA,IAAA;AAAA,EAClB,UAAY,EAAA,IAAA;AAAA,EACZ,cAAgB,EAAA;AAAA,IACd,IAAM,EAAA,IAAA;AAAA,IACN,SAAW,EAAA,IAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACT;AAAA,EACA,aAAa,EAAC;AAAA,EACd,iBAAiB,EAAC;AAAA,EAClB,gBAAgB,EAAC;AAAA,EACjB,cAAc,EAAC;AAAA,EACf,WAAW,EAAC;AAAA,EACZ,sBAAsB,EAAC;AAAA,EACvB,0BAA0B,EAAC;AAAA,EAC3B,iBAAmB,EAAA,KAAA;AAAA,EACnB,cAAA,EAAgB,CAAC,GAAA,EAAU,CAAe,KAAA;AAC5C,CAAA"}
@@ -0,0 +1,24 @@
1
+ import {useEffect}from'react';function SubscriptionHandler({
2
+ subscribeToMore,
3
+ document,
4
+ variables,
5
+ updateQuery,
6
+ onError,
7
+ enabled = true
8
+ }) {
9
+ useEffect(() => {
10
+ if (!enabled)
11
+ return;
12
+ const unsubscribe = subscribeToMore({
13
+ document,
14
+ variables,
15
+ updateQuery,
16
+ onError
17
+ });
18
+ return () => {
19
+ if (unsubscribe && typeof unsubscribe === "function")
20
+ unsubscribe();
21
+ };
22
+ }, [subscribeToMore, document, JSON.stringify(variables), updateQuery, onError, enabled]);
23
+ return null;
24
+ }export{SubscriptionHandler};//# sourceMappingURL=SubscriptionHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionHandler.js","sources":["../../../../src/screens/inbox/components/SubscriptionHandler.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\n/**\n * Shared SubscriptionHandler for Apollo subscribeToMore\n *\n * @param subscribeToMore - Apollo subscribeToMore function\n * @param document - GraphQL subscription document\n * @param variables - Variables for the subscription\n * @param updateQuery - Apollo updateQuery function\n * @param onError - Optional error handler\n * @param enabled - If false, disables the subscription\n */\nexport function SubscriptionHandler({\n subscribeToMore,\n document,\n variables,\n updateQuery,\n onError,\n enabled = true,\n}: {\n subscribeToMore: Function;\n document: any;\n variables: Record<string, any>;\n updateQuery: (prev: any, { subscriptionData }: any) => any;\n onError?: (error: any) => void;\n enabled?: boolean;\n}) {\n useEffect(() => {\n if (!enabled) return;\n const unsubscribe = subscribeToMore({\n document,\n variables,\n updateQuery,\n onError,\n });\n return () => {\n if (unsubscribe && typeof unsubscribe === 'function') unsubscribe();\n };\n }, [subscribeToMore, document, JSON.stringify(variables), updateQuery, onError, enabled]);\n return null;\n}\n"],"names":[],"mappings":"8BAYO,SAAS,mBAAoB,CAAA;AAAA,EAClC,eAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAU,GAAA;AACZ,CASG,EAAA;AACD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,OAAA;AAAS,MAAA;AACd,IAAA,MAAM,cAAc,eAAgB,CAAA;AAAA,MAClC,QAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACD,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAI,IAAA,WAAA,IAAe,OAAO,WAAgB,KAAA,UAAA;AAAY,QAAY,WAAA,EAAA;AAAA,KACpE;AAAA,GACF,EAAG,CAAC,eAAA,EAAiB,QAAU,EAAA,IAAA,CAAK,SAAU,CAAA,SAAS,CAAG,EAAA,WAAA,EAAa,OAAS,EAAA,OAAO,CAAC,CAAA;AACxF,EAAO,OAAA,IAAA;AACT"}