react-native-gifted-chat 3.3.2 → 3.4.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 +30 -2
- package/lib/Actions.d.ts +16 -0
- package/lib/Actions.d.ts.map +1 -0
- package/lib/Actions.js +64 -0
- package/lib/Actions.js.map +1 -0
- package/lib/Avatar.d.ts +19 -0
- package/lib/Avatar.d.ts.map +1 -0
- package/lib/Avatar.js +93 -0
- package/lib/Avatar.js.map +1 -0
- package/lib/Bubble/index.d.ts +6 -0
- package/lib/Bubble/index.d.ts.map +1 -0
- package/lib/Bubble/index.js +268 -0
- package/lib/Bubble/index.js.map +1 -0
- package/lib/Bubble/styles.d.ts +57 -0
- package/lib/Bubble/styles.d.ts.map +1 -0
- package/lib/Bubble/styles.js +59 -0
- package/lib/Bubble/styles.js.map +1 -0
- package/lib/Bubble/types.d.ts +59 -0
- package/lib/Bubble/types.d.ts.map +1 -0
- package/lib/Bubble/types.js +2 -0
- package/lib/Bubble/types.js.map +1 -0
- package/lib/Color.d.ts +18 -0
- package/lib/Color.d.ts.map +1 -0
- package/lib/Color.js +18 -0
- package/lib/Color.js.map +1 -0
- package/lib/Composer.d.ts +9 -0
- package/lib/Composer.d.ts.map +1 -0
- package/lib/Composer.js +56 -0
- package/lib/Composer.js.map +1 -0
- package/lib/Constant.d.ts +8 -0
- package/lib/Constant.d.ts.map +1 -0
- package/lib/Constant.js +8 -0
- package/lib/Constant.js.map +1 -0
- package/lib/Day/index.d.ts +5 -0
- package/lib/Day/index.d.ts.map +1 -0
- package/lib/Day/index.js +39 -0
- package/lib/Day/index.js.map +1 -0
- package/lib/Day/styles.d.ts +21 -0
- package/lib/Day/styles.d.ts.map +1 -0
- package/lib/Day/styles.js +22 -0
- package/lib/Day/styles.js.map +1 -0
- package/lib/Day/types.d.ts +11 -0
- package/lib/Day/types.d.ts.map +1 -0
- package/lib/Day/types.js +2 -0
- package/lib/Day/types.js.map +1 -0
- package/lib/GiftedAvatar.d.ts +12 -0
- package/lib/GiftedAvatar.d.ts.map +1 -0
- package/lib/GiftedAvatar.js +100 -0
- package/lib/GiftedAvatar.js.map +1 -0
- package/lib/GiftedChat/index.d.ts +10 -0
- package/lib/GiftedChat/index.d.ts.map +1 -0
- package/lib/GiftedChat/index.js +240 -0
- package/lib/GiftedChat/index.js.map +1 -0
- package/lib/GiftedChat/styles.d.ts +13 -0
- package/lib/GiftedChat/styles.d.ts.map +1 -0
- package/lib/GiftedChat/styles.js +13 -0
- package/lib/GiftedChat/styles.js.map +1 -0
- package/lib/GiftedChat/types.d.ts +90 -0
- package/lib/GiftedChat/types.d.ts.map +1 -0
- package/lib/GiftedChat/types.js +2 -0
- package/lib/GiftedChat/types.js.map +1 -0
- package/lib/GiftedChatContext.d.ts +12 -0
- package/lib/GiftedChatContext.d.ts.map +1 -0
- package/lib/GiftedChatContext.js +10 -0
- package/lib/GiftedChatContext.js.map +1 -0
- package/lib/InputToolbar.d.ts +36 -0
- package/lib/InputToolbar.d.ts.map +1 -0
- package/lib/InputToolbar.js +108 -0
- package/lib/InputToolbar.js.map +1 -0
- package/lib/LoadEarlierMessages.d.ts +17 -0
- package/lib/LoadEarlierMessages.d.ts.map +1 -0
- package/lib/LoadEarlierMessages.js +44 -0
- package/lib/LoadEarlierMessages.js.map +1 -0
- package/lib/Message/index.d.ts +6 -0
- package/lib/Message/index.d.ts.map +1 -0
- package/lib/Message/index.js +180 -0
- package/lib/Message/index.js.map +1 -0
- package/lib/Message/styles.d.ts +18 -0
- package/lib/Message/styles.d.ts.map +1 -0
- package/lib/Message/styles.js +18 -0
- package/lib/Message/styles.js.map +1 -0
- package/lib/Message/types.d.ts +25 -0
- package/lib/Message/types.d.ts.map +1 -0
- package/lib/Message/types.js +2 -0
- package/lib/Message/types.js.map +1 -0
- package/lib/MessageAudio.d.ts +3 -0
- package/lib/MessageAudio.d.ts.map +1 -0
- package/lib/MessageAudio.js +24 -0
- package/lib/MessageAudio.js.map +1 -0
- package/lib/MessageImage.d.ts +12 -0
- package/lib/MessageImage.d.ts.map +1 -0
- package/lib/MessageImage.js +164 -0
- package/lib/MessageImage.js.map +1 -0
- package/lib/MessageReply.d.ts +15 -0
- package/lib/MessageReply.d.ts.map +1 -0
- package/lib/MessageReply.js +102 -0
- package/lib/MessageReply.js.map +1 -0
- package/lib/MessageText.d.ts +24 -0
- package/lib/MessageText.d.ts.map +1 -0
- package/lib/MessageText.js +40 -0
- package/lib/MessageText.js.map +1 -0
- package/lib/MessageVideo.d.ts +3 -0
- package/lib/MessageVideo.d.ts.map +1 -0
- package/lib/MessageVideo.js +24 -0
- package/lib/MessageVideo.js.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/index.d.ts +5 -0
- package/lib/MessagesContainer/components/DayAnimated/index.d.ts.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/index.js +92 -0
- package/lib/MessagesContainer/components/DayAnimated/index.js.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/styles.d.ts +12 -0
- package/lib/MessagesContainer/components/DayAnimated/styles.d.ts.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/styles.js +12 -0
- package/lib/MessagesContainer/components/DayAnimated/styles.js.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/types.d.ts +18 -0
- package/lib/MessagesContainer/components/DayAnimated/types.d.ts.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/types.js +2 -0
- package/lib/MessagesContainer/components/DayAnimated/types.js.map +1 -0
- package/lib/MessagesContainer/components/Item/index.d.ts +23 -0
- package/lib/MessagesContainer/components/Item/index.d.ts.map +1 -0
- package/lib/MessagesContainer/components/Item/index.js +120 -0
- package/lib/MessagesContainer/components/Item/index.js.map +1 -0
- package/lib/MessagesContainer/components/Item/types.d.ts +19 -0
- package/lib/MessagesContainer/components/Item/types.d.ts.map +1 -0
- package/lib/MessagesContainer/components/Item/types.js +2 -0
- package/lib/MessagesContainer/components/Item/types.js.map +1 -0
- package/lib/MessagesContainer/index.d.ts +6 -0
- package/lib/MessagesContainer/index.d.ts.map +1 -0
- package/lib/MessagesContainer/index.js +258 -0
- package/lib/MessagesContainer/index.js.map +1 -0
- package/lib/MessagesContainer/styles.d.ts +55 -0
- package/lib/MessagesContainer/styles.d.ts.map +1 -0
- package/lib/MessagesContainer/styles.js +42 -0
- package/lib/MessagesContainer/styles.js.map +1 -0
- package/lib/MessagesContainer/types.d.ts +88 -0
- package/lib/MessagesContainer/types.d.ts.map +1 -0
- package/lib/MessagesContainer/types.js +10 -0
- package/lib/MessagesContainer/types.js.map +1 -0
- package/lib/Models.d.ts +58 -0
- package/lib/Models.d.ts.map +1 -0
- package/lib/Models.js +2 -0
- package/lib/Models.js.map +1 -0
- package/lib/QuickReplies.d.ts +16 -0
- package/lib/QuickReplies.d.ts.map +1 -0
- package/lib/QuickReplies.js +107 -0
- package/lib/QuickReplies.js.map +1 -0
- package/lib/Reply/index.d.ts +2 -0
- package/lib/Reply/index.d.ts.map +1 -0
- package/lib/Reply/index.js +2 -0
- package/lib/Reply/index.js.map +1 -0
- package/lib/Reply/types.d.ts +72 -0
- package/lib/Reply/types.d.ts.map +1 -0
- package/lib/Reply/types.js +2 -0
- package/lib/Reply/types.js.map +1 -0
- package/lib/ReplyPreview.d.ts +14 -0
- package/lib/ReplyPreview.d.ts.map +1 -0
- package/lib/ReplyPreview.js +94 -0
- package/lib/ReplyPreview.js.map +1 -0
- package/lib/Send.d.ts +19 -0
- package/lib/Send.d.ts.map +1 -0
- package/lib/Send.js +56 -0
- package/lib/Send.js.map +1 -0
- package/lib/SystemMessage.d.ts +14 -0
- package/lib/SystemMessage.d.ts.map +1 -0
- package/lib/SystemMessage.js +42 -0
- package/lib/SystemMessage.js.map +1 -0
- package/lib/Time.d.ts +12 -0
- package/lib/Time.d.ts.map +1 -0
- package/lib/Time.js +38 -0
- package/lib/Time.js.map +1 -0
- package/lib/TypingIndicator/index.d.ts +5 -0
- package/lib/TypingIndicator/index.d.ts.map +1 -0
- package/lib/TypingIndicator/index.js +94 -0
- package/lib/TypingIndicator/index.js.map +1 -0
- package/lib/TypingIndicator/styles.d.ts +21 -0
- package/lib/TypingIndicator/styles.d.ts.map +1 -0
- package/lib/TypingIndicator/styles.js +22 -0
- package/lib/TypingIndicator/styles.js.map +1 -0
- package/lib/TypingIndicator/types.d.ts +6 -0
- package/lib/TypingIndicator/types.d.ts.map +1 -0
- package/lib/TypingIndicator/types.js +2 -0
- package/lib/TypingIndicator/types.js.map +1 -0
- package/lib/components/MessageReply.d.ts +29 -0
- package/lib/components/MessageReply.d.ts.map +1 -0
- package/lib/components/MessageReply.js +87 -0
- package/lib/components/MessageReply.js.map +1 -0
- package/lib/components/ReplyPreview.d.ts +17 -0
- package/lib/components/ReplyPreview.d.ts.map +1 -0
- package/lib/components/ReplyPreview.js +148 -0
- package/lib/components/ReplyPreview.js.map +1 -0
- package/lib/components/TouchableOpacity.d.ts +9 -0
- package/lib/components/TouchableOpacity.d.ts.map +1 -0
- package/lib/components/TouchableOpacity.js +47 -0
- package/lib/components/TouchableOpacity.js.map +1 -0
- package/lib/hooks/useColorScheme.d.ts +8 -0
- package/lib/hooks/useColorScheme.d.ts.map +1 -0
- package/lib/hooks/useColorScheme.js +17 -0
- package/lib/hooks/useColorScheme.js.map +1 -0
- package/lib/hooks/useUpdateLayoutEffect.d.ts +9 -0
- package/lib/hooks/useUpdateLayoutEffect.d.ts.map +1 -0
- package/lib/hooks/useUpdateLayoutEffect.js +17 -0
- package/lib/hooks/useUpdateLayoutEffect.js.map +1 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +31 -0
- package/lib/index.js.map +1 -0
- package/lib/linkParser.d.ts +39 -0
- package/lib/linkParser.d.ts.map +1 -0
- package/lib/linkParser.js +154 -0
- package/lib/linkParser.js.map +1 -0
- package/lib/logging.d.ts +3 -0
- package/lib/logging.d.ts.map +1 -0
- package/lib/logging.js +5 -0
- package/lib/logging.js.map +1 -0
- package/lib/styles.d.ts +14 -0
- package/lib/styles.d.ts.map +1 -0
- package/lib/styles.js +23 -0
- package/lib/styles.js.map +1 -0
- package/lib/types.d.ts +19 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts +8 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +105 -0
- package/lib/utils.js.map +1 -0
- package/package.json +43 -41
- package/src/Actions.tsx +0 -110
- package/src/Avatar.tsx +0 -169
- package/src/Bubble/index.tsx +0 -407
- package/src/Bubble/styles.ts +0 -66
- package/src/Bubble/types.ts +0 -104
- package/src/Color.ts +0 -17
- package/src/Composer.tsx +0 -100
- package/src/Constant.ts +0 -8
- package/src/Day/index.tsx +0 -63
- package/src/Day/styles.ts +0 -22
- package/src/Day/types.ts +0 -15
- package/src/GiftedAvatar.tsx +0 -187
- package/src/GiftedChat/index.tsx +0 -397
- package/src/GiftedChat/styles.ts +0 -13
- package/src/GiftedChat/types.ts +0 -156
- package/src/GiftedChatContext.ts +0 -25
- package/src/InputToolbar.tsx +0 -177
- package/src/LoadEarlierMessages.tsx +0 -94
- package/src/Message/index.tsx +0 -273
- package/src/Message/styles.ts +0 -18
- package/src/Message/types.ts +0 -26
- package/src/MessageAudio.tsx +0 -29
- package/src/MessageImage.tsx +0 -251
- package/src/MessageReply.tsx +0 -160
- package/src/MessageText.tsx +0 -111
- package/src/MessageVideo.tsx +0 -29
- package/src/MessagesContainer/components/DayAnimated/index.tsx +0 -151
- package/src/MessagesContainer/components/DayAnimated/styles.ts +0 -12
- package/src/MessagesContainer/components/DayAnimated/types.ts +0 -12
- package/src/MessagesContainer/components/Item/index.tsx +0 -197
- package/src/MessagesContainer/components/Item/types.ts +0 -13
- package/src/MessagesContainer/index.tsx +0 -434
- package/src/MessagesContainer/styles.ts +0 -42
- package/src/MessagesContainer/types.ts +0 -102
- package/src/Models.ts +0 -66
- package/src/QuickReplies.tsx +0 -181
- package/src/Reply/index.ts +0 -1
- package/src/Reply/types.ts +0 -80
- package/src/ReplyPreview.tsx +0 -132
- package/src/Send.tsx +0 -115
- package/src/SystemMessage.tsx +0 -79
- package/src/Time.tsx +0 -64
- package/src/TypingIndicator/index.tsx +0 -155
- package/src/TypingIndicator/styles.ts +0 -22
- package/src/TypingIndicator/types.ts +0 -6
- package/src/__tests__/Actions.test.tsx +0 -9
- package/src/__tests__/Avatar.test.tsx +0 -17
- package/src/__tests__/Bubble.test.tsx +0 -17
- package/src/__tests__/Color.test.tsx +0 -5
- package/src/__tests__/Composer.test.tsx +0 -10
- package/src/__tests__/Constant.test.tsx +0 -5
- package/src/__tests__/Day.test.tsx +0 -20
- package/src/__tests__/DayAnimated.test.tsx +0 -46
- package/src/__tests__/GiftedAvatar.test.tsx +0 -10
- package/src/__tests__/GiftedChat.test.tsx +0 -60
- package/src/__tests__/InputToolbar.test.tsx +0 -10
- package/src/__tests__/LoadEarlier.test.tsx +0 -10
- package/src/__tests__/Message.test.tsx +0 -67
- package/src/__tests__/MessageImage.test.tsx +0 -24
- package/src/__tests__/MessageReply.test.tsx +0 -54
- package/src/__tests__/MessageText.test.tsx +0 -15
- package/src/__tests__/MessagesContainer.test.tsx +0 -38
- package/src/__tests__/ReplyPreview.test.tsx +0 -41
- package/src/__tests__/Send.test.tsx +0 -21
- package/src/__tests__/SystemMessage.test.tsx +0 -24
- package/src/__tests__/Time.test.tsx +0 -26
- package/src/__tests__/__snapshots__/Actions.test.tsx.snap +0 -40
- package/src/__tests__/__snapshots__/Avatar.test.tsx.snap +0 -17
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +0 -121
- package/src/__tests__/__snapshots__/Color.test.tsx.snap +0 -21
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +0 -51
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +0 -13
- package/src/__tests__/__snapshots__/Day.test.tsx.snap +0 -99
- package/src/__tests__/__snapshots__/DayAnimated.test.tsx.snap +0 -5
- package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +0 -24
- package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +0 -184
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +0 -123
- package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +0 -33
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +0 -510
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +0 -203
- package/src/__tests__/__snapshots__/MessageReply.test.tsx.snap +0 -181
- package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +0 -29
- package/src/__tests__/__snapshots__/ReplyPreview.test.tsx.snap +0 -349
- package/src/__tests__/__snapshots__/Send.test.tsx.snap +0 -148
- package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +0 -77
- package/src/__tests__/__snapshots__/Time.test.tsx.snap +0 -22
- package/src/__tests__/data.ts +0 -8
- package/src/__tests__/utils.test.ts +0 -31
- package/src/components/MessageReply.tsx +0 -156
- package/src/components/ReplyPreview.tsx +0 -230
- package/src/components/TouchableOpacity.tsx +0 -67
- package/src/hooks/useColorScheme.ts +0 -18
- package/src/hooks/useUpdateLayoutEffect.ts +0 -21
- package/src/index.ts +0 -29
- package/src/linkParser.tsx +0 -255
- package/src/logging.ts +0 -8
- package/src/styles.ts +0 -25
- package/src/types.ts +0 -25
- package/src/utils.ts +0 -139
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-chat",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "The most complete chat UI for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -23,22 +23,23 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"author": "Farid Safi",
|
|
25
25
|
"type": "module",
|
|
26
|
-
"main": "
|
|
27
|
-
"types": "
|
|
26
|
+
"main": "lib/index.js",
|
|
27
|
+
"types": "lib/index.d.ts",
|
|
28
28
|
"files": [
|
|
29
|
-
"
|
|
29
|
+
"lib"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
+
"typecheck": "yarn tsc --noEmit",
|
|
33
|
+
"build": "rm -rf lib && yarn tsc",
|
|
34
|
+
"tsc:watch": "yarn typecheck --watch",
|
|
32
35
|
"lint": "yarn eslint src example",
|
|
33
36
|
"lint:fix": "yarn eslint --cache --fix src example",
|
|
34
|
-
"prepublishOnly": "yarn lint && yarn test",
|
|
37
|
+
"prepublishOnly": "yarn lint && yarn test && yarn build",
|
|
35
38
|
"start": "cd example && expo start",
|
|
36
39
|
"start:web": "cd example && expo start -w --dev",
|
|
37
40
|
"test": "TZ=Europe/Paris jest --no-watchman",
|
|
38
41
|
"test:coverage": "TZ=Europe/Paris jest --coverage",
|
|
39
42
|
"test:watch": "TZ=Europe/Paris jest --watch",
|
|
40
|
-
"tsc:write": "yarn tsc --project tsconfig.json",
|
|
41
|
-
"tsc:watch": "yarn tsc --watch --noEmit",
|
|
42
43
|
"fresh": "yarn start --reset-cache",
|
|
43
44
|
"prepare": "yarn husky"
|
|
44
45
|
},
|
|
@@ -50,55 +51,56 @@
|
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@expo/react-native-action-sheet": "^4.1.1",
|
|
52
53
|
"@types/lodash.isequal": "^4.5.8",
|
|
53
|
-
"dayjs": "^1.11.
|
|
54
|
+
"dayjs": "^1.11.21",
|
|
54
55
|
"lodash.isequal": "^4.5.0",
|
|
55
|
-
"react-native-zoom-reanimated": "^1.5.
|
|
56
|
+
"react-native-zoom-reanimated": "^1.5.4"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "^7.
|
|
59
|
-
"@babel/plugin-transform-react-jsx": "^7.
|
|
60
|
-
"@babel/plugin-transform-unicode-property-regex": "^7.
|
|
61
|
-
"@babel/preset-env": "^7.
|
|
62
|
-
"@react-native-community/cli": "20.
|
|
63
|
-
"@react-native-community/cli-platform-android": "20.
|
|
64
|
-
"@react-native-community/cli-platform-ios": "20.
|
|
65
|
-
"@react-native/babel-preset": "0.
|
|
66
|
-
"@react-native/eslint-config": "0.
|
|
67
|
-
"@react-native/
|
|
68
|
-
"@react-native/
|
|
69
|
-
"@
|
|
59
|
+
"@babel/core": "^7.29.7",
|
|
60
|
+
"@babel/plugin-transform-react-jsx": "^7.29.7",
|
|
61
|
+
"@babel/plugin-transform-unicode-property-regex": "^7.29.7",
|
|
62
|
+
"@babel/preset-env": "^7.29.7",
|
|
63
|
+
"@react-native-community/cli": "20.1.3",
|
|
64
|
+
"@react-native-community/cli-platform-android": "20.1.3",
|
|
65
|
+
"@react-native-community/cli-platform-ios": "20.1.3",
|
|
66
|
+
"@react-native/babel-preset": "0.85.3",
|
|
67
|
+
"@react-native/eslint-config": "0.85.3",
|
|
68
|
+
"@react-native/jest-preset": "0.85.3",
|
|
69
|
+
"@react-native/metro-config": "0.85.3",
|
|
70
|
+
"@react-native/typescript-config": "0.85.3",
|
|
71
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
70
72
|
"@testing-library/dom": "^10.4.1",
|
|
71
73
|
"@testing-library/react": "^16.3.0",
|
|
72
74
|
"@testing-library/react-native": "^13.3.3",
|
|
73
|
-
"@types/jest": "^29.5.
|
|
74
|
-
"@types/react": "^19.2.
|
|
75
|
+
"@types/jest": "^29.5.14",
|
|
76
|
+
"@types/react": "^19.2.17",
|
|
75
77
|
"@types/react-dom": "^19.2.3",
|
|
76
|
-
"@types/react-native": "^0.
|
|
78
|
+
"@types/react-native": "^0.73.0",
|
|
77
79
|
"@types/react-test-renderer": "^19.1.0",
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
79
|
-
"@typescript-eslint/parser": "^8.
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
81
|
+
"@typescript-eslint/parser": "^8.61.1",
|
|
80
82
|
"babel-jest": "^29.7.0",
|
|
81
|
-
"eslint": "^9.
|
|
82
|
-
"eslint-import-resolver-typescript": "^4.4.
|
|
83
|
+
"eslint": "^9.39.4",
|
|
84
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
83
85
|
"eslint-plugin-import": "^2.32.0",
|
|
84
86
|
"eslint-plugin-jest": "^28.11.0",
|
|
85
|
-
"eslint-plugin-perfectionist": "^
|
|
87
|
+
"eslint-plugin-perfectionist": "^5.9.1",
|
|
86
88
|
"eslint-plugin-react": "^7.37.5",
|
|
87
|
-
"eslint-plugin-react-hooks": "^
|
|
89
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
88
90
|
"husky": "^9.1.7",
|
|
89
91
|
"jest": "^29.7.0",
|
|
90
92
|
"json": "^11.0.0",
|
|
91
|
-
"lint-staged": "^
|
|
92
|
-
"react": "19.
|
|
93
|
-
"react-dom": "19.
|
|
94
|
-
"react-native": "0.
|
|
95
|
-
"react-native-gesture-handler": "~2.
|
|
96
|
-
"react-native-keyboard-controller": "1.
|
|
97
|
-
"react-native-reanimated": "
|
|
98
|
-
"react-native-safe-area-context": "
|
|
99
|
-
"react-native-worklets": "0.
|
|
100
|
-
"react-test-renderer": "19.
|
|
101
|
-
"typescript": "^
|
|
93
|
+
"lint-staged": "^17.0.7",
|
|
94
|
+
"react": "19.2.3",
|
|
95
|
+
"react-dom": "19.2.3",
|
|
96
|
+
"react-native": "0.85.3",
|
|
97
|
+
"react-native-gesture-handler": "~2.31.1",
|
|
98
|
+
"react-native-keyboard-controller": "^1.21.11",
|
|
99
|
+
"react-native-reanimated": "^4.4.1",
|
|
100
|
+
"react-native-safe-area-context": "^5.8.0",
|
|
101
|
+
"react-native-worklets": "^0.9.2",
|
|
102
|
+
"react-test-renderer": "19.2.3",
|
|
103
|
+
"typescript": "^6.0.3"
|
|
102
104
|
},
|
|
103
105
|
"peerDependencies": {
|
|
104
106
|
"react": ">=18.0.0",
|
package/src/Actions.tsx
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useCallback } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
View,
|
|
5
|
-
StyleProp,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
TextStyle,
|
|
8
|
-
} from 'react-native'
|
|
9
|
-
import { Text } from 'react-native-gesture-handler'
|
|
10
|
-
import { Color } from './Color'
|
|
11
|
-
import { TouchableOpacity } from './components/TouchableOpacity'
|
|
12
|
-
|
|
13
|
-
import { useChatContext } from './GiftedChatContext'
|
|
14
|
-
import stylesCommon from './styles'
|
|
15
|
-
|
|
16
|
-
export interface ActionsProps {
|
|
17
|
-
actions?: Array<{ title: string, action: () => void }>
|
|
18
|
-
actionSheetOptionTintColor?: string
|
|
19
|
-
icon?: () => ReactNode
|
|
20
|
-
wrapperStyle?: StyleProp<ViewStyle>
|
|
21
|
-
iconTextStyle?: StyleProp<TextStyle>
|
|
22
|
-
buttonStyle?: StyleProp<ViewStyle>
|
|
23
|
-
onPressActionButton?(): void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function Actions ({
|
|
27
|
-
actions,
|
|
28
|
-
actionSheetOptionTintColor = Color.optionTintColor,
|
|
29
|
-
icon,
|
|
30
|
-
wrapperStyle,
|
|
31
|
-
iconTextStyle,
|
|
32
|
-
onPressActionButton,
|
|
33
|
-
buttonStyle,
|
|
34
|
-
}: ActionsProps) {
|
|
35
|
-
const { actionSheet } = useChatContext()
|
|
36
|
-
|
|
37
|
-
const handlePress = useCallback(() => {
|
|
38
|
-
if (onPressActionButton) {
|
|
39
|
-
onPressActionButton()
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!actions?.length)
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
const titles = actions.map(item => item.title)
|
|
47
|
-
|
|
48
|
-
actionSheet().showActionSheetWithOptions(
|
|
49
|
-
{
|
|
50
|
-
options: titles,
|
|
51
|
-
cancelButtonIndex: titles.length - 1,
|
|
52
|
-
tintColor: actionSheetOptionTintColor,
|
|
53
|
-
},
|
|
54
|
-
(buttonIndex?: number) => {
|
|
55
|
-
if (buttonIndex === undefined)
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
const item = actions[buttonIndex]
|
|
59
|
-
item.action?.()
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}, [actionSheet, actions, actionSheetOptionTintColor, onPressActionButton])
|
|
63
|
-
|
|
64
|
-
const renderIcon = useCallback(() => {
|
|
65
|
-
if (icon)
|
|
66
|
-
return icon()
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<View style={[stylesCommon.centerItems, styles.wrapper, wrapperStyle]}>
|
|
70
|
-
<Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
|
|
71
|
-
</View>
|
|
72
|
-
)
|
|
73
|
-
}, [icon, iconTextStyle, wrapperStyle])
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<View style={styles.container}>
|
|
77
|
-
<TouchableOpacity
|
|
78
|
-
onPress={handlePress}
|
|
79
|
-
style={[styles.button, buttonStyle]}
|
|
80
|
-
>
|
|
81
|
-
{renderIcon()}
|
|
82
|
-
</TouchableOpacity>
|
|
83
|
-
</View>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const styles = StyleSheet.create({
|
|
88
|
-
container: {
|
|
89
|
-
alignItems: 'flex-end',
|
|
90
|
-
},
|
|
91
|
-
button: {
|
|
92
|
-
paddingLeft: 10,
|
|
93
|
-
paddingRight: 4,
|
|
94
|
-
paddingVertical: 7,
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
wrapper: {
|
|
98
|
-
borderColor: Color.defaultColor,
|
|
99
|
-
borderWidth: 2,
|
|
100
|
-
width: 26,
|
|
101
|
-
height: 26,
|
|
102
|
-
borderRadius: 13,
|
|
103
|
-
},
|
|
104
|
-
iconText: {
|
|
105
|
-
color: Color.defaultColor,
|
|
106
|
-
fontWeight: 'bold',
|
|
107
|
-
fontSize: 16,
|
|
108
|
-
lineHeight: 16,
|
|
109
|
-
},
|
|
110
|
-
})
|
package/src/Avatar.tsx
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useCallback } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
ImageStyle,
|
|
4
|
-
StyleSheet,
|
|
5
|
-
TextStyle,
|
|
6
|
-
View,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
} from 'react-native'
|
|
9
|
-
import { GiftedAvatar } from './GiftedAvatar'
|
|
10
|
-
import { IMessage, LeftRightStyle, User } from './Models'
|
|
11
|
-
import { isSameUser, isSameDay } from './utils'
|
|
12
|
-
|
|
13
|
-
interface Styles {
|
|
14
|
-
left: {
|
|
15
|
-
container: ViewStyle
|
|
16
|
-
onTop: ViewStyle
|
|
17
|
-
image: ImageStyle
|
|
18
|
-
}
|
|
19
|
-
right: {
|
|
20
|
-
container: ViewStyle
|
|
21
|
-
onTop: ViewStyle
|
|
22
|
-
image: ImageStyle
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const styles: Styles = {
|
|
27
|
-
left: StyleSheet.create({
|
|
28
|
-
container: {
|
|
29
|
-
marginRight: 8,
|
|
30
|
-
},
|
|
31
|
-
onTop: {
|
|
32
|
-
alignSelf: 'flex-start',
|
|
33
|
-
},
|
|
34
|
-
image: {
|
|
35
|
-
height: 36,
|
|
36
|
-
width: 36,
|
|
37
|
-
borderRadius: 18,
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
right: StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
marginLeft: 8,
|
|
43
|
-
},
|
|
44
|
-
onTop: {
|
|
45
|
-
alignSelf: 'flex-start',
|
|
46
|
-
},
|
|
47
|
-
image: {
|
|
48
|
-
height: 36,
|
|
49
|
-
width: 36,
|
|
50
|
-
borderRadius: 18,
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface AvatarProps<TMessage extends IMessage> {
|
|
56
|
-
currentMessage: TMessage
|
|
57
|
-
previousMessage?: TMessage
|
|
58
|
-
nextMessage?: TMessage
|
|
59
|
-
position: 'left' | 'right'
|
|
60
|
-
isAvatarOnTop?: boolean
|
|
61
|
-
isAvatarVisibleForEveryMessage?: boolean
|
|
62
|
-
imageStyle?: LeftRightStyle<ImageStyle>
|
|
63
|
-
containerStyle?: LeftRightStyle<ViewStyle>
|
|
64
|
-
textStyle?: TextStyle
|
|
65
|
-
renderAvatar?(props: Omit<AvatarProps<TMessage>, 'renderAvatar'>): ReactNode
|
|
66
|
-
onPressAvatar?: (user: User) => void
|
|
67
|
-
onLongPressAvatar?: (user: User) => void
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function Avatar<TMessage extends IMessage = IMessage> (
|
|
71
|
-
props: AvatarProps<TMessage>
|
|
72
|
-
) {
|
|
73
|
-
const {
|
|
74
|
-
isAvatarOnTop,
|
|
75
|
-
isAvatarVisibleForEveryMessage,
|
|
76
|
-
containerStyle,
|
|
77
|
-
position,
|
|
78
|
-
currentMessage,
|
|
79
|
-
renderAvatar,
|
|
80
|
-
previousMessage,
|
|
81
|
-
nextMessage,
|
|
82
|
-
imageStyle,
|
|
83
|
-
onPressAvatar,
|
|
84
|
-
onLongPressAvatar,
|
|
85
|
-
} = props
|
|
86
|
-
|
|
87
|
-
const messageToCompare = isAvatarOnTop ? previousMessage : nextMessage
|
|
88
|
-
|
|
89
|
-
const renderAvatarComponent = useCallback(() => {
|
|
90
|
-
if (renderAvatar)
|
|
91
|
-
return renderAvatar({
|
|
92
|
-
isAvatarOnTop,
|
|
93
|
-
isAvatarVisibleForEveryMessage,
|
|
94
|
-
containerStyle,
|
|
95
|
-
position,
|
|
96
|
-
currentMessage,
|
|
97
|
-
previousMessage,
|
|
98
|
-
nextMessage,
|
|
99
|
-
imageStyle,
|
|
100
|
-
onPressAvatar,
|
|
101
|
-
onLongPressAvatar,
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
if (currentMessage)
|
|
105
|
-
return (
|
|
106
|
-
<GiftedAvatar
|
|
107
|
-
avatarStyle={[
|
|
108
|
-
styles[position].image,
|
|
109
|
-
imageStyle?.[position],
|
|
110
|
-
]}
|
|
111
|
-
user={currentMessage.user}
|
|
112
|
-
onPress={() => onPressAvatar?.(currentMessage.user)}
|
|
113
|
-
onLongPress={() => onLongPressAvatar?.(currentMessage.user)}
|
|
114
|
-
/>
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
return null
|
|
118
|
-
}, [
|
|
119
|
-
renderAvatar,
|
|
120
|
-
isAvatarOnTop,
|
|
121
|
-
isAvatarVisibleForEveryMessage,
|
|
122
|
-
containerStyle,
|
|
123
|
-
position,
|
|
124
|
-
currentMessage,
|
|
125
|
-
previousMessage,
|
|
126
|
-
nextMessage,
|
|
127
|
-
imageStyle,
|
|
128
|
-
onPressAvatar,
|
|
129
|
-
onLongPressAvatar,
|
|
130
|
-
])
|
|
131
|
-
|
|
132
|
-
if (renderAvatar === null)
|
|
133
|
-
return null
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
!isAvatarVisibleForEveryMessage &&
|
|
137
|
-
currentMessage &&
|
|
138
|
-
messageToCompare &&
|
|
139
|
-
isSameUser(currentMessage, messageToCompare) &&
|
|
140
|
-
isSameDay(currentMessage, messageToCompare)
|
|
141
|
-
)
|
|
142
|
-
return (
|
|
143
|
-
<View
|
|
144
|
-
style={[
|
|
145
|
-
styles[position].container,
|
|
146
|
-
containerStyle?.[position],
|
|
147
|
-
]}
|
|
148
|
-
>
|
|
149
|
-
<GiftedAvatar
|
|
150
|
-
avatarStyle={[
|
|
151
|
-
styles[position].image,
|
|
152
|
-
imageStyle?.[position],
|
|
153
|
-
]}
|
|
154
|
-
/>
|
|
155
|
-
</View>
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<View
|
|
160
|
-
style={[
|
|
161
|
-
styles[position].container,
|
|
162
|
-
isAvatarOnTop && styles[position].onTop,
|
|
163
|
-
containerStyle?.[position],
|
|
164
|
-
]}
|
|
165
|
-
>
|
|
166
|
-
{renderAvatarComponent()}
|
|
167
|
-
</View>
|
|
168
|
-
)
|
|
169
|
-
}
|