react-native-gifted-chat 2.4.0 → 2.5.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/README.md +16 -6
- package/lib/Actions.d.ts +5 -6
- package/lib/Actions.js +16 -13
- package/lib/Actions.js.map +1 -1
- package/lib/Avatar.d.ts +10 -24
- package/lib/Avatar.js +24 -35
- package/lib/Avatar.js.flow +1 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/Bubble.d.ts +30 -29
- package/lib/Bubble.js +90 -72
- package/lib/Bubble.js.flow +3 -1
- package/lib/Bubble.js.map +1 -1
- package/lib/Composer.d.ts +1 -1
- package/lib/Composer.js +30 -32
- package/lib/Composer.js.map +1 -1
- package/lib/Constant.js +1 -0
- package/lib/Constant.js.map +1 -1
- package/lib/Day.d.ts +3 -15
- package/lib/Day.js +2 -14
- package/lib/Day.js.flow +1 -1
- package/lib/Day.js.map +1 -1
- package/lib/GiftedAvatar.d.ts +7 -7
- package/lib/GiftedAvatar.js +30 -29
- package/lib/GiftedAvatar.js.map +1 -1
- package/lib/GiftedChat.d.ts +16 -89
- package/lib/GiftedChat.js +204 -350
- package/lib/GiftedChat.js.flow +3 -3
- package/lib/GiftedChat.js.map +1 -1
- package/lib/GiftedChatContext.d.ts +2 -1
- package/lib/GiftedChatContext.js.map +1 -1
- package/lib/InputToolbar.d.ts +7 -5
- package/lib/InputToolbar.js +41 -34
- package/lib/InputToolbar.js.map +1 -1
- package/lib/LoadEarlier.d.ts +4 -4
- package/lib/LoadEarlier.js +8 -6
- package/lib/LoadEarlier.js.map +1 -1
- package/lib/Message.d.ts +8 -9
- package/lib/Message.js +47 -40
- package/lib/Message.js.flow +1 -1
- package/lib/Message.js.map +1 -1
- package/lib/MessageAudio.d.ts +2 -1
- package/lib/MessageAudio.js +4 -4
- package/lib/MessageAudio.js.flow +1 -1
- package/lib/MessageAudio.js.map +1 -1
- package/lib/MessageContainer.d.ts +17 -17
- package/lib/MessageContainer.js +33 -51
- package/lib/MessageContainer.js.map +1 -1
- package/lib/MessageImage.d.ts +8 -5
- package/lib/MessageImage.js +6 -6
- package/lib/MessageImage.js.flow +1 -1
- package/lib/MessageImage.js.map +1 -1
- package/lib/MessageText.d.ts +11 -10
- package/lib/MessageText.js +5 -10
- package/lib/MessageText.js.flow +1 -1
- package/lib/MessageText.js.map +1 -1
- package/lib/MessageVideo.d.ts +2 -1
- package/lib/MessageVideo.js +4 -4
- package/lib/MessageVideo.js.flow +1 -1
- package/lib/MessageVideo.js.map +1 -1
- package/lib/Models.d.ts +7 -7
- package/lib/QuickReplies.d.ts +4 -3
- package/lib/QuickReplies.js +10 -16
- package/lib/QuickReplies.js.flow +4 -2
- package/lib/QuickReplies.js.map +1 -1
- package/lib/Send.d.ts +4 -4
- package/lib/Send.js +6 -9
- package/lib/Send.js.map +1 -1
- package/lib/SystemMessage.d.ts +6 -5
- package/lib/SystemMessage.js +1 -2
- package/lib/SystemMessage.js.flow +1 -1
- package/lib/SystemMessage.js.map +1 -1
- package/lib/Time.d.ts +7 -6
- package/lib/Time.js +1 -3
- package/lib/Time.js.flow +1 -1
- package/lib/Time.js.map +1 -1
- package/lib/TypingIndicator.d.ts +2 -1
- package/lib/TypingIndicator.js +5 -5
- package/lib/TypingIndicator.js.map +1 -1
- package/lib/hooks/useUpdateLayoutEffect.js +2 -4
- package/lib/hooks/useUpdateLayoutEffect.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/logging.d.ts +2 -2
- package/lib/logging.js.map +1 -1
- package/lib/types.js.flow +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +2 -4
- package/lib/utils.js.map +1 -1
- package/package.json +83 -53
- package/src/Actions.tsx +114 -0
- package/src/Avatar.tsx +178 -0
- package/src/Bubble.tsx +601 -0
- package/src/Color.ts +17 -0
- package/src/Composer.tsx +147 -0
- package/src/Constant.ts +18 -0
- package/src/Day.tsx +71 -0
- package/src/GiftedAvatar.tsx +205 -0
- package/src/GiftedChat.tsx +670 -0
- package/src/GiftedChatContext.ts +23 -0
- package/src/InputToolbar.tsx +113 -0
- package/src/LoadEarlier.tsx +108 -0
- package/src/Message.tsx +229 -0
- package/src/MessageAudio.tsx +19 -0
- package/src/MessageContainer.tsx +362 -0
- package/src/MessageImage.tsx +78 -0
- package/src/MessageText.tsx +187 -0
- package/src/MessageVideo.tsx +19 -0
- package/src/Models.ts +84 -0
- package/src/QuickReplies.tsx +186 -0
- package/src/Send.tsx +102 -0
- package/src/SystemMessage.tsx +61 -0
- package/src/Time.tsx +97 -0
- package/src/TypingIndicator.tsx +108 -0
- package/src/__tests__/Actions.test.tsx +10 -0
- package/src/__tests__/Avatar.test.tsx +13 -0
- package/src/__tests__/Bubble.test.tsx +23 -0
- package/src/__tests__/Color.test.tsx +5 -0
- package/src/__tests__/Composer.test.tsx +11 -0
- package/src/__tests__/Constant.test.tsx +5 -0
- package/src/__tests__/Day.test.tsx +23 -0
- package/src/__tests__/GiftedAvatar.test.tsx +11 -0
- package/src/__tests__/GiftedChat.test.tsx +36 -0
- package/src/__tests__/InputToolbar.test.tsx +11 -0
- package/src/__tests__/LoadEarlier.test.tsx +11 -0
- package/src/__tests__/Message.test.tsx +77 -0
- package/src/__tests__/MessageContainer.test.tsx +11 -0
- package/src/__tests__/MessageImage.test.tsx +27 -0
- package/src/__tests__/MessageText.test.tsx +11 -0
- package/src/__tests__/Send.test.tsx +22 -0
- package/src/__tests__/SystemMessage.test.tsx +27 -0
- package/src/__tests__/Time.test.tsx +29 -0
- package/src/__tests__/__snapshots__/Actions.test.tsx.snap +76 -0
- package/src/__tests__/__snapshots__/Avatar.test.tsx.snap +17 -0
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +145 -0
- package/src/__tests__/__snapshots__/Color.test.tsx.snap +21 -0
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +35 -0
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +16 -0
- package/src/__tests__/__snapshots__/Day.test.tsx.snap +37 -0
- package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +22 -0
- package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +15 -0
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +60 -0
- package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +74 -0
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +628 -0
- package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +127 -0
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +38 -0
- package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +30 -0
- package/src/__tests__/__snapshots__/Send.test.tsx.snap +129 -0
- package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +38 -0
- package/src/__tests__/__snapshots__/Time.test.tsx.snap +33 -0
- package/src/__tests__/data.ts +8 -0
- package/src/__tests__/utils.test.ts +31 -0
- package/src/hooks/useUpdateLayoutEffect.ts +21 -0
- package/src/index.ts +4 -0
- package/src/logging.ts +8 -0
- package/src/utils.ts +39 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -21
- package/jest.config.js +0 -15
package/README.md
CHANGED
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
<a href="https://www.npmjs.com/package/react-native-gifted-chat">
|
|
17
17
|
<img alt="npm downloads" src="https://img.shields.io/npm/dm/react-native-gifted-chat.svg"/></a>
|
|
18
18
|
<a href="https://www.npmjs.com/package/react-native-gifted-chat"><img alt="npm version" src="https://badge.fury.io/js/react-native-gifted-chat.svg"/></a>
|
|
19
|
-
<a href="https://reactnative.gallery/FaridSafi/gifted-chat"><img src="https://img.shields.io/badge/reactnative.gallery-%F0%9F%8E%AC-green.svg"/></a>
|
|
20
|
-
|
|
21
19
|
</p>
|
|
22
20
|
<p align="center">
|
|
23
21
|
<a href="https://circleci.com/gh/FaridSafi/react-native-gifted-chat"><img src="https://circleci.com/gh/FaridSafi/react-native-gifted-chat.svg?style=shield" alt="build"></a>
|
|
@@ -67,6 +65,20 @@
|
|
|
67
65
|
</p>
|
|
68
66
|
</p>
|
|
69
67
|
|
|
68
|
+
<p align="center">
|
|
69
|
+
<br/>
|
|
70
|
+
<a href="https://www.ethora.com" target="_blank">
|
|
71
|
+
<img src="https://www.dappros.com/wp-content/uploads/2023/12/Ethora-Logo.png" width="300px">
|
|
72
|
+
</a>
|
|
73
|
+
<br>
|
|
74
|
+
<p align="center">
|
|
75
|
+
A complete app engine featuring GiftedChat
|
|
76
|
+
</p>
|
|
77
|
+
<p align="center">
|
|
78
|
+
<a href="https://bit.ly/ethorachat" target="_blank">Check out our GitHub</a>
|
|
79
|
+
</p>
|
|
80
|
+
</p>
|
|
81
|
+
|
|
70
82
|
## The future of GiftedChat 🎉
|
|
71
83
|
|
|
72
84
|
Please give us your advice: [Related PR](https://github.com/FaridSafi/react-native-gifted-chat/pull/1775)
|
|
@@ -186,7 +198,7 @@ See [`App.tsx`](https://github.com/FaridSafi/react-native-gifted-chat/blob/maste
|
|
|
186
198
|
|
|
187
199
|
## "Slack" example
|
|
188
200
|
|
|
189
|
-
See the files in [`example-slack-message`](example-slack-message) for an example of how to override the default UI to make something that looks more like Slack -- with usernames displayed and all messages on the left.
|
|
201
|
+
See the files in [`example/example-slack-message`](example/example-slack-message) for an example of how to override the default UI to make something that looks more like Slack -- with usernames displayed and all messages on the left.
|
|
190
202
|
|
|
191
203
|
## Message object
|
|
192
204
|
|
|
@@ -252,7 +264,7 @@ See PR [#1211](https://github.com/FaridSafi/react-native-gifted-chat/pull/1211)
|
|
|
252
264
|
interface Reply {
|
|
253
265
|
title: string
|
|
254
266
|
value: string
|
|
255
|
-
messageId?:
|
|
267
|
+
messageId?: number | string
|
|
256
268
|
}
|
|
257
269
|
|
|
258
270
|
interface QuickReplies {
|
|
@@ -334,7 +346,6 @@ interface QuickReplies {
|
|
|
334
346
|
- **`timeFormat`** _(String)_ - Format to use for rendering times; default is `'LT'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
|
|
335
347
|
- **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'ll'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
|
|
336
348
|
- **`loadEarlier`** _(Bool)_ - Enables the "load earlier messages" button, required for `infiniteScroll`
|
|
337
|
-
- **`isKeyboardInternallyHandled`** _(Bool)_ - Determine whether to handle keyboard awareness inside the plugin. If you have your own keyboard handling outside the plugin set this to false; default is `true`
|
|
338
349
|
- **`onLoadEarlier`** _(Function)_ - Callback when loading earlier messages
|
|
339
350
|
- **`isLoadingEarlier`** _(Bool)_ - Display an `ActivityIndicator` when loading earlier messages
|
|
340
351
|
- **`renderLoading`** _(Function)_ - Render a loading view when initializing
|
|
@@ -373,7 +384,6 @@ interface QuickReplies {
|
|
|
373
384
|
- **`renderSend`** _(Function)_ - Custom send button; you can pass children to the original `Send` component quite easily, for example, to use a custom icon ([example](https://github.com/FaridSafi/react-native-gifted-chat/pull/487))
|
|
374
385
|
- **`renderAccessory`** _(Function)_ - Custom second line of actions below the message composer
|
|
375
386
|
- **`onPressActionButton`** _(Function)_ - Callback when the Action button is pressed (if set, the default `actionSheet` will not be used)
|
|
376
|
-
- **`bottomOffset`** _(Integer)_ - Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar)
|
|
377
387
|
- **`minInputToolbarHeight`** _(Integer)_ - Minimum height of the input toolbar; default is `44`
|
|
378
388
|
- **`listViewProps`** _(Object)_ - Extra props to be passed to the messages [`<ListView>`](https://facebook.github.io/react-native/docs/listview.html); some props can't be overridden, see the code in `MessageContainer.render()` for details
|
|
379
389
|
- **`textInputProps`** _(Object)_ - Extra props to be passed to the [`<TextInput>`](https://facebook.github.io/react-native/docs/textinput.html)
|
package/lib/Actions.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
4
4
|
export interface ActionsProps {
|
|
5
5
|
options?: {
|
|
6
|
-
[key: string]:
|
|
6
|
+
[key: string]: () => void;
|
|
7
7
|
};
|
|
8
8
|
optionTintColor?: string;
|
|
9
9
|
icon?: () => ReactNode;
|
|
@@ -12,15 +12,14 @@ export interface ActionsProps {
|
|
|
12
12
|
containerStyle?: StyleProp<ViewStyle>;
|
|
13
13
|
onPressActionButton?(): void;
|
|
14
14
|
}
|
|
15
|
-
export declare function Actions({ options, optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }: ActionsProps): JSX.Element;
|
|
15
|
+
export declare function Actions({ options, optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }: ActionsProps): React.JSX.Element;
|
|
16
16
|
export declare namespace Actions {
|
|
17
17
|
var propTypes: {
|
|
18
|
-
onSend: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
18
|
options: PropTypes.Requireable<object>;
|
|
20
19
|
optionTintColor: PropTypes.Requireable<string>;
|
|
21
20
|
icon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
21
|
onPressActionButton: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
-
wrapperStyle: PropTypes.Requireable<number | boolean | object
|
|
24
|
-
containerStyle: PropTypes.Requireable<number | boolean | object
|
|
22
|
+
wrapperStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
23
|
+
containerStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
25
24
|
};
|
|
26
25
|
}
|
package/lib/Actions.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
3
|
import { StyleSheet, Text, TouchableOpacity, View, } from 'react-native';
|
|
4
4
|
import Color from './Color';
|
|
5
5
|
import { StylePropType } from './utils';
|
|
6
6
|
import { useChatContext } from './GiftedChatContext';
|
|
7
|
-
|
|
8
|
-
export function Actions({ options = {}, optionTintColor = Color.optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }) {
|
|
7
|
+
export function Actions({ options, optionTintColor = Color.optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }) {
|
|
9
8
|
const { actionSheet } = useChatContext();
|
|
10
|
-
const onActionsPress =
|
|
9
|
+
const onActionsPress = useCallback(() => {
|
|
10
|
+
if (!options)
|
|
11
|
+
return;
|
|
11
12
|
const optionKeys = Object.keys(options);
|
|
12
13
|
const cancelButtonIndex = optionKeys.indexOf('Cancel');
|
|
13
14
|
actionSheet().showActionSheetWithOptions({
|
|
@@ -15,26 +16,25 @@ export function Actions({ options = {}, optionTintColor = Color.optionTintColor,
|
|
|
15
16
|
cancelButtonIndex,
|
|
16
17
|
tintColor: optionTintColor,
|
|
17
18
|
}, (buttonIndex) => {
|
|
19
|
+
if (buttonIndex === undefined)
|
|
20
|
+
return;
|
|
18
21
|
const key = optionKeys[buttonIndex];
|
|
19
|
-
if (key)
|
|
22
|
+
if (key)
|
|
20
23
|
options[key]();
|
|
21
|
-
}
|
|
22
24
|
});
|
|
23
|
-
}, []);
|
|
24
|
-
const renderIcon =
|
|
25
|
-
if (icon)
|
|
25
|
+
}, [actionSheet, options, optionTintColor]);
|
|
26
|
+
const renderIcon = useCallback(() => {
|
|
27
|
+
if (icon)
|
|
26
28
|
return icon();
|
|
27
|
-
}
|
|
28
29
|
return (<View style={[styles.wrapper, wrapperStyle]}>
|
|
29
|
-
<Text style={[styles.iconText, iconTextStyle]}
|
|
30
|
+
<Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
|
|
30
31
|
</View>);
|
|
31
|
-
}, []);
|
|
32
|
+
}, [icon, iconTextStyle, wrapperStyle]);
|
|
32
33
|
return (<TouchableOpacity style={[styles.container, containerStyle]} onPress={onPressActionButton || onActionsPress}>
|
|
33
34
|
{renderIcon()}
|
|
34
35
|
</TouchableOpacity>);
|
|
35
36
|
}
|
|
36
37
|
Actions.propTypes = {
|
|
37
|
-
onSend: PropTypes.func,
|
|
38
38
|
options: PropTypes.object,
|
|
39
39
|
optionTintColor: PropTypes.string,
|
|
40
40
|
icon: PropTypes.func,
|
|
@@ -54,11 +54,14 @@ const styles = StyleSheet.create({
|
|
|
54
54
|
borderColor: Color.defaultColor,
|
|
55
55
|
borderWidth: 2,
|
|
56
56
|
flex: 1,
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center',
|
|
57
59
|
},
|
|
58
60
|
iconText: {
|
|
59
61
|
color: Color.defaultColor,
|
|
60
62
|
fontWeight: 'bold',
|
|
61
63
|
fontSize: 16,
|
|
64
|
+
lineHeight: 16,
|
|
62
65
|
backgroundColor: Color.backgroundTransparent,
|
|
63
66
|
textAlign: 'center',
|
|
64
67
|
},
|
package/lib/Actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EACL,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,IAAI,GAIL,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAYpD,MAAM,UAAU,OAAO,CAAE,EACvB,OAAO,EACP,eAAe,GAAG,KAAK,CAAC,eAAe,EACvC,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB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C,OAAO,CAAC,CAAC,mBAAmB,IAAI,cAAc,CAAC,CAE/C;MAAA,CAAC,UAAU,EAAE,CACf;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAA;AACH,CAAC;AAED,OAAO,CAAC,SAAS,GAAG;IAClB,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC,IAAI,EAAE,SAAS,CAAC,IAAI;IACpB,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,YAAY,EAAE,aAAa;IAC3B,cAAc,EAAE,aAAa;CAC9B,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,EAAE;KACjB;IACD,OAAO,EAAE;QACP,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,WAAW,EAAE,CAAC;QACd,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,KAAK,CAAC,YAAY;QACzB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,KAAK,CAAC,qBAAqB;QAC5C,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA"}
|
package/lib/Avatar.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { IMessage, LeftRightStyle, User } from './Models';
|
|
5
5
|
export interface AvatarProps<TMessage extends IMessage> {
|
|
6
|
-
currentMessage
|
|
6
|
+
currentMessage: TMessage;
|
|
7
7
|
previousMessage?: TMessage;
|
|
8
8
|
nextMessage?: TMessage;
|
|
9
9
|
position: 'left' | 'right';
|
|
@@ -13,25 +13,11 @@ export interface AvatarProps<TMessage extends IMessage> {
|
|
|
13
13
|
containerStyle?: LeftRightStyle<ViewStyle>;
|
|
14
14
|
textStyle?: TextStyle;
|
|
15
15
|
renderAvatar?(props: Omit<AvatarProps<TMessage>, 'renderAvatar'>): ReactNode;
|
|
16
|
-
onPressAvatar
|
|
17
|
-
onLongPressAvatar
|
|
16
|
+
onPressAvatar?: (user: User) => void;
|
|
17
|
+
onLongPressAvatar?: (user: User) => void;
|
|
18
18
|
}
|
|
19
|
-
export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): JSX.Element | null;
|
|
19
|
+
export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): React.JSX.Element | null;
|
|
20
20
|
export declare namespace Avatar {
|
|
21
|
-
var defaultProps: {
|
|
22
|
-
renderAvatarOnTop: boolean;
|
|
23
|
-
showAvatarForEveryMessage: boolean;
|
|
24
|
-
position: string;
|
|
25
|
-
currentMessage: {
|
|
26
|
-
user: null;
|
|
27
|
-
};
|
|
28
|
-
previousMessage: {};
|
|
29
|
-
nextMessage: {};
|
|
30
|
-
containerStyle: {};
|
|
31
|
-
imageStyle: {};
|
|
32
|
-
onPressAvatar: () => void;
|
|
33
|
-
onLongPressAvatar: () => void;
|
|
34
|
-
};
|
|
35
21
|
var propTypes: {
|
|
36
22
|
renderAvatarOnTop: PropTypes.Requireable<boolean>;
|
|
37
23
|
showAvatarForEveryMessage: PropTypes.Requireable<boolean>;
|
|
@@ -43,12 +29,12 @@ export declare namespace Avatar {
|
|
|
43
29
|
onLongPressAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
30
|
renderAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
31
|
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
46
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
47
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
32
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
33
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
48
34
|
}>>;
|
|
49
35
|
imageStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
50
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
51
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
36
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
37
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
52
38
|
}>>;
|
|
53
39
|
};
|
|
54
40
|
}
|
package/lib/Avatar.js
CHANGED
|
@@ -11,7 +11,6 @@ const styles = {
|
|
|
11
11
|
onTop: {
|
|
12
12
|
alignSelf: 'flex-start',
|
|
13
13
|
},
|
|
14
|
-
onBottom: {},
|
|
15
14
|
image: {
|
|
16
15
|
height: 36,
|
|
17
16
|
width: 36,
|
|
@@ -25,7 +24,6 @@ const styles = {
|
|
|
25
24
|
onTop: {
|
|
26
25
|
alignSelf: 'flex-start',
|
|
27
26
|
},
|
|
28
|
-
onBottom: {},
|
|
29
27
|
image: {
|
|
30
28
|
height: 36,
|
|
31
29
|
width: 36,
|
|
@@ -34,62 +32,53 @@ const styles = {
|
|
|
34
32
|
}),
|
|
35
33
|
};
|
|
36
34
|
export function Avatar(props) {
|
|
37
|
-
const { renderAvatarOnTop, showAvatarForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, } = props;
|
|
35
|
+
const { renderAvatarOnTop, showAvatarForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, onPressAvatar, onLongPressAvatar, } = props;
|
|
38
36
|
const messageToCompare = renderAvatarOnTop ? previousMessage : nextMessage;
|
|
39
|
-
|
|
40
|
-
if (renderAvatar === null) {
|
|
37
|
+
if (renderAvatar === null)
|
|
41
38
|
return null;
|
|
42
|
-
}
|
|
43
39
|
if (!showAvatarForEveryMessage &&
|
|
44
40
|
currentMessage &&
|
|
45
41
|
messageToCompare &&
|
|
46
42
|
isSameUser(currentMessage, messageToCompare) &&
|
|
47
|
-
isSameDay(currentMessage, messageToCompare))
|
|
43
|
+
isSameDay(currentMessage, messageToCompare))
|
|
48
44
|
return (<View style={[
|
|
49
45
|
styles[position].container,
|
|
50
|
-
containerStyle
|
|
46
|
+
containerStyle?.[position],
|
|
51
47
|
]}>
|
|
52
48
|
<GiftedAvatar avatarStyle={[
|
|
53
49
|
styles[position].image,
|
|
54
|
-
imageStyle
|
|
50
|
+
imageStyle?.[position],
|
|
55
51
|
]}/>
|
|
56
52
|
</View>);
|
|
57
|
-
}
|
|
58
53
|
const renderAvatarComponent = () => {
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
if (renderAvatar)
|
|
55
|
+
return renderAvatar({
|
|
56
|
+
renderAvatarOnTop,
|
|
57
|
+
showAvatarForEveryMessage,
|
|
58
|
+
containerStyle,
|
|
59
|
+
position,
|
|
60
|
+
currentMessage,
|
|
61
|
+
previousMessage,
|
|
62
|
+
nextMessage,
|
|
63
|
+
imageStyle,
|
|
64
|
+
onPressAvatar,
|
|
65
|
+
onLongPressAvatar,
|
|
66
|
+
});
|
|
67
|
+
if (currentMessage)
|
|
64
68
|
return (<GiftedAvatar avatarStyle={[
|
|
65
|
-
styles[
|
|
66
|
-
|
|
67
|
-
]} user={
|
|
68
|
-
}
|
|
69
|
+
styles[position].image,
|
|
70
|
+
imageStyle?.[position],
|
|
71
|
+
]} user={currentMessage.user} onPress={() => onPressAvatar?.(currentMessage.user)} onLongPress={() => onLongPressAvatar?.(currentMessage.user)}/>);
|
|
69
72
|
return null;
|
|
70
73
|
};
|
|
71
74
|
return (<View style={[
|
|
72
75
|
styles[position].container,
|
|
73
|
-
styles[position]
|
|
74
|
-
containerStyle
|
|
76
|
+
renderAvatarOnTop && styles[position].onTop,
|
|
77
|
+
containerStyle?.[position],
|
|
75
78
|
]}>
|
|
76
79
|
{renderAvatarComponent()}
|
|
77
80
|
</View>);
|
|
78
81
|
}
|
|
79
|
-
Avatar.defaultProps = {
|
|
80
|
-
renderAvatarOnTop: false,
|
|
81
|
-
showAvatarForEveryMessage: false,
|
|
82
|
-
position: 'left',
|
|
83
|
-
currentMessage: {
|
|
84
|
-
user: null,
|
|
85
|
-
},
|
|
86
|
-
previousMessage: {},
|
|
87
|
-
nextMessage: {},
|
|
88
|
-
containerStyle: {},
|
|
89
|
-
imageStyle: {},
|
|
90
|
-
onPressAvatar: () => { },
|
|
91
|
-
onLongPressAvatar: () => { },
|
|
92
|
-
};
|
|
93
82
|
Avatar.propTypes = {
|
|
94
83
|
renderAvatarOnTop: PropTypes.bool,
|
|
95
84
|
showAvatarForEveryMessage: PropTypes.bool,
|
package/lib/Avatar.js.flow
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
8
8
|
|
|
9
9
|
export type AvatarProps<TMessage: IMessage = IMessage> = $ReadOnly<{|
|
|
10
|
-
currentMessage
|
|
10
|
+
currentMessage: TMessage,
|
|
11
11
|
previousMessage?: TMessage,
|
|
12
12
|
nextMessage?: TMessage,
|
|
13
13
|
position: 'left' | 'right',
|
package/lib/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;A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1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,SAAS,GAAG;IACjB,iBAAiB,EAAE,SAAS,CAAC,IAAI;IACjC,yBAAyB,EAAE,SAAS,CAAC,IAAI;IACzC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,cAAc,EAAE,SAAS,CAAC,MAAM;IAChC,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,aAAa,EAAE,SAAS,CAAC,IAAI;IAC7B,iBAAiB,EAAE,SAAS,CAAC,IAAI;IACjC,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,cAAc,EAAE,SAAS,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;KACrB,CAAC;IACF,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC;QAC1B,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;KACrB,CAAC;CACH,CAAA"}
|
package/lib/Bubble.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { MessageTextProps } from './MessageText';
|
|
|
6
6
|
import { MessageImageProps } from './MessageImage';
|
|
7
7
|
import { TimeProps } from './Time';
|
|
8
8
|
import { User, IMessage, LeftRightStyle, Reply, Omit, MessageVideoProps, MessageAudioProps } from './Models';
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
9
|
+
export type RenderMessageImageProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageImageProps<TMessage>;
|
|
10
|
+
export type RenderMessageVideoProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageVideoProps<TMessage>;
|
|
11
|
+
export type RenderMessageAudioProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageAudioProps<TMessage>;
|
|
12
|
+
export type RenderMessageTextProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageTextProps<TMessage>;
|
|
13
13
|
export interface BubbleProps<TMessage extends IMessage> {
|
|
14
14
|
user?: User;
|
|
15
15
|
touchableProps?: object;
|
|
@@ -17,7 +17,7 @@ export interface BubbleProps<TMessage extends IMessage> {
|
|
|
17
17
|
isCustomViewBottom?: boolean;
|
|
18
18
|
inverted?: boolean;
|
|
19
19
|
position: 'left' | 'right';
|
|
20
|
-
currentMessage
|
|
20
|
+
currentMessage: TMessage;
|
|
21
21
|
nextMessage?: TMessage;
|
|
22
22
|
previousMessage?: TMessage;
|
|
23
23
|
optionTitles?: string[];
|
|
@@ -31,8 +31,9 @@ export interface BubbleProps<TMessage extends IMessage> {
|
|
|
31
31
|
usernameStyle?: TextStyle;
|
|
32
32
|
quickReplyStyle?: StyleProp<ViewStyle>;
|
|
33
33
|
quickReplyTextStyle?: StyleProp<TextStyle>;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
quickReplyContainerStyle?: StyleProp<ViewStyle>;
|
|
35
|
+
onPress?(context?: unknown, message?: unknown): void;
|
|
36
|
+
onLongPress?(context?: unknown, message?: unknown): void;
|
|
36
37
|
onQuickReply?(replies: Reply[]): void;
|
|
37
38
|
renderMessageImage?(props: RenderMessageImageProps<TMessage>): React.ReactNode;
|
|
38
39
|
renderMessageVideo?(props: RenderMessageVideoProps<TMessage>): React.ReactNode;
|
|
@@ -100,26 +101,26 @@ export default class Bubble<TMessage extends IMessage = IMessage> extends React.
|
|
|
100
101
|
nextMessage: PropTypes.Requireable<object>;
|
|
101
102
|
previousMessage: PropTypes.Requireable<object>;
|
|
102
103
|
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
103
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
104
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
104
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
105
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
105
106
|
}>>;
|
|
106
107
|
wrapperStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
107
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
108
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
108
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
109
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
109
110
|
}>>;
|
|
110
111
|
bottomContainerStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
111
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
112
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
112
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
113
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
113
114
|
}>>;
|
|
114
|
-
tickStyle: PropTypes.Requireable<number | boolean | object
|
|
115
|
-
usernameStyle: PropTypes.Requireable<number | boolean | object
|
|
115
|
+
tickStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
116
|
+
usernameStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
116
117
|
containerToNextStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
117
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
118
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
118
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
119
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
119
120
|
}>>;
|
|
120
121
|
containerToPreviousStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
121
|
-
left: PropTypes.Requireable<number | boolean | object
|
|
122
|
-
right: PropTypes.Requireable<number | boolean | object
|
|
122
|
+
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
123
|
+
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
123
124
|
}>>;
|
|
124
125
|
};
|
|
125
126
|
onPress: () => void;
|
|
@@ -134,15 +135,15 @@ export default class Bubble<TMessage extends IMessage = IMessage> extends React.
|
|
|
134
135
|
} | {
|
|
135
136
|
borderTopRightRadius: number;
|
|
136
137
|
})[] | null;
|
|
137
|
-
renderQuickReplies(): React.ReactNode;
|
|
138
|
-
renderMessageText(): React.ReactNode;
|
|
139
|
-
renderMessageImage(): React.ReactNode;
|
|
140
|
-
renderMessageVideo(): React.ReactNode;
|
|
141
|
-
renderMessageAudio(): React.ReactNode;
|
|
142
|
-
renderTicks(): React.ReactNode;
|
|
143
|
-
renderTime(): React.ReactNode;
|
|
144
|
-
renderUsername(): React.ReactNode;
|
|
138
|
+
renderQuickReplies(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
139
|
+
renderMessageText(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
140
|
+
renderMessageImage(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
141
|
+
renderMessageVideo(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
142
|
+
renderMessageAudio(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
143
|
+
renderTicks(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
144
|
+
renderTime(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
145
|
+
renderUsername(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
145
146
|
renderCustomView(): React.ReactNode;
|
|
146
|
-
renderBubbleContent(): JSX.Element;
|
|
147
|
-
render(): JSX.Element;
|
|
147
|
+
renderBubbleContent(): React.JSX.Element;
|
|
148
|
+
render(): React.JSX.Element;
|
|
148
149
|
}
|