react-native-gifted-chat 2.8.2-alpha.4 → 2.9.0-alpha.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.
Files changed (62) hide show
  1. package/CHANGELOG_2.8.1_to_2.8.2-alpha.5.md +374 -0
  2. package/README.md +26 -26
  3. package/package.json +2 -1
  4. package/src/Actions.tsx +1 -1
  5. package/src/Bubble/index.tsx +12 -14
  6. package/src/Bubble/styles.ts +1 -1
  7. package/src/Bubble/types.ts +4 -5
  8. package/src/Color.ts +1 -1
  9. package/src/Composer.tsx +1 -1
  10. package/src/Day/styles.ts +1 -1
  11. package/src/GiftedAvatar.tsx +1 -1
  12. package/src/GiftedChat/index.tsx +12 -49
  13. package/src/GiftedChat/types.ts +2 -2
  14. package/src/InputToolbar.tsx +22 -13
  15. package/src/LoadEarlierMessages.tsx +48 -51
  16. package/src/Message/index.tsx +6 -8
  17. package/src/MessageAudio.tsx +1 -1
  18. package/src/MessageContainer/components/DayAnimated/index.tsx +2 -3
  19. package/src/MessageContainer/components/Item/index.tsx +8 -10
  20. package/src/MessageContainer/index.tsx +9 -11
  21. package/src/MessageContainer/styles.ts +1 -1
  22. package/src/MessageText.tsx +2 -1
  23. package/src/MessageVideo.tsx +1 -1
  24. package/src/QuickReplies.tsx +1 -1
  25. package/src/Send.tsx +1 -1
  26. package/src/SystemMessage.tsx +30 -24
  27. package/src/Time.tsx +5 -5
  28. package/src/TypingIndicator/index.tsx +1 -3
  29. package/src/TypingIndicator/styles.ts +1 -1
  30. package/src/__tests__/Actions.test.tsx +1 -1
  31. package/src/__tests__/Avatar.test.tsx +7 -2
  32. package/src/__tests__/Bubble.test.tsx +3 -7
  33. package/src/__tests__/Color.test.tsx +1 -1
  34. package/src/__tests__/Composer.test.tsx +1 -1
  35. package/src/__tests__/Day.test.tsx +3 -3
  36. package/src/__tests__/DayAnimated.test.tsx +5 -11
  37. package/src/__tests__/GiftedAvatar.test.tsx +1 -1
  38. package/src/__tests__/GiftedChat.test.tsx +1 -1
  39. package/src/__tests__/InputToolbar.test.tsx +1 -1
  40. package/src/__tests__/LoadEarlier.test.tsx +2 -2
  41. package/src/__tests__/Message.test.tsx +5 -11
  42. package/src/__tests__/MessageContainer.test.tsx +4 -4
  43. package/src/__tests__/MessageImage.test.tsx +2 -2
  44. package/src/__tests__/MessageText.test.tsx +3 -2
  45. package/src/__tests__/Send.test.tsx +1 -1
  46. package/src/__tests__/SystemMessage.test.tsx +1 -1
  47. package/src/__tests__/Time.test.tsx +1 -1
  48. package/src/__tests__/__snapshots__/Actions.test.tsx.snap +61 -57
  49. package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +1 -2
  50. package/src/__tests__/__snapshots__/Day.test.tsx.snap +96 -2
  51. package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +56 -36
  52. package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +1 -1
  53. package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +64 -52
  54. package/src/__tests__/__snapshots__/Message.test.tsx.snap +41 -5
  55. package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +1 -2
  56. package/src/__tests__/__snapshots__/Send.test.tsx.snap +120 -108
  57. package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +38 -8
  58. package/src/__tests__/data.ts +1 -1
  59. package/src/components/TouchableOpacity.tsx +26 -15
  60. package/src/index.ts +19 -1
  61. package/src/utils.ts +22 -1
  62. package/src/LoadEarlier.tsx +0 -95
