react-native-gifted-chat 2.8.2-alpha.0 → 2.8.2-alpha.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 -12
- package/package.json +20 -21
- package/src/Bubble/index.tsx +11 -10
- package/src/Bubble/types.ts +2 -2
- package/src/Composer.tsx +19 -26
- package/src/Constant.ts +0 -1
- package/src/GiftedAvatar.tsx +29 -36
- package/src/GiftedChat/index.tsx +11 -62
- package/src/GiftedChat/types.ts +5 -52
- package/src/InputToolbar.tsx +25 -8
- package/src/LoadEarlier.tsx +19 -17
- package/src/MessageAudio.tsx +19 -7
- package/src/MessageContainer/components/DayAnimated/index.tsx +14 -9
- package/src/MessageContainer/components/Item/index.tsx +7 -1
- package/src/MessageContainer/index.tsx +47 -28
- package/src/MessageContainer/types.ts +31 -6
- package/src/MessageImage.tsx +18 -6
- package/src/MessageText.tsx +18 -23
- package/src/MessageVideo.tsx +19 -7
- package/src/QuickReplies.tsx +17 -10
- package/src/Send.tsx +7 -1
- package/src/SystemMessage.tsx +9 -2
- package/src/Time.tsx +9 -2
- package/src/TypingIndicator/index.tsx +2 -1
- package/src/TypingIndicator/types.ts +3 -0
- package/src/__tests__/Actions.test.tsx +3 -4
- package/src/__tests__/Avatar.test.tsx +5 -6
- package/src/__tests__/Bubble.test.tsx +14 -19
- package/src/__tests__/Composer.test.tsx +3 -4
- package/src/__tests__/Day.test.tsx +5 -8
- package/src/__tests__/DayAnimated.test.tsx +11 -13
- package/src/__tests__/GiftedAvatar.test.tsx +3 -8
- package/src/__tests__/GiftedChat.test.tsx +32 -41
- package/src/__tests__/InputToolbar.test.tsx +3 -4
- package/src/__tests__/LoadEarlier.test.tsx +3 -4
- package/src/__tests__/Message.test.tsx +51 -58
- package/src/__tests__/MessageContainer.test.tsx +39 -5
- package/src/__tests__/MessageImage.test.tsx +12 -15
- package/src/__tests__/MessageText.test.tsx +7 -4
- package/src/__tests__/Send.test.tsx +7 -8
- package/src/__tests__/SystemMessage.test.tsx +12 -15
- package/src/__tests__/Time.test.tsx +5 -8
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +48 -50
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +1 -2
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +0 -1
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +2 -2
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +146 -150
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +12 -10
- package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +12 -8
- package/src/__tests__/__snapshots__/Send.test.tsx.snap +2 -0
- package/src/reanimatedCompat.ts +27 -0
- package/src/types.ts +4 -0
- package/lib/Actions.d.ts +0 -14
- package/lib/Actions.js +0 -57
- package/lib/Actions.js.map +0 -1
- package/lib/Avatar.d.ts +0 -18
- package/lib/Avatar.js +0 -93
- package/lib/Avatar.js.map +0 -1
- package/lib/Bubble/index.d.ts +0 -6
- package/lib/Bubble/index.js +0 -242
- package/lib/Bubble/index.js.map +0 -1
- package/lib/Bubble/styles.d.ts +0 -69
- package/lib/Bubble/styles.js +0 -72
- package/lib/Bubble/styles.js.map +0 -1
- package/lib/Bubble/types.d.ts +0 -47
- package/lib/Bubble/types.js +0 -2
- package/lib/Bubble/types.js.map +0 -1
- package/lib/Color.d.ts +0 -18
- package/lib/Color.js +0 -18
- package/lib/Color.js.map +0 -1
- package/lib/Composer.d.ts +0 -20
- package/lib/Composer.js +0 -60
- package/lib/Composer.js.map +0 -1
- package/lib/Constant.d.ts +0 -10
- package/lib/Constant.js +0 -17
- package/lib/Constant.js.map +0 -1
- package/lib/Day/index.d.ts +0 -4
- package/lib/Day/index.js +0 -39
- package/lib/Day/index.js.map +0 -1
- package/lib/Day/styles.d.ts +0 -20
- package/lib/Day/styles.js +0 -22
- package/lib/Day/styles.js.map +0 -1
- package/lib/Day/types.d.ts +0 -9
- package/lib/Day/types.js +0 -2
- package/lib/Day/types.js.map +0 -1
- package/lib/GiftedAvatar.d.ts +0 -11
- package/lib/GiftedAvatar.js +0 -104
- package/lib/GiftedAvatar.js.map +0 -1
- package/lib/GiftedChat/index.d.ts +0 -26
- package/lib/GiftedChat/index.js +0 -317
- package/lib/GiftedChat/index.js.map +0 -1
- package/lib/GiftedChat/styles.d.ts +0 -6
- package/lib/GiftedChat/styles.js +0 -7
- package/lib/GiftedChat/styles.js.map +0 -1
- package/lib/GiftedChat/types.d.ts +0 -112
- package/lib/GiftedChat/types.js +0 -2
- package/lib/GiftedChat/types.js.map +0 -1
- package/lib/GiftedChatContext.d.ts +0 -9
- package/lib/GiftedChatContext.js +0 -9
- package/lib/GiftedChatContext.js.map +0 -1
- package/lib/InputToolbar.d.ts +0 -23
- package/lib/InputToolbar.js +0 -56
- package/lib/InputToolbar.js.map +0 -1
- package/lib/LoadEarlier.d.ts +0 -14
- package/lib/LoadEarlier.js +0 -45
- package/lib/LoadEarlier.js.map +0 -1
- package/lib/Message/index.d.ts +0 -6
- package/lib/Message/index.js +0 -80
- package/lib/Message/index.js.map +0 -1
- package/lib/Message/styles.d.ts +0 -21
- package/lib/Message/styles.js +0 -22
- package/lib/Message/styles.js.map +0 -1
- package/lib/Message/types.d.ts +0 -22
- package/lib/Message/types.js +0 -2
- package/lib/Message/types.js.map +0 -1
- package/lib/MessageAudio.d.ts +0 -2
- package/lib/MessageAudio.js +0 -14
- package/lib/MessageAudio.js.map +0 -1
- package/lib/MessageContainer/components/DayAnimated/index.d.ts +0 -5
- package/lib/MessageContainer/components/DayAnimated/index.js +0 -85
- package/lib/MessageContainer/components/DayAnimated/index.js.map +0 -1
- package/lib/MessageContainer/components/DayAnimated/styles.d.ts +0 -11
- package/lib/MessageContainer/components/DayAnimated/styles.js +0 -12
- package/lib/MessageContainer/components/DayAnimated/styles.js.map +0 -1
- package/lib/MessageContainer/components/DayAnimated/types.d.ts +0 -17
- package/lib/MessageContainer/components/DayAnimated/types.js +0 -2
- package/lib/MessageContainer/components/DayAnimated/types.js.map +0 -1
- package/lib/MessageContainer/components/Item/index.d.ts +0 -23
- package/lib/MessageContainer/components/Item/index.js +0 -88
- package/lib/MessageContainer/components/Item/index.js.map +0 -1
- package/lib/MessageContainer/components/Item/types.d.ts +0 -17
- package/lib/MessageContainer/components/Item/types.js +0 -2
- package/lib/MessageContainer/components/Item/types.js.map +0 -1
- package/lib/MessageContainer/index.d.ts +0 -6
- package/lib/MessageContainer/index.js +0 -235
- package/lib/MessageContainer/index.js.map +0 -1
- package/lib/MessageContainer/styles.d.ts +0 -35
- package/lib/MessageContainer/styles.js +0 -32
- package/lib/MessageContainer/styles.js.map +0 -1
- package/lib/MessageContainer/types.d.ts +0 -51
- package/lib/MessageContainer/types.js +0 -2
- package/lib/MessageContainer/types.js.map +0 -1
- package/lib/MessageImage.d.ts +0 -13
- package/lib/MessageImage.js +0 -30
- package/lib/MessageImage.js.map +0 -1
- package/lib/MessageText.d.ts +0 -19
- package/lib/MessageText.js +0 -69
- package/lib/MessageText.js.map +0 -1
- package/lib/MessageVideo.d.ts +0 -2
- package/lib/MessageVideo.js +0 -14
- package/lib/MessageVideo.js.map +0 -1
- package/lib/QuickReplies.d.ts +0 -15
- package/lib/QuickReplies.js +0 -101
- package/lib/QuickReplies.js.map +0 -1
- package/lib/Send.d.ts +0 -15
- package/lib/Send.js +0 -34
- package/lib/Send.js.map +0 -1
- package/lib/SystemMessage.d.ts +0 -11
- package/lib/SystemMessage.js +0 -27
- package/lib/SystemMessage.js.map +0 -1
- package/lib/Time.d.ts +0 -11
- package/lib/Time.js +0 -56
- package/lib/Time.js.map +0 -1
- package/lib/TypingIndicator/index.d.ts +0 -5
- package/lib/TypingIndicator/index.js +0 -94
- package/lib/TypingIndicator/index.js.map +0 -1
- package/lib/TypingIndicator/styles.d.ts +0 -20
- package/lib/TypingIndicator/styles.js +0 -22
- package/lib/TypingIndicator/styles.js.map +0 -1
- package/lib/TypingIndicator/types.d.ts +0 -3
- package/lib/TypingIndicator/types.js +0 -2
- package/lib/TypingIndicator/types.js.map +0 -1
- package/lib/hooks/useUpdateLayoutEffect.d.ts +0 -8
- package/lib/hooks/useUpdateLayoutEffect.js +0 -17
- package/lib/hooks/useUpdateLayoutEffect.js.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -5
- package/lib/index.js.map +0 -1
- package/lib/logging.d.ts +0 -2
- package/lib/logging.js +0 -5
- package/lib/logging.js.map +0 -1
- package/lib/styles.d.ts +0 -10
- package/lib/styles.js +0 -11
- package/lib/styles.js.map +0 -1
- package/lib/types.d.ts +0 -67
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts +0 -5
- package/lib/utils.js +0 -83
- package/lib/utils.js.map +0 -1
- package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +0 -108
package/lib/Avatar.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
import { IMessage, LeftRightStyle, User } from './types';
|
|
4
|
-
export interface AvatarProps<TMessage extends IMessage> {
|
|
5
|
-
currentMessage: TMessage;
|
|
6
|
-
previousMessage?: TMessage;
|
|
7
|
-
nextMessage?: TMessage;
|
|
8
|
-
position: 'left' | 'right';
|
|
9
|
-
renderAvatarOnTop?: boolean;
|
|
10
|
-
showAvatarForEveryMessage?: boolean;
|
|
11
|
-
imageStyle?: LeftRightStyle<ImageStyle>;
|
|
12
|
-
containerStyle?: LeftRightStyle<ViewStyle>;
|
|
13
|
-
textStyle?: TextStyle;
|
|
14
|
-
renderAvatar?(props: Omit<AvatarProps<TMessage>, 'renderAvatar'>): ReactNode;
|
|
15
|
-
onPressAvatar?: (user: User) => void;
|
|
16
|
-
onLongPressAvatar?: (user: User) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): React.JSX.Element | null;
|
package/lib/Avatar.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { StyleSheet, View, } from 'react-native';
|
|
3
|
-
import { GiftedAvatar } from './GiftedAvatar';
|
|
4
|
-
import { isSameUser, isSameDay } from './utils';
|
|
5
|
-
const styles = {
|
|
6
|
-
left: StyleSheet.create({
|
|
7
|
-
container: {
|
|
8
|
-
marginRight: 8,
|
|
9
|
-
},
|
|
10
|
-
onTop: {
|
|
11
|
-
alignSelf: 'flex-start',
|
|
12
|
-
},
|
|
13
|
-
image: {
|
|
14
|
-
height: 36,
|
|
15
|
-
width: 36,
|
|
16
|
-
borderRadius: 18,
|
|
17
|
-
},
|
|
18
|
-
}),
|
|
19
|
-
right: StyleSheet.create({
|
|
20
|
-
container: {
|
|
21
|
-
marginLeft: 8,
|
|
22
|
-
},
|
|
23
|
-
onTop: {
|
|
24
|
-
alignSelf: 'flex-start',
|
|
25
|
-
},
|
|
26
|
-
image: {
|
|
27
|
-
height: 36,
|
|
28
|
-
width: 36,
|
|
29
|
-
borderRadius: 18,
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
};
|
|
33
|
-
export function Avatar(props) {
|
|
34
|
-
const { renderAvatarOnTop, showAvatarForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, onPressAvatar, onLongPressAvatar, } = props;
|
|
35
|
-
const messageToCompare = renderAvatarOnTop ? previousMessage : nextMessage;
|
|
36
|
-
const renderAvatarComponent = useCallback(() => {
|
|
37
|
-
if (renderAvatar)
|
|
38
|
-
return renderAvatar({
|
|
39
|
-
renderAvatarOnTop,
|
|
40
|
-
showAvatarForEveryMessage,
|
|
41
|
-
containerStyle,
|
|
42
|
-
position,
|
|
43
|
-
currentMessage,
|
|
44
|
-
previousMessage,
|
|
45
|
-
nextMessage,
|
|
46
|
-
imageStyle,
|
|
47
|
-
onPressAvatar,
|
|
48
|
-
onLongPressAvatar,
|
|
49
|
-
});
|
|
50
|
-
if (currentMessage)
|
|
51
|
-
return (<GiftedAvatar avatarStyle={[
|
|
52
|
-
styles[position].image,
|
|
53
|
-
imageStyle?.[position],
|
|
54
|
-
]} user={currentMessage.user} onPress={() => onPressAvatar?.(currentMessage.user)} onLongPress={() => onLongPressAvatar?.(currentMessage.user)}/>);
|
|
55
|
-
return null;
|
|
56
|
-
}, [
|
|
57
|
-
renderAvatar,
|
|
58
|
-
renderAvatarOnTop,
|
|
59
|
-
showAvatarForEveryMessage,
|
|
60
|
-
containerStyle,
|
|
61
|
-
position,
|
|
62
|
-
currentMessage,
|
|
63
|
-
previousMessage,
|
|
64
|
-
nextMessage,
|
|
65
|
-
imageStyle,
|
|
66
|
-
onPressAvatar,
|
|
67
|
-
onLongPressAvatar,
|
|
68
|
-
]);
|
|
69
|
-
if (renderAvatar === null)
|
|
70
|
-
return null;
|
|
71
|
-
if (!showAvatarForEveryMessage &&
|
|
72
|
-
currentMessage &&
|
|
73
|
-
messageToCompare &&
|
|
74
|
-
isSameUser(currentMessage, messageToCompare) &&
|
|
75
|
-
isSameDay(currentMessage, messageToCompare))
|
|
76
|
-
return (<View style={[
|
|
77
|
-
styles[position].container,
|
|
78
|
-
containerStyle?.[position],
|
|
79
|
-
]}>
|
|
80
|
-
<GiftedAvatar avatarStyle={[
|
|
81
|
-
styles[position].image,
|
|
82
|
-
imageStyle?.[position],
|
|
83
|
-
]}/>
|
|
84
|
-
</View>);
|
|
85
|
-
return (<View style={[
|
|
86
|
-
styles[position].container,
|
|
87
|
-
renderAvatarOnTop && styles[position].onTop,
|
|
88
|
-
containerStyle?.[position],
|
|
89
|
-
]}>
|
|
90
|
-
{renderAvatarComponent()}
|
|
91
|
-
</View>);
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=Avatar.js.map
|
package/lib/Avatar.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[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C,CAAC;YACL,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS;YAC1B,iBAAiB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;YAC3C,cAAc,EAAE,CAAC,QAAQ,CAAC;SAC3B,CAAC,CAEF;MAAA,CAAC,qBAAqB,EAAE,CAC1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
|
package/lib/Bubble/index.d.ts
DELETED
package/lib/Bubble/index.js
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { Text, TouchableWithoutFeedback, View, } from 'react-native';
|
|
3
|
-
import { useChatContext } from '../GiftedChatContext';
|
|
4
|
-
import { QuickReplies } from '../QuickReplies';
|
|
5
|
-
import { MessageText } from '../MessageText';
|
|
6
|
-
import { MessageImage } from '../MessageImage';
|
|
7
|
-
import { MessageVideo } from '../MessageVideo';
|
|
8
|
-
import { MessageAudio } from '../MessageAudio';
|
|
9
|
-
import { Time } from '../Time';
|
|
10
|
-
import { isSameUser, isSameDay } from '../utils';
|
|
11
|
-
import stylesCommon from '../styles';
|
|
12
|
-
import styles from './styles';
|
|
13
|
-
export * from './types';
|
|
14
|
-
const Bubble = (props) => {
|
|
15
|
-
const { currentMessage, nextMessage, position, containerToNextStyle, previousMessage, containerToPreviousStyle, onQuickReply, renderQuickReplySend, quickReplyStyle, quickReplyTextStyle, quickReplyContainerStyle, containerStyle, wrapperStyle, bottomContainerStyle, onPress: onPressProp, onLongPress: onLongPressProp, } = props;
|
|
16
|
-
const context = useChatContext();
|
|
17
|
-
const onPress = useCallback(() => {
|
|
18
|
-
onPressProp?.(context, currentMessage);
|
|
19
|
-
}, [onPressProp, context, currentMessage]);
|
|
20
|
-
const onLongPress = useCallback(() => {
|
|
21
|
-
onLongPressProp?.(context, currentMessage);
|
|
22
|
-
}, [
|
|
23
|
-
currentMessage,
|
|
24
|
-
context,
|
|
25
|
-
onLongPressProp,
|
|
26
|
-
]);
|
|
27
|
-
const styledBubbleToNext = useCallback(() => {
|
|
28
|
-
if (currentMessage &&
|
|
29
|
-
nextMessage &&
|
|
30
|
-
position &&
|
|
31
|
-
isSameUser(currentMessage, nextMessage) &&
|
|
32
|
-
isSameDay(currentMessage, nextMessage))
|
|
33
|
-
return [
|
|
34
|
-
styles[position].containerToNext,
|
|
35
|
-
containerToNextStyle?.[position],
|
|
36
|
-
];
|
|
37
|
-
return null;
|
|
38
|
-
}, [
|
|
39
|
-
currentMessage,
|
|
40
|
-
nextMessage,
|
|
41
|
-
position,
|
|
42
|
-
containerToNextStyle,
|
|
43
|
-
]);
|
|
44
|
-
const styledBubbleToPrevious = useCallback(() => {
|
|
45
|
-
if (currentMessage &&
|
|
46
|
-
previousMessage &&
|
|
47
|
-
position &&
|
|
48
|
-
isSameUser(currentMessage, previousMessage) &&
|
|
49
|
-
isSameDay(currentMessage, previousMessage))
|
|
50
|
-
return [
|
|
51
|
-
styles[position].containerToPrevious,
|
|
52
|
-
containerToPreviousStyle?.[position],
|
|
53
|
-
];
|
|
54
|
-
return null;
|
|
55
|
-
}, [
|
|
56
|
-
currentMessage,
|
|
57
|
-
previousMessage,
|
|
58
|
-
position,
|
|
59
|
-
containerToPreviousStyle,
|
|
60
|
-
]);
|
|
61
|
-
const renderQuickReplies = useCallback(() => {
|
|
62
|
-
if (currentMessage?.quickReplies) {
|
|
63
|
-
const {
|
|
64
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
65
|
-
containerStyle, wrapperStyle,
|
|
66
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
67
|
-
...quickReplyProps } = props;
|
|
68
|
-
if (props.renderQuickReplies)
|
|
69
|
-
return props.renderQuickReplies(quickReplyProps);
|
|
70
|
-
return (<QuickReplies currentMessage={currentMessage} onQuickReply={onQuickReply} renderQuickReplySend={renderQuickReplySend} quickReplyStyle={quickReplyStyle} quickReplyTextStyle={quickReplyTextStyle} quickReplyContainerStyle={quickReplyContainerStyle} nextMessage={nextMessage}/>);
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}, [
|
|
74
|
-
currentMessage,
|
|
75
|
-
onQuickReply,
|
|
76
|
-
renderQuickReplySend,
|
|
77
|
-
quickReplyStyle,
|
|
78
|
-
quickReplyTextStyle,
|
|
79
|
-
quickReplyContainerStyle,
|
|
80
|
-
nextMessage,
|
|
81
|
-
props,
|
|
82
|
-
]);
|
|
83
|
-
const renderMessageText = useCallback(() => {
|
|
84
|
-
if (currentMessage?.text) {
|
|
85
|
-
const {
|
|
86
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
87
|
-
containerStyle, wrapperStyle,
|
|
88
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
89
|
-
...messageTextProps } = props;
|
|
90
|
-
if (props.renderMessageText)
|
|
91
|
-
return props.renderMessageText(messageTextProps);
|
|
92
|
-
return <MessageText {...messageTextProps}/>;
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}, [props, currentMessage]);
|
|
96
|
-
const renderMessageImage = useCallback(() => {
|
|
97
|
-
if (currentMessage?.image) {
|
|
98
|
-
const {
|
|
99
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
100
|
-
containerStyle, wrapperStyle,
|
|
101
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
102
|
-
...messageImageProps } = props;
|
|
103
|
-
if (props.renderMessageImage)
|
|
104
|
-
return props.renderMessageImage(messageImageProps);
|
|
105
|
-
return <MessageImage {...messageImageProps}/>;
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
}, [props, currentMessage]);
|
|
109
|
-
const renderMessageVideo = useCallback(() => {
|
|
110
|
-
if (!currentMessage?.video)
|
|
111
|
-
return null;
|
|
112
|
-
const {
|
|
113
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
114
|
-
containerStyle, wrapperStyle,
|
|
115
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
116
|
-
...messageVideoProps } = props;
|
|
117
|
-
if (props.renderMessageVideo)
|
|
118
|
-
return props.renderMessageVideo(messageVideoProps);
|
|
119
|
-
return <MessageVideo />;
|
|
120
|
-
}, [props, currentMessage]);
|
|
121
|
-
const renderMessageAudio = useCallback(() => {
|
|
122
|
-
if (!currentMessage?.audio)
|
|
123
|
-
return null;
|
|
124
|
-
const {
|
|
125
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
126
|
-
containerStyle, wrapperStyle,
|
|
127
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
128
|
-
...messageAudioProps } = props;
|
|
129
|
-
if (props.renderMessageAudio)
|
|
130
|
-
return props.renderMessageAudio(messageAudioProps);
|
|
131
|
-
return <MessageAudio />;
|
|
132
|
-
}, [props, currentMessage]);
|
|
133
|
-
const renderTicks = useCallback(() => {
|
|
134
|
-
const { renderTicks, user, } = props;
|
|
135
|
-
if (renderTicks && currentMessage)
|
|
136
|
-
return renderTicks(currentMessage);
|
|
137
|
-
if (user &&
|
|
138
|
-
currentMessage?.user &&
|
|
139
|
-
currentMessage.user._id !== user._id)
|
|
140
|
-
return null;
|
|
141
|
-
if (currentMessage &&
|
|
142
|
-
(currentMessage.sent || currentMessage.received || currentMessage.pending))
|
|
143
|
-
return (<View style={styles.content.tickView}>
|
|
144
|
-
{!!currentMessage.sent && (<Text style={[styles.content.tick, props.tickStyle]}>
|
|
145
|
-
{'✓'}
|
|
146
|
-
</Text>)}
|
|
147
|
-
{!!currentMessage.received && (<Text style={[styles.content.tick, props.tickStyle]}>
|
|
148
|
-
{'✓'}
|
|
149
|
-
</Text>)}
|
|
150
|
-
{!!currentMessage.pending && (<Text style={[styles.content.tick, props.tickStyle]}>
|
|
151
|
-
{'🕓'}
|
|
152
|
-
</Text>)}
|
|
153
|
-
</View>);
|
|
154
|
-
return null;
|
|
155
|
-
}, [
|
|
156
|
-
props,
|
|
157
|
-
currentMessage,
|
|
158
|
-
]);
|
|
159
|
-
const renderTime = useCallback(() => {
|
|
160
|
-
if (currentMessage?.createdAt) {
|
|
161
|
-
const {
|
|
162
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
163
|
-
containerStyle, wrapperStyle, textStyle,
|
|
164
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
165
|
-
...timeProps } = props;
|
|
166
|
-
if (props.renderTime)
|
|
167
|
-
return props.renderTime(timeProps);
|
|
168
|
-
return <Time {...timeProps}/>;
|
|
169
|
-
}
|
|
170
|
-
return null;
|
|
171
|
-
}, [props, currentMessage]);
|
|
172
|
-
const renderUsername = useCallback(() => {
|
|
173
|
-
const { user, renderUsername, } = props;
|
|
174
|
-
if (props.renderUsernameOnMessage && currentMessage) {
|
|
175
|
-
if (user && currentMessage.user._id === user._id)
|
|
176
|
-
return null;
|
|
177
|
-
if (renderUsername)
|
|
178
|
-
return renderUsername(currentMessage.user);
|
|
179
|
-
return (<View style={styles.content.usernameView}>
|
|
180
|
-
<Text style={[styles.content.username, props.usernameStyle]}>
|
|
181
|
-
{'~ '}
|
|
182
|
-
{currentMessage.user.name}
|
|
183
|
-
</Text>
|
|
184
|
-
</View>);
|
|
185
|
-
}
|
|
186
|
-
return null;
|
|
187
|
-
}, [
|
|
188
|
-
currentMessage,
|
|
189
|
-
props,
|
|
190
|
-
]);
|
|
191
|
-
const renderCustomView = useCallback(() => {
|
|
192
|
-
if (props.renderCustomView)
|
|
193
|
-
return props.renderCustomView(props);
|
|
194
|
-
return null;
|
|
195
|
-
}, [props]);
|
|
196
|
-
const renderBubbleContent = useCallback(() => {
|
|
197
|
-
return (<View>
|
|
198
|
-
{!props.isCustomViewBottom && renderCustomView()}
|
|
199
|
-
{renderMessageImage()}
|
|
200
|
-
{renderMessageVideo()}
|
|
201
|
-
{renderMessageAudio()}
|
|
202
|
-
{renderMessageText()}
|
|
203
|
-
{props.isCustomViewBottom && renderCustomView()}
|
|
204
|
-
</View>);
|
|
205
|
-
}, [
|
|
206
|
-
renderCustomView,
|
|
207
|
-
renderMessageImage,
|
|
208
|
-
renderMessageVideo,
|
|
209
|
-
renderMessageAudio,
|
|
210
|
-
renderMessageText,
|
|
211
|
-
props.isCustomViewBottom,
|
|
212
|
-
]);
|
|
213
|
-
return (<View style={[
|
|
214
|
-
stylesCommon.fill,
|
|
215
|
-
styles[position].container,
|
|
216
|
-
containerStyle && containerStyle[position],
|
|
217
|
-
]}>
|
|
218
|
-
<View style={[
|
|
219
|
-
styles[position].wrapper,
|
|
220
|
-
styledBubbleToNext(),
|
|
221
|
-
styledBubbleToPrevious(),
|
|
222
|
-
wrapperStyle && wrapperStyle[position],
|
|
223
|
-
]}>
|
|
224
|
-
<TouchableWithoutFeedback onPress={onPress} onLongPress={onLongPress} accessibilityRole='text' {...props.touchableProps}>
|
|
225
|
-
<View>
|
|
226
|
-
{renderBubbleContent()}
|
|
227
|
-
<View style={[
|
|
228
|
-
styles[position].bottom,
|
|
229
|
-
bottomContainerStyle?.[position],
|
|
230
|
-
]}>
|
|
231
|
-
{renderUsername()}
|
|
232
|
-
{renderTime()}
|
|
233
|
-
{renderTicks()}
|
|
234
|
-
</View>
|
|
235
|
-
</View>
|
|
236
|
-
</TouchableWithoutFeedback>
|
|
237
|
-
</View>
|
|
238
|
-
{renderQuickReplies()}
|
|
239
|
-
</View>);
|
|
240
|
-
};
|
|
241
|
-
export default Bubble;
|
|
242
|
-
//# sourceMappingURL=index.js.map
|
package/lib/Bubble/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Bubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAA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EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/lib/Bubble/styles.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
declare const styles: {
|
|
2
|
-
left: {
|
|
3
|
-
container: {
|
|
4
|
-
alignItems: "flex-start";
|
|
5
|
-
};
|
|
6
|
-
wrapper: {
|
|
7
|
-
borderRadius: number;
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
marginRight: number;
|
|
10
|
-
minHeight: number;
|
|
11
|
-
justifyContent: "flex-end";
|
|
12
|
-
};
|
|
13
|
-
containerToNext: {
|
|
14
|
-
borderBottomLeftRadius: number;
|
|
15
|
-
};
|
|
16
|
-
containerToPrevious: {
|
|
17
|
-
borderTopLeftRadius: number;
|
|
18
|
-
};
|
|
19
|
-
bottom: {
|
|
20
|
-
flexDirection: "row";
|
|
21
|
-
justifyContent: "flex-start";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
right: {
|
|
25
|
-
container: {
|
|
26
|
-
alignItems: "flex-end";
|
|
27
|
-
};
|
|
28
|
-
wrapper: {
|
|
29
|
-
borderRadius: number;
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
marginLeft: number;
|
|
32
|
-
minHeight: number;
|
|
33
|
-
justifyContent: "flex-end";
|
|
34
|
-
};
|
|
35
|
-
containerToNext: {
|
|
36
|
-
borderBottomRightRadius: number;
|
|
37
|
-
};
|
|
38
|
-
containerToPrevious: {
|
|
39
|
-
borderTopRightRadius: number;
|
|
40
|
-
};
|
|
41
|
-
bottom: {
|
|
42
|
-
flexDirection: "row";
|
|
43
|
-
justifyContent: "flex-end";
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
content: {
|
|
47
|
-
tick: {
|
|
48
|
-
fontSize: number;
|
|
49
|
-
backgroundColor: string;
|
|
50
|
-
color: string;
|
|
51
|
-
};
|
|
52
|
-
tickView: {
|
|
53
|
-
flexDirection: "row";
|
|
54
|
-
marginRight: number;
|
|
55
|
-
};
|
|
56
|
-
username: {
|
|
57
|
-
top: number;
|
|
58
|
-
left: number;
|
|
59
|
-
fontSize: number;
|
|
60
|
-
backgroundColor: string;
|
|
61
|
-
color: string;
|
|
62
|
-
};
|
|
63
|
-
usernameView: {
|
|
64
|
-
flexDirection: "row";
|
|
65
|
-
marginHorizontal: number;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export default styles;
|
package/lib/Bubble/styles.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
import Color from '../Color';
|
|
3
|
-
const styles = {
|
|
4
|
-
left: StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
alignItems: 'flex-start',
|
|
7
|
-
},
|
|
8
|
-
wrapper: {
|
|
9
|
-
borderRadius: 15,
|
|
10
|
-
backgroundColor: Color.leftBubbleBackground,
|
|
11
|
-
marginRight: 60,
|
|
12
|
-
minHeight: 20,
|
|
13
|
-
justifyContent: 'flex-end',
|
|
14
|
-
},
|
|
15
|
-
containerToNext: {
|
|
16
|
-
borderBottomLeftRadius: 3,
|
|
17
|
-
},
|
|
18
|
-
containerToPrevious: {
|
|
19
|
-
borderTopLeftRadius: 3,
|
|
20
|
-
},
|
|
21
|
-
bottom: {
|
|
22
|
-
flexDirection: 'row',
|
|
23
|
-
justifyContent: 'flex-start',
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
right: StyleSheet.create({
|
|
27
|
-
container: {
|
|
28
|
-
alignItems: 'flex-end',
|
|
29
|
-
},
|
|
30
|
-
wrapper: {
|
|
31
|
-
borderRadius: 15,
|
|
32
|
-
backgroundColor: Color.defaultBlue,
|
|
33
|
-
marginLeft: 60,
|
|
34
|
-
minHeight: 20,
|
|
35
|
-
justifyContent: 'flex-end',
|
|
36
|
-
},
|
|
37
|
-
containerToNext: {
|
|
38
|
-
borderBottomRightRadius: 3,
|
|
39
|
-
},
|
|
40
|
-
containerToPrevious: {
|
|
41
|
-
borderTopRightRadius: 3,
|
|
42
|
-
},
|
|
43
|
-
bottom: {
|
|
44
|
-
flexDirection: 'row',
|
|
45
|
-
justifyContent: 'flex-end',
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
content: StyleSheet.create({
|
|
49
|
-
tick: {
|
|
50
|
-
fontSize: 10,
|
|
51
|
-
backgroundColor: Color.backgroundTransparent,
|
|
52
|
-
color: Color.white,
|
|
53
|
-
},
|
|
54
|
-
tickView: {
|
|
55
|
-
flexDirection: 'row',
|
|
56
|
-
marginRight: 10,
|
|
57
|
-
},
|
|
58
|
-
username: {
|
|
59
|
-
top: -3,
|
|
60
|
-
left: 0,
|
|
61
|
-
fontSize: 12,
|
|
62
|
-
backgroundColor: Color.backgroundTransparent,
|
|
63
|
-
color: '#aaa',
|
|
64
|
-
},
|
|
65
|
-
usernameView: {
|
|
66
|
-
flexDirection: 'row',
|
|
67
|
-
marginHorizontal: 10,
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
export default styles;
|
|
72
|
-
//# sourceMappingURL=styles.js.map
|
package/lib/Bubble/styles.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/Bubble/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE;YACT,UAAU,EAAE,YAAY;SACzB;QACD,OAAO,EAAE;YACP,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,KAAK,CAAC,oBAAoB;YAC3C,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;YACb,cAAc,EAAE,UAAU;SAC3B;QACD,eAAe,EAAE;YACf,sBAAsB,EAAE,CAAC;SAC1B;QACD,mBAAmB,EAAE;YACnB,mBAAmB,EAAE,CAAC;SACvB;QACD,MAAM,EAAE;YACN,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,YAAY;SAC7B;KACF,CAAC;IACF,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,UAAU,EAAE,UAAU;SACvB;QACD,OAAO,EAAE;YACP,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,KAAK,CAAC,WAAW;YAClC,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,cAAc,EAAE,UAAU;SAC3B;QACD,eAAe,EAAE;YACf,uBAAuB,EAAE,CAAC;SAC3B;QACD,mBAAmB,EAAE;YACnB,oBAAoB,EAAE,CAAC;SACxB;QACD,MAAM,EAAE;YACN,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,UAAU;SAC3B;KACF,CAAC;IACF,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;YACZ,eAAe,EAAE,KAAK,CAAC,qBAAqB;YAC5C,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE,EAAE;SAChB;QACD,QAAQ,EAAE;YACR,GAAG,EAAE,CAAC,CAAC;YACP,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;YACZ,eAAe,EAAE,KAAK,CAAC,qBAAqB;YAC5C,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,gBAAgB,EAAE,EAAE;SACrB;KACF,CAAC;CACH,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/lib/Bubble/types.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import { QuickRepliesProps } from '../QuickReplies';
|
|
4
|
-
import { MessageTextProps, MessageOption } from '../MessageText';
|
|
5
|
-
import { MessageImageProps } from '../MessageImage';
|
|
6
|
-
import { TimeProps } from '../Time';
|
|
7
|
-
import { User, IMessage, LeftRightStyle, Reply, Omit, MessageVideoProps, MessageAudioProps } from '../types';
|
|
8
|
-
export type RenderMessageImageProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageImageProps<TMessage>;
|
|
9
|
-
export type RenderMessageVideoProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageVideoProps<TMessage>;
|
|
10
|
-
export type RenderMessageAudioProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle'> & MessageAudioProps<TMessage>;
|
|
11
|
-
export type RenderMessageTextProps<TMessage extends IMessage> = Omit<BubbleProps<TMessage>, 'containerStyle' | 'wrapperStyle' | 'options'> & MessageTextProps<TMessage>;
|
|
12
|
-
export interface BubbleProps<TMessage extends IMessage> {
|
|
13
|
-
user?: User;
|
|
14
|
-
touchableProps?: object;
|
|
15
|
-
renderUsernameOnMessage?: boolean;
|
|
16
|
-
isCustomViewBottom?: boolean;
|
|
17
|
-
inverted?: boolean;
|
|
18
|
-
position: 'left' | 'right';
|
|
19
|
-
currentMessage: TMessage;
|
|
20
|
-
nextMessage?: TMessage;
|
|
21
|
-
previousMessage?: TMessage;
|
|
22
|
-
options?: MessageOption[];
|
|
23
|
-
containerStyle?: LeftRightStyle<ViewStyle>;
|
|
24
|
-
wrapperStyle?: LeftRightStyle<ViewStyle>;
|
|
25
|
-
textStyle?: LeftRightStyle<TextStyle>;
|
|
26
|
-
bottomContainerStyle?: LeftRightStyle<ViewStyle>;
|
|
27
|
-
tickStyle?: StyleProp<TextStyle>;
|
|
28
|
-
containerToNextStyle?: LeftRightStyle<ViewStyle>;
|
|
29
|
-
containerToPreviousStyle?: LeftRightStyle<ViewStyle>;
|
|
30
|
-
usernameStyle?: TextStyle;
|
|
31
|
-
quickReplyStyle?: StyleProp<ViewStyle>;
|
|
32
|
-
quickReplyTextStyle?: StyleProp<TextStyle>;
|
|
33
|
-
quickReplyContainerStyle?: StyleProp<ViewStyle>;
|
|
34
|
-
onPress?(context?: unknown, message?: unknown): void;
|
|
35
|
-
onLongPress?(context?: unknown, message?: unknown): void;
|
|
36
|
-
onQuickReply?(replies: Reply[]): void;
|
|
37
|
-
renderMessageImage?(props: RenderMessageImageProps<TMessage>): React.ReactNode;
|
|
38
|
-
renderMessageVideo?(props: RenderMessageVideoProps<TMessage>): React.ReactNode;
|
|
39
|
-
renderMessageAudio?(props: RenderMessageAudioProps<TMessage>): React.ReactNode;
|
|
40
|
-
renderMessageText?(props: RenderMessageTextProps<TMessage>): React.ReactNode;
|
|
41
|
-
renderCustomView?(bubbleProps: BubbleProps<TMessage>): React.ReactNode;
|
|
42
|
-
renderTime?(timeProps: TimeProps<TMessage>): React.ReactNode;
|
|
43
|
-
renderTicks?(currentMessage: TMessage): React.ReactNode;
|
|
44
|
-
renderUsername?(user?: TMessage['user']): React.ReactNode;
|
|
45
|
-
renderQuickReplySend?(): React.ReactNode;
|
|
46
|
-
renderQuickReplies?(quickReplies: QuickRepliesProps<TMessage>): React.ReactNode;
|
|
47
|
-
}
|
package/lib/Bubble/types.js
DELETED
package/lib/Bubble/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/Bubble/types.ts"],"names":[],"mappings":""}
|
package/lib/Color.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
defaultColor: string;
|
|
3
|
-
backgroundTransparent: string;
|
|
4
|
-
defaultBlue: string;
|
|
5
|
-
leftBubbleBackground: string;
|
|
6
|
-
black: string;
|
|
7
|
-
white: string;
|
|
8
|
-
carrot: string;
|
|
9
|
-
emerald: string;
|
|
10
|
-
peterRiver: string;
|
|
11
|
-
wisteria: string;
|
|
12
|
-
alizarin: string;
|
|
13
|
-
turquoise: string;
|
|
14
|
-
midnightBlue: string;
|
|
15
|
-
optionTintColor: string;
|
|
16
|
-
timeTextColor: string;
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
package/lib/Color.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
defaultColor: '#b2b2b2',
|
|
3
|
-
backgroundTransparent: 'transparent',
|
|
4
|
-
defaultBlue: '#0084ff',
|
|
5
|
-
leftBubbleBackground: '#f0f0f0',
|
|
6
|
-
black: '#000',
|
|
7
|
-
white: '#fff',
|
|
8
|
-
carrot: '#e67e22',
|
|
9
|
-
emerald: '#2ecc71',
|
|
10
|
-
peterRiver: '#3498db',
|
|
11
|
-
wisteria: '#8e44ad',
|
|
12
|
-
alizarin: '#e74c3c',
|
|
13
|
-
turquoise: '#1abc9c',
|
|
14
|
-
midnightBlue: '#2c3e50',
|
|
15
|
-
optionTintColor: '#007AFF',
|
|
16
|
-
timeTextColor: '#aaa',
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=Color.js.map
|
package/lib/Color.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Color.js","sourceRoot":"","sources":["../src/Color.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,YAAY,EAAE,SAAS;IACvB,qBAAqB,EAAE,aAAa;IACpC,WAAW,EAAE,SAAS;IACtB,oBAAoB,EAAE,SAAS;IAC/B,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,aAAa,EAAE,MAAM;CACtB,CAAA"}
|
package/lib/Composer.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextInputProps } from 'react-native';
|
|
3
|
-
export interface ComposerProps {
|
|
4
|
-
composerHeight?: number;
|
|
5
|
-
text?: string;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
placeholderTextColor?: string;
|
|
8
|
-
textInputProps?: Partial<TextInputProps>;
|
|
9
|
-
textInputStyle?: TextInputProps['style'];
|
|
10
|
-
textInputAutoFocus?: boolean;
|
|
11
|
-
keyboardAppearance?: TextInputProps['keyboardAppearance'];
|
|
12
|
-
multiline?: boolean;
|
|
13
|
-
disableComposer?: boolean;
|
|
14
|
-
onTextChanged?(text: string): void;
|
|
15
|
-
onInputSizeChanged?(layout: {
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
}): void;
|
|
19
|
-
}
|
|
20
|
-
export declare function Composer({ composerHeight, disableComposer, keyboardAppearance, multiline, onInputSizeChanged, onTextChanged, placeholder, placeholderTextColor, text, textInputAutoFocus, textInputProps, textInputStyle, }: ComposerProps): React.ReactElement;
|