@tencentcloud/chat-uikit-react 3.0.3 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +5 -4
- package/CHANGELOG.md +9 -0
- package/dist/components/Chat/Chat.d.ts +1 -1
- package/dist/components/Chat/Chat.js +18 -23
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
- package/dist/components/ChatHeader/ChatHeader.js +43 -41
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/index.d.ts +2 -1
- package/dist/components/ChatHeader/index.js +4 -2
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Model/index.js +1 -1
- package/dist/components/Plugins/index.js +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/PopupNew/Popup.js +1 -1
- package/dist/components/Profile/Profile.js +20 -22
- package/dist/components/Profile/ProfileDefault.d.ts +3 -2
- package/dist/components/Profile/ProfileDefault.js +55 -56
- package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
- package/dist/components/Profile/hooks/useMyProfile.js +1 -1
- package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
- package/dist/components/Profile/myProfile/MyProfile.js +12 -16
- package/dist/components/index.js +27 -25
- package/dist/context/ChatContext.d.ts +1 -1
- package/dist/context/ChatContext.js +11 -16
- package/dist/context/ContactContext.d.ts +1 -1
- package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
- package/dist/hooks/useChatHeader.js +41 -0
- package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +93 -4133
- package/dist/server/mainServer.js +2 -2
- package/dist/states/UIManagerState.d.ts +5 -5
- package/dist/states/UIManagerState.js +2 -2
- package/dist/states/index.d.ts +0 -1
- package/dist/states/index.js +2 -4
- package/dist/styles/AudioCallPicker.css +1 -0
- package/dist/styles/ChatHeaderUI.css +1 -1
- package/dist/styles/VideoCallPicker.css +1 -0
- package/dist/styles/index-UBuvRM8r.css +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/styles/index2.css +1 -1
- package/dist/styles/index3.css +1 -1
- package/dist/styles/index4.css +1 -1
- package/dist/styles/index5.css +1 -1
- package/dist/types/message.d.ts +1 -1
- package/dist/types/user.d.ts +4 -4
- package/package.json +12 -20
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
- package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/ChatHeader.tsx +15 -3
- package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
- package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/index.ts +2 -1
- package/src/components/Profile/Profile.tsx +7 -6
- package/src/components/Profile/ProfileDefault.tsx +8 -8
- package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
- package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
- package/src/context/ChatContext.tsx +1 -1
- package/src/context/ContactContext.tsx +1 -1
- package/src/hooks/index.ts +2 -2
- package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
- package/src/index.ts +3 -5
- package/src/server/mainServer.ts +2 -2
- package/src/states/UIManagerState.ts +9 -9
- package/src/states/index.ts +0 -2
- package/src/styles/index.scss +0 -1
- package/src/types/message.ts +1 -1
- package/src/types/user.ts +4 -4
- package/vite.config.ts +4 -25
- package/dist/ChatSetting-LYkP2NWu.js +0 -29890
- package/dist/assets/fonts/iconfont.ttf +0 -0
- package/dist/assets/fonts/iconfont.woff +0 -0
- package/dist/assets/fonts/iconfont.woff2 +0 -0
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
- package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
- package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
- package/dist/components/IconFont/Icon.d.ts +0 -21
- package/dist/components/IconFont/Icon.js +0 -47
- package/dist/components/IconFont/index.d.ts +0 -2
- package/dist/components/IconFont/index.js +0 -4
- package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
- package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
- package/dist/states/ChatHeaderState.js +0 -46
- package/dist/styles/ChatHeaderActions.css +0 -1
- package/dist/styles/ChatSetting.css +0 -1
- package/dist/styles/Icon2.css +0 -1
- 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/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
- package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
- package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
- package/src/components/IconFont/Icon.module.scss +0 -42
- package/src/components/IconFont/Icon.tsx +0 -68
- package/src/components/IconFont/index.ts +0 -3
- package/src/styles/fonts/icon-font.scss +0 -18
package/src/server/mainServer.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
|
|
3
|
-
import TUICore, { TUILogin, TUIConstants } from '@tencentcloud/tui-core';
|
|
2
|
+
import TUIChatEngine from '@tencentcloud/chat-uikit-engine-lite';
|
|
3
|
+
import TUICore, { TUILogin, TUIConstants } from '@tencentcloud/tui-core-lite';
|
|
4
4
|
|
|
5
5
|
export default class MainServer {
|
|
6
6
|
constructor() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TUIStore, StoreName, TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
|
2
|
-
import { TUILogin } from '@tencentcloud/tui-core';
|
|
1
|
+
import { TUIStore, StoreName, TUIConversationService } from '@tencentcloud/chat-uikit-engine-lite';
|
|
2
|
+
import { TUILogin } from '@tencentcloud/tui-core-lite';
|
|
3
3
|
import { useStore } from 'zustand';
|
|
4
4
|
import { createStore } from 'zustand/vanilla';
|
|
5
|
-
import type {
|
|
6
|
-
import type { Profile, Friend, FriendApplication } from '@tencentcloud/chat';
|
|
7
|
-
import type { IConversationModel, IGroupModel } from '@tencentcloud/chat-uikit-engine';
|
|
5
|
+
import type { UserStatusMap } from '../types/user';
|
|
6
|
+
import type { Profile, Friend, FriendApplication } from '@tencentcloud/lite-chat';
|
|
7
|
+
import type { IConversationModel, IGroupModel } from '@tencentcloud/chat-uikit-engine-lite';
|
|
8
8
|
|
|
9
9
|
type BlockData = {
|
|
10
10
|
type: 'block';
|
|
@@ -54,7 +54,7 @@ interface IUIManagerState {
|
|
|
54
54
|
/** TUIManageShow */
|
|
55
55
|
TUIManageShow: boolean;
|
|
56
56
|
/** userStatusMap */
|
|
57
|
-
userStatusMap:
|
|
57
|
+
userStatusMap: UserStatusMap | undefined;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
@@ -98,7 +98,7 @@ interface IUIManagerAction {
|
|
|
98
98
|
/** Set the user status map
|
|
99
99
|
* @param userStatusMap - The user status map to set, undefined to clear
|
|
100
100
|
*/
|
|
101
|
-
setUserStatusMap: (userStatusMap?:
|
|
101
|
+
setUserStatusMap: (userStatusMap?: UserStatusMap) => void;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -186,11 +186,11 @@ function onConversationListUpdated(conversationList: IConversationModel[]) {
|
|
|
186
186
|
uiManagerStore.getState().setConversationList(conversationList);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
function onUserStatusListUpdated(userStatusMap: Map<number,
|
|
189
|
+
function onUserStatusListUpdated(userStatusMap: Map<number, UserStatusMap>) {
|
|
190
190
|
if (userStatusMap?.size <= 0) {
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
const userOnlineStatusMap = Object.fromEntries(userStatusMap) as unknown as
|
|
193
|
+
const userOnlineStatusMap = Object.fromEntries(userStatusMap) as unknown as UserStatusMap;
|
|
194
194
|
uiManagerStore.getState().setUserStatusMap(userOnlineStatusMap);
|
|
195
195
|
}
|
|
196
196
|
|
package/src/states/index.ts
CHANGED
package/src/styles/index.scss
CHANGED
package/src/types/message.ts
CHANGED
package/src/types/user.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface UserStatus {
|
|
2
2
|
/**
|
|
3
3
|
* user status type
|
|
4
4
|
* 0: unknown
|
|
@@ -13,8 +13,8 @@ interface IUserStatus {
|
|
|
13
13
|
customStatus: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface
|
|
17
|
-
[userID: string]:
|
|
16
|
+
interface UserStatusMap {
|
|
17
|
+
[userID: string]: UserStatus;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type {
|
|
20
|
+
export type { UserStatus, UserStatusMap };
|
package/vite.config.ts
CHANGED
|
@@ -2,12 +2,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { extname, relative, resolve } from 'path';
|
|
3
3
|
import react from '@vitejs/plugin-react';
|
|
4
4
|
import { glob } from 'glob';
|
|
5
|
-
import postcssUrl from 'postcss-url';
|
|
6
5
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
7
6
|
import { defineConfig } from 'vite';
|
|
8
7
|
import dts from 'vite-plugin-dts';
|
|
9
8
|
import { libInjectCss } from 'vite-plugin-lib-inject-css';
|
|
10
|
-
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
11
9
|
|
|
12
10
|
// https://vite.dev/config/
|
|
13
11
|
export default defineConfig(({ mode }) => {
|
|
@@ -26,10 +24,10 @@ export default defineConfig(({ mode }) => {
|
|
|
26
24
|
'react/jsx-runtime',
|
|
27
25
|
'react-dom',
|
|
28
26
|
'react-dom/client',
|
|
29
|
-
'@tencentcloud/chat',
|
|
30
|
-
'@tencentcloud/tui-core',
|
|
27
|
+
'@tencentcloud/lite-chat',
|
|
28
|
+
'@tencentcloud/tui-core-lite',
|
|
31
29
|
'@tencentcloud/universal-api',
|
|
32
|
-
'@tencentcloud/chat-uikit-engine',
|
|
30
|
+
'@tencentcloud/chat-uikit-engine-lite',
|
|
33
31
|
'@tencentcloud/call-uikit-react',
|
|
34
32
|
'@tencentcloud/uikit-base-component-react',
|
|
35
33
|
],
|
|
@@ -50,9 +48,6 @@ export default defineConfig(({ mode }) => {
|
|
|
50
48
|
'external_modules/mui': [
|
|
51
49
|
'@mui/base',
|
|
52
50
|
],
|
|
53
|
-
'external_modules/lodash': [
|
|
54
|
-
'lodash-es',
|
|
55
|
-
],
|
|
56
51
|
'external_modules/zustand': [
|
|
57
52
|
'zustand',
|
|
58
53
|
],
|
|
@@ -73,12 +68,6 @@ export default defineConfig(({ mode }) => {
|
|
|
73
68
|
outDir: 'dist',
|
|
74
69
|
entryRoot: 'src',
|
|
75
70
|
}),
|
|
76
|
-
viteStaticCopy({
|
|
77
|
-
targets: [{
|
|
78
|
-
src: 'src/assets/fonts',
|
|
79
|
-
dest: 'assets',
|
|
80
|
-
}],
|
|
81
|
-
}),
|
|
82
71
|
enableBuildStats(!isDevelopment),
|
|
83
72
|
],
|
|
84
73
|
css: {
|
|
@@ -86,17 +75,7 @@ export default defineConfig(({ mode }) => {
|
|
|
86
75
|
generateScopedName: name => `uikit-${name}`,
|
|
87
76
|
},
|
|
88
77
|
postcss: {
|
|
89
|
-
plugins: [
|
|
90
|
-
postcssUrl({
|
|
91
|
-
url: (asset) => {
|
|
92
|
-
if (!/\.(woff|woff2|ttf)$/.test(asset.pathname || '')) {
|
|
93
|
-
return asset.url;
|
|
94
|
-
}
|
|
95
|
-
// ensure paths are correct in npm publish
|
|
96
|
-
return `"../assets/fonts/${asset.url.split('/').pop()}"`;
|
|
97
|
-
},
|
|
98
|
-
}),
|
|
99
|
-
],
|
|
78
|
+
plugins: [],
|
|
100
79
|
},
|
|
101
80
|
preprocessorOptions: {
|
|
102
81
|
scss: {
|