@@ -1,51 +1,71 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`should render <GiftedChat/> and compare with snapshot 1`] = `
4
- <View
5
- style={
6
- {
7
- "flex": 1,
8
- }
9
- }
10
- >
4
+ <KeyboardProvider>
11
5
  <View
12
- onLayout={[Function]}
13
6
  style={
14
- [
7
+ {
8
+ "flex": 1,
9
+ }
10
+ }
11
+ >
12
+ <View
13
+ style={
15
14
  {
16
15
  "flex": 1,
17
- },
18
- {
19
- "overflow": "hidden",
20
- },
21
- ]
22
- }
23
- testID="GC_WRAPPER"
24
- />
25
- </View>
16
+ }
17
+ }
18
+ >
19
+ <View
20
+ onLayout={[Function]}
21
+ style={
22
+ [
23
+ {
24
+ "flex": 1,
25
+ },
26
+ {
27
+ "overflow": "hidden",
28
+ },
29
+ ]
30
+ }
31
+ testID="GC_WRAPPER"
32
+ />
33
+ </View>
34
+ </View>
35
+ </KeyboardProvider>
26
36
  `;
27
37
 
28
38
  exports[`should render <GiftedChat/> with isKeyboardInternallyHandled=false 1`] = `
29
- <View
30
- style={
31
- {
32
- "flex": 1,
33
- }
34
- }
35
- >
39
+ <KeyboardProvider>
36
40
  <View
37
- onLayout={[Function]}
38
41
  style={
39
- [
42
+ {
43
+ "flex": 1,
44
+ }
45
+ }
46
+ >
47
+ <View
48
+ style={
40
49
  {
41
50
  "flex": 1,
42
- },
43
- {
44
- "overflow": "hidden",
45
- },
46
- ]
47
- }
48
- testID="GC_WRAPPER"
49
- />
50
- </View>
51
+ }
52
+ }
53
+ >
54
+ <View
55
+ onLayout={[Function]}
56
+ style={
57
+ [
58
+ {
59
+ "flex": 1,
60
+ },
61
+ {
62
+ "overflow": "hidden",
63
+ },
64
+ ]
65
+ }
66
+ testID="GC_WRAPPER"
67
+ />
68
+ </View>
69
+ </View>
70
+ </KeyboardProvider>
51
71
  `;
@@ -9,7 +9,7 @@ exports[`should render <InputToolbar /> and compare with snapshot 1`] = `
9
9
  "borderTopColor": "#b2b2b2",
10
10
  "borderTopWidth": 0.5,
11
11
  },
12
- undefined,
12
+ false,
13
13
  undefined,
14
14
  ]
15
15
  }
@@ -2,12 +2,11 @@
2
2
 
3
3
  exports[`should render <LoadEarlierMessages /> and compare with snapshot 1`] = `
4
4
  <View
