react-native-gifted-chat 2.6.0 → 2.6.2
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 +10 -20
- package/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/.ci/compile +351 -0
- package/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- package/lib/Composer.d.ts +1 -1
- package/lib/Composer.js +2 -3
- package/lib/Composer.js.map +1 -1
- package/lib/GiftedChat.d.ts +8 -3
- package/lib/GiftedChat.js +0 -1
- package/lib/GiftedChat.js.map +1 -1
- package/lib/QuickReplies.d.ts +1 -1
- package/lib/QuickReplies.js +2 -3
- package/lib/QuickReplies.js.map +1 -1
- package/lib/TypingIndicator.d.ts +2 -2
- package/lib/TypingIndicator.js +96 -64
- package/lib/TypingIndicator.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
- package/src/Composer.tsx +2 -3
- package/src/GiftedChat.tsx +2 -3
- package/src/QuickReplies.tsx +2 -3
- package/src/TypingIndicator.tsx +147 -76
- package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +1 -20
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -79,16 +79,6 @@
|
|
|
79
79
|
</p>
|
|
80
80
|
</p>
|
|
81
81
|
|
|
82
|
-
## The future of GiftedChat 🎉
|
|
83
|
-
|
|
84
|
-
Please give us your advice: [Related PR](https://github.com/FaridSafi/react-native-gifted-chat/pull/1775)
|
|
85
|
-
|
|
86
|
-
## Please vote
|
|
87
|
-
|
|
88
|
-
**GiftedChat** depends on other packages and some needs a boost, please vote for PRs will improve it, thanks:
|
|
89
|
-
|
|
90
|
-
- https://github.com/watadarkstar/react-native-typing-animation/issues/18
|
|
91
|
-
|
|
92
82
|
## Features
|
|
93
83
|
|
|
94
84
|
- 🎉 **_`react-native-web`able_ (since 0.10.0)** [web configuration](#react-native-web)
|
|
@@ -105,13 +95,7 @@ Please give us your advice: [Related PR](https://github.com/FaridSafi/react-nati
|
|
|
105
95
|
- Redux support
|
|
106
96
|
- System message
|
|
107
97
|
- Quick Reply messages (bot)
|
|
108
|
-
- Typing indicator
|
|
109
|
-
|
|
110
|
-
## Dependency
|
|
111
|
-
|
|
112
|
-
- Use version `0.2.x` for RN `>= 0.44.0`
|
|
113
|
-
- Use version `0.1.x` for RN `>= 0.40.0`
|
|
114
|
-
- Use version `0.0.10` for RN `< 0.40.0`
|
|
98
|
+
- Typing indicator
|
|
115
99
|
|
|
116
100
|
# Getting started
|
|
117
101
|
|
|
@@ -121,18 +105,24 @@ Please give us your advice: [Related PR](https://github.com/FaridSafi/react-nati
|
|
|
121
105
|
|
|
122
106
|
Yarn:
|
|
123
107
|
```bash
|
|
124
|
-
yarn add react-native-gifted-chat react-native-reanimated react-native-safe-area-context
|
|
108
|
+
yarn add react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
|
|
125
109
|
```
|
|
126
110
|
|
|
127
111
|
Npm:
|
|
128
112
|
|
|
129
113
|
```bash
|
|
130
|
-
npm install --save react-native-gifted-chat react-native-reanimated react-native-safe-area-context
|
|
114
|
+
npm install --save react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
|
|
131
115
|
```
|
|
132
116
|
|
|
133
117
|
Expo
|
|
134
118
|
```bash
|
|
135
|
-
npx expo install react-native-gifted-chat react-native-reanimated react-native-safe-area-context
|
|
119
|
+
npx expo install react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Non-expo users
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx pod-install
|
|
136
126
|
```
|
|
137
127
|
|
|
138
128
|
### Setup react-native-safe-area-context
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
#! /bin/sh
|
|
2
|
+
# Wrapper for compilers which do not understand '-c -o'.
|
|
3
|
+
|
|
4
|
+
scriptversion=2018-03-27.18; # UTC
|
|
5
|
+
|
|
6
|
+
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
|
7
|
+
# Written by Tom Tromey <tromey@cygnus.com>.
|
|
8
|
+
#
|
|
9
|
+
# This program is free software; you can redistribute it and/or modify
|
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
|
11
|
+
# the Free Software Foundation; either version 2, or (at your option)
|
|
12
|
+
# any later version.
|
|
13
|
+
#
|
|
14
|
+
# This program is distributed in the hope that it will be useful,
|
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
# GNU General Public License for more details.
|
|
18
|
+
#
|
|
19
|
+
# You should have received a copy of the GNU General Public License
|
|
20
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
21
|
+
|
|
22
|
+
# As a special exception to the GNU General Public License, if you
|
|
23
|
+
# distribute this file as part of a program that contains a
|
|
24
|
+
# configuration script generated by Autoconf, you may include it under
|
|
25
|
+
# the same distribution terms that you use for the rest of that program.
|
|
26
|
+
|
|
27
|
+
# This file is maintained in Automake, please report
|
|
28
|
+
# bugs to <bug-automake@gnu.org> or send patches to
|
|
29
|
+
# <automake-patches@gnu.org>.
|
|
30
|
+
|
|
31
|
+
nl='
|
|
32
|
+
'
|
|
33
|
+
|
|
34
|
+
# We need space, tab and new line, in precisely that order. Quoting is
|
|
35
|
+
# there to prevent tools from complaining about whitespace usage.
|
|
36
|
+
IFS=" "" $nl"
|
|
37
|
+
|
|
38
|
+
file_conv=
|
|
39
|
+
|
|
40
|
+
# func_file_conv build_file lazy
|
|
41
|
+
# Convert a $build file to $host form and store it in $file
|
|
42
|
+
# Currently only supports Windows hosts. If the determined conversion
|
|
43
|
+
# type is listed in (the comma separated) LAZY, no conversion will
|
|
44
|
+
# take place.
|
|
45
|
+
func_file_conv ()
|
|
46
|
+
{
|
|
47
|
+
file=$1
|
|
48
|
+
case $file in
|
|
49
|
+
/ | /[!/]*) # absolute file, and not a UNC file
|
|
50
|
+
if test -z "$file_conv"; then
|
|
51
|
+
# lazily determine how to convert abs files
|
|
52
|
+
case `uname -s` in
|
|
53
|
+
MINGW*)
|
|
54
|
+
file_conv=mingw
|
|
55
|
+
;;
|
|
56
|
+
CYGWIN*)
|
|
57
|
+
file_conv=cygwin
|
|
58
|
+
;;
|
|
59
|
+
*)
|
|
60
|
+
file_conv=wine
|
|
61
|
+
;;
|
|
62
|
+
esac
|
|
63
|
+
fi
|
|
64
|
+
case $file_conv/,$2, in
|
|
65
|
+
*,$file_conv,*)
|
|
66
|
+
;;
|
|
67
|
+
mingw/*)
|
|
68
|
+
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
|
69
|
+
;;
|
|
70
|
+
cygwin/*)
|
|
71
|
+
file=`cygpath -m "$file" || echo "$file"`
|
|
72
|
+
;;
|
|
73
|
+
wine/*)
|
|
74
|
+
file=`winepath -w "$file" || echo "$file"`
|
|
75
|
+
;;
|
|
76
|
+
esac
|
|
77
|
+
;;
|
|
78
|
+
esac
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# func_cl_dashL linkdir
|
|
82
|
+
# Make cl look for libraries in LINKDIR
|
|
83
|
+
func_cl_dashL ()
|
|
84
|
+
{
|
|
85
|
+
func_file_conv "$1"
|
|
86
|
+
if test -z "$lib_path"; then
|
|
87
|
+
lib_path=$file
|
|
88
|
+
else
|
|
89
|
+
lib_path="$lib_path;$file"
|
|
90
|
+
fi
|
|
91
|
+
linker_opts="$linker_opts -LIBPATH:$file"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# func_cl_dashl library
|
|
95
|
+
# Do a library search-path lookup for cl
|
|
96
|
+
func_cl_dashl ()
|
|
97
|
+
{
|
|
98
|
+
lib=$1
|
|
99
|
+
found=no
|
|
100
|
+
save_IFS=$IFS
|
|
101
|
+
IFS=';'
|
|
102
|
+
for dir in $lib_path $LIB
|
|
103
|
+
do
|
|
104
|
+
IFS=$save_IFS
|
|
105
|
+
if $shared && test -f "$dir/$lib.dll.lib"; then
|
|
106
|
+
found=yes
|
|
107
|
+
lib=$dir/$lib.dll.lib
|
|
108
|
+
break
|
|
109
|
+
fi
|
|
110
|
+
if test -f "$dir/$lib.lib"; then
|
|
111
|
+
found=yes
|
|
112
|
+
lib=$dir/$lib.lib
|
|
113
|
+
break
|
|
114
|
+
fi
|
|
115
|
+
if test -f "$dir/lib$lib.a"; then
|
|
116
|
+
found=yes
|
|
117
|
+
lib=$dir/lib$lib.a
|
|
118
|
+
break
|
|
119
|
+
fi
|
|
120
|
+
done
|
|
121
|
+
IFS=$save_IFS
|
|
122
|
+
|
|
123
|
+
if test "$found" != yes; then
|
|
124
|
+
lib=$lib.lib
|
|
125
|
+
fi
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
# func_cl_wrapper cl arg...
|
|
129
|
+
# Adjust compile command to suit cl
|
|
130
|
+
func_cl_wrapper ()
|
|
131
|
+
{
|
|
132
|
+
# Assume a capable shell
|
|
133
|
+
lib_path=
|
|
134
|
+
shared=:
|
|
135
|
+
linker_opts=
|
|
136
|
+
for arg
|
|
137
|
+
do
|
|
138
|
+
if test -n "$eat"; then
|
|
139
|
+
eat=
|
|
140
|
+
else
|
|
141
|
+
case $1 in
|
|
142
|
+
-o)
|
|
143
|
+
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
144
|
+
eat=1
|
|
145
|
+
case $2 in
|
|
146
|
+
*.o | *.[oO][bB][jJ])
|
|
147
|
+
func_file_conv "$2"
|
|
148
|
+
set x "$@" -Fo"$file"
|
|
149
|
+
shift
|
|
150
|
+
;;
|
|
151
|
+
*)
|
|
152
|
+
func_file_conv "$2"
|
|
153
|
+
set x "$@" -Fe"$file"
|
|
154
|
+
shift
|
|
155
|
+
;;
|
|
156
|
+
esac
|
|
157
|
+
;;
|
|
158
|
+
-I)
|
|
159
|
+
eat=1
|
|
160
|
+
func_file_conv "$2" mingw
|
|
161
|
+
set x "$@" -I"$file"
|
|
162
|
+
shift
|
|
163
|
+
;;
|
|
164
|
+
-I*)
|
|
165
|
+
func_file_conv "${1#-I}" mingw
|
|
166
|
+
set x "$@" -I"$file"
|
|
167
|
+
shift
|
|
168
|
+
;;
|
|
169
|
+
-l)
|
|
170
|
+
eat=1
|
|
171
|
+
func_cl_dashl "$2"
|
|
172
|
+
set x "$@" "$lib"
|
|
173
|
+
shift
|
|
174
|
+
;;
|
|
175
|
+
-l*)
|
|
176
|
+
func_cl_dashl "${1#-l}"
|
|
177
|
+
set x "$@" "$lib"
|
|
178
|
+
shift
|
|
179
|
+
;;
|
|
180
|
+
-L)
|
|
181
|
+
eat=1
|
|
182
|
+
func_cl_dashL "$2"
|
|
183
|
+
;;
|
|
184
|
+
-L*)
|
|
185
|
+
func_cl_dashL "${1#-L}"
|
|
186
|
+
;;
|
|
187
|
+
-static)
|
|
188
|
+
shared=false
|
|
189
|
+
;;
|
|
190
|
+
-warn)
|
|
191
|
+
eat=1
|
|
192
|
+
;;
|
|
193
|
+
-Wl,*)
|
|
194
|
+
arg=${1#-Wl,}
|
|
195
|
+
save_ifs="$IFS"; IFS=','
|
|
196
|
+
for flag in $arg; do
|
|
197
|
+
IFS="$save_ifs"
|
|
198
|
+
linker_opts="$linker_opts $flag"
|
|
199
|
+
done
|
|
200
|
+
IFS="$save_ifs"
|
|
201
|
+
;;
|
|
202
|
+
-Xlinker)
|
|
203
|
+
eat=1
|
|
204
|
+
linker_opts="$linker_opts $2"
|
|
205
|
+
;;
|
|
206
|
+
-*)
|
|
207
|
+
set x "$@" "$1"
|
|
208
|
+
shift
|
|
209
|
+
;;
|
|
210
|
+
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
|
211
|
+
func_file_conv "$1"
|
|
212
|
+
set x "$@" -Tp"$file"
|
|
213
|
+
shift
|
|
214
|
+
;;
|
|
215
|
+
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
|
216
|
+
func_file_conv "$1" mingw
|
|
217
|
+
set x "$@" "$file"
|
|
218
|
+
shift
|
|
219
|
+
;;
|
|
220
|
+
*)
|
|
221
|
+
set x "$@" "$1"
|
|
222
|
+
shift
|
|
223
|
+
;;
|
|
224
|
+
esac
|
|
225
|
+
fi
|
|
226
|
+
shift
|
|
227
|
+
done
|
|
228
|
+
if test -n "$linker_opts"; then
|
|
229
|
+
linker_opts="-link$linker_opts"
|
|
230
|
+
fi
|
|
231
|
+
exec "$@" $linker_opts
|
|
232
|
+
exit 1
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
eat=
|
|
236
|
+
|
|
237
|
+
case $1 in
|
|
238
|
+
'')
|
|
239
|
+
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
|
240
|
+
exit 1;
|
|
241
|
+
;;
|
|
242
|
+
-h | --h*)
|
|
243
|
+
cat <<\EOF
|
|
244
|
+
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
|
245
|
+
|
|
246
|
+
Wrapper for compilers which do not understand '-c -o'.
|
|
247
|
+
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
|
248
|
+
arguments, and rename the output as expected.
|
|
249
|
+
|
|
250
|
+
If you are trying to build a whole package this is not the
|
|
251
|
+
right script to run: please start by reading the file 'INSTALL'.
|
|
252
|
+
|
|
253
|
+
Report bugs to <bug-automake@gnu.org>.
|
|
254
|
+
EOF
|
|
255
|
+
exit $?
|
|
256
|
+
;;
|
|
257
|
+
-v | --v*)
|
|
258
|
+
echo "compile $scriptversion"
|
|
259
|
+
exit $?
|
|
260
|
+
;;
|
|
261
|
+
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
|
262
|
+
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
|
263
|
+
func_cl_wrapper "$@" # Doesn't return...
|
|
264
|
+
;;
|
|
265
|
+
esac
|
|
266
|
+
|
|
267
|
+
ofile=
|
|
268
|
+
cfile=
|
|
269
|
+
|
|
270
|
+
for arg
|
|
271
|
+
do
|
|
272
|
+
if test -n "$eat"; then
|
|
273
|
+
eat=
|
|
274
|
+
else
|
|
275
|
+
case $1 in
|
|
276
|
+
-o)
|
|
277
|
+
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
278
|
+
# So we strip '-o arg' only if arg is an object.
|
|
279
|
+
eat=1
|
|
280
|
+
case $2 in
|
|
281
|
+
*.o | *.obj)
|
|
282
|
+
ofile=$2
|
|
283
|
+
;;
|
|
284
|
+
*)
|
|
285
|
+
set x "$@" -o "$2"
|
|
286
|
+
shift
|
|
287
|
+
;;
|
|
288
|
+
esac
|
|
289
|
+
;;
|
|
290
|
+
*.c)
|
|
291
|
+
cfile=$1
|
|
292
|
+
set x "$@" "$1"
|
|
293
|
+
shift
|
|
294
|
+
;;
|
|
295
|
+
*)
|
|
296
|
+
set x "$@" "$1"
|
|
297
|
+
shift
|
|
298
|
+
;;
|
|
299
|
+
esac
|
|
300
|
+
fi
|
|
301
|
+
shift
|
|
302
|
+
done
|
|
303
|
+
|
|
304
|
+
if test -z "$ofile" || test -z "$cfile"; then
|
|
305
|
+
# If no '-o' option was seen then we might have been invoked from a
|
|
306
|
+
# pattern rule where we don't need one. That is ok -- this is a
|
|
307
|
+
# normal compilation that the losing compiler can handle. If no
|
|
308
|
+
# '.c' file was seen then we are probably linking. That is also
|
|
309
|
+
# ok.
|
|
310
|
+
exec "$@"
|
|
311
|
+
fi
|
|
312
|
+
|
|
313
|
+
# Name of file we expect compiler to create.
|
|
314
|
+
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
|
315
|
+
|
|
316
|
+
# Create the lock directory.
|
|
317
|
+
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
|
318
|
+
# that we are using for the .o file. Also, base the name on the expected
|
|
319
|
+
# object file name, since that is what matters with a parallel build.
|
|
320
|
+
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
|
321
|
+
while true; do
|
|
322
|
+
if mkdir "$lockdir" >/dev/null 2>&1; then
|
|
323
|
+
break
|
|
324
|
+
fi
|
|
325
|
+
sleep 1
|
|
326
|
+
done
|
|
327
|
+
# FIXME: race condition here if user kills between mkdir and trap.
|
|
328
|
+
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
|
329
|
+
|
|
330
|
+
# Run the compile.
|
|
331
|
+
"$@"
|
|
332
|
+
ret=$?
|
|
333
|
+
|
|
334
|
+
if test -f "$cofile"; then
|
|
335
|
+
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
|
336
|
+
elif test -f "${cofile}bj"; then
|
|
337
|
+
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
|
338
|
+
fi
|
|
339
|
+
|
|
340
|
+
rmdir "$lockdir"
|
|
341
|
+
exit $ret
|
|
342
|
+
|
|
343
|
+
# Local Variables:
|
|
344
|
+
# mode: shell-script
|
|
345
|
+
# sh-indentation: 2
|
|
346
|
+
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
347
|
+
# time-stamp-start: "scriptversion="
|
|
348
|
+
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
349
|
+
# time-stamp-time-zone: "UTC0"
|
|
350
|
+
# time-stamp-end: "; # UTC"
|
|
351
|
+
# End:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CC = gcc
|
|
2
|
+
CFLAGS = -O2 -Wall
|
|
3
|
+
prefix =
|
|
4
|
+
includedir = $(prefix)/include
|
|
5
|
+
libdir = $(prefix)/lib
|
|
6
|
+
CPPFLAGS = -I$(includedir)
|
|
7
|
+
LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir)
|
|
8
|
+
|
|
9
|
+
all: check-call check-callback
|
|
10
|
+
|
|
11
|
+
test-call: test-call.c testcases.c
|
|
12
|
+
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi
|
|
13
|
+
|
|
14
|
+
test-callback: test-callback.c testcases.c
|
|
15
|
+
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi
|
|
16
|
+
|
|
17
|
+
check-call: test-call
|
|
18
|
+
./test-call > test-call.out
|
|
19
|
+
LC_ALL=C uniq -u < test-call.out > failed-call
|
|
20
|
+
test '!' -s failed-call
|
|
21
|
+
|
|
22
|
+
check-callback: test-callback
|
|
23
|
+
./test-callback > test-callback.out
|
|
24
|
+
LC_ALL=C uniq -u < test-callback.out > failed-callback
|
|
25
|
+
test '!' -s failed-callback
|
|
26
|
+
|
|
27
|
+
clean:
|
|
28
|
+
rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback
|
package/lib/Composer.d.ts
CHANGED
package/lib/Composer.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React, { useCallback, useRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { Platform, StyleSheet, TextInput, } from 'react-native';
|
|
4
4
|
import { MIN_COMPOSER_HEIGHT, DEFAULT_PLACEHOLDER } from './Constant';
|
|
5
5
|
import Color from './Color';
|
|
6
6
|
import { StylePropType } from './utils';
|
|
7
|
-
import { useCallbackOne } from 'use-memo-one';
|
|
8
7
|
export function Composer({ composerHeight = MIN_COMPOSER_HEIGHT, disableComposer = false, keyboardAppearance = 'default', multiline = true, onInputSizeChanged, onTextChanged, placeholder = DEFAULT_PLACEHOLDER, placeholderTextColor = Color.defaultColor, text = '', textInputAutoFocus = false, textInputProps, textInputStyle, }) {
|
|
9
8
|
const dimensionsRef = useRef();
|
|
10
|
-
const determineInputSizeChange =
|
|
9
|
+
const determineInputSizeChange = useCallback((dimensions) => {
|
|
11
10
|
// Support earlier versions of React Native on Android.
|
|
12
11
|
if (!dimensions)
|
|
13
12
|
return;
|
package/lib/Composer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composer.js","sourceRoot":"","sources":["../src/Composer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Composer.js","sourceRoot":"","sources":["../src/Composer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,SAAS,GAIV,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAiBvC,MAAM,UAAU,QAAQ,CAAE,EACxB,cAAc,GAAG,mBAAmB,EACpC,eAAe,GAAG,KAAK,EACvB,kBAAkB,GAAG,SAAS,EAC9B,SAAS,GAAG,IAAI,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,GAAG,mBAAmB,EACjC,oBAAoB,GAAG,KAAK,CAAC,YAAY,EACzC,IAAI,GAAG,EAAE,EACT,kBAAkB,GAAG,KAAK,EAC1B,cAAc,EACd,cAAc,GACA;IACd,MAAM,aAAa,GAAG,MAAM,EAAqC,CAAA;IAEjE,MAAM,wBAAwB,GAAG,WAAW,CAC1C,CAAC,UAA6C,EAAE,EAAE;QAChD,uDAAuD;QACvD,IAAI,CAAC,UAAU;YACb,OAAM;QAER,IACE,CAAC,aAAa,CAAC,OAAO;YACtB,CAAC,aAAa,CAAC,OAAO;gBACpB,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK;oBAC/C,aAAa,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC,EACxD,CAAC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M;IACtB,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,oBAAoB,EAAE,SAAS,CAAC,MAAM;IACtC,cAAc,EAAE,SAAS,CAAC,MAAM;IAChC,aAAa,EAAE,SAAS,CAAC,IAAI;IAC7B,kBAAkB,EAAE,SAAS,CAAC,IAAI;IAClC,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,eAAe,EAAE,SAAS,CAAC,IAAI;IAC/B,cAAc,EAAE,aAAa;IAC7B,kBAAkB,EAAE,SAAS,CAAC,IAAI;IAClC,kBAAkB,EAAE,SAAS,CAAC,MAAM;CACrC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,CAAC;aACf;SACF,CAAC;QACF,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC;YACzB,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,CAAC;YACV,GAAG,EAAE,CAAC;SACP,CAAC;QACF,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC;YAC5B,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,CAAC;YACV,GAAG,EAAE,CAAC;SACP,CAAC;KACH;CACF,CAAC,CAAA"}
|
package/lib/GiftedChat.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import 'react-native-get-random-values';
|
|
3
2
|
import { ActionSheetOptions } from '@expo/react-native-action-sheet';
|
|
4
3
|
import { FlatList, StyleProp, TextInput, TextStyle, ViewStyle } from 'react-native';
|
|
5
4
|
import { LightboxProps } from 'react-native-lightbox-v2';
|
|
@@ -49,7 +48,7 @@ export interface GiftedChatProps<TMessage extends IMessage = IMessage> {
|
|
|
49
48
|
minInputToolbarHeight?: number;
|
|
50
49
|
listViewProps?: object;
|
|
51
50
|
textInputProps?: object;
|
|
52
|
-
keyboardShouldPersistTaps?:
|
|
51
|
+
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled';
|
|
53
52
|
maxInputLength?: number;
|
|
54
53
|
alwaysShowSend?: boolean;
|
|
55
54
|
imageStyle?: StyleProp<ViewStyle>;
|
|
@@ -100,7 +99,13 @@ export interface GiftedChatProps<TMessage extends IMessage = IMessage> {
|
|
|
100
99
|
renderAccessory?(props: InputToolbarProps<TMessage>): React.ReactNode;
|
|
101
100
|
onPressActionButton?(): void;
|
|
102
101
|
onInputTextChanged?(text: string): void;
|
|
103
|
-
parsePatterns?: (linkStyle
|
|
102
|
+
parsePatterns?: (linkStyle?: TextStyle) => {
|
|
103
|
+
type?: string;
|
|
104
|
+
pattern?: RegExp;
|
|
105
|
+
style?: StyleProp<TextStyle> | object;
|
|
106
|
+
onPress?: unknown;
|
|
107
|
+
renderText?: unknown;
|
|
108
|
+
}[];
|
|
104
109
|
onQuickReply?(replies: Reply[]): void;
|
|
105
110
|
renderQuickReplies?(quickReplies: QuickRepliesProps<TMessage>): React.ReactNode;
|
|
106
111
|
renderQuickReplySend?(): React.ReactNode;
|
package/lib/GiftedChat.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { createRef, useEffect, useMemo, useRef, useState, useCallback, } from 'react';
|
|
2
|
-
import 'react-native-get-random-values'; // NOTE: FOR "uuid" SUPPORT
|
|
3
2
|
import { ActionSheetProvider, } from '@expo/react-native-action-sheet';
|
|
4
3
|
import dayjs from 'dayjs';
|
|
5
4
|
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
package/lib/GiftedChat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftedChat.js","sourceRoot":"","sources":["../src/GiftedChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,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AAC,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/QuickReplies.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
4
4
|
import { IMessage, Reply } from './Models';
|
|
5
5
|
export interface QuickRepliesProps<TMessage extends IMessage = IMessage> {
|
package/lib/QuickReplies.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React, { useState, useMemo } from 'react';
|
|
3
3
|
import { Text, StyleSheet, View, TouchableOpacity, } from 'react-native';
|
|
4
|
-
import { useCallbackOne } from 'use-memo-one';
|
|
5
4
|
import Color from './Color';
|
|
6
5
|
import { StylePropType } from './utils';
|
|
7
6
|
import { warning } from './logging';
|
|
@@ -49,7 +48,7 @@ export function QuickReplies({ currentMessage, nextMessage, color = Color.peterR
|
|
|
49
48
|
return true;
|
|
50
49
|
return false;
|
|
51
50
|
}, [currentMessage, nextMessage]);
|
|
52
|
-
const handlePress =
|
|
51
|
+
const handlePress = useCallback((reply) => () => {
|
|
53
52
|
if (currentMessage) {
|
|
54
53
|
const { type } = currentMessage.quickReplies;
|
|
55
54
|
switch (type) {
|
package/lib/QuickReplies.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickReplies.js","sourceRoot":"","sources":["../src/QuickReplies.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"QuickReplies.js","sourceRoot":"","sources":["../src/QuickReplies.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EACL,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,gBAAgB,GAIjB,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,GAAG;KACd;IACD,UAAU,EAAE;QACV,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,GAAG;QACb,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,CAAC;KACV;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,SAAS;KACpB;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,CAAC;KACf;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,K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A,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,YAAY,CAAC,SAAS,GAAG;IACvB,cAAc,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAC3C,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,QAAQ,EAAE,SAAS,CAAC,MAAM;IAC1B,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,eAAe,EAAE,aAAa;CAC/B,CAAA"}
|
package/lib/TypingIndicator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
isTyping?: boolean;
|
|
4
4
|
}
|
|
5
|
-
declare const TypingIndicator: ({ isTyping }: Props) => React.JSX.Element;
|
|
5
|
+
declare const TypingIndicator: ({ isTyping }: Props) => React.JSX.Element | null;
|
|
6
6
|
export default TypingIndicator;
|
package/lib/TypingIndicator.js
CHANGED
|
@@ -1,74 +1,92 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { TypingAnimation } from 'react-native-typing-animation';
|
|
4
|
-
import { useUpdateLayoutEffect } from './hooks/useUpdateLayoutEffect';
|
|
1
|
+
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
3
|
import Color from './Color';
|
|
4
|
+
import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withDelay, withRepeat, withSequence, withTiming, } from 'react-native-reanimated';
|
|
5
|
+
const DotsAnimation = () => {
|
|
6
|
+
const dot1 = useSharedValue(0);
|
|
7
|
+
const dot2 = useSharedValue(0);
|
|
8
|
+
const dot3 = useSharedValue(0);
|
|
9
|
+
const topY = useMemo(() => -5, []);
|
|
10
|
+
const bottomY = useMemo(() => 5, []);
|
|
11
|
+
const duration = useMemo(() => 500, []);
|
|
12
|
+
const dot1Style = useAnimatedStyle(() => ({
|
|
13
|
+
transform: [{
|
|
14
|
+
translateY: dot1.value,
|
|
15
|
+
}],
|
|
16
|
+
}), [dot1]);
|
|
17
|
+
const dot2Style = useAnimatedStyle(() => ({
|
|
18
|
+
transform: [{
|
|
19
|
+
translateY: dot2.value,
|
|
20
|
+
}],
|
|
21
|
+
}), [dot2]);
|
|
22
|
+
const dot3Style = useAnimatedStyle(() => ({
|
|
23
|
+
transform: [{
|
|
24
|
+
translateY: dot3.value,
|
|
25
|
+
}],
|
|
26
|
+
}), [dot3]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
dot1.value = withRepeat(withSequence(withTiming(topY, { duration }), withTiming(bottomY, { duration })), 0, true);
|
|
29
|
+
}, [dot1, topY, bottomY, duration]);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
dot2.value = withDelay(100, withRepeat(withSequence(withTiming(topY, { duration }), withTiming(bottomY, { duration })), 0, true));
|
|
32
|
+
}, [dot2, topY, bottomY, duration]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
dot3.value = withDelay(200, withRepeat(withSequence(withTiming(topY, { duration }), withTiming(bottomY, { duration })), 0, true));
|
|
35
|
+
}, [dot3, topY, bottomY, duration]);
|
|
36
|
+
return (<View style={styles.dots}>
|
|
37
|
+
<Animated.View style={[styles.dot, dot1Style]}/>
|
|
38
|
+
<Animated.View style={[styles.dot, dot2Style]}/>
|
|
39
|
+
<Animated.View style={[styles.dot, dot3Style]}/>
|
|
40
|
+
</View>);
|
|
41
|
+
};
|
|
6
42
|
const TypingIndicator = ({ isTyping }) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
43
|
+
const yCoords = useSharedValue(200);
|
|
44
|
+
const heightScale = useSharedValue(0);
|
|
45
|
+
const marginScale = useSharedValue(0);
|
|
46
|
+
const [isVisible, setIsVisible] = useState(isTyping);
|
|
47
|
+
const containerStyle = useAnimatedStyle(() => ({
|
|
48
|
+
transform: [
|
|
49
|
+
{
|
|
50
|
+
translateY: yCoords.value,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
height: heightScale.value,
|
|
54
|
+
marginBottom: marginScale.value,
|
|
55
|
+
}), [yCoords, heightScale, marginScale]);
|
|
56
|
+
const slideIn = useCallback(() => {
|
|
57
|
+
const duration = 250;
|
|
58
|
+
yCoords.value = withTiming(0, { duration });
|
|
59
|
+
heightScale.value = withTiming(35, { duration });
|
|
60
|
+
marginScale.value = withTiming(8, { duration });
|
|
61
|
+
}, [yCoords, heightScale, marginScale]);
|
|
62
|
+
// side effect
|
|
63
|
+
const slideOut = useCallback(() => {
|
|
64
|
+
const duration = 250;
|
|
65
|
+
yCoords.value = withTiming(200, { duration });
|
|
66
|
+
heightScale.value = withTiming(0, { duration });
|
|
67
|
+
marginScale.value = withTiming(0, { duration }, isFinished => {
|
|
68
|
+
if (isFinished)
|
|
69
|
+
runOnJS(setIsVisible)(false);
|
|
70
|
+
});
|
|
71
|
+
}, [yCoords, heightScale, marginScale]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (isVisible)
|
|
74
|
+
if (isTyping)
|
|
75
|
+
slideIn();
|
|
76
|
+
else
|
|
77
|
+
slideOut();
|
|
78
|
+
}, [isVisible, isTyping, slideIn, slideOut]);
|
|
79
|
+
useEffect(() => {
|
|
14
80
|
if (isTyping)
|
|
15
|
-
|
|
16
|
-
else
|
|
17
|
-
slideOut();
|
|
81
|
+
setIsVisible(true);
|
|
18
82
|
}, [isTyping]);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Animated.parallel([
|
|
22
|
-
Animated.spring(yCoords, {
|
|
23
|
-
toValue: 0,
|
|
24
|
-
useNativeDriver: false,
|
|
25
|
-
}),
|
|
26
|
-
Animated.timing(heightScale, {
|
|
27
|
-
toValue: 35,
|
|
28
|
-
duration: 250,
|
|
29
|
-
useNativeDriver: false,
|
|
30
|
-
}),
|
|
31
|
-
Animated.timing(marginScale, {
|
|
32
|
-
toValue: 8,
|
|
33
|
-
duration: 250,
|
|
34
|
-
useNativeDriver: false,
|
|
35
|
-
}),
|
|
36
|
-
]).start();
|
|
37
|
-
};
|
|
38
|
-
// side effect
|
|
39
|
-
const slideOut = () => {
|
|
40
|
-
Animated.parallel([
|
|
41
|
-
Animated.spring(yCoords, {
|
|
42
|
-
toValue: 200,
|
|
43
|
-
useNativeDriver: false,
|
|
44
|
-
}),
|
|
45
|
-
Animated.timing(heightScale, {
|
|
46
|
-
toValue: 0,
|
|
47
|
-
duration: 250,
|
|
48
|
-
useNativeDriver: false,
|
|
49
|
-
}),
|
|
50
|
-
Animated.timing(marginScale, {
|
|
51
|
-
toValue: 0,
|
|
52
|
-
duration: 250,
|
|
53
|
-
useNativeDriver: false,
|
|
54
|
-
}),
|
|
55
|
-
]).start();
|
|
56
|
-
};
|
|
83
|
+
if (!isVisible)
|
|
84
|
+
return null;
|
|
57
85
|
return (<Animated.View style={[
|
|
58
86
|
styles.container,
|
|
59
|
-
|
|
60
|
-
transform: [
|
|
61
|
-
{
|
|
62
|
-
translateY: yCoords,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
height: heightScale,
|
|
66
|
-
marginBottom: marginScale,
|
|
67
|
-
},
|
|
87
|
+
containerStyle,
|
|
68
88
|
]}>
|
|
69
|
-
|
|
70
|
-
? (<TypingAnimation style={{ marginLeft: 6, marginTop: 7.2 }} dotRadius={4} dotMargin={5.5} dotColor='rgba(0, 0, 0, 0.38)'/>)
|
|
71
|
-
: null}
|
|
89
|
+
<DotsAnimation />
|
|
72
90
|
</Animated.View>);
|
|
73
91
|
};
|
|
74
92
|
const styles = StyleSheet.create({
|
|
@@ -78,6 +96,20 @@ const styles = StyleSheet.create({
|
|
|
78
96
|
borderRadius: 15,
|
|
79
97
|
backgroundColor: Color.leftBubbleBackground,
|
|
80
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
|
+
},
|
|
81
113
|
});
|
|
82
114
|
export default TypingIndicator;
|
|
83
115
|
//# sourceMappingURL=TypingIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypingIndicator.js","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TypingIndicator.js","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,EAAE,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,yBAAyB,CAAA;AAEhC,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;IAE9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACpC,MAA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AO,EAAE,CAAA;;gBAET,QAAQ,EAAE,CAAA;IAChB,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE5C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ;YACV,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,IAAI,CAAC,SAAS;QACZ,OAAO,IAAI,CAAA;IAEb,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CACZ,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,SAAS;YAChB,cAAc;SACf,CAAC,CAEF;MAAA,CAAC,aAAa,CAAC,AAAD,EAChB;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,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;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE,CAAC;KACR;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;AAEF,eAAe,eAAe,CAAA"}
|
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,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAA,CAAC,2BAA2B;AAEnE,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-chat",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "The most complete chat UI for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -57,12 +57,9 @@
|
|
|
57
57
|
"lodash.isequal": "^4.5.0",
|
|
58
58
|
"prop-types": "^15.8.1",
|
|
59
59
|
"react-native-communications": "^2.2.1",
|
|
60
|
-
"react-native-get-random-values": "^1.11.0",
|
|
61
60
|
"react-native-iphone-x-helper": "^1.3.1",
|
|
62
61
|
"react-native-lightbox-v2": "^0.9.0",
|
|
63
62
|
"react-native-parsed-text": "^0.0.22",
|
|
64
|
-
"react-native-typing-animation": "^0.1.7",
|
|
65
|
-
"use-memo-one": "^1.1.3",
|
|
66
63
|
"uuid": "^10.0.0"
|
|
67
64
|
},
|
|
68
65
|
"devDependencies": {
|
|
@@ -98,6 +95,7 @@
|
|
|
98
95
|
"react": "^18.3.1",
|
|
99
96
|
"react-dom": "^18.3.1",
|
|
100
97
|
"react-native": "^0.74.5",
|
|
98
|
+
"react-native-get-random-values": "^1.11.0",
|
|
101
99
|
"react-native-reanimated": "^3.15.0",
|
|
102
100
|
"react-native-safe-area-context": "^4.10.9",
|
|
103
101
|
"react-test-renderer": "^18.3.1",
|
|
@@ -106,6 +104,7 @@
|
|
|
106
104
|
"peerDependencies": {
|
|
107
105
|
"react": "*",
|
|
108
106
|
"react-native": "*",
|
|
107
|
+
"react-native-get-random-values": "*",
|
|
109
108
|
"react-native-reanimated": "*",
|
|
110
109
|
"react-native-safe-area-context": "*"
|
|
111
110
|
},
|
package/src/Composer.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PropTypes from 'prop-types'
|
|
2
1
|
import React, { useCallback, useRef } from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
3
|
import {
|
|
4
4
|
Platform,
|
|
5
5
|
StyleSheet,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
import { MIN_COMPOSER_HEIGHT, DEFAULT_PLACEHOLDER } from './Constant'
|
|
12
12
|
import Color from './Color'
|
|
13
13
|
import { StylePropType } from './utils'
|
|
14
|
-
import { useCallbackOne } from 'use-memo-one'
|
|
15
14
|
|
|
16
15
|
export interface ComposerProps {
|
|
17
16
|
composerHeight?: number
|
|
@@ -44,7 +43,7 @@ export function Composer ({
|
|
|
44
43
|
}: ComposerProps): React.ReactElement {
|
|
45
44
|
const dimensionsRef = useRef<{ width: number, height: number }>()
|
|
46
45
|
|
|
47
|
-
const determineInputSizeChange =
|
|
46
|
+
const determineInputSizeChange = useCallback(
|
|
48
47
|
(dimensions: { width: number, height: number }) => {
|
|
49
48
|
// Support earlier versions of React Native on Android.
|
|
50
49
|
if (!dimensions)
|
package/src/GiftedChat.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import React, {
|
|
|
7
7
|
useCallback,
|
|
8
8
|
MutableRefObject,
|
|
9
9
|
} from 'react'
|
|
10
|
-
import 'react-native-get-random-values' // NOTE: FOR "uuid" SUPPORT
|
|
11
10
|
import {
|
|
12
11
|
ActionSheetOptions,
|
|
13
12
|
ActionSheetProvider,
|
|
@@ -121,7 +120,7 @@ export interface GiftedChatProps<TMessage extends IMessage = IMessage> {
|
|
|
121
120
|
/* Extra props to be passed to the <TextInput> */
|
|
122
121
|
textInputProps?: object
|
|
123
122
|
/* Determines whether the keyboard should stay visible after a tap; see <ScrollView> docs */
|
|
124
|
-
keyboardShouldPersistTaps?:
|
|
123
|
+
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled'
|
|
125
124
|
/* Max message composer TextInput length */
|
|
126
125
|
maxInputLength?: number
|
|
127
126
|
/* Force send button */
|
|
@@ -215,7 +214,7 @@ export interface GiftedChatProps<TMessage extends IMessage = IMessage> {
|
|
|
215
214
|
/* Callback when the input text changes */
|
|
216
215
|
onInputTextChanged?(text: string): void
|
|
217
216
|
/* Custom parse patterns for react-native-parsed-text used to linking message content (like URLs and phone numbers) */
|
|
218
|
-
parsePatterns?: (linkStyle
|
|
217
|
+
parsePatterns?: (linkStyle?: TextStyle) => { type?: string, pattern?: RegExp, style?: StyleProp<TextStyle> | object, onPress?: unknown, renderText?: unknown }[]
|
|
219
218
|
onQuickReply?(replies: Reply[]): void
|
|
220
219
|
renderQuickReplies?(
|
|
221
220
|
quickReplies: QuickRepliesProps<TMessage>,
|
package/src/QuickReplies.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback } from 'react'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
|
-
import React, { useState, useMemo } from 'react'
|
|
3
3
|
import {
|
|
4
4
|
Text,
|
|
5
5
|
StyleSheet,
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
ViewStyle,
|
|
10
10
|
TextStyle,
|
|
11
11
|
} from 'react-native'
|
|
12
|
-
import { useCallbackOne } from 'use-memo-one'
|
|
13
12
|
import { IMessage, Reply } from './Models'
|
|
14
13
|
import Color from './Color'
|
|
15
14
|
import { StylePropType } from './utils'
|
|
@@ -91,7 +90,7 @@ export function QuickReplies ({
|
|
|
91
90
|
return false
|
|
92
91
|
}, [currentMessage, nextMessage])
|
|
93
92
|
|
|
94
|
-
const handlePress =
|
|
93
|
+
const handlePress = useCallback(
|
|
95
94
|
(reply: Reply) => () => {
|
|
96
95
|
if (currentMessage) {
|
|
97
96
|
const { type } = currentMessage.quickReplies!
|
package/src/TypingIndicator.tsx
CHANGED
|
@@ -1,97 +1,154 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { TypingAnimation } from 'react-native-typing-animation'
|
|
4
|
-
import { useUpdateLayoutEffect } from './hooks/useUpdateLayoutEffect'
|
|
1
|
+
import React, { useCallback, useEffect, useState, useMemo } from 'react'
|
|
2
|
+
import { StyleSheet, View } from 'react-native'
|
|
5
3
|
import Color from './Color'
|
|
4
|
+
import Animated, {
|
|
5
|
+
runOnJS,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
useSharedValue,
|
|
8
|
+
withDelay,
|
|
9
|
+
withRepeat,
|
|
10
|
+
withSequence,
|
|
11
|
+
withTiming,
|
|
12
|
+
} from 'react-native-reanimated'
|
|
13
|
+
|
|
14
|
+
const DotsAnimation = () => {
|
|
15
|
+
const dot1 = useSharedValue(0)
|
|
16
|
+
const dot2 = useSharedValue(0)
|
|
17
|
+
const dot3 = useSharedValue(0)
|
|
18
|
+
|
|
19
|
+
const topY = useMemo(() => -5, [])
|
|
20
|
+
const bottomY = useMemo(() => 5, [])
|
|
21
|
+
const duration = useMemo(() => 500, [])
|
|
22
|
+
|
|
23
|
+
const dot1Style = useAnimatedStyle(() => ({
|
|
24
|
+
transform: [{
|
|
25
|
+
translateY: dot1.value,
|
|
26
|
+
}],
|
|
27
|
+
}), [dot1])
|
|
28
|
+
|
|
29
|
+
const dot2Style = useAnimatedStyle(() => ({
|
|
30
|
+
transform: [{
|
|
31
|
+
translateY: dot2.value,
|
|
32
|
+
}],
|
|
33
|
+
}), [dot2])
|
|
34
|
+
|
|
35
|
+
const dot3Style = useAnimatedStyle(() => ({
|
|
36
|
+
transform: [{
|
|
37
|
+
translateY: dot3.value,
|
|
38
|
+
}],
|
|
39
|
+
}), [dot3])
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
dot1.value = withRepeat(
|
|
43
|
+
withSequence(
|
|
44
|
+
withTiming(topY, { duration }),
|
|
45
|
+
withTiming(bottomY, { duration })
|
|
46
|
+
),
|
|
47
|
+
0,
|
|
48
|
+
true
|
|
49
|
+
)
|
|
50
|
+
}, [dot1, topY, bottomY, duration])
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
dot2.value = withDelay(100,
|
|
54
|
+
withRepeat(
|
|
55
|
+
withSequence(
|
|
56
|
+
withTiming(topY, { duration }),
|
|
57
|
+
withTiming(bottomY, { duration })
|
|
58
|
+
),
|
|
59
|
+
0,
|
|
60
|
+
true
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
}, [dot2, topY, bottomY, duration])
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
dot3.value = withDelay(200,
|
|
67
|
+
withRepeat(
|
|
68
|
+
withSequence(
|
|
69
|
+
withTiming(topY, { duration }),
|
|
70
|
+
withTiming(bottomY, { duration })
|
|
71
|
+
),
|
|
72
|
+
0,
|
|
73
|
+
true
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
}, [dot3, topY, bottomY, duration])
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<View style={styles.dots}>
|
|
80
|
+
<Animated.View style={[styles.dot, dot1Style]} />
|
|
81
|
+
<Animated.View style={[styles.dot, dot2Style]} />
|
|
82
|
+
<Animated.View style={[styles.dot, dot3Style]} />
|
|
83
|
+
</View>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
6
86
|
|
|
7
87
|
interface Props {
|
|
8
88
|
isTyping?: boolean
|
|
9
89
|
}
|
|
10
90
|
|
|
11
91
|
const TypingIndicator = ({ isTyping }: Props) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}),
|
|
18
|
-
[]
|
|
19
|
-
)
|
|
92
|
+
const yCoords = useSharedValue(200)
|
|
93
|
+
const heightScale = useSharedValue(0)
|
|
94
|
+
const marginScale = useSharedValue(0)
|
|
95
|
+
|
|
96
|
+
const [isVisible, setIsVisible] = useState(isTyping)
|
|
20
97
|
|
|
21
|
-
|
|
22
|
-
|
|
98
|
+
const containerStyle = useAnimatedStyle(() => ({
|
|
99
|
+
transform: [
|
|
100
|
+
{
|
|
101
|
+
translateY: yCoords.value,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
height: heightScale.value,
|
|
105
|
+
marginBottom: marginScale.value,
|
|
106
|
+
}), [yCoords, heightScale, marginScale])
|
|
107
|
+
|
|
108
|
+
const slideIn = useCallback(() => {
|
|
109
|
+
const duration = 250
|
|
110
|
+
|
|
111
|
+
yCoords.value = withTiming(0, { duration })
|
|
112
|
+
heightScale.value = withTiming(35, { duration })
|
|
113
|
+
marginScale.value = withTiming(8, { duration })
|
|
114
|
+
}, [yCoords, heightScale, marginScale])
|
|
115
|
+
|
|
116
|
+
// side effect
|
|
117
|
+
const slideOut = useCallback(() => {
|
|
118
|
+
const duration = 250
|
|
119
|
+
|
|
120
|
+
yCoords.value = withTiming(200, { duration })
|
|
121
|
+
heightScale.value = withTiming(0, { duration })
|
|
122
|
+
marginScale.value = withTiming(0, { duration }, isFinished => {
|
|
123
|
+
if (isFinished)
|
|
124
|
+
runOnJS(setIsVisible)(false)
|
|
125
|
+
})
|
|
126
|
+
}, [yCoords, heightScale, marginScale])
|
|
127
|
+
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
if (isVisible)
|
|
130
|
+
if (isTyping)
|
|
131
|
+
slideIn()
|
|
132
|
+
else
|
|
133
|
+
slideOut()
|
|
134
|
+
}, [isVisible, isTyping, slideIn, slideOut])
|
|
135
|
+
|
|
136
|
+
useEffect(() => {
|
|
23
137
|
if (isTyping)
|
|
24
|
-
|
|
25
|
-
else
|
|
26
|
-
slideOut()
|
|
138
|
+
setIsVisible(true)
|
|
27
139
|
}, [isTyping])
|
|
28
140
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Animated.parallel([
|
|
32
|
-
Animated.spring(yCoords, {
|
|
33
|
-
toValue: 0,
|
|
34
|
-
useNativeDriver: false,
|
|
35
|
-
}),
|
|
36
|
-
Animated.timing(heightScale, {
|
|
37
|
-
toValue: 35,
|
|
38
|
-
duration: 250,
|
|
39
|
-
useNativeDriver: false,
|
|
40
|
-
}),
|
|
41
|
-
Animated.timing(marginScale, {
|
|
42
|
-
toValue: 8,
|
|
43
|
-
duration: 250,
|
|
44
|
-
useNativeDriver: false,
|
|
45
|
-
}),
|
|
46
|
-
]).start()
|
|
47
|
-
}
|
|
141
|
+
if (!isVisible)
|
|
142
|
+
return null
|
|
48
143
|
|
|
49
|
-
// side effect
|
|
50
|
-
const slideOut = () => {
|
|
51
|
-
Animated.parallel([
|
|
52
|
-
Animated.spring(yCoords, {
|
|
53
|
-
toValue: 200,
|
|
54
|
-
useNativeDriver: false,
|
|
55
|
-
}),
|
|
56
|
-
Animated.timing(heightScale, {
|
|
57
|
-
toValue: 0,
|
|
58
|
-
duration: 250,
|
|
59
|
-
useNativeDriver: false,
|
|
60
|
-
}),
|
|
61
|
-
Animated.timing(marginScale, {
|
|
62
|
-
toValue: 0,
|
|
63
|
-
duration: 250,
|
|
64
|
-
useNativeDriver: false,
|
|
65
|
-
}),
|
|
66
|
-
]).start()
|
|
67
|
-
}
|
|
68
144
|
return (
|
|
69
145
|
<Animated.View
|
|
70
146
|
style={[
|
|
71
147
|
styles.container,
|
|
72
|
-
|
|
73
|
-
transform: [
|
|
74
|
-
{
|
|
75
|
-
translateY: yCoords,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
height: heightScale,
|
|
79
|
-
marginBottom: marginScale,
|
|
80
|
-
},
|
|
148
|
+
containerStyle,
|
|
81
149
|
]}
|
|
82
150
|
>
|
|
83
|
-
|
|
84
|
-
isTyping
|
|
85
|
-
? (
|
|
86
|
-
<TypingAnimation
|
|
87
|
-
style={{ marginLeft: 6, marginTop: 7.2 }}
|
|
88
|
-
dotRadius={4}
|
|
89
|
-
dotMargin={5.5}
|
|
90
|
-
dotColor='rgba(0, 0, 0, 0.38)'
|
|
91
|
-
/>
|
|
92
|
-
)
|
|
93
|
-
: null
|
|
94
|
-
}
|
|
151
|
+
<DotsAnimation />
|
|
95
152
|
</Animated.View>
|
|
96
153
|
)
|
|
97
154
|
}
|
|
@@ -103,6 +160,20 @@ const styles = StyleSheet.create({
|
|
|
103
160
|
borderRadius: 15,
|
|
104
161
|
backgroundColor: Color.leftBubbleBackground,
|
|
105
162
|
},
|
|
163
|
+
dots: {
|
|
164
|
+
flexDirection: 'row',
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
justifyContent: 'center',
|
|
167
|
+
flex: 1,
|
|
168
|
+
},
|
|
169
|
+
dot: {
|
|
170
|
+
marginLeft: 2,
|
|
171
|
+
marginRight: 2,
|
|
172
|
+
borderRadius: 4,
|
|
173
|
+
width: 8,
|
|
174
|
+
height: 8,
|
|
175
|
+
backgroundColor: 'rgba(0, 0, 0, 0.38)',
|
|
176
|
+
},
|
|
106
177
|
})
|
|
107
178
|
|
|
108
179
|
export default TypingIndicator
|
|
@@ -74,26 +74,7 @@ exports[`should render <MessageContainer /> and compare with snapshot 1`] = `
|
|
|
74
74
|
],
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
<View
|
|
79
|
-
collapsable={false}
|
|
80
|
-
style={
|
|
81
|
-
{
|
|
82
|
-
"backgroundColor": "#f0f0f0",
|
|
83
|
-
"borderRadius": 15,
|
|
84
|
-
"height": 0,
|
|
85
|
-
"marginBottom": 0,
|
|
86
|
-
"marginLeft": 8,
|
|
87
|
-
"transform": [
|
|
88
|
-
{
|
|
89
|
-
"translateY": 200,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
"width": 45,
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/>
|
|
96
|
-
</View>
|
|
77
|
+
/>
|
|
97
78
|
<View
|
|
98
79
|
style={
|
|
99
80
|
{
|