react-native-gifted-chat 2.6.4 → 2.7.0
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 +9 -16
- 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} +58 -59
- 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} +29 -37
- 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 +175 -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 +30 -34
- package/src/Actions.tsx +3 -15
- package/src/Avatar.tsx +43 -52
- package/src/{Bubble.tsx → Bubble/index.tsx} +53 -270
- 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 +503 -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 +316 -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 +2 -25
- 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/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/.ci/compile +0 -351
- package/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
- 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 -103
- 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 -678
- package/src/Message.tsx +0 -229
- package/src/MessageContainer.tsx +0 -359
package/lib/Composer.js.flow
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { TextInput } from 'react-native'
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
|
|
5
|
-
type TextInputProps = $Shape<React.ElementProps<typeof TextInput>>
|
|
6
|
-
|
|
7
|
-
export type ComposerProps = $ReadOnly<{|
|
|
8
|
-
composerHeight?: number,
|
|
9
|
-
text?: string,
|
|
10
|
-
placeholder?: string,
|
|
11
|
-
placeholderTextColor?: string,
|
|
12
|
-
textInputProps?: TextInputProps,
|
|
13
|
-
textInputStyle?: $PropertyType<TextInputProps, 'style'>,
|
|
14
|
-
textInputAutoFocus?: boolean,
|
|
15
|
-
keyboardAppearance?: $PropertyType<TextInputProps, 'keyboardAppearance'>,
|
|
16
|
-
multiline?: boolean,
|
|
17
|
-
onTextChanged?: string => void,
|
|
18
|
-
onInputSizeChanged?: ({|
|
|
19
|
-
width: number,
|
|
20
|
-
height: number,
|
|
21
|
-
|}) => void,
|
|
22
|
-
|}>
|
|
23
|
-
|
|
24
|
-
export default class Composer extends React.Component<ComposerProps> {}
|
package/lib/Day.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, TextStyle, TextProps } from 'react-native';
|
|
3
|
-
import { IMessage } from './Models';
|
|
4
|
-
export interface DayProps<TMessage extends IMessage = IMessage> {
|
|
5
|
-
currentMessage: TMessage;
|
|
6
|
-
nextMessage?: TMessage;
|
|
7
|
-
previousMessage?: TMessage;
|
|
8
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
9
|
-
wrapperStyle?: StyleProp<ViewStyle>;
|
|
10
|
-
textStyle?: StyleProp<TextStyle>;
|
|
11
|
-
textProps?: TextProps;
|
|
12
|
-
dateFormat?: string;
|
|
13
|
-
inverted?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function Day<TMessage extends IMessage = IMessage>({ dateFormat, currentMessage, previousMessage, containerStyle, wrapperStyle, textStyle, }: DayProps<TMessage>): React.JSX.Element | null;
|
package/lib/Day.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { StyleSheet, Text, View, } from 'react-native';
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
import Color from './Color';
|
|
5
|
-
import { isSameDay } from './utils';
|
|
6
|
-
import { DATE_FORMAT } from './Constant';
|
|
7
|
-
import { useChatContext } from './GiftedChatContext';
|
|
8
|
-
const styles = StyleSheet.create({
|
|
9
|
-
container: {
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
marginTop: 5,
|
|
13
|
-
marginBottom: 10,
|
|
14
|
-
},
|
|
15
|
-
text: {
|
|
16
|
-
backgroundColor: Color.backgroundTransparent,
|
|
17
|
-
color: Color.defaultColor,
|
|
18
|
-
fontSize: 12,
|
|
19
|
-
fontWeight: '600',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
export function Day({ dateFormat = DATE_FORMAT, currentMessage, previousMessage, containerStyle, wrapperStyle, textStyle, }) {
|
|
23
|
-
const { getLocale } = useChatContext();
|
|
24
|
-
if (currentMessage == null || isSameDay(currentMessage, previousMessage))
|
|
25
|
-
return null;
|
|
26
|
-
return (<View style={[styles.container, containerStyle]}>
|
|
27
|
-
<View style={wrapperStyle}>
|
|
28
|
-
<Text style={[styles.text, textStyle]}>
|
|
29
|
-
{dayjs(currentMessage.createdAt)
|
|
30
|
-
.locale(getLocale())
|
|
31
|
-
.format(dateFormat)}
|
|
32
|
-
</Text>
|
|
33
|
-
</View>
|
|
34
|
-
</View>);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=Day.js.map
|
package/lib/Day.js.flow
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { PureComponent } from 'react'
|
|
3
|
-
import type { IMessage } from './types'
|
|
4
|
-
import type {
|
|
5
|
-
ViewStyleProp,
|
|
6
|
-
ImageStyleProp,
|
|
7
|
-
TextStyleProp,
|
|
8
|
-
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
9
|
-
|
|
10
|
-
export type DayProps<TMessage: IMessage = IMessage> = $ReadOnly<{|
|
|
11
|
-
currentMessage: TMessage,
|
|
12
|
-
nextMessage?: TMessage,
|
|
13
|
-
previousMessage?: TMessage,
|
|
14
|
-
containerStyle?: ViewStyleProp,
|
|
15
|
-
wrapperStyle?: ViewStyleProp,
|
|
16
|
-
textStyle?: TextStyleProp,
|
|
17
|
-
dateFormat?: string,
|
|
18
|
-
inverted?: boolean,
|
|
19
|
-
|}>
|
|
20
|
-
|
|
21
|
-
export default class Day<TMessage: IMessage = IMessage> extends PureComponent<
|
|
22
|
-
DayProps<TMessage>,
|
|
23
|
-
> {}
|
package/lib/Day.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Day.js","sourceRoot":"","sources":["../src/Day.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,GAKL,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,MAAM,SAA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H,CAAC"}
|
package/lib/GiftedAvatar.js.flow
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { Component } from 'react'
|
|
3
|
-
import type { User } from './types'
|
|
4
|
-
import type {
|
|
5
|
-
ImageStyleProp,
|
|
6
|
-
TextStyleProp,
|
|
7
|
-
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
8
|
-
|
|
9
|
-
export type GiftedAvatarProps = $ReadOnly<{|
|
|
10
|
-
user?: User,
|
|
11
|
-
avatarStyle?: ImageStyleProp,
|
|
12
|
-
textStyle?: TextStyleProp,
|
|
13
|
-
onPress: any => void,
|
|
14
|
-
onLongPress: any => void,
|
|
15
|
-
|}>
|
|
16
|
-
|
|
17
|
-
export default class GiftedAvatar extends Component<GiftedAvatarProps> {}
|
package/lib/GiftedChat.js.flow
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import Actions from './Actions'
|
|
4
|
-
import type { ActionsProps } from './Actions'
|
|
5
|
-
import Avatar from './Avatar'
|
|
6
|
-
import type { AvatarProps } from './Avatar'
|
|
7
|
-
import Bubble from './Bubble'
|
|
8
|
-
import type { BubbleProps } from './Bubble'
|
|
9
|
-
import SystemMessage from './SystemMessage'
|
|
10
|
-
import type { SystemMessageProps } from './SystemMessage'
|
|
11
|
-
import MessageImage from './MessageImage'
|
|
12
|
-
import type { MessageImageProps } from './MessageImage'
|
|
13
|
-
import MessageVideo from './MessageVideo'
|
|
14
|
-
import type { MessageVideoProps } from './MessageVideo'
|
|
15
|
-
import MessageAudio from './MessageAudio'
|
|
16
|
-
import type { MessageAudioProps } from './MessageAudio'
|
|
17
|
-
import MessageText from './MessageText'
|
|
18
|
-
import type { MessageTextProps } from './MessageText'
|
|
19
|
-
import Composer from './Composer'
|
|
20
|
-
import type { ComposerProps } from './Composer'
|
|
21
|
-
import Day from './Day'
|
|
22
|
-
import type { DayProps } from './Day'
|
|
23
|
-
import InputToolbar from './InputToolbar'
|
|
24
|
-
import type { InputToolbarProps } from './InputToolbar'
|
|
25
|
-
import LoadEarlier from './LoadEarlier'
|
|
26
|
-
import type { LoadEarlierProps } from './LoadEarlier'
|
|
27
|
-
import Message from './Message'
|
|
28
|
-
import type { MessageProps } from './Message'
|
|
29
|
-
import Send from './Send'
|
|
30
|
-
import type { SendProps } from './Send'
|
|
31
|
-
import Time from './Time'
|
|
32
|
-
import type { TimeProps } from './Time'
|
|
33
|
-
import QuickReplies from './QuickReplies'
|
|
34
|
-
import type { QuickRepliesProps } from './QuickReplies'
|
|
35
|
-
import MessageContainer from './MessageContainer.js.flow'
|
|
36
|
-
import GiftedAvatar from './GiftedAvatar.js.flow'
|
|
37
|
-
import type { IMessage, User, Reply, LeftRightStyle } from './types'
|
|
38
|
-
import type AnimatedValue from 'react-native/Libraries/Animated/src/nodes/AnimatedValue'
|
|
39
|
-
import type {
|
|
40
|
-
TextStyleProp,
|
|
41
|
-
ImageStyleProp,
|
|
42
|
-
ViewStyleProp,
|
|
43
|
-
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
44
|
-
import { FlatList } from 'react-native'
|
|
45
|
-
import * as utils from './utils'
|
|
46
|
-
|
|
47
|
-
export type GiftedChatProps<TMessage: IMessage = IMessage> = $ReadOnly<{|
|
|
48
|
-
messages?: Array<TMessage>,
|
|
49
|
-
text?: string,
|
|
50
|
-
alignTop?: boolean,
|
|
51
|
-
scrollToBottom?: boolean,
|
|
52
|
-
scrollToBottomStyle?: ViewStyleProp,
|
|
53
|
-
scrollToBottomComponent?: () => React.Node,
|
|
54
|
-
initialText?: string,
|
|
55
|
-
placeholder?: string,
|
|
56
|
-
user?: User,
|
|
57
|
-
locale?: string,
|
|
58
|
-
timeFormat?: string,
|
|
59
|
-
dateFormat?: string,
|
|
60
|
-
isKeyboardInternallyHandled?: boolean,
|
|
61
|
-
loadEarlier?: boolean,
|
|
62
|
-
isLoadingEarlier?: boolean,
|
|
63
|
-
showUserAvatar?: boolean,
|
|
64
|
-
showAvatarForEveryMessage?: boolean,
|
|
65
|
-
renderAvatarOnTop?: boolean,
|
|
66
|
-
inverted?: boolean,
|
|
67
|
-
imageProps?: MessageProps<TMessage>,
|
|
68
|
-
lightboxProps?: any,
|
|
69
|
-
minInputToolbarHeight?: number,
|
|
70
|
-
listViewProps?: $Shape<React.ElementProps<typeof FlatList>>,
|
|
71
|
-
textInputProps?: any,
|
|
72
|
-
textInputStyle?: any,
|
|
73
|
-
keyboardShouldPersistTaps?: any,
|
|
74
|
-
maxInputLength?: number,
|
|
75
|
-
forceGetKeyboardHeight?: boolean,
|
|
76
|
-
alwaysShowSend?: boolean,
|
|
77
|
-
imageStyle?: ImageStyleProp,
|
|
78
|
-
extraData?: any,
|
|
79
|
-
minComposerHeight?: number,
|
|
80
|
-
maxComposerHeight?: number,
|
|
81
|
-
options?: {
|
|
82
|
-
[key: string]: any,
|
|
83
|
-
},
|
|
84
|
-
optionTintColor?: string,
|
|
85
|
-
quickReplyStyle?: ViewStyleProp,
|
|
86
|
-
quickReplyTextStyle?: TextStyleProp,
|
|
87
|
-
quickReplyContainerStyle?: ViewStyleProp,
|
|
88
|
-
isCustomViewBottom?: boolean,
|
|
89
|
-
timeTextStyle?: LeftRightStyle<TextStyleProp>,
|
|
90
|
-
onPressAvatar?: User => void,
|
|
91
|
-
onLongPressAvatar?: User => void,
|
|
92
|
-
messageIdGenerator?: (message?: TMessage) => string,
|
|
93
|
-
onSend?: (messages: Array<TMessage>) => void,
|
|
94
|
-
onLoadEarlier?: () => void,
|
|
95
|
-
renderLoading?: () => React.Node,
|
|
96
|
-
renderLoadEarlier?: LoadEarlierProps => React.Node,
|
|
97
|
-
renderAvatar?: ((AvatarProps<TMessage>) => React.Node) | null,
|
|
98
|
-
renderBubble?: (BubbleProps<TMessage>) => React.Node,
|
|
99
|
-
renderSystemMessage?: (SystemMessageProps<TMessage>) => React.Node,
|
|
100
|
-
onPress?: (context: any, message: TMessage) => void,
|
|
101
|
-
onLongPress?: (context: any, message: TMessage) => void,
|
|
102
|
-
renderMessage?: (MessageProps<TMessage>) => React.Node,
|
|
103
|
-
renderMessageText?: (MessageTextProps<TMessage>) => React.Node,
|
|
104
|
-
renderMessageImage?: (MessageImageProps<TMessage>) => React.Node,
|
|
105
|
-
renderMessageVideo?: (MessageVideoProps<TMessage>) => React.Node,
|
|
106
|
-
renderMessageAudio?: (MessageAudioProps<TMessage>) => React.Node,
|
|
107
|
-
renderCustomView?: (BubbleProps<TMessage>) => React.Node,
|
|
108
|
-
renderDay?: (DayProps<TMessage>) => React.Node,
|
|
109
|
-
renderTime?: (TimeProps<TMessage>) => React.Node,
|
|
110
|
-
renderFooter?: () => React.Node,
|
|
111
|
-
renderChatFooter?: () => React.Node,
|
|
112
|
-
renderInputToolbar?: InputToolbarProps => React.Node,
|
|
113
|
-
renderComposer?: ComposerProps => React.Node,
|
|
114
|
-
renderActions?: ActionsProps => React.Node,
|
|
115
|
-
renderSend?: SendProps => React.Node,
|
|
116
|
-
renderAccessory?: InputToolbarProps => React.Node,
|
|
117
|
-
onPressActionButton?: () => void,
|
|
118
|
-
onInputTextChanged?: (text: string) => void,
|
|
119
|
-
parsePatterns?: () => React.Node,
|
|
120
|
-
onQuickReply?: (Array<Reply>) => void,
|
|
121
|
-
renderQuickReplies?: (QuickRepliesProps<TMessage>) => React.Node,
|
|
122
|
-
renderQuickReplySend?: () => React.Node,
|
|
123
|
-
shouldUpdateMessage?: (
|
|
124
|
-
props: MessageProps<TMessage>,
|
|
125
|
-
nextProps: MessageProps<TMessage>,
|
|
126
|
-
) => boolean,
|
|
127
|
-
|}>
|
|
128
|
-
|
|
129
|
-
export type GiftedChatState<TMessage: IMessage = IMessage> = {|
|
|
130
|
-
isInitialized: boolean,
|
|
131
|
-
composerHeight?: number,
|
|
132
|
-
isTypingDisabled: boolean,
|
|
133
|
-
text?: string,
|
|
134
|
-
messages?: Array<TMessage>,
|
|
135
|
-
|}
|
|
136
|
-
|
|
137
|
-
class GiftedChat<TMessage: IMessage = IMessage> extends React.Component<
|
|
138
|
-
GiftedChatProps<TMessage>,
|
|
139
|
-
GiftedChatState<TMessage>,
|
|
140
|
-
> {}
|
|
141
|
-
|
|
142
|
-
export * from './types'
|
|
143
|
-
export {
|
|
144
|
-
GiftedChat,
|
|
145
|
-
Actions,
|
|
146
|
-
Avatar,
|
|
147
|
-
Bubble,
|
|
148
|
-
SystemMessage,
|
|
149
|
-
MessageImage,
|
|
150
|
-
MessageVideo,
|
|
151
|
-
MessageAudio,
|
|
152
|
-
MessageText,
|
|
153
|
-
Composer,
|
|
154
|
-
Day,
|
|
155
|
-
InputToolbar,
|
|
156
|
-
LoadEarlier,
|
|
157
|
-
Message,
|
|
158
|
-
MessageContainer,
|
|
159
|
-
Send,
|
|
160
|
-
Time,
|
|
161
|
-
GiftedAvatar,
|
|
162
|
-
utils,
|
|
163
|
-
}
|
package/lib/GiftedChat.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GiftedChat.js","sourceRoot":"","sources":["../src/GiftedChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAAW,GAEZ,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,mBAAmB,GAEpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,eAAe,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAEL,QAAQ,EAER,UAAU,EAGV,IAAI,GAGL,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAC9C,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,QAA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A8B,EAAE,EAChC,QAAoB,EACpB,QAAQ,GAAG,IAAI,EACf,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC1B,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEvB,OAAO,QAAQ;QACb,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACtC,CAAC,CAAA;AAED,UAAU,CAAC,OAAO,GAAG,CACnB,kBAA8B,EAAE,EAChC,QAAoB,EACpB,QAAQ,GAAG,IAAI,EACf,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC1B,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAA;IAEvB,OAAO,QAAQ;QACb,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC;QAClC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC;KACR;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAA;AAEF,cAAc,UAAU,CAAA;AACxB,OAAO,EACL,UAAU,EACV,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAAa,EACb,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,GAAG,EACH,YAAY,EACZ,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,KAAK,EACN,CAAA"}
|
package/lib/InputToolbar.js.flow
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import type { ComposerProps } from './Composer'
|
|
4
|
-
import type { SendProps } from './Send'
|
|
5
|
-
import type { ActionsProps } from './Actions'
|
|
6
|
-
import type {
|
|
7
|
-
TextStyleProp,
|
|
8
|
-
ViewStyleProp,
|
|
9
|
-
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
10
|
-
|
|
11
|
-
export type InputToolbarProps = $ReadOnly<{|
|
|
12
|
-
options?: {
|
|
13
|
-
[key: string]: any,
|
|
14
|
-
},
|
|
15
|
-
optionTintColor?: string,
|
|
16
|
-
containerStyle?: ViewStyleProp,
|
|
17
|
-
primaryStyle?: ViewStyleProp,
|
|
18
|
-
accessoryStyle?: ViewStyleProp,
|
|
19
|
-
renderAccessory?: InputToolbarProps => React.Node,
|
|
20
|
-
renderActions?: ActionsProps => React.Node,
|
|
21
|
-
renderSend?: SendProps => React.Node,
|
|
22
|
-
renderComposer?: ComposerProps => React.Node,
|
|
23
|
-
onPressActionButton: () => void,
|
|
24
|
-
|}>
|
|
25
|
-
|
|
26
|
-
export default class InputToolbar extends React.Component<
|
|
27
|
-
InputToolbarProps,
|
|
28
|
-
{|
|
|
29
|
-
position: string,
|
|
30
|
-
|},
|
|
31
|
-
> {}
|
package/lib/LoadEarlier.js.flow
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { Component } from 'react'
|
|
3
|
-
import type {
|
|
4
|
-
TextStyleProp,
|
|
5
|
-
ViewStyleProp,
|
|
6
|
-
} from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
7
|
-
|
|
8
|
-
export type LoadEarlierProps = $ReadOnly<{|
|
|
9
|
-
isLoadingEarlier?: boolean,
|
|
10
|
-
label?: string,
|
|
11
|
-
containerStyle?: ViewStyleProp,
|
|
12
|
-
wrapperStyle?: ViewStyleProp,
|
|
13
|
-
textStyle?: TextStyleProp,
|
|
14
|
-
activityIndicatorStyle?: ViewStyleProp,
|
|
15
|
-
activityIndicatorColor?: string,
|
|
16
|
-
activityIndicatorSize?: number | 'small' | 'large',
|
|
17
|
-
onLoadEarlier?: () => void,
|
|
18
|
-
|}>
|
|
19
|
-
|
|
20
|
-
export default class LoadEarlier extends Component<LoadEarlierProps> {}
|
package/lib/Message.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ViewStyle, LayoutChangeEvent } from 'react-native';
|
|
4
|
-
import { AvatarProps } from './Avatar';
|
|
5
|
-
import Bubble from './Bubble';
|
|
6
|
-
import { SystemMessageProps } from './SystemMessage';
|
|
7
|
-
import { DayProps } from './Day';
|
|
8
|
-
import { IMessage, User, LeftRightStyle } from './Models';
|
|
9
|
-
export interface MessageProps<TMessage extends IMessage> {
|
|
10
|
-
showUserAvatar?: boolean;
|
|
11
|
-
position: 'left' | 'right';
|
|
12
|
-
currentMessage: TMessage;
|
|
13
|
-
nextMessage?: TMessage;
|
|
14
|
-
previousMessage?: TMessage;
|
|
15
|
-
user: User;
|
|
16
|
-
inverted?: boolean;
|
|
17
|
-
containerStyle?: LeftRightStyle<ViewStyle>;
|
|
18
|
-
renderBubble?(props: Bubble['props']): React.ReactNode;
|
|
19
|
-
renderDay?(props: DayProps<TMessage>): React.ReactNode;
|
|
20
|
-
renderSystemMessage?(props: SystemMessageProps<TMessage>): React.ReactNode;
|
|
21
|
-
renderAvatar?(props: AvatarProps<TMessage>): React.ReactNode;
|
|
22
|
-
shouldUpdateMessage?(props: MessageProps<IMessage>, nextProps: MessageProps<IMessage>): boolean;
|
|
23
|
-
onMessageLayout?(event: LayoutChangeEvent): void;
|
|
24
|
-
}
|
|
25
|
-
export default class Message<TMessage extends IMessage = IMessage> extends React.Component<MessageProps<TMessage>> {
|
|
26
|
-
static defaultProps: {
|
|
27
|
-
renderAvatar: undefined;
|
|
28
|
-
renderBubble: null;
|
|
29
|
-
renderDay: null;
|
|
30
|
-
renderSystemMessage: null;
|
|
31
|
-
position: string;
|
|
32
|
-
currentMessage: {};
|
|
33
|
-
nextMessage: {};
|
|
34
|
-
previousMessage: {};
|
|
35
|
-
user: {};
|
|
36
|
-
containerStyle: {};
|
|
37
|
-
showUserAvatar: boolean;
|
|
38
|
-
inverted: boolean;
|
|
39
|
-
shouldUpdateMessage: undefined;
|
|
40
|
-
onMessageLayout: undefined;
|
|
41
|
-
};
|
|
42
|
-
static propTypes: {
|
|
43
|
-
renderAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
-
showUserAvatar: PropTypes.Requireable<boolean>;
|
|
45
|
-
renderBubble: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
-
renderDay: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
renderSystemMessage: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
position: PropTypes.Requireable<string>;
|
|
49
|
-
currentMessage: PropTypes.Requireable<object>;
|
|
50
|
-
nextMessage: PropTypes.Requireable<object>;
|
|
51
|
-
previousMessage: PropTypes.Requireable<object>;
|
|
52
|
-
user: PropTypes.Requireable<object>;
|
|
53
|
-
inverted: PropTypes.Requireable<boolean>;
|
|
54
|
-
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
55
|
-
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
56
|
-
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
57
|
-
}>>;
|
|
58
|
-
shouldUpdateMessage: PropTypes.Requireable<(...args: any[]) => any>;
|
|
59
|
-
onMessageLayout: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
|
-
};
|
|
61
|
-
shouldComponentUpdate(nextProps: MessageProps<TMessage>): boolean;
|
|
62
|
-
renderDay(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
63
|
-
renderBubble(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
64
|
-
renderSystemMessage(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
65
|
-
renderAvatar(): React.JSX.Element | null;
|
|
66
|
-
render(): React.JSX.Element | null;
|
|
67
|
-
}
|
package/lib/Message.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View, StyleSheet } from 'react-native';
|
|
4
|
-
import isEqual from 'lodash.isequal';
|
|
5
|
-
import { Avatar } from './Avatar';
|
|
6
|
-
import Bubble from './Bubble';
|
|
7
|
-
import { SystemMessage } from './SystemMessage';
|
|
8
|
-
import { Day } from './Day';
|
|
9
|
-
import { StylePropType, isSameUser } from './utils';
|
|
10
|
-
const styles = {
|
|
11
|
-
left: StyleSheet.create({
|
|
12
|
-
container: {
|
|
13
|
-
flexDirection: 'row',
|
|
14
|
-
alignItems: 'flex-end',
|
|
15
|
-
justifyContent: 'flex-start',
|
|
16
|
-
marginLeft: 8,
|
|
17
|
-
marginRight: 0,
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
right: StyleSheet.create({
|
|
21
|
-
container: {
|
|
22
|
-
flexDirection: 'row',
|
|
23
|
-
alignItems: 'flex-end',
|
|
24
|
-
justifyContent: 'flex-end',
|
|
25
|
-
marginLeft: 0,
|
|
26
|
-
marginRight: 8,
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
class Message extends React.Component {
|
|
31
|
-
shouldComponentUpdate(nextProps) {
|
|
32
|
-
const next = nextProps.currentMessage;
|
|
33
|
-
const current = this.props.currentMessage;
|
|
34
|
-
const { previousMessage, nextMessage } = this.props;
|
|
35
|
-
const nextPropsMessage = nextProps.nextMessage;
|
|
36
|
-
const nextPropsPreviousMessage = nextProps.previousMessage;
|
|
37
|
-
let shouldUpdate = this.props.shouldUpdateMessage?.(this.props, nextProps) || false;
|
|
38
|
-
shouldUpdate =
|
|
39
|
-
shouldUpdate ||
|
|
40
|
-
!isEqual(current, next) ||
|
|
41
|
-
!isEqual(previousMessage, nextPropsPreviousMessage) ||
|
|
42
|
-
!isEqual(nextMessage, nextPropsMessage);
|
|
43
|
-
return shouldUpdate;
|
|
44
|
-
}
|
|
45
|
-
renderDay() {
|
|
46
|
-
if (this.props.currentMessage && this.props.currentMessage.createdAt) {
|
|
47
|
-
const {
|
|
48
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
49
|
-
containerStyle, onMessageLayout,
|
|
50
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
51
|
-
...props } = this.props;
|
|
52
|
-
if (this.props.renderDay)
|
|
53
|
-
return this.props.renderDay(props);
|
|
54
|
-
return <Day {...props}/>;
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
renderBubble() {
|
|
59
|
-
const {
|
|
60
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
61
|
-
containerStyle, onMessageLayout,
|
|
62
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
63
|
-
...props } = this.props;
|
|
64
|
-
if (this.props.renderBubble)
|
|
65
|
-
return this.props.renderBubble(props);
|
|
66
|
-
return <Bubble {...props}/>;
|
|
67
|
-
}
|
|
68
|
-
renderSystemMessage() {
|
|
69
|
-
const {
|
|
70
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
71
|
-
containerStyle, onMessageLayout,
|
|
72
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
73
|
-
...props } = this.props;
|
|
74
|
-
if (this.props.renderSystemMessage)
|
|
75
|
-
return this.props.renderSystemMessage(props);
|
|
76
|
-
return <SystemMessage {...props}/>;
|
|
77
|
-
}
|
|
78
|
-
renderAvatar() {
|
|
79
|
-
const { user, currentMessage, showUserAvatar } = this.props;
|
|
80
|
-
if (user &&
|
|
81
|
-
user._id &&
|
|
82
|
-
currentMessage &&
|
|
83
|
-
currentMessage.user &&
|
|
84
|
-
user._id === currentMessage.user._id &&
|
|
85
|
-
!showUserAvatar)
|
|
86
|
-
return null;
|
|
87
|
-
if (currentMessage &&
|
|
88
|
-
currentMessage.user &&
|
|
89
|
-
currentMessage.user.avatar === null)
|
|
90
|
-
return null;
|
|
91
|
-
const {
|
|
92
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
93
|
-
containerStyle, onMessageLayout,
|
|
94
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
95
|
-
...props } = this.props;
|
|
96
|
-
return <Avatar {...props}/>;
|
|
97
|
-
}
|
|
98
|
-
render() {
|
|
99
|
-
const { currentMessage, onMessageLayout, nextMessage, position, containerStyle, } = this.props;
|
|
100
|
-
if (currentMessage) {
|
|
101
|
-
const sameUser = isSameUser(currentMessage, nextMessage);
|
|
102
|
-
return (<View onLayout={onMessageLayout}>
|
|
103
|
-
{this.renderDay()}
|
|
104
|
-
{currentMessage.system
|
|
105
|
-
? (this.renderSystemMessage())
|
|
106
|
-
: (<View style={[
|
|
107
|
-
styles[position].container,
|
|
108
|
-
{ marginBottom: sameUser ? 2 : 10 },
|
|
109
|
-
!this.props.inverted && { marginBottom: 2 },
|
|
110
|
-
containerStyle && containerStyle[position],
|
|
111
|
-
]}>
|
|
112
|
-
{this.props.position === 'left' ? this.renderAvatar() : null}
|
|
113
|
-
{this.renderBubble()}
|
|
114
|
-
{this.props.position === 'right' ? this.renderAvatar() : null}
|
|
115
|
-
</View>)}
|
|
116
|
-
</View>);
|
|
117
|
-
}
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
Message.defaultProps = {
|
|
122
|
-
renderAvatar: undefined,
|
|
123
|
-
renderBubble: null,
|
|
124
|
-
renderDay: null,
|
|
125
|
-
renderSystemMessage: null,
|
|
126
|
-
position: 'left',
|
|
127
|
-
currentMessage: {},
|
|
128
|
-
nextMessage: {},
|
|
129
|
-
previousMessage: {},
|
|
130
|
-
user: {},
|
|
131
|
-
containerStyle: {},
|
|
132
|
-
showUserAvatar: false,
|
|
133
|
-
inverted: true,
|
|
134
|
-
shouldUpdateMessage: undefined,
|
|
135
|
-
onMessageLayout: undefined,
|
|
136
|
-
};
|
|
137
|
-
Message.propTypes = {
|
|
138
|
-
renderAvatar: PropTypes.func,
|
|
139
|
-
showUserAvatar: PropTypes.bool,
|
|
140
|
-
renderBubble: PropTypes.func,
|
|
141
|
-
renderDay: PropTypes.func,
|
|
142
|
-
renderSystemMessage: PropTypes.func,
|
|
143
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
144
|
-
currentMessage: PropTypes.object,
|
|
145
|
-
nextMessage: PropTypes.object,
|
|
146
|
-
previousMessage: PropTypes.object,
|
|
147
|
-
user: PropTypes.object,
|
|
148
|
-
inverted: PropTypes.bool,
|
|
149
|
-
containerStyle: PropTypes.shape({
|
|
150
|
-
left: StylePropType,
|
|
151
|
-
right: StylePropType,
|
|
152
|
-
}),
|
|
153
|
-
shouldUpdateMessage: PropTypes.func,
|
|
154
|
-
onMessageLayout: PropTypes.func,
|
|
155
|
-
};
|
|
156
|
-
export default Message;
|
|
157
|
-
//# sourceMappingURL=Message.js.map
|
package/lib/Message.js.flow
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import type { AvatarProps } from './Avatar'
|
|
4
|
-
import type { BubbleProps } from './Bubble'
|
|
5
|
-
import type { SystemMessageProps } from './SystemMessage'
|
|
6
|
-
import type { DayProps } from './Day'
|
|
7
|
-
import type { IMessage, User, LeftRightStyle } from './types'
|
|
8
|
-
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
9
|
-
|
|
10
|
-
export type MessageProps<TMessage: IMessage = IMessage> = $ReadOnly<{|
|
|
11
|
-
key: React$Key,
|
|
12
|
-
showUserAvatar?: boolean,
|
|
13
|
-
position: 'left' | 'right',
|
|
14
|
-
currentMessage: TMessage,
|
|
15
|
-
nextMessage?: TMessage,
|
|
16
|
-
previousMessage?: TMessage,
|
|
17
|
-
user: User,
|
|
18
|
-
inverted?: boolean,
|
|
19
|
-
containerStyle?: LeftRightStyle<ViewStyleProp>,
|
|
20
|
-
renderBubble?: (BubbleProps<TMessage>) => React.Node,
|
|
21
|
-
renderDay?: (DayProps<TMessage>) => React.Node,
|
|
22
|
-
renderSystemMessage?: (SystemMessageProps<TMessage>) => React.Node,
|
|
23
|
-
renderAvatar?: ((AvatarProps<TMessage>) => React.Node) | null,
|
|
24
|
-
shouldUpdateMessage?: (
|
|
25
|
-
props: MessageProps<IMessage>,
|
|
26
|
-
nextProps: MessageProps<IMessage>,
|
|
27
|
-
) => boolean,
|
|
28
|
-
|}>
|
|
29
|
-
|
|
30
|
-
export default class Message<
|
|
31
|
-
TMessage: IMessage = IMessage,
|
|
32
|
-
> extends React.Component<MessageProps<TMessage>> {}
|
package/lib/Message.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../src/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAgC,MAAM,cAAc,CAAA;AAC7E,OAAO,OAAO,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAC9C,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGnD,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,UAAU;YACtB,cAAc,EAAE,YAAY;YAC5B,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC;SACf;KACF,CAAC;IACF,KAAK,EAAE,UAAU,C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1KM,oBAAY,GAAG;IACpB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;IACf,mBAAmB,EAAE,IAAI;IACzB,QAAQ,EAAE,MAAM;IAChB,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,EAAE;IACf,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,EAAE;IACR,cAAc,EAAE,EAAE;IAClB,cAAc,EAAE,KAAK;IACrB,QAAQ,EAAE,IAAI;IACd,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,SAAS;CAC3B,CAAA;AAEM,iBAAS,GAAG;IACjB,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,cAAc,EAAE,SAAS,CAAC,MAAM;IAChC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,cAAc,EAAE,SAAS,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;KACrB,CAAC;IACF,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,eAAe,EAAE,SAAS,CAAC,IAAI;CAChC,CAAA;eAtCkB,OAAO"}
|
package/lib/MessageAudio.js.flow
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { Component } from 'react'
|
|
3
|
-
import type { IMessage } from './types'
|
|
4
|
-
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet'
|
|
5
|
-
|
|
6
|
-
export type MessageAudioProps<TMessage: IMessage = IMessage> = $ReadOnly<{|
|
|
7
|
-
currentMessage: TMessage,
|
|
8
|
-
containerStyle?: ViewStyleProp,
|
|
9
|
-
audioStyle?: ViewStyleProp,
|
|
10
|
-
audioProps?: Object,
|
|
11
|
-
|}>
|
|
12
|
-
|
|
13
|
-
export default class MessageAudio<
|
|
14
|
-
TMessage: IMessage = IMessage,
|
|
15
|
-
> extends Component<MessageAudioProps<TMessage>> {}
|