5
- accessibilityRole="button"
6
5
  accessibilityState={
7
6
  {
8
7
  "busy": undefined,
9
8
  "checked": undefined,
10
- "disabled": false,
9
+ "disabled": undefined,
11
10
  "expanded": undefined,
12
11
  "selected": undefined,
13
12
  }
@@ -23,30 +22,6 @@ exports[`should render <LoadEarlierMessages /> and compare with snapshot 1`] = `
23
22
  accessible={true}
24
23
  collapsable={false}
25
24
  focusable={true}
26
- jestAnimatedProps={
27
- {
28
- "value": {},
29
- }
30
- }
31
- jestAnimatedStyle={
32
- {
33
- "value": {
34
- "opacity": 1,
35
- },
36
- }
37
- }
38
- jestInlineStyle={
39
- [
40
- [
41
- {
42
- "alignItems": "center",
43
- "marginBottom": 10,
44
- "marginTop": 5,
45
- },
46
- undefined,
47
- ],
48
- ]
49
- }
50
25
  onBlur={[Function]}
51
26
  onClick={[Function]}
52
27
  onFocus={[Function]}
@@ -56,52 +31,89 @@ exports[`should render <LoadEarlierMessages /> and compare with snapshot 1`] = `
56
31
  onResponderTerminate={[Function]}
57
32
  onResponderTerminationRequest={[Function]}
58
33
  onStartShouldSetResponder={[Function]}
59
- style={
60
- [
61
- {
62
- "alignItems": "center",
63
- "marginBottom": 10,
64
- "marginTop": 5,
65
- },
66
- undefined,
67
- {
68
- "opacity": 1,
69
- },
70
- ]
71
- }
72
34
  >
73
35
  <View
36
+ accessibilityRole="button"
37
+ collapsable={false}
38
+ disabled={false}
39
+ jestAnimatedProps={
40
+ {
41
+ "value": {},
42
+ }
43
+ }
44
+ jestAnimatedStyle={
45
+ {
46
+ "value": {
47
+ "opacity": 1,
48
+ },
49
+ }
50
+ }
51
+ jestInlineStyle={
52
+ [
53
+ [
54
+ {
55
+ "alignItems": "center",
56
+ "marginVertical": 10,
57
+ },
58
+ undefined,
59
+ ],
60
+ ]
61
+ }
74
62
  style={
75
63
  [
76
64
  {
77
65
  "alignItems": "center",
78
- "justifyContent": "center",
66
+ "marginVertical": 10,
79
67
  },
68
+ undefined,
80
69
  {
81
- "backgroundColor": "#b2b2b2",
82
- "borderRadius": 15,
83
- "height": 30,
84
- "paddingLeft": 10,
85
- "paddingRight": 10,
70
+ "opacity": 1,
86
71
  },
87
- undefined,
88
72
  ]
89
73
  }
90
74
  >
91
- <Text
75
+ <View
92
76
  style={
93
77
  [
94
78
  {
95
- "backgroundColor": "transparent",
96
- "color": "#fff",
97
- "fontSize": 12,
79
+ "alignItems": "center",
80
+ "justifyContent": "center",
81
+ },
82
+ {
83
+ "backgroundColor": "#b2b2b2",
84
+ "borderRadius": 15,
85
+ "paddingHorizontal": 10,
86
+ "paddingVertical": 5,
98
87
  },
99
88
  undefined,
100
89
  ]
101
90
  }
102
91
  >
103
- Load earlier messages
104
- </Text>
92
+ <View
93
+ style={
94
+ {
95
+ "paddingBottom": 4,
96
+ "paddingTop": 3,
97
+ }
98
+ }
99
+ >
100
+ <Text
101
+ style={
102
+ [
103
+ {
104
+ "backgroundColor": "transparent",
105
+ "color": "#fff",
106
+ "fontSize": 12,
107
+ "lineHeight": 13,
108
+ },
109
+ undefined,
110
+ ]
111
+ }
112
+ >
113
+ Load earlier messages
114
+ </Text>
115
+ </View>
116
+ </View>
105
117
  </View>
106
118
  </View>
107
119
  `;
@@ -100,7 +100,6 @@ exports[`Message component should render <Message /> and compare with snapshot 1
100
100
  }
101
101
  >
102
102
  <Text
103
- link={true}
104
103
  style={
105
104
  [
106
105
  {
@@ -306,7 +305,6 @@ exports[`Message component should render <Message /> with Avatar 1`] = `
306
305
  }
307
306
  >
308
307
  <Text
309
- link={true}
310
308
  showUserAvatar={true}
311
309
  style={
312
310
  [
@@ -364,7 +362,7 @@ exports[`Message component should render <Message /> with Avatar 1`] = `
364
362
  ]
365
363
  }
366
364
  >
367
- 7:20 PM
365
+ 12:00 AM
368
366
  </Text>
369
367
  </View>
370
368
  </View>
@@ -398,6 +396,45 @@ exports[`Message component should render null if user has no Avatar 1`] = `
398
396
  ]
399
397
  }
400
398
  >
399
+ <View
400
+ style={
401
+ [
402
+ {
403
+ "marginRight": 8,
404
+ },
405
+ undefined,
406
+ undefined,
407
+ ]
408
+ }
409
+ >
410
+ <View
411
+ accessibilityRole="image"
412
+ style={
413
+ [
414
+ {
415
+ "alignItems": "center",
416
+ "justifyContent": "center",
417
+ },
418
+ {
419
+ "borderRadius": 20,
420
+ "height": 40,
421
+ "width": 40,
422
+ },
423
+ {
424
+ "backgroundColor": "transparent",
425
+ },
426
+ [
427
+ {
428
+ "borderRadius": 18,
429
+ "height": 36,
430
+ "width": 36,
431
+ },
432
+ undefined,
433
+ ],
434
+ ]
435
+ }
436
+ />
437
+ </View>
401
438
  <View
402
439
  style={
403
440
  [
@@ -474,7 +511,6 @@ exports[`Message component should render null if user has no Avatar 1`] = `
474
511
  }
475
512
  >
476
513
  <Text
477
- link={true}
478
514
  showUserAvatar={true}
