@tencentcloud/chat-uikit-react 2.2.4 → 2.2.5
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/.babelrc +2 -2
- package/.eslintrc.js +125 -19
- package/.stylelintrc.js +17 -18
- package/CHANGELOG.md +11 -2
- package/README.md +8 -8
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/context/TUIKitContext.js +1 -1
- package/dist/cjs/index.css +2 -1
- package/dist/cjs/index.d.css +643 -166
- package/dist/esm/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/context/TUIKitContext.js +1 -1
- package/dist/esm/index.css +2 -1
- package/dist/esm/index.d.css +643 -166
- package/package.json +7 -6
- package/rollup.config.js +13 -2
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
- package/src/components/ConversationCreate/styles/index.scss +23 -13
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +1 -2
- package/src/components/ConversationPreview/styles/index.scss +44 -14
- package/src/components/ConversationPreview/utils.tsx +36 -28
- package/src/components/Input/styles/index.scss +7 -5
- package/src/components/Model/styles/layout.scss +3 -3
- package/src/components/Plugins/styles/color.scss +17 -3
- package/src/components/Popup/styles/layout.scss +2 -1
- package/src/components/TUIChatHeader/styles/layout.scss +13 -2
- package/src/components/TUIConversationList/index.scss +25 -7
- package/src/components/TUIKit/TUIKit.tsx +3 -2
- package/src/components/TUIKit/styles/index.scss +27 -7
- package/src/components/TUIManage/styles/index.scss +16 -6
- package/src/components/TUIMessage/styles/color.scss +20 -9
- package/src/components/TUIMessage/styles/layout.scss +44 -11
- package/src/components/TUIMessageInput/styles/color.scss +25 -6
- package/src/components/TUIMessageInput/styles/layout.scss +58 -16
- package/src/components/TUIMessageList/styles/layout.scss +16 -2
- package/src/components/TUIProfile/styles/layout.scss +33 -16
- package/src/context/TUIKitContext.tsx +6 -1
- package/src/styles/colors/_color-dark.scss +35 -0
- package/src/styles/colors/_color-light.scss +35 -0
- package/src/styles/colors/_color-theme.scss +54 -0
- package/src/styles/fonts/icon-font.scss +18 -0
- package/src/styles/index.scss +4 -0
- package/src/styles/normalize.scss +355 -0
- package/src/components/TUIKit/styles/reset.scss +0 -67
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/chat-uikit-react",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"uikit"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "
|
|
18
|
+
"build": "rimraf ./dist && yarn run rollup -c",
|
|
19
19
|
"start": "yarn run rollup -c -w",
|
|
20
|
-
"clean": "rimraf ./dist",
|
|
20
|
+
"clean": "rimraf -g ./dist node_modules examples/*/node_modules",
|
|
21
21
|
"prepare": "husky install"
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://www.tencentcloud.com/document/product/1047/45912",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"eslint": "^8.57.0",
|
|
46
46
|
"eslint-config-react-app": "^7.0.1",
|
|
47
47
|
"eslint-import-resolver-typescript": "^3.5.1",
|
|
48
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
48
49
|
"husky": "^8.0.3",
|
|
49
50
|
"lint-staged": "^15.2.7",
|
|
50
51
|
"postcss": "^8.4.16",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
56
57
|
"rollup-plugin-postcss": "^4.0.2",
|
|
57
58
|
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
-
"sass": "^1.
|
|
59
|
+
"sass": "^1.77.8",
|
|
59
60
|
"stylelint": "^16.7.0",
|
|
60
61
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
61
62
|
"stylelint-config-standard": "^36.0.1",
|
|
@@ -69,9 +70,9 @@
|
|
|
69
70
|
"@tencentcloud/tui-core": "latest",
|
|
70
71
|
"@tencentcloud/universal-api": "latest",
|
|
71
72
|
"date-fns": "^2.29.3",
|
|
72
|
-
"node-sass": "^7.0.3",
|
|
73
73
|
"react-date-picker": "^9.0.0",
|
|
74
|
-
"react-dom": "^18.2.0"
|
|
74
|
+
"react-dom": "^18.2.0",
|
|
75
|
+
"rollup-plugin-copy": "^3.5.0"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
78
|
"date-fns": "^2.29.3",
|
package/rollup.config.js
CHANGED
|
@@ -8,6 +8,7 @@ import postcss from 'rollup-plugin-postcss';
|
|
|
8
8
|
import autoprefixer from 'autoprefixer';
|
|
9
9
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
10
10
|
import url from '@rollup/plugin-url';
|
|
11
|
+
import copy from 'rollup-plugin-copy';
|
|
11
12
|
|
|
12
13
|
export default [
|
|
13
14
|
{
|
|
@@ -21,13 +22,23 @@ export default [
|
|
|
21
22
|
autoprefixer(),
|
|
22
23
|
],
|
|
23
24
|
}),
|
|
25
|
+
copy({
|
|
26
|
+
targets: [{
|
|
27
|
+
src: [
|
|
28
|
+
'src/assets/fonts/iconfont.ttf',
|
|
29
|
+
'src/assets/fonts/iconfont.woff',
|
|
30
|
+
'src/assets/fonts/iconfont.woff2',
|
|
31
|
+
],
|
|
32
|
+
dest: ['dist/cjs/assets/fonts', 'dist/esm/assets/fonts'],
|
|
33
|
+
}],
|
|
34
|
+
}),
|
|
24
35
|
peerDepsExternal(),
|
|
25
36
|
resolve(),
|
|
26
37
|
commonjs(),
|
|
38
|
+
typescript(),
|
|
27
39
|
babel({
|
|
28
|
-
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', 'ts', 'tsx'],
|
|
40
|
+
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.ts', '.tsx'],
|
|
29
41
|
}),
|
|
30
|
-
typescript(),
|
|
31
42
|
terser(),
|
|
32
43
|
],
|
|
33
44
|
external: ['react', 'date-fns', 'tslib', 'react-date-picker', 'i18next', 'react-i18next', '@tencentcloud/tui-core',
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,49 +2,57 @@
|
|
|
2
2
|
.create-group-box {
|
|
3
3
|
padding: 10px 0;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
.input-group-text {
|
|
6
7
|
font-weight: 400;
|
|
7
|
-
font-size:
|
|
8
|
+
font-size: 14px;
|
|
8
9
|
font-family: PingFangSC-Medium;
|
|
9
10
|
line-height: 22px;
|
|
10
|
-
color: #
|
|
11
|
+
color: #000;
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
.create-group-name {
|
|
13
15
|
.input-group-name {
|
|
14
16
|
font-weight: 700;
|
|
15
|
-
font-size:
|
|
17
|
+
font-size: 14px;
|
|
16
18
|
font-family: PingFangSC-Medium;
|
|
17
19
|
line-height: 19px;
|
|
18
|
-
color: #
|
|
20
|
+
color: #000;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
23
|
+
|
|
21
24
|
.input-group-title {
|
|
22
|
-
color: rgba(0, 0, 0,
|
|
25
|
+
color: rgba(0, 0, 0, 40%);
|
|
23
26
|
width: 106px;
|
|
27
|
+
font-size: 14px;
|
|
24
28
|
}
|
|
29
|
+
|
|
25
30
|
.create-group-illustrate {
|
|
26
31
|
font-weight: 400;
|
|
27
32
|
font-size: 12px;
|
|
28
33
|
font-family: PingFangSC-Medium;
|
|
29
34
|
line-height: 17px;
|
|
30
35
|
text-align: justify;
|
|
31
|
-
color: rgba(0, 0, 0,
|
|
36
|
+
color: rgba(0, 0, 0, 40%);
|
|
32
37
|
padding-left: 8px;
|
|
33
38
|
}
|
|
39
|
+
|
|
34
40
|
.create-group-portrait {
|
|
35
41
|
.create-group-portrait-title {
|
|
36
42
|
font-weight: 600;
|
|
37
43
|
font-size: 14px;
|
|
38
44
|
font-family: PingFangSC-Medium;
|
|
39
45
|
line-height: 20px;
|
|
40
|
-
color: #
|
|
46
|
+
color: #000;
|
|
41
47
|
padding: 20px 0 20px 8px;
|
|
42
48
|
}
|
|
49
|
+
|
|
43
50
|
.create-group-portrait-info-container {
|
|
44
51
|
display: flex;
|
|
45
52
|
flex-wrap: wrap;
|
|
46
53
|
justify-content: flex-start;
|
|
47
54
|
margin-bottom: 10px;
|
|
55
|
+
|
|
48
56
|
.create-group-portrait-info {
|
|
49
57
|
align-items: center;
|
|
50
58
|
display: flex;
|
|
@@ -52,6 +60,7 @@
|
|
|
52
60
|
width: calc((100% - 10px) / 6);
|
|
53
61
|
padding: 6px;
|
|
54
62
|
box-sizing: border-box;
|
|
63
|
+
|
|
55
64
|
&-nick {
|
|
56
65
|
font-size: 12px;
|
|
57
66
|
font-family: PingFangSC-Medium;
|
|
@@ -1,85 +1,96 @@
|
|
|
1
1
|
.tui-conversation-create-header {
|
|
2
|
-
background-color: #
|
|
2
|
+
background-color: #f9fafb;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
padding: 16px 20px;
|
|
6
6
|
align-items: center;
|
|
7
7
|
text-align: center;
|
|
8
|
+
|
|
8
9
|
.title {
|
|
9
10
|
margin-left: 10px;
|
|
10
11
|
font-weight: 600;
|
|
11
|
-
font-size:
|
|
12
|
+
font-size: 16px;
|
|
12
13
|
font-family: PingFangSC-Medium;
|
|
13
14
|
line-height: 32px;
|
|
14
15
|
letter-spacing: -0.41px;
|
|
15
|
-
color: #
|
|
16
|
+
color: #000;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
19
|
+
|
|
18
20
|
.tui-conversation-create-search-input {
|
|
19
|
-
margin: 10px
|
|
21
|
+
margin: 10px;
|
|
20
22
|
}
|
|
23
|
+
|
|
21
24
|
.tui-user {
|
|
22
|
-
padding: 10px
|
|
25
|
+
padding: 10px;
|
|
23
26
|
display: flex;
|
|
24
27
|
align-items: center;
|
|
25
28
|
text-align: center;
|
|
26
29
|
cursor: pointer;
|
|
30
|
+
|
|
27
31
|
&:hover {
|
|
28
|
-
background-color: rgba(0,110,255
|
|
32
|
+
background-color: rgba(0, 110, 255, 10%);
|
|
29
33
|
}
|
|
34
|
+
|
|
30
35
|
.tui-user-name {
|
|
31
36
|
margin-left: 10px;
|
|
32
37
|
font-weight: 400;
|
|
33
38
|
font-size: 14px;
|
|
34
39
|
font-family: PingFangSC-Medium;
|
|
35
40
|
line-height: 20px;
|
|
36
|
-
color: #
|
|
41
|
+
color: #000;
|
|
37
42
|
width: 80%;
|
|
38
43
|
text-align: left;
|
|
44
|
+
|
|
39
45
|
&.active {
|
|
40
46
|
font-weight: 600;
|
|
41
47
|
font-size: 14px;
|
|
42
48
|
font-family: PingFangSC-Medium;
|
|
43
49
|
line-height: 20px;
|
|
44
|
-
color: rgba(3, 101, 249,
|
|
50
|
+
color: rgba(3, 101, 249, 100%);
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
}
|
|
54
|
+
|
|
48
55
|
.tui-user-checkbox-label {
|
|
49
56
|
.tui-user-checkbox {
|
|
50
57
|
margin-left: auto;
|
|
51
58
|
}
|
|
59
|
+
|
|
52
60
|
input[type="checkbox"] {
|
|
53
61
|
cursor: pointer;
|
|
54
62
|
}
|
|
55
63
|
}
|
|
64
|
+
|
|
56
65
|
.tui-conversation-create-next-container {
|
|
57
66
|
width: 100%;
|
|
58
67
|
display: flex;
|
|
59
68
|
justify-content: center;
|
|
60
69
|
margin: 20px auto 10px;
|
|
70
|
+
|
|
61
71
|
.tui-conversation-create-next {
|
|
62
72
|
cursor: pointer;
|
|
63
73
|
text-align: center;
|
|
64
|
-
|
|
65
|
-
background-color: rgba(3, 101, 249, 1);
|
|
74
|
+
background-color: rgba(3, 101, 249, 100%);
|
|
66
75
|
border-radius: 31px;
|
|
67
76
|
font-size: 14px;
|
|
68
77
|
font-family: PingFangSC-Medium;
|
|
69
78
|
line-height: 20px;
|
|
70
|
-
color: #
|
|
79
|
+
color: #fff;
|
|
71
80
|
padding: 12px 36px;
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
83
|
|
|
75
|
-
|
|
76
84
|
.tui-conversation-create {
|
|
77
85
|
overflow-y: auto;
|
|
86
|
+
|
|
78
87
|
.tui-conversation-create-container {
|
|
79
88
|
position: relative;
|
|
89
|
+
|
|
80
90
|
.tui-group-container {
|
|
81
91
|
width: 100%;
|
|
82
92
|
}
|
|
93
|
+
|
|
83
94
|
.tui-group-box {
|
|
84
95
|
.title {
|
|
85
96
|
font-weight: 600;
|
|
@@ -91,4 +102,3 @@
|
|
|
91
102
|
}
|
|
92
103
|
}
|
|
93
104
|
}
|
|
94
|
-
|
|
@@ -159,8 +159,7 @@ export function unMemoConversationPreviewContent<T extends ConversationPreviewUI
|
|
|
159
159
|
{t(!conversation.isPinned ? 'TUIConversation.Pin' : 'TUIConversation.Unpin')}
|
|
160
160
|
</div>,
|
|
161
161
|
<div
|
|
162
|
-
className="more-handle-item"
|
|
163
|
-
style={{ color: '#FF584C' }}
|
|
162
|
+
className="more-handle-item delete"
|
|
164
163
|
onClick={(e) => {
|
|
165
164
|
moreHandle(e, 'delete');
|
|
166
165
|
}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
2
3
|
.conversation-list-container {
|
|
3
4
|
overflow-x: hidden;
|
|
4
5
|
height: 100%;
|
|
@@ -7,7 +8,6 @@ $font-color: #7A7A7A;
|
|
|
7
8
|
.conversation-preview-container {
|
|
8
9
|
display: flex;
|
|
9
10
|
align-items: center;
|
|
10
|
-
background-color: #FFFFFF;
|
|
11
11
|
border: none;
|
|
12
12
|
width: 100%;
|
|
13
13
|
height: 64px;
|
|
@@ -15,6 +15,10 @@ $font-color: #7A7A7A;
|
|
|
15
15
|
line-height: 17px;
|
|
16
16
|
padding: 0 20px;
|
|
17
17
|
|
|
18
|
+
@include theme() {
|
|
19
|
+
background-color: get(bg-primary);
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
.content {
|
|
19
23
|
flex: 1 1 auto;
|
|
20
24
|
text-align: left;
|
|
@@ -29,20 +33,26 @@ $font-color: #7A7A7A;
|
|
|
29
33
|
font-family: PingFangSC-Medium;
|
|
30
34
|
padding: 1px 0;
|
|
31
35
|
width: 100%;
|
|
32
|
-
|
|
36
|
+
|
|
37
|
+
@include theme() {
|
|
38
|
+
color: get(text-primary);
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
.message {
|
|
36
43
|
overflow: hidden;
|
|
37
44
|
text-overflow: ellipsis;
|
|
38
45
|
white-space: nowrap;
|
|
39
|
-
color: $font-color;
|
|
40
46
|
font-family: PingFangSC-Medium;
|
|
41
47
|
font-style: normal;
|
|
42
48
|
font-weight: 400;
|
|
43
49
|
font-size: 12px;
|
|
44
50
|
line-height: 14px;
|
|
45
51
|
padding: 1px 0;
|
|
52
|
+
|
|
53
|
+
@include theme() {
|
|
54
|
+
color: get(text-secondary);
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
|
|
@@ -58,13 +68,16 @@ $font-color: #7A7A7A;
|
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
.time {
|
|
61
|
-
color: $font-color;
|
|
62
71
|
font-family: PingFangSC-Medium;
|
|
63
72
|
font-style: normal;
|
|
64
73
|
font-weight: 400;
|
|
65
74
|
font-size: 12px;
|
|
66
75
|
line-height: 14px;
|
|
67
76
|
padding: 1px 0;
|
|
77
|
+
|
|
78
|
+
@include theme() {
|
|
79
|
+
color: get(text-secondary);
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
|
|
70
83
|
.more--hover {
|
|
@@ -96,10 +109,16 @@ $font-color: #7A7A7A;
|
|
|
96
109
|
font-weight: 500;
|
|
97
110
|
box-sizing: border-box;
|
|
98
111
|
|
|
112
|
+
&.delete {
|
|
113
|
+
@include theme() {
|
|
114
|
+
color: get(status-danger);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
99
118
|
&:hover {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
@include theme() {
|
|
120
|
+
background-color: get(bg-active);
|
|
121
|
+
}
|
|
103
122
|
}
|
|
104
123
|
}
|
|
105
124
|
}
|
|
@@ -107,18 +126,26 @@ $font-color: #7A7A7A;
|
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
&:hover {
|
|
110
|
-
|
|
129
|
+
@include theme() {
|
|
130
|
+
background-color: get(bg-active);
|
|
131
|
+
}
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
&.conversation-preview-content--pin {
|
|
114
|
-
|
|
135
|
+
@include theme() {
|
|
136
|
+
background-color: get(bg-secondary);
|
|
137
|
+
}
|
|
115
138
|
}
|
|
116
139
|
|
|
117
140
|
&.conversation-preview-content--active {
|
|
118
|
-
|
|
141
|
+
@include theme() {
|
|
142
|
+
background-color: get(bg-active);
|
|
143
|
+
}
|
|
119
144
|
|
|
120
145
|
.title {
|
|
121
|
-
|
|
146
|
+
@include theme() {
|
|
147
|
+
color: get(status-info);
|
|
148
|
+
}
|
|
122
149
|
}
|
|
123
150
|
}
|
|
124
151
|
|
|
@@ -126,16 +153,19 @@ $font-color: #7A7A7A;
|
|
|
126
153
|
.unread {
|
|
127
154
|
width: 16px;
|
|
128
155
|
height: 13px;
|
|
129
|
-
background: #FF3742;
|
|
130
156
|
border-radius: 16px;
|
|
131
157
|
display: flex;
|
|
132
158
|
justify-content: center;
|
|
133
159
|
align-items: center;
|
|
134
160
|
padding: 2px 5px 1px;
|
|
135
|
-
color: #FFFFFF;
|
|
136
161
|
font-size: 11px;
|
|
137
162
|
font-weight: 700;
|
|
138
163
|
margin: 2px 0 2px auto;
|
|
164
|
+
color: #fff;
|
|
165
|
+
|
|
166
|
+
@include theme() {
|
|
167
|
+
background-color: get(status-danger);
|
|
168
|
+
}
|
|
139
169
|
}
|
|
140
170
|
}
|
|
141
171
|
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import TencentCloudChat, { Conversation, Group, Profile } from '@tencentcloud/chat';
|
|
4
3
|
import { defaultGroupAvatarWork, defaultUserAvatar } from '../Avatar';
|
|
5
4
|
import { formatEmojiString } from '../TUIMessage/utils/emojiMap';
|
|
6
5
|
import { getTimeStamp } from '../untils';
|
|
7
6
|
|
|
7
|
+
interface TProfile extends Profile, Group {}
|
|
8
|
+
export const getMessageProfile = (conversation: Conversation): TProfile => {
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
if (!conversation) return null;
|
|
12
|
+
let result = {};
|
|
13
|
+
const { type, groupProfile, userProfile } = conversation;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case TencentCloudChat.TYPES.CONV_C2C:
|
|
16
|
+
result = userProfile;
|
|
17
|
+
break;
|
|
18
|
+
case TencentCloudChat.TYPES.CONV_GROUP:
|
|
19
|
+
result = groupProfile;
|
|
20
|
+
break;
|
|
21
|
+
case TencentCloudChat.TYPES.CONV_SYSTEM:
|
|
22
|
+
default:
|
|
23
|
+
}
|
|
24
|
+
return result as TProfile;
|
|
25
|
+
};
|
|
26
|
+
|
|
8
27
|
export const getDisplayTitle = (
|
|
9
28
|
conversation: Conversation,
|
|
10
29
|
searchValue?: string,
|
|
@@ -25,15 +44,22 @@ export const getDisplayTitle = (
|
|
|
25
44
|
default:
|
|
26
45
|
title = '';
|
|
27
46
|
}
|
|
28
|
-
const handleTitle = (str:string) => {
|
|
47
|
+
const handleTitle = (str: string) => {
|
|
29
48
|
const tempStr = str.toLocaleLowerCase();
|
|
30
49
|
const pos = searchValue && tempStr.indexOf(searchValue.toLocaleLowerCase());
|
|
31
|
-
|
|
50
|
+
const titleList = str.split(new RegExp(`(${searchValue})`, 'gi'));
|
|
51
|
+
if (pos === '') return <></>;
|
|
32
52
|
return (
|
|
33
53
|
<div>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
{searchValue && titleList.map((textItem: string, index: number) =>
|
|
55
|
+
(textItem.toLowerCase() === searchValue.toLowerCase())
|
|
56
|
+
? (
|
|
57
|
+
<span key={index} style={{ color: highlightColor }}>{textItem}</span>
|
|
58
|
+
) : (
|
|
59
|
+
<span key={index}>{textItem}</span>
|
|
60
|
+
),
|
|
61
|
+
)}
|
|
62
|
+
;
|
|
37
63
|
</div>
|
|
38
64
|
);
|
|
39
65
|
};
|
|
@@ -58,9 +84,9 @@ export const getDisplayImage = (conversation: Conversation) => {
|
|
|
58
84
|
return displayImage;
|
|
59
85
|
};
|
|
60
86
|
export const getDisplayMessage = (
|
|
61
|
-
conversation:Conversation,
|
|
62
|
-
myProfile:Profile,
|
|
63
|
-
language?:string,
|
|
87
|
+
conversation: Conversation,
|
|
88
|
+
myProfile: Profile,
|
|
89
|
+
language?: string,
|
|
64
90
|
) => {
|
|
65
91
|
const { lastMessage, type } = conversation;
|
|
66
92
|
const {
|
|
@@ -93,25 +119,7 @@ export const getDisplayMessage = (
|
|
|
93
119
|
</div>
|
|
94
120
|
);
|
|
95
121
|
};
|
|
96
|
-
|
|
97
|
-
export const getMessageProfile = (conversation: Conversation):TProfile => {
|
|
98
|
-
// eslint-disable-next-line
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
if (!conversation) return null;
|
|
101
|
-
let result = {};
|
|
102
|
-
const { type, groupProfile, userProfile } = conversation;
|
|
103
|
-
switch (type) {
|
|
104
|
-
case TencentCloudChat.TYPES.CONV_C2C:
|
|
105
|
-
result = userProfile;
|
|
106
|
-
break;
|
|
107
|
-
case TencentCloudChat.TYPES.CONV_GROUP:
|
|
108
|
-
result = groupProfile;
|
|
109
|
-
break;
|
|
110
|
-
case TencentCloudChat.TYPES.CONV_SYSTEM:
|
|
111
|
-
default:
|
|
112
|
-
}
|
|
113
|
-
return result as TProfile;
|
|
114
|
-
};
|
|
122
|
+
|
|
115
123
|
export const getDisplayTime = (conversation: Conversation, language: string) => {
|
|
116
124
|
const { lastMessage } = conversation;
|
|
117
125
|
return getTimeStamp(lastMessage.lastTime * 1000, language);
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
border-radius: 10px;
|
|
6
|
-
background:
|
|
6
|
+
background: rgba(249, 249, 249, 94%);
|
|
7
7
|
padding: 0 8px;
|
|
8
8
|
height: 36px;
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
|
|
11
11
|
&.tui-kit-input-box--focus {
|
|
12
|
-
outline: 1px solid #
|
|
12
|
+
outline: 1px solid #147aff;
|
|
13
13
|
}
|
|
14
|
+
|
|
14
15
|
&.tui-kit-input-border--bottom {
|
|
15
|
-
border-bottom: 1px solid rgba(0, 0, 0,
|
|
16
|
+
border-bottom: 1px solid rgba(0, 0, 0, 10%);
|
|
16
17
|
background-color: #fff;
|
|
17
18
|
outline: none;
|
|
18
19
|
border-radius: 0;
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
.tui-kit-input {
|
|
21
23
|
margin-left: 6px;
|
|
22
24
|
margin-right: auto;
|
|
@@ -28,6 +30,7 @@
|
|
|
28
30
|
border-radius: 10px;
|
|
29
31
|
border: none;
|
|
30
32
|
box-sizing: border-box;
|
|
33
|
+
font-size: 14px;
|
|
31
34
|
|
|
32
35
|
&:focus {
|
|
33
36
|
border: none;
|
|
@@ -36,9 +39,8 @@
|
|
|
36
39
|
|
|
37
40
|
&::placeholder {
|
|
38
41
|
font-weight: 400;
|
|
39
|
-
color: rgba(67, 60, 63,
|
|
42
|
+
color: rgba(67, 60, 63, 60%);
|
|
40
43
|
padding: 2px 0;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
|
|
44
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.model {
|
|
2
|
-
background: rgba(#
|
|
2
|
+
background: rgba(#000, 0.5);
|
|
3
3
|
position: fixed;
|
|
4
|
-
z-index:
|
|
4
|
+
z-index: 5;
|
|
5
5
|
width: 100vw;
|
|
6
6
|
top: 0;
|
|
7
7
|
left: 0;
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.plugin-popup {
|
|
2
4
|
&-box {
|
|
3
|
-
background: #FFFFFF;
|
|
4
|
-
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
5
5
|
border-radius: 16px;
|
|
6
|
+
|
|
7
|
+
@include theme() {
|
|
8
|
+
color: get(text-primary);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-chat-theme="light"] & {
|
|
12
|
+
background-color: var(--chat-theme-light-bg-primary);
|
|
13
|
+
box-shadow: var(--chat-theme-light-box-shadow-1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-chat-theme="dark"] & {
|
|
17
|
+
background-color: var(--chat-theme-dark-bg-3);
|
|
18
|
+
box-shadow: var(--chat-theme-dark-box-shadow-1);
|
|
19
|
+
}
|
|
6
20
|
}
|
|
7
|
-
}
|
|
21
|
+
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.tui-chat-header {
|
|
2
4
|
padding: 16px 20px;
|
|
3
5
|
display: flex;
|
|
4
6
|
flex-direction: row;
|
|
5
7
|
justify-content: space-between;
|
|
6
8
|
align-items: center;
|
|
9
|
+
|
|
10
|
+
@include theme() {
|
|
11
|
+
background-color: get(bg-primary);
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
&-left {
|
|
8
15
|
display: flex;
|
|
9
16
|
align-items: center;
|
|
@@ -24,7 +31,11 @@
|
|
|
24
31
|
font-style: normal;
|
|
25
32
|
font-weight: 700;
|
|
26
33
|
font-size: 14px;
|
|
27
|
-
|
|
34
|
+
|
|
35
|
+
@include theme() {
|
|
36
|
+
color: get(text-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
}
|
|
29
40
|
.system {
|
|
30
41
|
height: 32px;
|
|
@@ -33,4 +44,4 @@
|
|
|
33
44
|
|
|
34
45
|
.tui-chat-live-header {
|
|
35
46
|
|
|
36
|
-
}
|
|
47
|
+
}
|