@trtc/calls-uikit-react 4.5.1 → 4.5.3-beta.1
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 +3 -4
- 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 +16 -1
- package/src/TUICallService/TUIStore/callStore.ts +1 -0
- package/src/TUICallService/const/index.ts +1 -0
- package/src/TUICallService/interface/ICallStore.ts +1 -0
- package/src/index.ts +1 -1
- package/tuicall-uikit-react.es.js +1734 -1712
- package/tuicall-uikit-react.umd.js +4 -4
- package/types/Components/TUICallKit/TUICallKit.d.ts +2 -2
- package/types/Components/components/GroupCall/GroupCall.d.ts +2 -1
- package/types/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.d.ts +2 -1
- package/types/Components/components/GroupCall/MediaContainer/MediaContainer.d.ts +2 -1
- package/types/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.d.ts +1 -1
- package/types/Components/components/GroupCall/Waiting/Waiting.d.ts +2 -1
- package/types/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.d.ts +2 -1
- package/types/Components/components/SingleCall/MediaContainer/MediaContainer.d.ts +2 -1
- package/types/Components/components/SingleCall/SingleCall.d.ts +1 -1
- package/types/Components/components/SingleCall/Waiting/Waiting.d.ts +2 -1
- package/types/Components/components/base/Avatar/Avatar.d.ts +2 -2
- package/types/Components/components/base/Drag/Drag.d.ts +2 -2
- package/types/Components/components/base/Grid/Col/Col.d.ts +2 -2
- package/types/Components/components/base/Grid/Row/Row.d.ts +1 -1
- package/types/Components/components/base/GridLayout/GridLayout.d.ts +2 -1
- package/types/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.d.ts +2 -2
- package/types/Components/components/base/Icon/Icon.d.ts +2 -2
- package/types/Components/components/base/Loading/Circle/Cilrcle.d.ts +2 -1
- package/types/Components/components/base/Loading/Dot/Dot.d.ts +2 -1
- package/types/Components/components/base/Loading/Loading.d.ts +2 -2
- package/types/Components/components/base/Message/Message.d.ts +2 -2
- package/types/Components/components/base/Message/MessageIcon/Error.d.ts +1 -1
- package/types/Components/components/base/Message/MessageIcon/Info.d.ts +1 -1
- package/types/Components/components/base/Message/MessageIcon/Success.d.ts +1 -1
- package/types/Components/components/base/Message/MessageIcon/Warning.d.ts +1 -1
- package/types/Components/components/base/Overlayer/Overlayer.d.ts +2 -2
- package/types/Components/components/base/Text/Text.d.ts +2 -1
- package/types/Components/components/base/Time/Time.d.ts +2 -1
- package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +1 -1
- package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/ButtonPanel.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.d.ts +2 -2
- package/types/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Accept/Accept.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Camera.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Hangup/Hangup.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Microphone.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Minimize/Minimize.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Reject/Reject.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/Speaker.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/SwitchAudioCall.d.ts +2 -1
- package/types/Components/components/common/ButtonPanel/button/SwitchCamera.d.ts +2 -1
- package/types/Components/components/common/CallMessage/CallMessage.d.ts +1 -1
- package/types/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.d.ts +2 -1
- package/types/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.d.ts +2 -1
- package/types/Components/components/common/DeviceSelector/DeviceSelector.d.ts +2 -1
- package/types/Components/components/common/FloatingWindow/FloatingWindow.d.ts +2 -2
- package/types/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.d.ts +2 -2
- package/types/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.d.ts +2 -2
- package/types/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.d.ts +2 -2
- package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +2 -2
- package/types/Components/components/common/Player/Player.d.ts +2 -2
- package/types/Components/components/common/Pusher/Pusher.d.ts +1 -1
- package/types/Components/components/common/StreamInfo/StreamInfo.d.ts +2 -1
- package/types/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.d.ts +2 -1
- package/types/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.d.ts +2 -1
- package/types/Components/components/common/Tip/Tip.d.ts +2 -2
- package/types/Components/components/common/TopBar/TopBar.d.ts +2 -1
- package/types/Components/components/common/TopBar/h5/TopBarH5.d.ts +2 -1
- package/types/Components/components/common/TopBar/pc/TopBarPC.d.ts +2 -1
- package/types/TUICallService/CallService/index.d.ts +1 -0
- package/types/TUICallService/interface/ICallStore.d.ts +1 -0
- 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.1",
|
|
3
|
+
"version": "4.5.3-beta.1",
|
|
4
4
|
"main": "./tuicall-uikit-react.umd.js",
|
|
5
5
|
"module": "./tuicall-uikit-react.es.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tencentcloud/tui-core-lite": "~1.0.1",
|
|
17
|
-
"@trtc/call-engine-lite-js": "
|
|
18
|
-
"@tencentcloud/lite-chat": "^1.6.3"
|
|
19
|
-
"@trtc/call-engine-lite-wx": "~4.0.0"
|
|
17
|
+
"@trtc/call-engine-lite-js": "4.0.5-beta.1",
|
|
18
|
+
"@tencentcloud/lite-chat": "^1.6.3"
|
|
20
19
|
},
|
|
21
20
|
"bugs": {
|
|
22
21
|
"url": "https://github.com/tencentyun/TUICallKit/issues"
|
|
@@ -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.1';
|
|
30
|
+
const version = '4.5.3-beta.1';
|
|
31
31
|
import AIAssistant from './AIAssistant'; // 仅 web 支持 AI 实时字幕
|
|
32
32
|
const frameWork = 'react';
|
|
33
33
|
export { TUIGlobal, TUIStore, uiDesign };
|
|
@@ -51,6 +51,13 @@ export default class TUICallService {
|
|
|
51
51
|
private _wasmReadyPromise;
|
|
52
52
|
private _wasmReadyResolve;
|
|
53
53
|
private _isInitialized = false;
|
|
54
|
+
// Use an arrow function to keep the `this` binding when registering/unregistering the listener.
|
|
55
|
+
private _handleAutoPlayFailed = () => {
|
|
56
|
+
this._tuiCallEngine?.reportLog?.({
|
|
57
|
+
name: 'TUICallkit.onAutoPlayFailed',
|
|
58
|
+
});
|
|
59
|
+
TUIStore.update(StoreName.CALL, NAME.IS_SHOW_AUTO_PLAY_DIALOG, true);
|
|
60
|
+
};
|
|
54
61
|
|
|
55
62
|
constructor() {
|
|
56
63
|
console.log(`${NAME.PREFIX}version: ${version}`);
|
|
@@ -132,6 +139,9 @@ export default class TUICallService {
|
|
|
132
139
|
trtcCloudInstance?.callExperimentalAPI(JSON.stringify(
|
|
133
140
|
{ "api": "enableAutoPlayDialog","params": { "enable": 0 } }
|
|
134
141
|
));
|
|
142
|
+
// Register the auto play failed listener at initialization time, otherwise the event may
|
|
143
|
+
// be fired before the AutoPlayDialog component is mounted and the listener would miss it.
|
|
144
|
+
trtcCloudInstance?.on?.('onAutoPlayFailed', this._handleAutoPlayFailed);
|
|
135
145
|
this._tuiCallEngine?.reportLog?.({
|
|
136
146
|
name: 'TUICallkit.init',
|
|
137
147
|
data: {
|
|
@@ -153,6 +163,8 @@ export default class TUICallService {
|
|
|
153
163
|
}
|
|
154
164
|
if (this._tuiCallEngine) {
|
|
155
165
|
this._removeListenTuiCallEngineEvent();
|
|
166
|
+
const trtcCloudInstance = this._tuiCallEngine?.getTRTCCloudInstance?.();
|
|
167
|
+
trtcCloudInstance?.off?.('onAutoPlayFailed', this._handleAutoPlayFailed);
|
|
156
168
|
await this._tuiCallEngine.destroyInstance();
|
|
157
169
|
this._tuiCallEngine = null;
|
|
158
170
|
}
|
|
@@ -338,6 +350,9 @@ export default class TUICallService {
|
|
|
338
350
|
const { enable } = params;
|
|
339
351
|
TUIStore.update(StoreName.CALL, NAME.IS_FORCE_USE_V2_API, !!enable);
|
|
340
352
|
break;
|
|
353
|
+
case 'setWaterMark':
|
|
354
|
+
this._tuiCallEngine?.callExperimentalAPI?.(jsonStr);
|
|
355
|
+
break;
|
|
341
356
|
default:
|
|
342
357
|
break;
|
|
343
358
|
}
|
|
@@ -26,6 +26,7 @@ export const CALL_DATA_KEY: any = {
|
|
|
26
26
|
PLAYER: 'player',
|
|
27
27
|
IS_EAR_PHONE: 'isEarPhone',
|
|
28
28
|
IS_MUTE_SPEAKER: 'isMuteSpeaker',
|
|
29
|
+
IS_SHOW_AUTO_PLAY_DIALOG: 'isShowAutoPlayDialog',
|
|
29
30
|
SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP',
|
|
30
31
|
NETWORK_STATUS: 'NetWorkStatus',
|
|
31
32
|
CALL_ID: 'callID',
|
|
@@ -34,6 +34,7 @@ export interface ICallStore {
|
|
|
34
34
|
roomIdType: number;
|
|
35
35
|
cameraPosition: CameraPosition; // 前置或后置,值为front, back
|
|
36
36
|
isMuteSpeaker: boolean;
|
|
37
|
+
isShowAutoPlayDialog: boolean; // 是否显示自动播放失败弹窗, 默认: false
|
|
37
38
|
groupCallMembers: IUserInfo[]; // chat 群会话中在通话的成员
|
|
38
39
|
// TUICallKit 组件上的属性
|
|
39
40
|
displayMode: VideoDisplayMode; // 设置预览远端的画面显示模式, 默认: VideoDisplayMode.COVER
|