479
515
  style={
480
516
  [
@@ -532,7 +568,7 @@ exports[`Message component should render null if user has no Avatar 1`] = `
532
568
  ]
533
569
  }
534
570
  >
535
- 7:20 PM
571
+ 12:00 AM
536
572
  </Text>
537
573
  </View>
538
574
  </View>
@@ -15,7 +15,6 @@ exports[`should render <MessageText /> and compare with snapshot 1`] = `
15
15
  }
16
16
  >
17
17
  <Text
18
- link={true}
19
18
  style={
20
19
  [
21
20
  {
@@ -27,7 +26,7 @@ exports[`should render <MessageText /> and compare with snapshot 1`] = `
27
26
  }
28
27
  >
29
28
  <Text>
30
- test message
29
+ test
31
30
  </Text>
32
31
  </Text>
33
32
  </View>
@@ -2,13 +2,11 @@
2
2
 
3
3
  exports[`Send should always render <Send /> and compare with snapshot 1`] = `
4
4
  <View
5
- accessibilityLabel="send"
6
- accessibilityRole="button"
7
5
  accessibilityState={
8
6
  {
9
7
  "busy": undefined,
10
8
  "checked": undefined,
11
- "disabled": false,
9
+ "disabled": undefined,
12
10
  "expanded": undefined,
13
11
  "selected": undefined,
14
12
  }
@@ -24,29 +22,6 @@ exports[`Send should always render <Send /> and compare with snapshot 1`] = `
24
22
  accessible={true}
25
23
  collapsable={false}
26
24
  focusable={true}
27
- jestAnimatedProps={
28
- {
29
- "value": {},
30
- }
31
- }
32
- jestAnimatedStyle={
33
- {
34
- "value": {
35
- "opacity": 1,
36
- },
37
- }
38
- }
39
- jestInlineStyle={
40
- [
41
- [
42
- {
43
- "height": 44,
44
- "justifyContent": "flex-end",
45
- },
46
- undefined,
47
- ],
48
- ]
49
- }
50
25
  onBlur={[Function]}
51
26
  onClick={[Function]}
52
27
  onFocus={[Function]}
@@ -56,40 +31,71 @@ exports[`Send should always render <Send /> and compare with snapshot 1`] = `
56
31
  onResponderTerminate={[Function]}
57
32
  onResponderTerminationRequest={[Function]}
58
33
  onStartShouldSetResponder={[Function]}
59
- style={
60
- [
34
+ >
35
+ <View
36
+ accessibilityLabel="send"
37
+ accessibilityRole="button"
38
+ accessible={true}
39
+ collapsable={false}
40
+ disabled={false}
41
+ jestAnimatedProps={
61
42
  {
62
- "height": 44,
63
- "justifyContent": "flex-end",
64
- },
65
- undefined,
43
+ "value": {},
44
+ }
45
+ }
46
+ jestAnimatedStyle={
66
47
  {
67
- "opacity": 1,
68
- },
69
- ]
70
- }
71
- testID="GC_SEND_TOUCHABLE"
72
- >
73
- <View>
74
- <Text
75
- style={
48
+ "value": {
49
+ "opacity": 1,
50
+ },
51
+ }
52
+ }
53
+ jestInlineStyle={
54
+ [
76
55
  [
77
56
  {
78
- "backgroundColor": "transparent",
79
- "color": "#0084ff",
80
- "fontSize": 17,
81
- "fontWeight": "600",
82
- "marginBottom": 12,
83
- "marginLeft": 10,
84
- "marginRight": 10,
57
+ "height": 44,
58
+ "justifyContent": "flex-end",
85
59
  },
86
60
  undefined,
87
- undefined,
88
- ]
89
- }
90
- >
91
- Send
92
- </Text>
61
+ ],
62
+ ]
63
+ }
64
+ style={
65
+ [
66
+ {
67
+ "height": 44,
68
+ "justifyContent": "flex-end",
69
+ },
70
+ undefined,
71
+ {
72
+ "opacity": 1,
73
+ },
74
+ ]
75
+ }
76
+ testID="GC_SEND_TOUCHABLE"
77
+ >
78
+ <View>
79
+ <Text
80
+ style={
81
+ [
82
+ {
83
+ "backgroundColor": "transparent",
84
+ "color": "#0084ff",
85
+ "fontSize": 17,
86
+ "fontWeight": "600",
87
+ "marginBottom": 12,
88
+ "marginLeft": 10,
89
+ "marginRight": 10,
90
+ },
91
+ undefined,
92
+ undefined,
93
+ ]
94
+ }
95
+ >
96
+ Send
97
+ </Text>
98
+ </View>
93
99
  </View>
94
100
  </View>
95
101
  `;
@@ -98,13 +104,11 @@ exports[`Send should not render <Send /> and compare with snapshot 1`] = `null`;
98
104
 
99
105
  exports[`Send should render <Send /> where there is input and compare with snapshot 1`] = `
100
106
  <View
101
- accessibilityLabel="send"
102
- accessibilityRole="button"
103
107
  accessibilityState={
104
108
  {
105
109
  "busy": undefined,
106
110
  "checked": undefined,
107
- "disabled": false,
111
+ "disabled": undefined,
108
112
  "expanded": undefined,
109
113
  "selected": undefined,
110
114
  }
@@ -120,29 +124,6 @@ exports[`Send should render <Send /> where there is input and compare with snaps
120
124
  accessible={true}
121
125
  collapsable={false}
122
126
  focusable={true}
123
- jestAnimatedProps={
124
- {
125
- "value": {},
126
- }
127
- }
128
- jestAnimatedStyle={
129
- {
130
- "value": {
131
- "opacity": 1,
132
- },
133
- }
134
- }
135
- jestInlineStyle={
136
- [
137
- [
138
- {
139
- "height": 44,
140
- "justifyContent": "flex-end",
141
- },
142
- undefined,
143
- ],
144
- ]
145
- }
146
127
  onBlur={[Function]}
147
128
  onClick={[Function]}
148
129
  onFocus={[Function]}
@@ -152,40 +133,71 @@ exports[`Send should render <Send /> where there is input and compare with snaps
152
133
  onResponderTerminate={[Function]}
153
134
  onResponderTerminationRequest={[Function]}
154
135
  onStartShouldSetResponder={[Function]}
155
- style={
156
- [
136
+ >
137
+ <View
138
+ accessibilityLabel="send"
139
+ accessibilityRole="button"
140
+ accessible={true}
141
+ collapsable={false}
142
+ disabled={false}
143
+ jestAnimatedProps={
157
144
  {
158
- "height": 44,
159
- "justifyContent": "flex-end",
160
- },
161
- undefined,
145
+ "value": {},
146
+ }
147
+ }
148
+ jestAnimatedStyle={
162
149
  {
163
- "opacity": 1,
164
- },
165
- ]
166
- }
167
- testID="GC_SEND_TOUCHABLE"
168
- >
169
- <View>
170
- <Text
171
- style={
150
+ "value": {
151
+ "opacity": 1,
152
+ },
153
+ }
154
+ }
155
+ jestInlineStyle={
156
+ [
172
157
  [
173
158
  {
174
- "backgroundColor": "transparent",
175
- "color": "#0084ff",
176
- "fontSize": 17,
177
- "fontWeight": "600",
178
- "marginBottom": 12,
179
- "marginLeft": 10,
180
- "marginRight": 10,
159
+ "height": 44,
160
+ "justifyContent": "flex-end",
181
161
  },
182
162
  undefined,
183
- undefined,
184
- ]
185
- }
186
- >
187
- Send
188
- </Text>
163
+ ],
164
+ ]
165
+ }
166
+ style={
167
+ [
168
+ {
169
+ "height": 44,
170
+ "justifyContent": "flex-end",
171
+ },
172
+ undefined,
173
+ {
174
+ "opacity": 1,
175
+ },
176
+ ]
177
+ }
178
+ testID="GC_SEND_TOUCHABLE"
179
+ >
180
+ <View>
181
+ <Text
182
+ style={
183
+ [
184
+ {
185
+ "backgroundColor": "transparent",
186
+ "color": "#0084ff",
187
+ "fontSize": 17,
188
+ "fontWeight": "600",
189
+ "marginBottom": 12,
190
+ "marginLeft": 10,
191
+ "marginRight": 10,
192
+ },
193
+ undefined,
194
+ undefined,
195
+ ]
196
+ }
197
+ >
198
+ Send
199
+ </Text>
200
+ </View>
189
201
  </View>
190
202
  </View>
191
203
  `;