@tencentcloud/chat-uikit-react 2.2.3 → 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.
Files changed (164) hide show
  1. package/.babelrc +2 -2
  2. package/.editorconfig +16 -0
  3. package/.eslintrc.js +225 -48
  4. package/.husky/pre-commit +4 -0
  5. package/.lintstagedrc.json +6 -0
  6. package/.stylelintrc.js +40 -0
  7. package/CHANGELOG.md +14 -0
  8. package/README.md +8 -8
  9. package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
  10. package/dist/cjs/assets/fonts/iconfont.woff +0 -0
  11. package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
  12. package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  13. package/dist/cjs/components/ConversationPreview/utils.js +1 -1
  14. package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
  15. package/dist/cjs/components/Input/Input.js +1 -1
  16. package/dist/cjs/components/Plugins/index.js +1 -1
  17. package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
  18. package/dist/cjs/components/TUIMessage/utils/emojiMap.js +1 -1
  19. package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  20. package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  21. package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  22. package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
  23. package/dist/cjs/components/untils.js +1 -1
  24. package/dist/cjs/context/TUIKitContext.js +1 -1
  25. package/dist/cjs/index.css +2 -1
  26. package/dist/cjs/index.d.css +646 -172
  27. package/dist/cjs/index.d.ts +1 -1
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/cjs/locales/en-US/index.js +1 -0
  30. package/dist/cjs/locales/index.js +1 -1
  31. package/dist/cjs/locales/ja-JP/TUIChat.js +1 -0
  32. package/dist/cjs/locales/ja-JP/TUIContact.js +1 -0
  33. package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -0
  34. package/dist/cjs/locales/ja-JP/TUIProfile.js +1 -0
  35. package/dist/cjs/locales/ja-JP/index.js +1 -0
  36. package/dist/cjs/locales/ko-KR/TUIChat.js +1 -0
  37. package/dist/cjs/locales/ko-KR/TUIContact.js +1 -0
  38. package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -0
  39. package/dist/cjs/locales/ko-KR/TUIProfile.js +1 -0
  40. package/dist/cjs/locales/ko-KR/index.js +1 -0
  41. package/dist/cjs/utils/env.d.ts +4 -3
  42. package/dist/cjs/utils/env.js +1 -1
  43. package/dist/esm/assets/fonts/iconfont.ttf +0 -0
  44. package/dist/esm/assets/fonts/iconfont.woff +0 -0
  45. package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
  46. package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
  47. package/dist/esm/components/ConversationPreview/utils.js +1 -1
  48. package/dist/esm/components/DivWithEdit/WithText.js +1 -1
  49. package/dist/esm/components/Input/Input.js +1 -1
  50. package/dist/esm/components/Plugins/index.js +1 -1
  51. package/dist/esm/components/TUIKit/TUIKit.js +1 -1
  52. package/dist/esm/components/TUIMessage/utils/emojiMap.js +1 -1
  53. package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
  54. package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
  55. package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
  56. package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
  57. package/dist/esm/components/untils.js +1 -1
  58. package/dist/esm/context/TUIKitContext.js +1 -1
  59. package/dist/esm/index.css +2 -1
  60. package/dist/esm/index.d.css +646 -172
  61. package/dist/esm/index.d.ts +1 -1
  62. package/dist/esm/index.js +1 -1
  63. package/dist/esm/locales/en-US/index.js +1 -0
  64. package/dist/esm/locales/index.js +1 -1
  65. package/dist/esm/locales/ja-JP/TUIChat.js +1 -0
  66. package/dist/esm/locales/ja-JP/TUIContact.js +1 -0
  67. package/dist/esm/locales/ja-JP/TUIConversation.js +1 -0
  68. package/dist/esm/locales/ja-JP/TUIProfile.js +1 -0
  69. package/dist/esm/locales/ja-JP/index.js +1 -0
  70. package/dist/esm/locales/ko-KR/TUIChat.js +1 -0
  71. package/dist/esm/locales/ko-KR/TUIContact.js +1 -0
  72. package/dist/esm/locales/ko-KR/TUIConversation.js +1 -0
  73. package/dist/esm/locales/ko-KR/TUIProfile.js +1 -0
  74. package/dist/esm/locales/ko-KR/index.js +1 -0
  75. package/dist/esm/utils/env.d.ts +4 -3
  76. package/dist/esm/utils/env.js +1 -1
  77. package/package.json +22 -16
  78. package/rollup.config.js +40 -25
  79. package/src/assets/fonts/iconfont.ttf +0 -0
  80. package/src/assets/fonts/iconfont.woff +0 -0
  81. package/src/assets/fonts/iconfont.woff2 +0 -0
  82. package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
  83. package/src/components/ConversationCreate/styles/index.scss +23 -13
  84. package/src/components/ConversationPreview/ConversationPreviewContent.tsx +1 -2
  85. package/src/components/ConversationPreview/styles/index.scss +47 -19
  86. package/src/components/ConversationPreview/utils.tsx +37 -29
  87. package/src/components/DivWithEdit/WithText.tsx +4 -2
  88. package/src/components/Input/Input.tsx +3 -1
  89. package/src/components/Input/styles/index.scss +7 -5
  90. package/src/components/Model/styles/layout.scss +3 -3
  91. package/src/components/Plugins/styles/color.scss +17 -3
  92. package/src/components/Popup/styles/layout.scss +2 -1
  93. package/src/components/TUIChatHeader/styles/layout.scss +13 -2
  94. package/src/components/TUIConversationList/index.scss +26 -9
  95. package/src/components/TUIKit/TUIKit.tsx +4 -3
  96. package/src/components/TUIKit/styles/index.scss +27 -7
  97. package/src/components/TUIManage/styles/index.scss +20 -10
  98. package/src/components/TUIMessage/styles/color.scss +20 -9
  99. package/src/components/TUIMessage/styles/layout.scss +44 -11
  100. package/src/components/TUIMessage/utils/emojiMap.ts +1 -1
  101. package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +3 -1
  102. package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +1 -1
  103. package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +3 -1
  104. package/src/components/TUIMessageInput/styles/color.scss +25 -6
  105. package/src/components/TUIMessageInput/styles/layout.scss +58 -16
  106. package/src/components/TUIMessageList/TUIMessageList.tsx +17 -10
  107. package/src/components/TUIMessageList/styles/layout.scss +16 -2
  108. package/src/components/TUIProfile/styles/layout.scss +33 -16
  109. package/src/components/untils.ts +13 -17
  110. package/src/context/TUIKitContext.tsx +6 -1
  111. package/src/locales/en-US/TUIGlobal.ts +6 -0
  112. package/src/locales/en-US/index.ts +14 -0
  113. package/src/locales/index.ts +15 -7
  114. package/src/locales/ja-JP/TUIChat.ts +27 -0
  115. package/src/locales/ja-JP/TUIContact.ts +30 -0
  116. package/src/locales/ja-JP/TUIConversation.ts +33 -0
  117. package/src/locales/ja-JP/TUIGlobal.ts +6 -0
  118. package/src/locales/ja-JP/TUIProfile.ts +15 -0
  119. package/src/locales/{en → ja-JP}/index.ts +0 -2
  120. package/src/locales/ko-KR/TUIChat.ts +27 -0
  121. package/src/locales/ko-KR/TUIContact.ts +30 -0
  122. package/src/locales/ko-KR/TUIConversation.ts +33 -0
  123. package/src/locales/ko-KR/TUIGlobal.ts +6 -0
  124. package/src/locales/ko-KR/TUIProfile.ts +15 -0
  125. package/src/locales/ko-KR/index.ts +11 -0
  126. package/src/locales/zh-CN/TUIGlobal.ts +6 -0
  127. package/src/styles/colors/_color-dark.scss +35 -0
  128. package/src/styles/colors/_color-light.scss +35 -0
  129. package/src/styles/colors/_color-theme.scss +54 -0
  130. package/src/styles/fonts/icon-font.scss +18 -0
  131. package/src/styles/index.scss +4 -0
  132. package/src/styles/normalize.scss +355 -0
  133. package/src/utils/env.ts +7 -2
  134. package/tsconfig.json +1 -0
  135. package/dist/cjs/locales/en/index.js +0 -1
  136. package/dist/esm/locales/en/index.js +0 -1
  137. package/src/components/TUIKit/styles/reset.scss +0 -67
  138. /package/dist/cjs/locales/{en → en-US}/TUIChat.js +0 -0
  139. /package/dist/cjs/locales/{en → en-US}/TUIContact.js +0 -0
  140. /package/dist/cjs/locales/{en → en-US}/TUIConversation.js +0 -0
  141. /package/dist/cjs/locales/{en → en-US}/TUIProfile.js +0 -0
  142. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIChat.js +0 -0
  143. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIContact.js +0 -0
  144. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIConversation.js +0 -0
  145. /package/dist/cjs/locales/{zh_cn → zh-CN}/TUIProfile.js +0 -0
  146. /package/dist/cjs/locales/{zh_cn → zh-CN}/index.js +0 -0
  147. /package/dist/esm/locales/{en → en-US}/TUIChat.js +0 -0
  148. /package/dist/esm/locales/{en → en-US}/TUIContact.js +0 -0
  149. /package/dist/esm/locales/{en → en-US}/TUIConversation.js +0 -0
  150. /package/dist/esm/locales/{en → en-US}/TUIProfile.js +0 -0
  151. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIChat.js +0 -0
  152. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIContact.js +0 -0
  153. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIConversation.js +0 -0
  154. /package/dist/esm/locales/{zh_cn → zh-CN}/TUIProfile.js +0 -0
  155. /package/dist/esm/locales/{zh_cn → zh-CN}/index.js +0 -0
  156. /package/src/locales/{en → en-US}/TUIChat.ts +0 -0
  157. /package/src/locales/{en → en-US}/TUIContact.ts +0 -0
  158. /package/src/locales/{en → en-US}/TUIConversation.ts +0 -0
  159. /package/src/locales/{en → en-US}/TUIProfile.ts +0 -0
  160. /package/src/locales/{zh_cn → zh-CN}/TUIChat.ts +0 -0
  161. /package/src/locales/{zh_cn → zh-CN}/TUIContact.ts +0 -0
  162. /package/src/locales/{zh_cn → zh-CN}/TUIConversation.ts +0 -0
  163. /package/src/locales/{zh_cn → zh-CN}/TUIProfile.ts +0 -0
  164. /package/src/locales/{zh_cn → zh-CN}/index.ts +0 -0
