stream-chat-react-native-core 4.14.0-beta.1 → 4.15.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/FileAttachment.js +16 -7
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +10 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +6 -6
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +16 -7
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +10 -6
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/Message/Message.js +6 -6
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Message/Message.d.ts +9 -3
- package/package.json +1 -1
- package/src/components/Attachment/FileAttachment.tsx +3 -0
- package/src/components/ChannelPreview/ChannelPreview.tsx +6 -3
- package/src/components/Message/Message.tsx +9 -1
- package/src/version.json +1 -1
|
@@ -103,6 +103,7 @@ const FileAttachmentWithContext = <
|
|
|
103
103
|
onLongPress={(event) => {
|
|
104
104
|
if (onLongPress) {
|
|
105
105
|
onLongPress({
|
|
106
|
+
additionalInfo: { attachment },
|
|
106
107
|
emitter: 'fileAttachment',
|
|
107
108
|
event,
|
|
108
109
|
});
|
|
@@ -111,6 +112,7 @@ const FileAttachmentWithContext = <
|
|
|
111
112
|
onPress={(event) => {
|
|
112
113
|
if (onPress) {
|
|
113
114
|
onPress({
|
|
115
|
+
additionalInfo: { attachment },
|
|
114
116
|
defaultHandler: defaultOnPress,
|
|
115
117
|
emitter: 'fileAttachment',
|
|
116
118
|
event,
|
|
@@ -120,6 +122,7 @@ const FileAttachmentWithContext = <
|
|
|
120
122
|
onPressIn={(event) => {
|
|
121
123
|
if (onPressIn) {
|
|
122
124
|
onPressIn({
|
|
125
|
+
additionalInfo: { attachment },
|
|
123
126
|
defaultHandler: defaultOnPress,
|
|
124
127
|
emitter: 'fileAttachment',
|
|
125
128
|
event,
|
|
@@ -78,9 +78,12 @@ const ChannelPreviewWithContext = <
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
setLastMessage((prevLastMessage) => {
|
|
82
|
+
if (prevLastMessage?.id === event.message?.id) {
|
|
83
|
+
return event.message;
|
|
84
|
+
}
|
|
85
|
+
return prevLastMessage;
|
|
86
|
+
});
|
|
84
87
|
};
|
|
85
88
|
|
|
86
89
|
const listeners = [
|
|
@@ -73,15 +73,23 @@ export type UrlTouchableHandlerPayload = {
|
|
|
73
73
|
additionalInfo?: { url?: string };
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
export type FileAttachmentTouchableHandlerPayload<
|
|
77
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
78
|
+
> = {
|
|
79
|
+
emitter: 'fileAttachment';
|
|
80
|
+
additionalInfo?: { attachment?: Attachment<StreamChatGenerics> };
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
export type TouchableHandlerPayload = {
|
|
77
84
|
defaultHandler?: () => void;
|
|
78
85
|
event?: GestureResponderEvent;
|
|
79
86
|
} & (
|
|
80
87
|
| {
|
|
81
|
-
emitter?: TouchableEmitter
|
|
88
|
+
emitter?: Exclude<TouchableEmitter, 'textMention' | 'textLink' | 'card' | 'fileAttachment'>;
|
|
82
89
|
}
|
|
83
90
|
| TextMentionTouchableHandlerPayload
|
|
84
91
|
| UrlTouchableHandlerPayload
|
|
92
|
+
| FileAttachmentTouchableHandlerPayload
|
|
85
93
|
);
|
|
86
94
|
|
|
87
95
|
export type MessageTouchableHandlerPayload<
|
package/src/version.json
CHANGED