stream-chat-react-native-core 4.14.1-beta.1 → 4.15.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.
- package/lib/commonjs/components/Attachment/FileAttachment.js +16 -7
- package/lib/commonjs/components/Attachment/FileAttachment.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/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.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/Message/Message.js +6 -6
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Message/Message.d.ts +9 -3
- package/package.json +2 -2
- package/src/components/Attachment/FileAttachment.tsx +3 -0
- package/src/components/Message/Message.tsx +9 -1
- package/src/components/Message/MessageSimple/utils/renderText.tsx +1 -1
- package/src/version.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import type { UserResponse } from 'stream-chat';
|
|
2
|
+
import type { Attachment, UserResponse } from 'stream-chat';
|
|
3
3
|
import { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';
|
|
4
4
|
import { ChatContextValue } from '../../contexts/chatContext/ChatContext';
|
|
5
5
|
import { KeyboardContextValue } from '../../contexts/keyboardContext/KeyboardContext';
|
|
@@ -24,12 +24,18 @@ export declare type UrlTouchableHandlerPayload = {
|
|
|
24
24
|
url?: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
+
export declare type FileAttachmentTouchableHandlerPayload<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
28
|
+
emitter: 'fileAttachment';
|
|
29
|
+
additionalInfo?: {
|
|
30
|
+
attachment?: Attachment<StreamChatGenerics>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
27
33
|
export declare type TouchableHandlerPayload = {
|
|
28
34
|
defaultHandler?: () => void;
|
|
29
35
|
event?: GestureResponderEvent;
|
|
30
36
|
} & ({
|
|
31
|
-
emitter?: TouchableEmitter
|
|
32
|
-
} | TextMentionTouchableHandlerPayload | UrlTouchableHandlerPayload);
|
|
37
|
+
emitter?: Exclude<TouchableEmitter, 'textMention' | 'textLink' | 'card' | 'fileAttachment'>;
|
|
38
|
+
} | TextMentionTouchableHandlerPayload | UrlTouchableHandlerPayload | FileAttachmentTouchableHandlerPayload);
|
|
33
39
|
export declare type MessageTouchableHandlerPayload<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = TouchableHandlerPayload & {
|
|
34
40
|
actionHandlers?: MessageActionHandlers;
|
|
35
41
|
additionalInfo?: Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.15.0-beta.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-art": "^17.0.2",
|
|
81
81
|
"react-native-markdown-package": "1.8.2",
|
|
82
82
|
"react-native-url-polyfill": "^1.3.0",
|
|
83
|
-
"stream-chat": "6.7.
|
|
83
|
+
"stream-chat": "~6.7.3"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react-native-svg": "^12.1.0"
|
|
@@ -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,
|
|
@@ -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<
|
|
@@ -261,7 +261,7 @@ export const renderText = <
|
|
|
261
261
|
);
|
|
262
262
|
|
|
263
263
|
const customRules = {
|
|
264
|
-
link: { link },
|
|
264
|
+
link: { react: link },
|
|
265
265
|
list: { react: list },
|
|
266
266
|
// Truncate long text content in the message overlay
|
|
267
267
|
paragraph: messageTextNumberOfLines ? { react: paragraphText } : {},
|
package/src/version.json
CHANGED