react-native-gifted-chat 2.6.5 → 2.7.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 +8 -17
- package/lib/Actions.d.ts +0 -11
- package/lib/Actions.js +2 -14
- package/lib/Actions.js.map +1 -1
- package/lib/Avatar.d.ts +1 -23
- package/lib/Avatar.js +32 -40
- package/lib/Avatar.js.map +1 -1
- package/lib/Bubble/index.d.ts +30 -0
- package/lib/{Bubble.js → Bubble/index.js} +31 -181
- package/lib/Bubble/index.js.map +1 -0
- package/lib/Bubble/styles.d.ts +69 -0
- package/lib/Bubble/styles.js +72 -0
- package/lib/Bubble/styles.js.map +1 -0
- package/lib/Bubble/types.d.ts +47 -0
- package/lib/Bubble/types.js +2 -0
- package/lib/Bubble/types.js.map +1 -0
- package/lib/Composer.d.ts +0 -17
- package/lib/Composer.js +3 -18
- package/lib/Composer.js.map +1 -1
- package/lib/Constant.d.ts +1 -1
- package/lib/Constant.js +1 -1
- package/lib/Constant.js.map +1 -1
- package/lib/Day/index.d.ts +4 -0
- package/lib/Day/index.js +39 -0
- package/lib/Day/index.js.map +1 -0
- package/lib/Day/styles.d.ts +20 -0
- package/lib/Day/styles.js +22 -0
- package/lib/Day/styles.js.map +1 -0
- package/lib/Day/types.d.ts +9 -0
- package/lib/Day/types.js +2 -0
- package/lib/Day/types.js.map +1 -0
- package/lib/GiftedAvatar.d.ts +1 -11
- package/lib/GiftedAvatar.js +26 -33
- package/lib/GiftedAvatar.js.map +1 -1
- package/lib/GiftedChat/index.d.ts +26 -0
- package/lib/{GiftedChat.js → GiftedChat/index.js} +46 -52
- package/lib/GiftedChat/index.js.map +1 -0
- package/lib/GiftedChat/styles.d.ts +6 -0
- package/lib/GiftedChat/styles.js +7 -0
- package/lib/GiftedChat/styles.js.map +1 -0
- package/lib/{GiftedChat.d.ts → GiftedChat/types.d.ts} +28 -38
- package/lib/GiftedChat/types.js +2 -0
- package/lib/GiftedChat/types.js.map +1 -0
- package/lib/InputToolbar.d.ts +1 -14
- package/lib/InputToolbar.js +0 -12
- package/lib/InputToolbar.js.map +1 -1
- package/lib/LoadEarlier.d.ts +0 -14
- package/lib/LoadEarlier.js +2 -16
- package/lib/LoadEarlier.js.map +1 -1
- package/lib/Message/index.d.ts +6 -0
- package/lib/Message/index.js +85 -0
- package/lib/Message/index.js.map +1 -0
- package/lib/Message/styles.d.ts +21 -0
- package/lib/Message/styles.js +22 -0
- package/lib/Message/styles.js.map +1 -0
- package/lib/Message/types.d.ts +22 -0
- package/lib/Message/types.js +2 -0
- package/lib/Message/types.js.map +1 -0
- package/lib/MessageAudio.js +1 -2
- package/lib/MessageAudio.js.map +1 -1
- package/lib/MessageContainer/components/DayAnimated/index.d.ts +5 -0
- package/lib/MessageContainer/components/DayAnimated/index.js +85 -0
- package/lib/MessageContainer/components/DayAnimated/index.js.map +1 -0
- package/lib/MessageContainer/components/DayAnimated/styles.d.ts +11 -0
- package/lib/MessageContainer/components/DayAnimated/styles.js +12 -0
- package/lib/MessageContainer/components/DayAnimated/styles.js.map +1 -0
- package/lib/MessageContainer/components/DayAnimated/types.d.ts +17 -0
- package/lib/MessageContainer/components/DayAnimated/types.js +2 -0
- package/lib/MessageContainer/components/DayAnimated/types.js.map +1 -0
- package/lib/MessageContainer/components/Item/index.d.ts +22 -0
- package/lib/MessageContainer/components/Item/index.js +69 -0
- package/lib/MessageContainer/components/Item/index.js.map +1 -0
- package/lib/MessageContainer/components/Item/types.d.ts +18 -0
- package/lib/MessageContainer/components/Item/types.js +2 -0
- package/lib/MessageContainer/components/Item/types.js.map +1 -0
- package/lib/MessageContainer/index.d.ts +6 -0
- package/lib/MessageContainer/index.js +200 -0
- package/lib/MessageContainer/index.js.map +1 -0
- package/lib/MessageContainer/styles.d.ts +34 -0
- package/lib/MessageContainer/styles.js +31 -0
- package/lib/MessageContainer/styles.js.map +1 -0
- package/lib/MessageContainer/types.d.ts +54 -0
- package/lib/MessageContainer/types.js +2 -0
- package/lib/MessageContainer/types.js.map +1 -0
- package/lib/MessageImage.d.ts +1 -12
- package/lib/MessageImage.js +2 -12
- package/lib/MessageImage.js.map +1 -1
- package/lib/MessageText.d.ts +1 -24
- package/lib/MessageText.js +0 -22
- package/lib/MessageText.js.map +1 -1
- package/lib/MessageVideo.js +1 -2
- package/lib/MessageVideo.js.map +1 -1
- package/lib/QuickReplies.d.ts +1 -12
- package/lib/QuickReplies.js +10 -20
- package/lib/QuickReplies.js.map +1 -1
- package/lib/Send.d.ts +2 -16
- package/lib/Send.js +0 -13
- package/lib/Send.js.map +1 -1
- package/lib/SystemMessage.d.ts +1 -10
- package/lib/SystemMessage.js +2 -12
- package/lib/SystemMessage.js.map +1 -1
- package/lib/Time.d.ts +1 -17
- package/lib/Time.js +0 -15
- package/lib/Time.js.map +1 -1
- package/lib/TypingIndicator/index.d.ts +5 -0
- package/lib/{TypingIndicator.js → TypingIndicator/index.js} +9 -30
- package/lib/TypingIndicator/index.js.map +1 -0
- package/lib/TypingIndicator/styles.d.ts +20 -0
- package/lib/TypingIndicator/styles.js +22 -0
- package/lib/TypingIndicator/styles.js.map +1 -0
- package/lib/TypingIndicator/types.d.ts +3 -0
- package/lib/TypingIndicator/types.js +2 -0
- package/lib/TypingIndicator/types.js.map +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/styles.d.ts +10 -0
- package/lib/styles.js +11 -0
- package/lib/styles.js.map +1 -0
- package/lib/{Models.d.ts → types.d.ts} +1 -1
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts +1 -3
- package/lib/utils.js +0 -7
- package/lib/utils.js.map +1 -1
- package/package.json +21 -29
- package/src/Actions.tsx +3 -15
- package/src/Avatar.tsx +43 -52
- package/src/{Bubble.tsx → Bubble/index.tsx} +52 -269
- package/src/Bubble/styles.ts +73 -0
- package/src/Bubble/types.ts +90 -0
- package/src/Composer.tsx +3 -19
- package/src/Constant.ts +1 -1
- package/src/Day/index.tsx +63 -0
- package/src/Day/styles.ts +22 -0
- package/src/Day/types.ts +14 -0
- package/src/GiftedAvatar.tsx +31 -38
- package/src/GiftedChat/index.tsx +501 -0
- package/src/GiftedChat/styles.ts +7 -0
- package/src/GiftedChat/types.ts +206 -0
- package/src/InputToolbar.tsx +1 -14
- package/src/LoadEarlier.tsx +2 -17
- package/src/Message/index.tsx +135 -0
- package/src/Message/styles.ts +22 -0
- package/src/Message/types.ts +26 -0
- package/src/MessageAudio.tsx +1 -4
- package/src/MessageContainer/components/DayAnimated/index.tsx +143 -0
- package/src/MessageContainer/components/DayAnimated/styles.ts +12 -0
- package/src/MessageContainer/components/DayAnimated/types.ts +12 -0
- package/src/MessageContainer/components/Item/index.tsx +136 -0
- package/src/MessageContainer/components/Item/types.ts +13 -0
- package/src/MessageContainer/index.tsx +343 -0
- package/src/MessageContainer/styles.ts +31 -0
- package/src/MessageContainer/types.ts +60 -0
- package/src/MessageImage.tsx +3 -14
- package/src/MessageText.tsx +1 -24
- package/src/MessageVideo.tsx +1 -4
- package/src/QuickReplies.tsx +14 -25
- package/src/Send.tsx +1 -15
- package/src/SystemMessage.tsx +3 -14
- package/src/Time.tsx +1 -17
- package/src/{TypingIndicator.tsx → TypingIndicator/index.tsx} +12 -35
- package/src/TypingIndicator/styles.ts +22 -0
- package/src/TypingIndicator/types.ts +3 -0
- package/src/__tests__/Bubble.test.tsx +7 -4
- package/src/__tests__/GiftedAvatar.test.tsx +6 -2
- package/src/__tests__/GiftedChat.test.tsx +20 -14
- package/src/__tests__/Message.test.tsx +4 -1
- package/src/__tests__/__snapshots__/Actions.test.tsx.snap +6 -2
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +3 -1
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +2 -0
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/Day.test.tsx.snap +1 -33
- package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +4 -2
- package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +22 -9
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +2 -0
- package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +3 -1
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +21 -100
- package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +282 -82
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +8 -4
- package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +5 -1
- package/src/__tests__/data.ts +1 -1
- package/src/index.ts +0 -2
- package/src/styles.ts +11 -0
- package/src/{Models.ts → types.ts} +1 -1
- package/src/utils.ts +1 -9
- package/lib/Actions.js.flow +0 -21
- package/lib/Avatar.js.flow +0 -27
- package/lib/Bubble.d.ts +0 -148
- package/lib/Bubble.js.flow +0 -69
- package/lib/Bubble.js.map +0 -1
- package/lib/Composer.js.flow +0 -24
- package/lib/Day.d.ts +0 -15
- package/lib/Day.js +0 -36
- package/lib/Day.js.flow +0 -23
- package/lib/Day.js.map +0 -1
- package/lib/GiftedAvatar.js.flow +0 -17
- package/lib/GiftedChat.js.flow +0 -163
- package/lib/GiftedChat.js.map +0 -1
- package/lib/InputToolbar.js.flow +0 -31
- package/lib/LoadEarlier.js.flow +0 -20
- package/lib/Message.d.ts +0 -67
- package/lib/Message.js +0 -157
- package/lib/Message.js.flow +0 -32
- package/lib/Message.js.map +0 -1
- package/lib/MessageAudio.js.flow +0 -15
- package/lib/MessageContainer.d.ts +0 -105
- package/lib/MessageContainer.js +0 -224
- package/lib/MessageContainer.js.flow +0 -39
- package/lib/MessageContainer.js.map +0 -1
- package/lib/MessageImage.js.flow +0 -20
- package/lib/MessageText.js.flow +0 -23
- package/lib/MessageVideo.js.flow +0 -16
- package/lib/Models.js +0 -2
- package/lib/Models.js.map +0 -1
- package/lib/QuickReplies.js.flow +0 -25
- package/lib/Send.js.flow +0 -19
- package/lib/SystemMessage.js.flow +0 -18
- package/lib/Time.js.flow +0 -19
- package/lib/TypingIndicator.d.ts +0 -6
- package/lib/TypingIndicator.js.map +0 -1
- package/lib/index.js.flow +0 -2
- package/lib/types.js.flow +0 -43
- package/lib/utils.js.flow +0 -16
- package/src/Day.tsx +0 -71
- package/src/GiftedChat.tsx +0 -689
- package/src/Message.tsx +0 -229
- package/src/MessageContainer.tsx +0 -361
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import Color from './Color';
|
|
2
|
+
import { View } from 'react-native';
|
|
4
3
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withDelay, withRepeat, withSequence, withTiming, } from 'react-native-reanimated';
|
|
4
|
+
import stylesCommon from '../styles';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
export * from './types';
|
|
5
7
|
const DotsAnimation = () => {
|
|
6
8
|
const dot1 = useSharedValue(0);
|
|
7
9
|
const dot2 = useSharedValue(0);
|
|
@@ -33,7 +35,7 @@ const DotsAnimation = () => {
|
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
dot3.value = withDelay(200, withRepeat(withSequence(withTiming(topY, { duration }), withTiming(bottomY, { duration })), 0, true));
|
|
35
37
|
}, [dot3, topY, bottomY, duration]);
|
|
36
|
-
return (<View style={styles.dots}>
|
|
38
|
+
return (<View style={[stylesCommon.fill, stylesCommon.centerItems, styles.dots]}>
|
|
37
39
|
<Animated.View style={[styles.dot, dot1Style]}/>
|
|
38
40
|
<Animated.View style={[styles.dot, dot2Style]}/>
|
|
39
41
|
<Animated.View style={[styles.dot, dot3Style]}/>
|
|
@@ -59,15 +61,14 @@ const TypingIndicator = ({ isTyping }) => {
|
|
|
59
61
|
heightScale.value = withTiming(35, { duration });
|
|
60
62
|
marginScale.value = withTiming(8, { duration });
|
|
61
63
|
}, [yCoords, heightScale, marginScale]);
|
|
62
|
-
// side effect
|
|
63
64
|
const slideOut = useCallback(() => {
|
|
64
65
|
const duration = 250;
|
|
65
|
-
yCoords.value = withTiming(200, { duration }
|
|
66
|
-
heightScale.value = withTiming(0, { duration });
|
|
67
|
-
marginScale.value = withTiming(0, { duration }, isFinished => {
|
|
66
|
+
yCoords.value = withTiming(200, { duration }, isFinished => {
|
|
68
67
|
if (isFinished)
|
|
69
68
|
runOnJS(setIsVisible)(false);
|
|
70
69
|
});
|
|
70
|
+
heightScale.value = withTiming(0, { duration });
|
|
71
|
+
marginScale.value = withTiming(0, { duration });
|
|
71
72
|
}, [yCoords, heightScale, marginScale]);
|
|
72
73
|
useEffect(() => {
|
|
73
74
|
if (isVisible)
|
|
@@ -89,27 +90,5 @@ const TypingIndicator = ({ isTyping }) => {
|
|
|
89
90
|
<DotsAnimation />
|
|
90
91
|
</Animated.View>);
|
|
91
92
|
};
|
|
92
|
-
const styles = StyleSheet.create({
|
|
93
|
-
container: {
|
|
94
|
-
marginLeft: 8,
|
|
95
|
-
width: 45,
|
|
96
|
-
borderRadius: 15,
|
|
97
|
-
backgroundColor: Color.leftBubbleBackground,
|
|
98
|
-
},
|
|
99
|
-
dots: {
|
|
100
|
-
flexDirection: 'row',
|
|
101
|
-
alignItems: 'center',
|
|
102
|
-
justifyContent: 'center',
|
|
103
|
-
flex: 1,
|
|
104
|
-
},
|
|
105
|
-
dot: {
|
|
106
|
-
marginLeft: 2,
|
|
107
|
-
marginRight: 2,
|
|
108
|
-
borderRadius: 4,
|
|
109
|
-
width: 8,
|
|
110
|
-
height: 8,
|
|
111
|
-
backgroundColor: 'rgba(0, 0, 0, 0.38)',
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
93
|
export default TypingIndicator;
|
|
115
|
-
//# sourceMappingURL=
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TypingIndicator/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,S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AA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
container: {
|
|
3
|
+
marginLeft: number;
|
|
4
|
+
width: number;
|
|
5
|
+
borderRadius: number;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
};
|
|
8
|
+
dots: {
|
|
9
|
+
flexDirection: "row";
|
|
10
|
+
};
|
|
11
|
+
dot: {
|
|
12
|
+
marginLeft: number;
|
|
13
|
+
marginRight: number;
|
|
14
|
+
borderRadius: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import Color from '../Color';
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
marginLeft: 8,
|
|
6
|
+
width: 45,
|
|
7
|
+
borderRadius: 15,
|
|
8
|
+
backgroundColor: Color.leftBubbleBackground,
|
|
9
|
+
},
|
|
10
|
+
dots: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
},
|
|
13
|
+
dot: {
|
|
14
|
+
marginLeft: 2,
|
|
15
|
+
marginRight: 2,
|
|
16
|
+
borderRadius: 4,
|
|
17
|
+
width: 8,
|
|
18
|
+
height: 8,
|
|
19
|
+
backgroundColor: 'rgba(0, 0, 0, 0.38)',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/TypingIndicator/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,eAAe,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,KAAK,CAAC,oBAAoB;KAC5C;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;KACrB;IACD,GAAG,EAAE;QACH,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,qBAAqB;KACvC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/TypingIndicator/types.ts"],"names":[],"mappings":""}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA"}
|
package/lib/styles.d.ts
ADDED
package/lib/styles.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,eAAe,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC;KACR;IACD,WAAW,EAAE;QACX,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAA"}
|
|
@@ -21,7 +21,7 @@ export interface LeftRightStyle<T> {
|
|
|
21
21
|
left?: StyleProp<T>;
|
|
22
22
|
right?: StyleProp<T>;
|
|
23
23
|
}
|
|
24
|
-
type renderFunction = (x: unknown) =>
|
|
24
|
+
type renderFunction = (x: unknown) => React.ReactNode;
|
|
25
25
|
export interface User {
|
|
26
26
|
_id: string | number;
|
|
27
27
|
name?: string;
|
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IMessage } from './Models';
|
|
3
|
-
export declare const StylePropType: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
1
|
+
import { IMessage } from './types';
|
|
4
2
|
export declare function isSameDay(currentMessage: IMessage, diffMessage: IMessage | null | undefined): boolean;
|
|
5
3
|
export declare function isSameUser(currentMessage: IMessage, diffMessage: IMessage | null | undefined): boolean;
|
package/lib/utils.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
|
-
export const StylePropType = PropTypes.oneOfType([
|
|
4
|
-
PropTypes.array,
|
|
5
|
-
PropTypes.object,
|
|
6
|
-
PropTypes.number,
|
|
7
|
-
PropTypes.bool,
|
|
8
|
-
]);
|
|
9
2
|
export function isSameDay(currentMessage, diffMessage) {
|
|
10
3
|
if (!diffMessage || !diffMessage.createdAt)
|
|
11
4
|
return false;
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,UAAU,SAAS,CACvB,cAAwB,EACxB,WAAwC;IAExC,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,SAAS;QACxC,OAAO,KAAK,CAAA;IAEd,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;IACxD,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IAElD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;QACzD,OAAO,KAAK,CAAA;IAEd,OAAO,gBAAgB,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,cAAwB,EACxB,WAAwC;IAExC,OAAO,CAAC,CAAC,CACP,WAAW;QACX,WAAW,CAAC,IAAI;QAChB,cAAc,CAAC,IAAI;QACnB,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,CACjD,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-chat",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "The most complete chat UI for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lib"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "rm -rf lib/ && yarn tsc
|
|
33
|
+
"build": "rm -rf lib/ && yarn tsc",
|
|
34
34
|
"lint": "yarn eslint src",
|
|
35
35
|
"lint:fix": "yarn eslint --cache --fix",
|
|
36
36
|
"prepublishOnly": "yarn lint && yarn build && yarn test",
|
|
@@ -50,67 +50,59 @@
|
|
|
50
50
|
"bash -c 'yarn tsc:write'"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"resolutions": {
|
|
54
|
-
"@babel/plugin-transform-flow-strip-types": "^7.25.0"
|
|
55
|
-
},
|
|
56
53
|
"dependencies": {
|
|
57
54
|
"@expo/react-native-action-sheet": "^4.1.0",
|
|
58
55
|
"@types/lodash.isequal": "^4.5.8",
|
|
59
56
|
"dayjs": "^1.11.13",
|
|
60
57
|
"lodash.isequal": "^4.5.0",
|
|
61
|
-
"prop-types": "^15.8.1",
|
|
62
58
|
"react-native-communications": "^2.2.1",
|
|
63
59
|
"react-native-iphone-x-helper": "^1.3.1",
|
|
64
60
|
"react-native-lightbox-v2": "^0.9.2",
|
|
65
|
-
"react-native-parsed-text": "^0.0.22"
|
|
66
|
-
"uuid": "^11.0.4"
|
|
61
|
+
"react-native-parsed-text": "^0.0.22"
|
|
67
62
|
},
|
|
68
63
|
"devDependencies": {
|
|
69
|
-
"@babel/core": "^7.26.
|
|
70
|
-
"@babel/plugin-transform-flow-strip-types": "^7.25.9",
|
|
64
|
+
"@babel/core": "^7.26.8",
|
|
71
65
|
"@babel/plugin-transform-react-jsx": "^7.25.9",
|
|
72
66
|
"@babel/plugin-transform-unicode-property-regex": "^7.25.9",
|
|
73
|
-
"@babel/preset-env": "^7.26.
|
|
74
|
-
"@react-native/eslint-config": "^0.76.
|
|
75
|
-
"@
|
|
67
|
+
"@babel/preset-env": "^7.26.8",
|
|
68
|
+
"@react-native/eslint-config": "^0.76.6",
|
|
69
|
+
"@shopify/flash-list": "^1.7.3",
|
|
70
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
76
71
|
"@types/jest": "^29.5.14",
|
|
77
|
-
"@types/react": "^
|
|
72
|
+
"@types/react": "^19.0.10",
|
|
73
|
+
"@types/react-dom": "^19.0.4",
|
|
78
74
|
"@types/react-native": "^0.72.8",
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
82
|
-
"@typescript-eslint/parser": "^8.19.1",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^8.23.0",
|
|
76
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
83
77
|
"babel-jest": "^29.7.0",
|
|
84
78
|
"eslint": "^8.57.0",
|
|
85
79
|
"eslint-config-standard": "^17.1.0",
|
|
86
80
|
"eslint-config-standard-jsx": "^11.0.0",
|
|
87
81
|
"eslint-plugin-import": "^2.31.0",
|
|
88
|
-
"eslint-plugin-jest": "^28.
|
|
82
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
89
83
|
"eslint-plugin-json": "^4.0.1",
|
|
90
84
|
"eslint-plugin-n": "^17.15.1",
|
|
91
85
|
"eslint-plugin-node": "^11.1.0",
|
|
92
86
|
"eslint-plugin-promise": "^7.2.1",
|
|
93
|
-
"eslint-plugin-react": "^7.37.
|
|
94
|
-
"flow-bin": "^0.258.1",
|
|
87
|
+
"eslint-plugin-react": "^7.37.4",
|
|
95
88
|
"husky": "^9.1.7",
|
|
96
89
|
"jest": "^29.7.0",
|
|
97
90
|
"json": "^11.0.0",
|
|
98
|
-
"lint-staged": "^15.3
|
|
91
|
+
"lint-staged": "^15.4.3",
|
|
99
92
|
"react": "^18.3.1",
|
|
100
93
|
"react-dom": "^18.3.1",
|
|
101
|
-
"react-native": "^0.76.
|
|
102
|
-
"react-native-
|
|
103
|
-
"react-native-reanimated": "^3.16.
|
|
104
|
-
"react-native-safe-area-context": "^5.1.0",
|
|
94
|
+
"react-native": "^0.76.6",
|
|
95
|
+
"react-native-keyboard-controller": "^1.16.3",
|
|
96
|
+
"react-native-reanimated": "^3.16.7",
|
|
105
97
|
"react-test-renderer": "^18.3.1",
|
|
106
98
|
"typescript": "^5.7.3"
|
|
107
99
|
},
|
|
108
100
|
"peerDependencies": {
|
|
101
|
+
"@shopify/flash-list": ">=1.0.0",
|
|
109
102
|
"react": "*",
|
|
110
103
|
"react-native": "*",
|
|
111
|
-
"react-native-
|
|
112
|
-
"react-native-reanimated": "
|
|
113
|
-
"react-native-safe-area-context": "*"
|
|
104
|
+
"react-native-keyboard-controller": ">=1.0.0",
|
|
105
|
+
"react-native-reanimated": ">=2.0.0"
|
|
114
106
|
},
|
|
115
107
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
116
108
|
"engines": {
|
package/src/Actions.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types'
|
|
2
1
|
import React, { ReactNode, useCallback } from 'react'
|
|
3
2
|
import {
|
|
4
3
|
StyleSheet,
|
|
@@ -10,9 +9,10 @@ import {
|
|
|
10
9
|
TextStyle,
|
|
11
10
|
} from 'react-native'
|
|
12
11
|
import Color from './Color'
|
|
13
|
-
import { StylePropType } from './utils'
|
|
14
12
|
import { useChatContext } from './GiftedChatContext'
|
|
15
13
|
|
|
14
|
+
import stylesCommon from './styles'
|
|
15
|
+
|
|
16
16
|
export interface ActionsProps {
|
|
17
17
|
options?: { [key: string]: () => void }
|
|
18
18
|
optionTintColor?: string
|
|
@@ -63,7 +63,7 @@ export function Actions ({
|
|
|
63
63
|
return icon()
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<View style={[styles.wrapper, wrapperStyle]}>
|
|
66
|
+
<View style={[stylesCommon.fill, stylesCommon.centerItems, styles.wrapper, wrapperStyle]}>
|
|
67
67
|
<Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
|
|
68
68
|
</View>
|
|
69
69
|
)
|
|
@@ -79,15 +79,6 @@ export function Actions ({
|
|
|
79
79
|
)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
Actions.propTypes = {
|
|
83
|
-
options: PropTypes.object,
|
|
84
|
-
optionTintColor: PropTypes.string,
|
|
85
|
-
icon: PropTypes.func,
|
|
86
|
-
onPressActionButton: PropTypes.func,
|
|
87
|
-
wrapperStyle: StylePropType,
|
|
88
|
-
containerStyle: StylePropType,
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
const styles = StyleSheet.create({
|
|
92
83
|
container: {
|
|
93
84
|
width: 26,
|
|
@@ -99,9 +90,6 @@ const styles = StyleSheet.create({
|
|
|
99
90
|
borderRadius: 13,
|
|
100
91
|
borderColor: Color.defaultColor,
|
|
101
92
|
borderWidth: 2,
|
|
102
|
-
flex: 1,
|
|
103
|
-
alignItems: 'center',
|
|
104
|
-
justifyContent: 'center',
|
|
105
93
|
},
|
|
106
94
|
iconText: {
|
|
107
95
|
color: Color.defaultColor,
|
package/src/Avatar.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { ReactNode } from 'react'
|
|
1
|
+
import React, { ReactNode, useCallback } from 'react'
|
|
3
2
|
import {
|
|
4
3
|
ImageStyle,
|
|
5
4
|
StyleSheet,
|
|
@@ -8,8 +7,8 @@ import {
|
|
|
8
7
|
ViewStyle,
|
|
9
8
|
} from 'react-native'
|
|
10
9
|
import { GiftedAvatar } from './GiftedAvatar'
|
|
11
|
-
import {
|
|
12
|
-
import { IMessage, LeftRightStyle, User } from './
|
|
10
|
+
import { isSameUser, isSameDay } from './utils'
|
|
11
|
+
import { IMessage, LeftRightStyle, User } from './types'
|
|
13
12
|
|
|
14
13
|
interface Styles {
|
|
15
14
|
left: {
|
|
@@ -87,33 +86,7 @@ export function Avatar<TMessage extends IMessage = IMessage> (
|
|
|
87
86
|
|
|
88
87
|
const messageToCompare = renderAvatarOnTop ? previousMessage : nextMessage
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
return null
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
!showAvatarForEveryMessage &&
|
|
95
|
-
currentMessage &&
|
|
96
|
-
messageToCompare &&
|
|
97
|
-
isSameUser(currentMessage, messageToCompare) &&
|
|
98
|
-
isSameDay(currentMessage, messageToCompare)
|
|
99
|
-
)
|
|
100
|
-
return (
|
|
101
|
-
<View
|
|
102
|
-
style={[
|
|
103
|
-
styles[position].container,
|
|
104
|
-
containerStyle?.[position],
|
|
105
|
-
]}
|
|
106
|
-
>
|
|
107
|
-
<GiftedAvatar
|
|
108
|
-
avatarStyle={[
|
|
109
|
-
styles[position].image,
|
|
110
|
-
imageStyle?.[position],
|
|
111
|
-
]}
|
|
112
|
-
/>
|
|
113
|
-
</View>
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
const renderAvatarComponent = () => {
|
|
89
|
+
const renderAvatarComponent = useCallback(() => {
|
|
117
90
|
if (renderAvatar)
|
|
118
91
|
return renderAvatar({
|
|
119
92
|
renderAvatarOnTop,
|
|
@@ -142,7 +115,45 @@ export function Avatar<TMessage extends IMessage = IMessage> (
|
|
|
142
115
|
)
|
|
143
116
|
|
|
144
117
|
return null
|
|
145
|
-
}
|
|
118
|
+
}, [
|
|
119
|
+
renderAvatar,
|
|
120
|
+
renderAvatarOnTop,
|
|
121
|
+
showAvatarForEveryMessage,
|
|
122
|
+
containerStyle,
|
|
123
|
+
position,
|
|
124
|
+
currentMessage,
|
|
125
|
+
previousMessage,
|
|
126
|
+
nextMessage,
|
|
127
|
+
imageStyle,
|
|
128
|
+
onPressAvatar,
|
|
129
|
+
onLongPressAvatar,
|
|
130
|
+
])
|
|
131
|
+
|
|
132
|
+
if (renderAvatar === null)
|
|
133
|
+
return null
|
|
134
|
+
|
|
135
|
+
if (
|
|
136
|
+
!showAvatarForEveryMessage &&
|
|
137
|
+
currentMessage &&
|
|
138
|
+
messageToCompare &&
|
|
139
|
+
isSameUser(currentMessage, messageToCompare) &&
|
|
140
|
+
isSameDay(currentMessage, messageToCompare)
|
|
141
|
+
)
|
|
142
|
+
return (
|
|
143
|
+
<View
|
|
144
|
+
style={[
|
|
145
|
+
styles[position].container,
|
|
146
|
+
containerStyle?.[position],
|
|
147
|
+
]}
|
|
148
|
+
>
|
|
149
|
+
<GiftedAvatar
|
|
150
|
+
avatarStyle={[
|
|
151
|
+
styles[position].image,
|
|
152
|
+
imageStyle?.[position],
|
|
153
|
+
]}
|
|
154
|
+
/>
|
|
155
|
+
</View>
|
|
156
|
+
)
|
|
146
157
|
|
|
147
158
|
return (
|
|
148
159
|
<View
|
|
@@ -156,23 +167,3 @@ export function Avatar<TMessage extends IMessage = IMessage> (
|
|
|
156
167
|
</View>
|
|
157
168
|
)
|
|
158
169
|
}
|
|
159
|
-
|
|
160
|
-
Avatar.propTypes = {
|
|
161
|
-
renderAvatarOnTop: PropTypes.bool,
|
|
162
|
-
showAvatarForEveryMessage: PropTypes.bool,
|
|
163
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
164
|
-
currentMessage: PropTypes.object,
|
|
165
|
-
previousMessage: PropTypes.object,
|
|
166
|
-
nextMessage: PropTypes.object,
|
|
167
|
-
onPressAvatar: PropTypes.func,
|
|
168
|
-
onLongPressAvatar: PropTypes.func,
|
|
169
|
-
renderAvatar: PropTypes.func,
|
|
170
|
-
containerStyle: PropTypes.shape({
|
|
171
|
-
left: StylePropType,
|
|
172
|
-
right: StylePropType,
|
|
173
|
-
}),
|
|
174
|
-
imageStyle: PropTypes.shape({
|
|
175
|
-
left: StylePropType,
|
|
176
|
-
right: StylePropType,
|
|
177
|
-
}),
|
|
178
|
-
}
|