@trtc/calls-uikit-react 4.5.0 → 4.5.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/package.json +2 -2
- package/src/Components/components/base/Message/Message.tsx +2 -1
- package/src/Components/components/base/Message/MessagePlugin.tsx +17 -9
- package/src/Components/components/base/Popup/Popup.tsx +2 -1
- package/src/Components/components/common/FloatingWindow/FloatingWindow.tsx +2 -1
- package/src/Components/components/common/UIKitModal/UIKitModal.tsx +3 -1
- package/src/TUICallService/CallService/index.ts +1 -1
- package/src/TUICallService/const/call.ts +3 -1
- package/src/index.ts +1 -1
- package/tuicall-uikit-react.es.js +669 -665
- package/tuicall-uikit-react.umd.js +3 -3
- package/types/TUICallService/const/call.d.ts +3 -1
- package/src/TUICallService/utils/validate/validateConfig.ts +0 -188
- package/src/TUICallService/utils/validate/validateParams.ts +0 -88
- package/types/TUICallService/utils/validate/validateConfig.d.ts +0 -173
- package/types/TUICallService/utils/validate/validateParams.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trtc/calls-uikit-react",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"main": "./tuicall-uikit-react.umd.js",
|
|
5
5
|
"module": "./tuicall-uikit-react.es.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tencentcloud/tui-core-lite": "~1.0.1",
|
|
17
|
-
"@trtc/call-engine-lite-js": "~4.0.
|
|
17
|
+
"@trtc/call-engine-lite-js": "~4.0.3",
|
|
18
18
|
"@tencentcloud/lite-chat": "^1.6.3",
|
|
19
19
|
"@trtc/call-engine-lite-wx": "~4.0.0"
|
|
20
20
|
},
|
|
@@ -46,7 +46,8 @@ export function Message(props: IMessageProps) {
|
|
|
46
46
|
plaintext = false,
|
|
47
47
|
onClose = () => null,
|
|
48
48
|
} = props;
|
|
49
|
-
|
|
49
|
+
// React 19's useRef removed the no-argument overload; pass undefined explicitly.
|
|
50
|
+
const timer = useRef<any>(undefined);
|
|
50
51
|
const classnames = classNames([
|
|
51
52
|
className,
|
|
52
53
|
`${classPrefix}-message-container`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRoot, type Root } from 'react-dom/client';
|
|
2
2
|
import React, { CSSProperties, useEffect } from 'react';
|
|
3
3
|
import { IMessageProps, Message } from './Message';
|
|
4
4
|
import { noop } from '../../../../TUICallService/utils/common-utils';
|
|
@@ -46,7 +46,9 @@ function createContainer(): Promise<Element> {
|
|
|
46
46
|
const container = Array.from(mountedDom.querySelectorAll(`#${containerId}`));
|
|
47
47
|
if (container.length < 1) {
|
|
48
48
|
const div = document.createElement('div');
|
|
49
|
-
render
|
|
49
|
+
// Use React 18+ createRoot API; legacy ReactDOM.render was removed in React 19.
|
|
50
|
+
const root = createRoot(div);
|
|
51
|
+
root.render(
|
|
50
52
|
<MessageContainer
|
|
51
53
|
id={containerId}
|
|
52
54
|
zIndex={1}
|
|
@@ -56,7 +58,6 @@ function createContainer(): Promise<Element> {
|
|
|
56
58
|
resolve(containers[0]);
|
|
57
59
|
}}
|
|
58
60
|
/>,
|
|
59
|
-
div,
|
|
60
61
|
);
|
|
61
62
|
} else {
|
|
62
63
|
resolve(container[0]);
|
|
@@ -73,9 +74,18 @@ async function createMessage(theme, config): Promise<any> {
|
|
|
73
74
|
|
|
74
75
|
keyIndex += 1;
|
|
75
76
|
|
|
77
|
+
// Persist the React root so it can be unmounted explicitly in close().
|
|
78
|
+
let root: Root | null = null;
|
|
76
79
|
const message = {
|
|
77
80
|
close: () => {
|
|
78
|
-
|
|
81
|
+
if (root) {
|
|
82
|
+
// Defer unmount to the next tick to avoid React's "synchronously unmount
|
|
83
|
+
// a root while React is already rendering" warning when the close is
|
|
84
|
+
// triggered from inside a render-phase callback.
|
|
85
|
+
const targetRoot = root;
|
|
86
|
+
root = null;
|
|
87
|
+
Promise.resolve().then(() => targetRoot.unmount());
|
|
88
|
+
}
|
|
79
89
|
div.remove();
|
|
80
90
|
message.closed = true;
|
|
81
91
|
},
|
|
@@ -95,10 +105,9 @@ async function createMessage(theme, config): Promise<any> {
|
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
return new Promise((resolve) => {
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
render(
|
|
108
|
+
// Use React 18+ createRoot API; legacy ReactDOM.render was removed in React 19.
|
|
109
|
+
root = createRoot(div);
|
|
110
|
+
root.render(
|
|
102
111
|
<Message
|
|
103
112
|
key={keyIndex}
|
|
104
113
|
{...config}
|
|
@@ -111,7 +120,6 @@ async function createMessage(theme, config): Promise<any> {
|
|
|
111
120
|
>
|
|
112
121
|
{content}
|
|
113
122
|
</Message>,
|
|
114
|
-
div,
|
|
115
123
|
);
|
|
116
124
|
|
|
117
125
|
// Mounts the current rendered message to the specified container.
|
|
@@ -29,7 +29,8 @@ const Popup = forwardRef((props: IPopupProps, ref: any) => {
|
|
|
29
29
|
const [popperElement, setPopperElement] = useState(null);
|
|
30
30
|
const [arrowElement, setArrowElement] = useState(null);
|
|
31
31
|
const contentRef = useRef(null); // The content section.
|
|
32
|
-
|
|
32
|
+
// React 19's useRef removed the no-argument overload; pass undefined explicitly.
|
|
33
|
+
const updateTimeRef = useRef<any>(undefined);
|
|
33
34
|
const popupRef = useRef(null);
|
|
34
35
|
const { styles } = usePopper(referenceElement, popperElement, {
|
|
35
36
|
modifiers: [{ name: 'arrow', options: { element: arrowElement } }],
|
|
@@ -14,7 +14,8 @@ interface IFloatingWindowProps {
|
|
|
14
14
|
|
|
15
15
|
export default function FloatingWindow(props: IFloatingWindowProps) {
|
|
16
16
|
const { isGroupCall } = useContext(CallInfoContext);
|
|
17
|
-
|
|
17
|
+
// React 19's useRef removed the no-argument overload; pass undefined explicitly.
|
|
18
|
+
const nodeRef = useRef<any>(undefined);
|
|
18
19
|
const [clickable, setClickable] = useState(true);
|
|
19
20
|
const visibility: any = props.show ? '' : 'hidden';
|
|
20
21
|
|
|
@@ -50,7 +50,9 @@ function processAnchorTags(content: string): string {
|
|
|
50
50
|
return doc.body.innerHTML;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
// React 19 narrows component return types; use ReactNode instead of JSX.Element
|
|
54
|
+
// so each entry can be rendered as <TypeIcon />.
|
|
55
|
+
const TypeIcons: Record<string, () => ReactNode> = {
|
|
54
56
|
success: () => <span style={{ color: 'green', marginRight: '6px' }}>✓</span>,
|
|
55
57
|
info: () => <span style={{ color: '#1890ff', marginRight: '6px' }}>ℹ</span>,
|
|
56
58
|
error: () => <span style={{ color: 'red', marginRight: '6px' }}>✕</span>,
|
|
@@ -27,7 +27,7 @@ const TUIGlobal: ITUIGlobal = TuiGlobal.getInstance();
|
|
|
27
27
|
const TUIStore: ITUIStore = TuiStore.getInstance();
|
|
28
28
|
const uiDesign = UIDesign.getInstance();
|
|
29
29
|
uiDesign.setTUIStore(TUIStore);
|
|
30
|
-
const version = '4.5.
|
|
30
|
+
const version = '4.5.2';
|
|
31
31
|
import AIAssistant from './AIAssistant'; // 仅 web 支持 AI 实时字幕
|
|
32
32
|
const frameWork = 'react';
|
|
33
33
|
export { TUIGlobal, TUIStore, uiDesign };
|
|
@@ -54,7 +54,9 @@ export enum VideoDisplayMode {
|
|
|
54
54
|
* @property {String} 1080p
|
|
55
55
|
*/
|
|
56
56
|
export enum VideoResolution {
|
|
57
|
-
|
|
57
|
+
RESOLUTION_360P = '360p',
|
|
58
|
+
RESOLUTION_480P = '480p', // c++ 重构后, 480p 不支持, 使用的是 540p
|
|
59
|
+
RESOLUTION_540P = '540p',
|
|
58
60
|
RESOLUTION_720P = '720p',
|
|
59
61
|
RESOLUTION_1080P = '1080p',
|
|
60
62
|
}
|