@tencentcloud/chat-uikit-react 0.0.1 → 0.0.3
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/CHANGELOG.md +18 -0
- package/README.md +5 -3
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/Icon/images/create.png.js +1 -1
- package/dist/cjs/components/TUIMessage/utils/emojiMap.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +34 -17
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/Icon/images/create.png.js +1 -1
- package/dist/esm/components/TUIMessage/utils/emojiMap.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +34 -17
- package/package.json +6 -2
- package/rollup.config.js +1 -1
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +5 -0
- package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +1 -0
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +3 -0
- package/src/components/ConversationCreate/styles/index.scss +5 -0
- package/src/components/ConversationPreview/styles/index.scss +4 -3
- package/src/components/ConversationPreview/utils.tsx +2 -1
- package/src/components/ConversationSearch/styles/index.scss +1 -0
- package/src/components/Icon/images/create.png +0 -0
- package/src/components/Profile/styles/index.scss +2 -0
- package/src/components/TUIChatHeader/styles/layout.scss +1 -1
- package/src/components/TUIConversationList/index.scss +1 -0
- package/src/components/TUIManage/styles/index.scss +4 -0
- package/src/components/TUIMessage/styles/layout.scss +9 -4
- package/src/components/TUIMessage/utils/emojiMap.ts +181 -0
- package/src/components/TUIMessageInput/EmojiPicker.tsx +2 -1
- package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +2 -1
- package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -1
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +3 -2
- package/src/components/TUIMessageInput/styles/layout.scss +10 -8
- package/src/components/TUIMessageList/styles/layout.scss +1 -1
- package/src/components/TUIProfile/styles/layout.scss +3 -0
- package/dist/cjs/_virtual/DateInput.js +0 -1
- package/dist/cjs/_virtual/DatePicker.js +0 -1
- package/dist/cjs/_virtual/DayInput.js +0 -1
- package/dist/cjs/_virtual/Divider.js +0 -1
- package/dist/cjs/_virtual/Fit.js +0 -1
- package/dist/cjs/_virtual/Input.js +0 -1
- package/dist/cjs/_virtual/MonthInput.js +0 -1
- package/dist/cjs/_virtual/MonthSelect.js +0 -1
- package/dist/cjs/_virtual/NativeInput.js +0 -1
- package/dist/cjs/_virtual/YearInput.js +0 -1
- package/dist/cjs/_virtual/_commonjsHelpers.js +0 -1
- package/dist/cjs/_virtual/clsx.m.js +0 -1
- package/dist/cjs/_virtual/dateFormatter.js +0 -1
- package/dist/cjs/_virtual/dates.js +0 -1
- package/dist/cjs/_virtual/entry.js +0 -1
- package/dist/cjs/_virtual/index.js +0 -1
- package/dist/cjs/_virtual/index10.js +0 -1
- package/dist/cjs/_virtual/index2.js +0 -1
- package/dist/cjs/_virtual/index3.js +0 -1
- package/dist/cjs/_virtual/index4.js +0 -1
- package/dist/cjs/_virtual/index5.js +0 -1
- package/dist/cjs/_virtual/index6.js +0 -1
- package/dist/cjs/_virtual/index7.js +0 -1
- package/dist/cjs/_virtual/index8.js +0 -1
- package/dist/cjs/_virtual/index9.js +0 -1
- package/dist/cjs/_virtual/propTypes.js +0 -1
- package/dist/cjs/_virtual/react-dom.development.js +0 -1
- package/dist/cjs/_virtual/react-dom.production.min.js +0 -1
- package/dist/cjs/_virtual/react-is.development.js +0 -1
- package/dist/cjs/_virtual/react-is.production.min.js +0 -1
- package/dist/cjs/_virtual/scheduler.development.js +0 -1
- package/dist/cjs/_virtual/scheduler.production.min.js +0 -1
- package/dist/cjs/_virtual/tiny-warning.esm.js +0 -1
- package/dist/cjs/_virtual/utils.js +0 -1
- package/dist/esm/_virtual/DateInput.js +0 -1
- package/dist/esm/_virtual/DatePicker.js +0 -1
- package/dist/esm/_virtual/DayInput.js +0 -1
- package/dist/esm/_virtual/Divider.js +0 -1
- package/dist/esm/_virtual/Fit.js +0 -1
- package/dist/esm/_virtual/Input.js +0 -1
- package/dist/esm/_virtual/MonthInput.js +0 -1
- package/dist/esm/_virtual/MonthSelect.js +0 -1
- package/dist/esm/_virtual/NativeInput.js +0 -1
- package/dist/esm/_virtual/YearInput.js +0 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +0 -1
- package/dist/esm/_virtual/clsx.m.js +0 -1
- package/dist/esm/_virtual/dateFormatter.js +0 -1
- package/dist/esm/_virtual/dates.js +0 -1
- package/dist/esm/_virtual/entry.js +0 -1
- package/dist/esm/_virtual/index.js +0 -1
- package/dist/esm/_virtual/index10.js +0 -1
- package/dist/esm/_virtual/index2.js +0 -1
- package/dist/esm/_virtual/index3.js +0 -1
- package/dist/esm/_virtual/index4.js +0 -1
- package/dist/esm/_virtual/index5.js +0 -1
- package/dist/esm/_virtual/index6.js +0 -1
- package/dist/esm/_virtual/index7.js +0 -1
- package/dist/esm/_virtual/index8.js +0 -1
- package/dist/esm/_virtual/index9.js +0 -1
- package/dist/esm/_virtual/propTypes.js +0 -1
- package/dist/esm/_virtual/react-dom.development.js +0 -1
- package/dist/esm/_virtual/react-dom.production.min.js +0 -1
- package/dist/esm/_virtual/react-is.development.js +0 -1
- package/dist/esm/_virtual/react-is.production.min.js +0 -1
- package/dist/esm/_virtual/scheduler.development.js +0 -1
- package/dist/esm/_virtual/scheduler.production.min.js +0 -1
- package/dist/esm/_virtual/tiny-warning.esm.js +0 -1
- package/dist/esm/_virtual/utils.js +0 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
.input-group-text {
|
|
6
6
|
font-weight: 400;
|
|
7
7
|
font-size: 16px;
|
|
8
|
+
font-family: PingFangSC-Medium;
|
|
8
9
|
line-height: 22px;
|
|
9
10
|
color: #000000;
|
|
10
11
|
}
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
.input-group-name {
|
|
13
14
|
font-weight: 700;
|
|
14
15
|
font-size: 16px;
|
|
16
|
+
font-family: PingFangSC-Medium;
|
|
15
17
|
line-height: 19px;
|
|
16
18
|
color: #000000;
|
|
17
19
|
}
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
.create-group-illustrate {
|
|
24
26
|
font-weight: 400;
|
|
25
27
|
font-size: 12px;
|
|
28
|
+
font-family: PingFangSC-Medium;
|
|
26
29
|
line-height: 17px;
|
|
27
30
|
text-align: justify;
|
|
28
31
|
color: rgba(0, 0, 0, 0.4);
|
|
@@ -32,6 +35,7 @@
|
|
|
32
35
|
.create-group-portrait-title {
|
|
33
36
|
font-weight: 600;
|
|
34
37
|
font-size: 14px;
|
|
38
|
+
font-family: PingFangSC-Medium;
|
|
35
39
|
line-height: 20px;
|
|
36
40
|
color: #000000;
|
|
37
41
|
padding: 20px 0 20px 8px;
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
box-sizing: border-box;
|
|
51
55
|
&-nick {
|
|
52
56
|
font-size: 12px;
|
|
57
|
+
font-family: PingFangSC-Medium;
|
|
53
58
|
margin-top: 6px;
|
|
54
59
|
}
|
|
55
60
|
}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
.group-type-info-title {
|
|
24
24
|
font-size: 16px;
|
|
25
|
+
font-family: PingFangSC-Medium;
|
|
25
26
|
line-height: 22px;
|
|
26
27
|
color: rgba(0, 0, 0, 0.8);
|
|
27
28
|
display: flex;
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
|
|
34
35
|
.group-type-info-description {
|
|
35
36
|
font-size: 12px;
|
|
37
|
+
font-family: PingFangSC-Medium;
|
|
36
38
|
line-height: 17px;
|
|
37
39
|
text-align: justify;
|
|
38
40
|
color: rgba(0, 0, 0, 0.4);
|
|
@@ -41,6 +43,7 @@
|
|
|
41
43
|
|
|
42
44
|
.group-type-info-document {
|
|
43
45
|
font-size: 16px;
|
|
46
|
+
font-family: PingFangSC-Medium;
|
|
44
47
|
line-height: 22px;
|
|
45
48
|
text-align: justify;
|
|
46
49
|
text-decoration: none;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
margin-left: 10px;
|
|
10
10
|
font-weight: 600;
|
|
11
11
|
font-size: 20px;
|
|
12
|
+
font-family: PingFangSC-Medium;
|
|
12
13
|
line-height: 32px;
|
|
13
14
|
letter-spacing: -0.41px;
|
|
14
15
|
color: #000000;
|
|
@@ -30,11 +31,13 @@
|
|
|
30
31
|
margin-left: 10px;
|
|
31
32
|
font-weight: 400;
|
|
32
33
|
font-size: 14px;
|
|
34
|
+
font-family: PingFangSC-Medium;
|
|
33
35
|
line-height: 20px;
|
|
34
36
|
color: #000000;
|
|
35
37
|
&.active {
|
|
36
38
|
font-weight: 600;
|
|
37
39
|
font-size: 14px;
|
|
40
|
+
font-family: PingFangSC-Medium;
|
|
38
41
|
line-height: 20px;
|
|
39
42
|
color: rgba(3, 101, 249, 1);
|
|
40
43
|
}
|
|
@@ -60,6 +63,7 @@
|
|
|
60
63
|
background-color: rgba(3, 101, 249, 1);
|
|
61
64
|
border-radius: 31px;
|
|
62
65
|
font-size: 14px;
|
|
66
|
+
font-family: PingFangSC-Medium;
|
|
63
67
|
line-height: 20px;
|
|
64
68
|
color: #FFFFFF;
|
|
65
69
|
padding: 12px 36px;
|
|
@@ -78,6 +82,7 @@
|
|
|
78
82
|
.title {
|
|
79
83
|
font-weight: 600;
|
|
80
84
|
font-size: 14px;
|
|
85
|
+
font-family: PingFangSC-Medium;
|
|
81
86
|
line-height: 20px;
|
|
82
87
|
padding: 10px;
|
|
83
88
|
}
|
|
@@ -27,7 +27,7 @@ $font-color: #7A7A7A;
|
|
|
27
27
|
font-weight: 700;
|
|
28
28
|
font-size: 14px;
|
|
29
29
|
line-height: 17px;
|
|
30
|
-
font-family:
|
|
30
|
+
font-family: PingFangSC-Medium;
|
|
31
31
|
padding: 1px 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@ $font-color: #7A7A7A;
|
|
|
36
36
|
text-overflow: ellipsis;
|
|
37
37
|
white-space: nowrap;
|
|
38
38
|
color: $font-color;
|
|
39
|
-
font-family:
|
|
39
|
+
font-family: PingFangSC-Medium;
|
|
40
40
|
font-style: normal;
|
|
41
41
|
font-weight: 400;
|
|
42
42
|
font-size: 12px;
|
|
@@ -59,7 +59,7 @@ $font-color: #7A7A7A;
|
|
|
59
59
|
|
|
60
60
|
.time {
|
|
61
61
|
color: $font-color;
|
|
62
|
-
font-family:
|
|
62
|
+
font-family: PingFangSC-Medium;
|
|
63
63
|
font-style: normal;
|
|
64
64
|
font-weight: 400;
|
|
65
65
|
font-size: 12px;
|
|
@@ -89,6 +89,7 @@ $font-color: #7A7A7A;
|
|
|
89
89
|
|
|
90
90
|
.more-handle-item {
|
|
91
91
|
font-size: 16px;
|
|
92
|
+
font-family: PingFangSC-Medium;
|
|
92
93
|
line-height: 19px;
|
|
93
94
|
padding: 6px 16px;
|
|
94
95
|
cursor: pointer;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import TIM, { Conversation, Group, Profile } from 'tim-js-sdk';
|
|
6
6
|
import { defaultGroupAvatarWork, defaultUserAvatar } from '../Avatar';
|
|
7
|
+
import { formatEmojiString } from '../TUIMessage/utils/emojiMap';
|
|
7
8
|
|
|
8
9
|
export const getDisplayTitle = (
|
|
9
10
|
conversation: Conversation,
|
|
@@ -79,7 +80,7 @@ export const getDisplayMessage = (conversation:Conversation, myProfile:Profile)
|
|
|
79
80
|
}}
|
|
80
81
|
>
|
|
81
82
|
<span>{from}</span>
|
|
82
|
-
<span>{lastMessage.isRevoked ? 'recalled a message' : lastMessage.messageForShow}</span>
|
|
83
|
+
<span>{lastMessage.isRevoked ? 'recalled a message' : formatEmojiString(lastMessage.messageForShow, 1)}</span>
|
|
83
84
|
</div>
|
|
84
85
|
);
|
|
85
86
|
};
|
|
Binary file
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.profile {
|
|
2
|
+
font-family: PingFangSC-Medium;
|
|
2
3
|
background: #F9FAFB;
|
|
3
4
|
display: flex;
|
|
4
5
|
flex-direction: row;
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
display: flex;
|
|
10
11
|
align-items: center;
|
|
11
12
|
.profile-name {
|
|
13
|
+
font-family: PingFangSC-Medium;
|
|
12
14
|
font-weight: 600;
|
|
13
15
|
margin-left: 10px;
|
|
14
16
|
font-size: 14px;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
margin-left: 10px;
|
|
17
17
|
font-weight: 700;
|
|
18
18
|
font-size: 14px;
|
|
19
|
+
font-family: PingFangSC-Medium;
|
|
19
20
|
line-height: 17px;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -32,12 +33,14 @@
|
|
|
32
33
|
text-align: center;
|
|
33
34
|
font-weight: 700;
|
|
34
35
|
font-size: 24px;
|
|
36
|
+
font-family: PingFangSC-Medium;
|
|
35
37
|
line-height: 29px;
|
|
36
38
|
margin-bottom: 10px;
|
|
37
39
|
}
|
|
38
40
|
.info-id {
|
|
39
41
|
font-weight: 400;
|
|
40
42
|
font-size: 12px;
|
|
43
|
+
font-family: PingFangSC-Medium;
|
|
41
44
|
line-height: 14px;
|
|
42
45
|
color: #666666;
|
|
43
46
|
margin-bottom: 30px;
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
box-sizing: border-box;
|
|
59
62
|
.manage-handle-title {
|
|
60
63
|
font-size: 16px;
|
|
64
|
+
font-family: PingFangSC-Medium;
|
|
61
65
|
line-height: 22px;
|
|
62
66
|
color: rgba(0, 0, 0, 0.6);
|
|
63
67
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
font-family: SF Pro Text;
|
|
6
6
|
font-size: 14px;
|
|
7
|
+
font-family: PingFangSC-Medium;
|
|
7
8
|
font-style: normal;
|
|
8
9
|
font-weight: 500;
|
|
9
10
|
line-height: 17px;
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
font-weight: 400;
|
|
67
68
|
padding: 5px 0 0 10px;
|
|
68
69
|
font-size: 12px;
|
|
70
|
+
font-family: PingFangSC-Medium;
|
|
69
71
|
line-height: 14px;
|
|
70
72
|
text-align: right;
|
|
71
73
|
color: #7A7A7A;
|
|
@@ -89,7 +91,7 @@
|
|
|
89
91
|
&-content {
|
|
90
92
|
display: inline;
|
|
91
93
|
word-break: break-word;
|
|
92
|
-
font-family:
|
|
94
|
+
font-family: PingFangSC-Regular;
|
|
93
95
|
font-style: normal;
|
|
94
96
|
font-weight: 500;
|
|
95
97
|
font-size: 14px;
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
|
|
105
107
|
.message-text,
|
|
106
108
|
.message-tip {
|
|
107
|
-
font-family:
|
|
109
|
+
font-family: PingFangSC-Regular;
|
|
108
110
|
font-style: normal;
|
|
109
111
|
font-weight: 500;
|
|
110
112
|
font-size: 14px;
|
|
@@ -181,6 +183,7 @@
|
|
|
181
183
|
padding-top: 10px;
|
|
182
184
|
font-weight: 400;
|
|
183
185
|
font-size: 12px;
|
|
186
|
+
font-family: PingFangSC-Medium;
|
|
184
187
|
line-height: 14px;
|
|
185
188
|
color: #7A7A7A;
|
|
186
189
|
}
|
|
@@ -236,7 +239,7 @@
|
|
|
236
239
|
left: 0;
|
|
237
240
|
}
|
|
238
241
|
.title {
|
|
239
|
-
font-family:
|
|
242
|
+
font-family: PingFangSC-Medium;
|
|
240
243
|
font-style: normal;
|
|
241
244
|
font-weight: 500;
|
|
242
245
|
font-size: 14px;
|
|
@@ -278,6 +281,7 @@
|
|
|
278
281
|
content: "!";
|
|
279
282
|
color: #FFFFFF;
|
|
280
283
|
font-size: 12px;
|
|
284
|
+
font-family: PingFangSC-Medium;
|
|
281
285
|
}
|
|
282
286
|
}
|
|
283
287
|
|
|
@@ -359,6 +363,7 @@
|
|
|
359
363
|
align-items: center;
|
|
360
364
|
font-weight: 500;
|
|
361
365
|
font-size: 12.8px;
|
|
366
|
+
font-family: PingFangSC-Medium;
|
|
362
367
|
line-height: 15px;
|
|
363
368
|
&:hover {
|
|
364
369
|
background: rgba(0,110,255,.1);
|
|
@@ -376,7 +381,7 @@
|
|
|
376
381
|
a {
|
|
377
382
|
color: #679ce1;
|
|
378
383
|
text-decoration: none;
|
|
379
|
-
font-family:
|
|
384
|
+
font-family: PingFangSC-Regular;
|
|
380
385
|
font-style: normal;
|
|
381
386
|
font-weight: 500;
|
|
382
387
|
font-size: 14px;
|
|
@@ -150,6 +150,150 @@ export const emojiMap:IEmojiMap = {
|
|
|
150
150
|
'[鼓掌]': 'emoji_140@2x.png',
|
|
151
151
|
'[龇牙]': 'emoji_141@2x.png',
|
|
152
152
|
};
|
|
153
|
+
export const emojiEnKey:IEmojiMap = {
|
|
154
|
+
'[NO]': '[no]',
|
|
155
|
+
'[OK]': '[ok]',
|
|
156
|
+
'[下雨]': '[rain]',
|
|
157
|
+
'[么么哒]': '[muah]',
|
|
158
|
+
'[乒乓]': '[ping pong]',
|
|
159
|
+
'[便便]': '[poo]',
|
|
160
|
+
'[信封]': '[mail]',
|
|
161
|
+
'[偷笑]': '[snicker]',
|
|
162
|
+
'[傲慢]': '[arrogant]',
|
|
163
|
+
'[再见]': '[bye]',
|
|
164
|
+
'[冷汗]': '[sweat]',
|
|
165
|
+
'[凋谢]': '[wither]',
|
|
166
|
+
'[刀]': '[knife]',
|
|
167
|
+
'[删除]': '[delete]',
|
|
168
|
+
'[勾引]': '[hook]',
|
|
169
|
+
'[发呆]': '[daze]',
|
|
170
|
+
'[发抖]': '[shaking]',
|
|
171
|
+
'[可怜]': '[pitiful]',
|
|
172
|
+
'[可爱]': '[cute]',
|
|
173
|
+
'[右哼哼]': '[right hum]',
|
|
174
|
+
'[右太极]': '[right Tai Chi]',
|
|
175
|
+
'[右车头]': '[right head]',
|
|
176
|
+
'[吐]': '[vomit]',
|
|
177
|
+
'[吓]': '[scare]',
|
|
178
|
+
'[咒骂]': '[curse]',
|
|
179
|
+
'[咖啡]': '[cafe]',
|
|
180
|
+
'[啤酒]': '[beer]',
|
|
181
|
+
'[嘘]': '[hiss]',
|
|
182
|
+
'[回头]': '[look back]',
|
|
183
|
+
'[困]': '[sleepy]',
|
|
184
|
+
'[坏笑]': '[bad laugh]',
|
|
185
|
+
'[多云]': '[cloud]',
|
|
186
|
+
'[大兵]': '[soldiers]',
|
|
187
|
+
'[大哭]': '[cry]',
|
|
188
|
+
'[太阳]': '[sun]',
|
|
189
|
+
'[奋斗]': '[struggle]',
|
|
190
|
+
'[奶瓶]': '[feeding bottle]',
|
|
191
|
+
'[委屈]': '[wronged]',
|
|
192
|
+
'[害羞]': '[shy]',
|
|
193
|
+
'[尴尬]': '[awkward]',
|
|
194
|
+
'[左哼哼]': '[left hem]',
|
|
195
|
+
'[左太极]': '[left Tai Chi]',
|
|
196
|
+
'[左车头]': '[left head]',
|
|
197
|
+
'[差劲]': '[poor]',
|
|
198
|
+
'[弱]': '[weak]',
|
|
199
|
+
'[强]': '[stong]',
|
|
200
|
+
'[彩带]': '[ribbon]',
|
|
201
|
+
'[彩球]': '[ball]',
|
|
202
|
+
'[得意]': '[proud]',
|
|
203
|
+
'[微笑]': '[smile]',
|
|
204
|
+
'[心碎了]': '[heartbroken]',
|
|
205
|
+
'[快哭了]': '[almost cry]',
|
|
206
|
+
'[怄火]': '[ire]',
|
|
207
|
+
'[怒]': '[anger]',
|
|
208
|
+
'[惊恐]': '[terrify]',
|
|
209
|
+
'[惊讶]': '[flummox]',
|
|
210
|
+
'[憨笑]': '[smirk]',
|
|
211
|
+
'[手枪]': '[gun]',
|
|
212
|
+
'[打哈欠]': '[yawn]',
|
|
213
|
+
'[抓狂]': '[crazy]',
|
|
214
|
+
'[折磨]': '[torment]',
|
|
215
|
+
'[抠鼻]': '[nose picking]',
|
|
216
|
+
'[抱抱]': '[hug]',
|
|
217
|
+
'[抱拳]': '[hug fist]',
|
|
218
|
+
'[拳头]': '[fist]',
|
|
219
|
+
'[挥手]': '[waving hands]',
|
|
220
|
+
'[握手]': '[shake hands]',
|
|
221
|
+
'[撇嘴]': '[pouted]',
|
|
222
|
+
'[擦汗]': '[wipe sweat]',
|
|
223
|
+
'[敲打]': '[knock on the head]',
|
|
224
|
+
'[晕]': '[faint]',
|
|
225
|
+
'[月亮]': '[moon]',
|
|
226
|
+
'[棒棒糖]': '[lollipop]',
|
|
227
|
+
'[汽车]': '[car]',
|
|
228
|
+
'[沙发]': '[sofa]',
|
|
229
|
+
'[流汗]': '[sweat]',
|
|
230
|
+
'[流泪]': '[tears]',
|
|
231
|
+
'[激动]': '[excitement]',
|
|
232
|
+
'[灯泡]': '[light]',
|
|
233
|
+
'[炸弹]': '[bomb]',
|
|
234
|
+
'[熊猫]': '[panda]',
|
|
235
|
+
'[爆筋]': '[exploding muscle]',
|
|
236
|
+
'[爱你]': '[love you]',
|
|
237
|
+
'[爱心]': '[love heart]',
|
|
238
|
+
'[爱情]': '[love]',
|
|
239
|
+
'[猪头]': '[pig]',
|
|
240
|
+
'[猫咪]': '[cat]',
|
|
241
|
+
'[献吻]': '[kiss]',
|
|
242
|
+
'[玫瑰]': '[rose]',
|
|
243
|
+
'[瓢虫]': '[ladybird]',
|
|
244
|
+
'[疑问]': '[what]',
|
|
245
|
+
'[白眼]': '[rolling eyes]',
|
|
246
|
+
'[皮球]': '[rubber ball]',
|
|
247
|
+
'[睡觉]': '[sleep]',
|
|
248
|
+
'[磕头]': '[kowtow]',
|
|
249
|
+
'[示爱]': '[show love]',
|
|
250
|
+
'[礼品袋]': '[gift bag]',
|
|
251
|
+
'[礼物]': '[gift]',
|
|
252
|
+
'[篮球]': '[basketball]',
|
|
253
|
+
'[米饭]': '[rice]',
|
|
254
|
+
'[糗大了]': '[shame]',
|
|
255
|
+
'[红双喜]': '[happiness]',
|
|
256
|
+
'[红灯笼]': '[lantern]',
|
|
257
|
+
'[纸巾]': '[tissue]',
|
|
258
|
+
'[胜利]': '[victory]',
|
|
259
|
+
'[色]': '[lecherous]',
|
|
260
|
+
'[药]': '[medicine]',
|
|
261
|
+
'[菜刀]': '[kitchen knife]',
|
|
262
|
+
'[蛋糕]': '[coke]',
|
|
263
|
+
'[蜡烛]': '[candle]',
|
|
264
|
+
'[街舞]': '[hip hop]',
|
|
265
|
+
'[衰]': '[decline]',
|
|
266
|
+
'[西瓜]': '[lemon]',
|
|
267
|
+
'[调皮]': '[naughty]',
|
|
268
|
+
'[象棋]': '[chess]',
|
|
269
|
+
'[跳绳]': '[jump rope]',
|
|
270
|
+
'[跳跳]': '[jump]',
|
|
271
|
+
'[车厢]': '[compartment]',
|
|
272
|
+
'[转圈]': '[turn in circles]',
|
|
273
|
+
'[鄙视]': '[contempt]',
|
|
274
|
+
'[酷]': '[cool]',
|
|
275
|
+
'[钞票]': '[money]',
|
|
276
|
+
'[钻戒]': '[diamond]',
|
|
277
|
+
'[闪电]': '[lightning]',
|
|
278
|
+
'[闭嘴]': '[shut up]',
|
|
279
|
+
'[闹钟]': '[clock]',
|
|
280
|
+
'[阴险]': '[sinister]',
|
|
281
|
+
'[难过]': '[sad]',
|
|
282
|
+
'[雨伞]': '[umbrella]',
|
|
283
|
+
'[青蛙]': '[frog]',
|
|
284
|
+
'[面条]': '[noodles]',
|
|
285
|
+
'[鞭炮]': '[firecracker]',
|
|
286
|
+
'[风车]': '[windmill]',
|
|
287
|
+
'[飞吻]': '[blow kisses]',
|
|
288
|
+
'[飞机]': '[air]',
|
|
289
|
+
'[饥饿]': '[hunger]',
|
|
290
|
+
'[香蕉]': '[banana]',
|
|
291
|
+
'[骷髅]': '[skull]',
|
|
292
|
+
'[麦克风]': '[mic]',
|
|
293
|
+
'[麻将]': '[mahjong]',
|
|
294
|
+
'[鼓掌]': '[handclap]',
|
|
295
|
+
'[龇牙]': '[happy]',
|
|
296
|
+
};
|
|
153
297
|
export const emojiName:Array<string> = [
|
|
154
298
|
'[龇牙]',
|
|
155
299
|
'[调皮]',
|
|
@@ -309,3 +453,40 @@ export const bigEmojiList:Array<IBigEmojiListItem> = [
|
|
|
309
453
|
'gcs08', 'gcs09', 'gcs10', 'gcs11', 'gcs12', 'gcs13', 'gcs14', 'gcs15', 'gcs16'],
|
|
310
454
|
},
|
|
311
455
|
];
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Convert to expression key
|
|
459
|
+
* @param { string } data text
|
|
460
|
+
* @param { number } type 0:Convert to Chinese expression key 1: Convert to English expression key
|
|
461
|
+
* @returns { string } the converted text
|
|
462
|
+
*/
|
|
463
|
+
export function formatEmojiString(data: string, type = 0) {
|
|
464
|
+
let text = data;
|
|
465
|
+
const replace = {
|
|
466
|
+
key: type === 0 ? 1 : 0,
|
|
467
|
+
value: type,
|
|
468
|
+
};
|
|
469
|
+
Object.entries(emojiEnKey).map((item) => {
|
|
470
|
+
if (text.includes(item[replace.key])) {
|
|
471
|
+
text = transText(text, item[replace.key], item[replace.value]);
|
|
472
|
+
}
|
|
473
|
+
return item;
|
|
474
|
+
});
|
|
475
|
+
return text;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* recursive replacement text
|
|
480
|
+
* @param { string } data text
|
|
481
|
+
* @param { string } replaceVal the value to replace
|
|
482
|
+
* @param { string } value replace Value
|
|
483
|
+
* @returns { string } the replaced value
|
|
484
|
+
*/
|
|
485
|
+
function transText(data: string, replaceVal:string, value: string) {
|
|
486
|
+
let text = data;
|
|
487
|
+
text = text.replace(replaceVal, value);
|
|
488
|
+
if (text.includes(replaceVal)) {
|
|
489
|
+
text = transText(text, replaceVal, value);
|
|
490
|
+
}
|
|
491
|
+
return text;
|
|
492
|
+
}
|
|
@@ -3,7 +3,8 @@ import { useTUIMessageInputContext } from '../../context/TUIMessageInputContext'
|
|
|
3
3
|
import { Icon, IconTypes } from '../Icon';
|
|
4
4
|
import { Popup } from '../Popup';
|
|
5
5
|
import {
|
|
6
|
-
emojiUrl, emojiName, emojiMap,
|
|
6
|
+
emojiUrl, emojiName, emojiMap,
|
|
7
|
+
// bigEmojiList, faceUrl, IBigEmojiListItem,
|
|
7
8
|
} from '../TUIMessage/utils/emojiMap';
|
|
8
9
|
|
|
9
10
|
import type { EmojiData } from './hooks';
|
|
@@ -6,6 +6,7 @@ import { useTUIChatActionContext } from '../../context';
|
|
|
6
6
|
import { Icon, IconTypes } from '../Icon';
|
|
7
7
|
import { MESSAGE_OPERATE } from '../../constants';
|
|
8
8
|
import { useHandleQuoteMessage } from './hooks/useHandleQuoteMessage';
|
|
9
|
+
import { formatEmojiString } from '../TUIMessage/utils/emojiMap';
|
|
9
10
|
|
|
10
11
|
interface InputQuoteProps {
|
|
11
12
|
message?: Message
|
|
@@ -33,7 +34,7 @@ export function InputQuoteDefalut <T extends InputQuoteProps>(
|
|
|
33
34
|
<div className="input-quote">
|
|
34
35
|
<div className="input-quote-content">
|
|
35
36
|
<label htmlFor="input-quote-content">{message?.nick || message?.from}</label>
|
|
36
|
-
<span>{context?.messageAbstract}</span>
|
|
37
|
+
<span>{formatEmojiString(context?.messageAbstract, 1)}</span>
|
|
37
38
|
</div>
|
|
38
39
|
<Icon className="icon" width={12} height={12} type={IconTypes.CLOSE} onClick={handleClose} />
|
|
39
40
|
</div>
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
useCallback,
|
|
5
5
|
} from 'react';
|
|
6
6
|
import { useTUIChatActionContext } from '../../../context';
|
|
7
|
+
import { emojiEnKey } from '../../TUIMessage/utils/emojiMap';
|
|
7
8
|
import type { IbaseStateProps } from './useMessageInputState';
|
|
8
9
|
|
|
9
10
|
export interface EmojiData {
|
|
@@ -25,7 +26,7 @@ export function useEmojiPicker<T extends useEmojiPickerProps>(props:PropsWithChi
|
|
|
25
26
|
const { sendMessage, createFaceMessage } = useTUIChatActionContext('useEmojiPicker');
|
|
26
27
|
|
|
27
28
|
const onSelectEmoji = (emoji:EmojiData) => {
|
|
28
|
-
insertText(emoji.data);
|
|
29
|
+
insertText(emojiEnKey[emoji.data]);
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
const sendFaceMessage = useCallback((emoji:EmojiData) => {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useTUIChatStateContext,
|
|
12
12
|
useTUIKitContext,
|
|
13
13
|
} from '../../../context';
|
|
14
|
+
import { formatEmojiString } from '../../TUIMessage/utils/emojiMap';
|
|
14
15
|
import { useHandleQuoteMessage } from './useHandleQuoteMessage';
|
|
15
16
|
import type { IbaseStateProps, ICursorPos } from './useMessageInputState';
|
|
16
17
|
|
|
@@ -66,7 +67,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
66
67
|
}
|
|
67
68
|
const options:any = {
|
|
68
69
|
payload: {
|
|
69
|
-
text: state.text,
|
|
70
|
+
text: formatEmojiString(state.text),
|
|
70
71
|
},
|
|
71
72
|
};
|
|
72
73
|
if (cloudCustomData.messageReply) {
|
|
@@ -105,7 +106,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
105
106
|
if (!(e.clipboardData && e.clipboardData.items)) {
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
|
-
const str = e.clipboardData.getData('text');
|
|
109
|
+
const str = formatEmojiString(e.clipboardData.getData('text'), 1);
|
|
109
110
|
if (str) {
|
|
110
111
|
dispatch({
|
|
111
112
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
word-break: break-all;
|
|
22
22
|
visibility: hidden;
|
|
23
23
|
max-width: -webkit-fill-available;
|
|
24
|
-
font-family:
|
|
24
|
+
font-family: PingFangSC-Medium;
|
|
25
25
|
font-style: normal;
|
|
26
26
|
font-weight: 500;
|
|
27
27
|
font-size: 14px;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
width: -webkit-fill-available;
|
|
36
36
|
height: -webkit-fill-available;
|
|
37
37
|
flex: 1;
|
|
38
|
-
font-family:
|
|
38
|
+
font-family: PingFangSC-Medium;
|
|
39
39
|
font-style: normal;
|
|
40
40
|
font-weight: 500;
|
|
41
41
|
font-size: 14px;
|
|
@@ -73,6 +73,7 @@ ul li {
|
|
|
73
73
|
font-style: normal;
|
|
74
74
|
font-weight: 500;
|
|
75
75
|
font-size: 16px;
|
|
76
|
+
font-family: PingFangSC-Medium;
|
|
76
77
|
line-height: 19px;
|
|
77
78
|
display: flex;
|
|
78
79
|
span {
|
|
@@ -151,6 +152,7 @@ ul li {
|
|
|
151
152
|
flex-direction: column;
|
|
152
153
|
font-weight: 500;
|
|
153
154
|
font-size: 14px;
|
|
155
|
+
font-family: PingFangSC-Medium;
|
|
154
156
|
line-height: 17px;
|
|
155
157
|
color: #000000;
|
|
156
158
|
&::before {
|
|
@@ -187,7 +189,7 @@ ul li {
|
|
|
187
189
|
}
|
|
188
190
|
&-title {
|
|
189
191
|
padding: 0 16px;
|
|
190
|
-
font-family:
|
|
192
|
+
font-family: PingFangSC-Medium;
|
|
191
193
|
font-style: normal;
|
|
192
194
|
font-weight: 700;
|
|
193
195
|
font-size: 14px;
|
|
@@ -198,7 +200,7 @@ ul li {
|
|
|
198
200
|
max-height: calc(100vh - 200px);
|
|
199
201
|
overflow-y: auto;
|
|
200
202
|
.no-result {
|
|
201
|
-
font-family:
|
|
203
|
+
font-family: PingFangSC-Medium;
|
|
202
204
|
font-size: 14px;
|
|
203
205
|
font-style: normal;
|
|
204
206
|
line-height: 20px;
|
|
@@ -213,7 +215,7 @@ ul li {
|
|
|
213
215
|
&-list {
|
|
214
216
|
padding: 13px 0;
|
|
215
217
|
&-title {
|
|
216
|
-
font-family:
|
|
218
|
+
font-family: PingFangSC-Medium;
|
|
217
219
|
font-style: normal;
|
|
218
220
|
font-weight: 600;
|
|
219
221
|
font-size: 14px;
|
|
@@ -221,7 +223,7 @@ ul li {
|
|
|
221
223
|
}
|
|
222
224
|
&-item {
|
|
223
225
|
padding: 6px 0;
|
|
224
|
-
font-family:
|
|
226
|
+
font-family: PingFangSC-Medium;
|
|
225
227
|
font-style: normal;
|
|
226
228
|
font-weight: 400;
|
|
227
229
|
font-size: 14px;
|
|
@@ -234,7 +236,7 @@ ul li {
|
|
|
234
236
|
align-items: center;
|
|
235
237
|
&-nick {
|
|
236
238
|
padding: 0 13px;
|
|
237
|
-
font-family:
|
|
239
|
+
font-family: PingFangSC-Medium;
|
|
238
240
|
font-style: normal;
|
|
239
241
|
font-weight: 400;
|
|
240
242
|
font-size: 14px;
|
|
@@ -259,7 +261,7 @@ ul li {
|
|
|
259
261
|
background: #0365F9;
|
|
260
262
|
border-radius: 31px;
|
|
261
263
|
padding: 10px 21px;
|
|
262
|
-
font-family:
|
|
264
|
+
font-family: PingFangSC-Medium;
|
|
263
265
|
font-style: normal;
|
|
264
266
|
font-weight: 400;
|
|
265
267
|
font-size: 14px;
|