@@ -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
- if (pos === '') return <></>
50
+ const titleList = str.split(new RegExp(`(${searchValue})`, 'gi'));
51
+ if (pos === '') return <></>;
32
52
  return (
33
53
  <div>
34
- <span>{str.slice(0, pos)}</span>
35
- <span style={{ color: highlightColor }}>{pos && str.slice(pos, pos + searchValue.length)}</span>
36
- <span>{pos && str.slice(pos + searchValue.length)}</span>
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,26 +119,8 @@ export const getDisplayMessage = (
93
119
  </div>
94
120
  );
95
121
  };
96
- interface TProfile extends Profile, Group {}
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
- };
115
- export const getDisplayTime = (conversation: Conversation, language?: string) => {
122
+
123
+ export const getDisplayTime = (conversation: Conversation, language: string) => {
116
124
  const { lastMessage } = conversation;
117
125
  return getTimeStamp(lastMessage.lastTime * 1000, language);
118
126
  };
@@ -22,7 +22,9 @@ export function WithText<T extends WithEditProps>(props:PropsWithChildren<T>) {
22
22
  const [value, setValue] = useState(propsVal);
23
23
 
24
24
  useLayoutEffect(() => {
25
- inputRef?.current?.focus();
25
+ inputRef?.current?.focus({
26
+ preventScroll: true,
27
+ });
26
28
  setValue(value);
27
29
  }, [inputRef, propsVal]);
28
30
 
@@ -35,7 +37,7 @@ export function WithText<T extends WithEditProps>(props:PropsWithChildren<T>) {
35
37
  };
36
38
  return (
37
39
  <div className={`edit ${className}`}>
38
- {/* // eslint-disable-next-line
40
+ {/* // eslint-disable-next-line
39
41
  // @ts-ignore */}
40
42
  <input ref={inputRef} type="text" value={value} onChange={handleChange} />
41
43
  <Icon className="icon" width={15} height={10.5} type={IconTypes.CONFIRM} onClick={handleConfirm} />
@@ -83,7 +83,9 @@ export const Input = React.forwardRef<InputRef, InputProps>(
83
83
  };
84
84
  const focus = () => {
85
85
  if (inputRef.current) {
86
- inputRef.current.focus();
86
+ inputRef.current.focus({
87
+ preventScroll: true,
88
+ });
87
89
  }
88
90
  };
89
91
  useImperativeHandle(ref, () => ({
@@ -3,20 +3,22 @@
3
3
  display: flex;
4
4
  align-items: center;
5
5
  border-radius: 10px;
6
- background: rgba(249, 249, 249, 0.94);
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 #147AFF;
12
+ outline: 1px solid #147aff;
13
13
  }
14
+
14
15
  &.tui-kit-input-border--bottom {
15
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
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, 0.6);
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(#000000, 0.5);
2
+ background: rgba(#000, 0.5);
3
3
  position: fixed;
4
- z-index: 2;
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,6 +1,7 @@
1
1
  .popup {
2
2
  opacity: 0;
3
+
3
4
  &-show {
4
5
  opacity: 1;
5
6
  }
6
- }
7
+ }
@@ -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
- line-height: 17px;
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
+ }
@@ -1,16 +1,23 @@
1
+ @use "../../styles/colors/color-theme" as *;
2
+
1
3
  .tui-conversation {
2
- height: 0;
3
4
  flex: 1;
4
- min-width: 360px;
5
- max-width: 400px;
5
+ box-sizing: border-box;
6
+ overflow: hidden;
7
+ min-width: 0;
6
8
  display: flex;
7
9
  flex-direction: column;
8
10
  position: relative;
9
- border-right: 1px solid #F9FAFB;
10
11
  text-align: initial;
12
+
13
+ @include theme() {
14
+ background-color: get(bg-primary);
15
+ }
16
+
11
17
  .tui-conversation-header {
12
18
  display: flex;
13
19
  padding: 10px 20px;
20
+
14
21
  .tui-conversation-create-icon {
15
22
  display: flex;
16
23
  align-items: center;
@@ -18,16 +25,19 @@
18
25
  margin-left: 10px;
19
26
  }
20
27
  }
28
+
21
29
  .no-result {
22
30
  padding: 0 20px;
23
31
  display: flex;
24
32
  flex-direction: column;
25
33
  align-items: center;
34
+
26
35
  &-icon {
27
36
  margin: 100px auto 50px;
28
37
  }
38
+
29
39
  &-message {
30
- color: #999999;
40
+ color: #999;
31
41
  font-weight: 400;
32
42
  font-size: 16px;
33
43
  font-family: PingFangSC-Medium;
@@ -35,8 +45,15 @@
35
45
  }
36
46
  }
37
47
  }
48
+
38
49
  .tui-conversation-h5 {
39
- min-width: 100%;
40
- width: 100%;
41
- max-width: 100%;
42
- }
50
+ .tui-conversation-header {
51
+ padding: 10px;
52
+ }
53
+
54
+ .conversation-list-container {
55
+ .conversation-preview-container {
56
+ padding: 0 10px;
57
+ }
58
+ }
59
+ }
@@ -7,8 +7,6 @@ import { isH5, isPC } from '../../utils/env';
7
7
  import { useTUIKit, UseContactParams } from './hooks/useTUIKit';
8
8
  import { useCreateTUIKitContext } from './hooks/useCreateTUIKitContext';
9
9
  import { TUIKitProvider } from '../../context/TUIKitContext';
10
- import './styles/index.scss';
11
- import './styles/h5.scss';
12
10
  import { TUIConversation } from '../TUIConversation';
13
11
  import { TUIChat } from '../TUIChat';
14
12
  import { TUIManage } from '../TUIManage';
@@ -21,6 +19,9 @@ import chats from '../Icon/images/chats.svg';
21
19
  import chatsSelected from '../Icon/images/chats-selected.svg';
22
20
  import contacts from '../Icon/images/contacts.svg';
23
21
  import contactsSelected from '../Icon/images/contacts-selected.svg';
22
+ import './styles/index.scss';
23
+ import './styles/h5.scss';
24
+ import '../../styles/index.scss';
24
25
 
25
26
  export interface ChatProps {
26
27
  chat?: any,
@@ -134,7 +135,7 @@ export function TUIKit<
134
135
  chat = TUILogin.getContext().chat,
135
136
  customClasses,
136
137
  activeConversation,
137
- language = 'en',
138
+ language = 'en-US',
138
139
  } = props;
139
140
 
140
141
  (window as any).tencent_cloud_im_csig_react_uikit_23F_xa = true;
@@ -1,14 +1,19 @@
1
- @import "reset";
1
+ @use "../../../styles/colors/color-theme" as *;
2
+
2
3
  .tui-kit {
3
4
  position: relative;
4
5
  display: flex;
5
6
  width: 100%;
6
7
  height: 100%;
7
- background-color: #FFFFFF;
8
8
  text-align: initial;
9
+
10
+ @include theme() {
11
+ background-color: get(bg-primary);
12
+ }
9
13
  }
14
+
10
15
  .sample-chat {
11
- position:relative;
16
+ position: relative;
12
17
  margin: 0 auto;
13
18
  width: calc(100% - 20rem);
14
19
  min-width: 850px;
@@ -16,23 +21,30 @@
16
21
  box-sizing: border-box;
17
22
  border-radius: 12px;
18
23
  overflow: hidden;
24
+
19
25
  &-profile {
20
26
  position: absolute;
21
27
  top: 0;
22
28
  z-index: 1;
29
+ width: 100%;
30
+ height: 100%;
23
31
  }
32
+
24
33
  &-left-container {
25
34
  max-width: 360px;
26
35
  min-width: 360px;
27
36
  display: flex;
28
37
  flex-direction: column;
38
+ position: relative;
29
39
  }
40
+
30
41
  &-tab {
31
42
  display: flex;
32
43
  align-items: center;
33
44
  justify-content: space-around;
34
45
  margin: 12px;
35
46
  }
47
+
36
48
  &-tab-container {
37
49
  display: flex;
38
50
  flex-direction: column;
@@ -40,22 +52,26 @@
40
52
  justify-content: center;
41
53
  cursor: pointer;
42
54
  }
55
+
43
56
  &-tab-text {
44
57
  font-size: 15px;
45
58
  line-height: 25px;
46
59
  text-align: center;
47
60
  }
61
+
48
62
  &-tab-active {
49
- color: #147AFF;
63
+ color: #147aff;
50
64
  }
51
65
  }
66
+
52
67
  .tuikit-container {
53
68
  display: flex;
54
69
  height: 100%;
55
70
  position: relative;
56
71
  text-align: initial;
57
- box-shadow: 0 11px 20px 0 rgba(0,0,0,.3);
72
+ box-shadow: 0 11px 20px 0 rgba(0, 0, 0, 30%);
58
73
  }
74
+
59
75
  .tui-chat-default {
60
76
  width: 100%;
61
77
  height: 100%;
@@ -63,6 +79,7 @@
63
79
  background-position-x: -17px;
64
80
  background-position-y: 173px;
65
81
  padding: 100px 40px 0;
82
+
66
83
  header {
67
84
  display: flex;
68
85
  align-items: center;
@@ -71,11 +88,13 @@
71
88
  font-weight: 500;
72
89
  color: #000;
73
90
  letter-spacing: 0;
91
+
74
92
  img {
75
93
  width: 32px;
76
94
  margin: 0 10px;
77
95
  }
78
96
  }
97
+
79
98
  .content {
80
99
  max-width: 393px;
81
100
  font-size: 16px;
@@ -86,6 +105,7 @@
86
105
  letter-spacing: 0;
87
106
  padding: 36px 0 20px;
88
107
  }
108
+
89
109
  .link {
90
110
  font-size: 14px;
91
111
  line-height: 20px;
@@ -93,6 +113,7 @@
93
113
  font-weight: 400;
94
114
  color: #666;
95
115
  letter-spacing: 0;
116
+
96
117
  a {
97
118
  font-family: PingFangSC-Regular;
98
119
  font-weight: 400;
@@ -104,9 +125,8 @@
104
125
  }
105
126
  }
106
127
 
107
-
108
128
  body {
109
129
  #webpack-dev-server-client-overlay {
110
130
  display: none !important;
111
131
  }
112
- }
132
+ }
@@ -5,13 +5,16 @@
5
5
  max-width: 300px;
6
6
  min-width: 200px;
7
7
  border-left: 1px solid #f9fafb;
8
+
8
9
  .red {
9
- color: #FF584C !important;
10
+ color: #ff584c !important;
10
11
  }
12
+
11
13
  .tui-manage-title {
12
14
  display: flex;
13
15
  align-items: center;
14
- padding: 24px 20px;
16
+ padding: 24px 10px;
17
+
15
18
  span {
16
19
  margin-right: 10px;
17
20
  font-weight: 700;
@@ -20,15 +23,18 @@
20
23
  line-height: 17px;
21
24
  }
22
25
  }
26
+
23
27
  .tui-manage-container {
24
28
  .tui-manage-info {
25
29
  display: flex;
26
30
  flex-direction: column;
27
31
  align-items: center;
32
+
28
33
  .info-avatar {
29
34
  margin-top: 40px;
30
35
  margin-bottom: 20px;
31
36
  }
37
+
32
38
  .info-name {
33
39
  text-align: center;
34
40
  font-weight: 700;
@@ -37,33 +43,37 @@
37
43
  line-height: 29px;
38
44
  margin-bottom: 10px;
39
45
  }
46
+
40
47
  .info-id {
41
48
  font-weight: 400;
42
49
  font-size: 12px;
43
50
  font-family: PingFangSC-Medium;
44
51
  line-height: 14px;
45
- color: #666666;
52
+ color: #666;
46
53
  margin-bottom: 30px;
47
54
  text-align: center;
48
55
  }
49
56
  }
57
+
50
58
  .tui-manage-handle {
51
59
  .manage-handle-box {
52
- &:nth-child(2) {
53
- margin-top: 10px;
54
- cursor: pointer;
55
- }
56
60
  display: flex;
57
- background: rgba(249, 249, 249, 0.94);
61
+ background: rgba(249, 249, 249, 94%);
58
62
  align-items: center;
59
63
  justify-content: space-between;
60
64
  padding: 10px;
61
65
  box-sizing: border-box;
66
+
67
+ &:nth-child(2) {
68
+ margin-top: 10px;
69
+ cursor: pointer;
70
+ }
71
+
62
72
  .manage-handle-title {
63
73
  font-size: 16px;
64
74
  font-family: PingFangSC-Medium;
65
75
  line-height: 22px;
66
- color: rgba(0, 0, 0, 0.6);
76
+ color: rgba(0, 0, 0, 60%);
67
77
  }
68
78
  }
69
79
  }
@@ -71,7 +81,7 @@
71
81
  }
72
82
 
73
83
  .tui-manage.tui-h5-manage {
74
- border-left: 1px solid #f9fafb;
84
+ border-left: none;
75
85
  display: flex;
76
86
  flex-direction: column;
77
87
  position: absolute;
@@ -1,26 +1,37 @@
1
- .message-text, .message-custom{
2
- border: 1px solid #DDDDDD;
1
+ @use "../../../styles/colors/color-theme" as *;
2
+
3
+ .message-text,
4
+ .message-custom {
5
+ @include theme() {
6
+ border: 1px solid get(border-5);
7
+ }
3
8
  }
4
9
 
5
10
  .bubble {
11
+ @include theme() {
12
+ background-color: get(bg-primary);
13
+ }
14
+
6
15
  &-out {
7
- background: #F2F7FF;
8
- border: 1px solid #F2F7FF;
16
+ @include theme() {
17
+ border: none;
18
+ background-color: get(bg-secondary);
19
+ }
9
20
  }
10
21
  }
11
22
 
12
23
  .meesage-bubble-reply-out {
13
- background: #F2F7FF;
14
24
  .meesage-bubble-reply-main {
15
- .message-text{
25
+ .message-text {
16
26
  background: none;
17
27
  }
18
28
  }
19
29
  }
20
30
 
21
-
22
31
  .message-tip {
23
- color: #999999;
32
+ @include theme() {
33
+ color: get(text-secondary);
34
+ }
24
35
  }
25
36
 
26
37
  .tip {
@@ -30,4 +41,4 @@
30
41
  padding: 3px;
31
42
  }
32
43
  }
33
- }
44
+ }