@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.
Files changed (113) hide show
  1. package/.eslintrc.cjs +5 -4
  2. package/CHANGELOG.md +9 -0
  3. package/dist/components/Chat/Chat.d.ts +1 -1
  4. package/dist/components/Chat/Chat.js +18 -23
  5. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
  6. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
  7. package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
  8. package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
  9. package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
  10. package/dist/components/ChatHeader/ChatHeader.js +43 -41
  11. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
  12. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
  13. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
  14. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
  15. package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
  16. package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
  17. package/dist/components/ChatHeader/index.d.ts +2 -1
  18. package/dist/components/ChatHeader/index.js +4 -2
  19. package/dist/components/Checkbox/index.js +1 -1
  20. package/dist/components/Modal/Modal.js +1 -1
  21. package/dist/components/Model/index.js +1 -1
  22. package/dist/components/Plugins/index.js +1 -1
  23. package/dist/components/Popup/index.js +1 -1
  24. package/dist/components/PopupNew/Popup.js +1 -1
  25. package/dist/components/Profile/Profile.js +20 -22
  26. package/dist/components/Profile/ProfileDefault.d.ts +3 -2
  27. package/dist/components/Profile/ProfileDefault.js +55 -56
  28. package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
  29. package/dist/components/Profile/hooks/useMyProfile.js +1 -1
  30. package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
  31. package/dist/components/Profile/myProfile/MyProfile.js +12 -16
  32. package/dist/components/index.js +27 -25
  33. package/dist/context/ChatContext.d.ts +1 -1
  34. package/dist/context/ChatContext.js +11 -16
  35. package/dist/context/ContactContext.d.ts +1 -1
  36. package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
  37. package/dist/hooks/index.d.ts +2 -2
  38. package/dist/hooks/index.js +2 -2
  39. package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
  40. package/dist/hooks/useChatHeader.js +41 -0
  41. package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.js +93 -4133
  44. package/dist/server/mainServer.js +2 -2
  45. package/dist/states/UIManagerState.d.ts +5 -5
  46. package/dist/states/UIManagerState.js +2 -2
  47. package/dist/states/index.d.ts +0 -1
  48. package/dist/states/index.js +2 -4
  49. package/dist/styles/AudioCallPicker.css +1 -0
  50. package/dist/styles/ChatHeaderUI.css +1 -1
  51. package/dist/styles/VideoCallPicker.css +1 -0
  52. package/dist/styles/index-UBuvRM8r.css +1 -0
  53. package/dist/styles/index.css +1 -1
  54. package/dist/styles/index2.css +1 -1
  55. package/dist/styles/index3.css +1 -1
  56. package/dist/styles/index4.css +1 -1
  57. package/dist/styles/index5.css +1 -1
  58. package/dist/types/message.d.ts +1 -1
  59. package/dist/types/user.d.ts +4 -4
  60. package/package.json +12 -20
  61. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
  62. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
  63. package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
  64. package/src/components/ChatHeader/ChatHeader.tsx +15 -3
  65. package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
  66. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
  67. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
  68. package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
  69. package/src/components/ChatHeader/index.ts +2 -1
  70. package/src/components/Profile/Profile.tsx +7 -6
  71. package/src/components/Profile/ProfileDefault.tsx +8 -8
  72. package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
  73. package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
  74. package/src/context/ChatContext.tsx +1 -1
  75. package/src/context/ContactContext.tsx +1 -1
  76. package/src/hooks/index.ts +2 -2
  77. package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
  78. package/src/index.ts +3 -5
  79. package/src/server/mainServer.ts +2 -2
  80. package/src/states/UIManagerState.ts +9 -9
  81. package/src/states/index.ts +0 -2
  82. package/src/styles/index.scss +0 -1
  83. package/src/types/message.ts +1 -1
  84. package/src/types/user.ts +4 -4
  85. package/vite.config.ts +4 -25
  86. package/dist/ChatSetting-LYkP2NWu.js +0 -29890
  87. package/dist/assets/fonts/iconfont.ttf +0 -0
  88. package/dist/assets/fonts/iconfont.woff +0 -0
  89. package/dist/assets/fonts/iconfont.woff2 +0 -0
  90. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
  91. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
  92. package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
  93. package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
  94. package/dist/components/IconFont/Icon.d.ts +0 -21
  95. package/dist/components/IconFont/Icon.js +0 -47
  96. package/dist/components/IconFont/index.d.ts +0 -2
  97. package/dist/components/IconFont/index.js +0 -4
  98. package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
  99. package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
  100. package/dist/states/ChatHeaderState.js +0 -46
  101. package/dist/styles/ChatHeaderActions.css +0 -1
  102. package/dist/styles/ChatSetting.css +0 -1
  103. package/dist/styles/Icon2.css +0 -1
  104. package/src/assets/fonts/iconfont.ttf +0 -0
  105. package/src/assets/fonts/iconfont.woff +0 -0
  106. package/src/assets/fonts/iconfont.woff2 +0 -0
  107. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
  108. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
  109. package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
  110. package/src/components/IconFont/Icon.module.scss +0 -42
  111. package/src/components/IconFont/Icon.tsx +0 -68
  112. package/src/components/IconFont/index.ts +0 -3
  113. package/src/styles/fonts/icon-font.scss +0 -18
@@ -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 { IUserStatusMap } from '../types/user';
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: IUserStatusMap | undefined;
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?: IUserStatusMap) => void;
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, IUserStatusMap>) {
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 IUserStatusMap;
193
+ const userOnlineStatusMap = Object.fromEntries(userStatusMap) as unknown as UserStatusMap;
194
194
  uiManagerStore.getState().setUserStatusMap(userOnlineStatusMap);
195
195
  }
196
196
 
@@ -1,3 +1 @@
1
1
  export { useUIManagerState } from './UIManagerState';
2
-
3
- export { useChatHeaderState } from './ChatHeaderState';
@@ -1,2 +1 @@
1
1
  @forward "./normalize";
2
- @forward "./fonts/icon-font";
@@ -1,4 +1,4 @@
1
- import type { IMessageModel } from '@tencentcloud/chat-uikit-engine';
1
+ import type { IMessageModel } from '@tencentcloud/chat-uikit-engine-lite';
2
2
 
3
3
  interface IScrollPosition {
4
4
  /** The target scroll position from the top */
package/src/types/user.ts CHANGED
@@ -1,4 +1,4 @@
1
- interface IUserStatus {
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 IUserStatusMap {
17
- [userID: string]: IUserStatus;
16
+ interface UserStatusMap {
17
+ [userID: string]: UserStatus;
18
18
  }
19
19
 
20
- export type { IUserStatus, IUserStatusMap };
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: {