@trtc/calls-uikit-react 4.2.5 → 4.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/package.json +3 -3
- package/src/Components/components/common/UIKitModal/UIKitModal.tsx +250 -0
- package/src/Components/components/common/UIKitModal/UIKitModalState.ts +177 -0
- package/src/Components/components/common/UIKitModal/index.module.scss +176 -0
- package/src/Components/components/common/UIKitModal/index.ts +3 -0
- package/src/TUICallService/CallService/UIKitModal.ts +81 -0
- package/src/TUICallService/CallService/index.ts +12 -1
- package/src/TUICallService/const/index.ts +1 -0
- package/src/TUICallService/locales/en.ts +14 -0
- package/src/TUICallService/locales/ja_JP.ts +14 -0
- package/src/TUICallService/locales/zh-cn.ts +14 -0
- package/src/TUICallService/utils/common-utils.ts +1 -1
- package/src/index.ts +1 -1
- package/tuicall-uikit-react.es.js +2874 -2762
- package/tuicall-uikit-react.umd.js +11 -11
- package/types/Components/components/common/UIKitModal/UIKitModal.d.ts +21 -0
- package/types/Components/components/common/UIKitModal/UIKitModalState.d.ts +27 -0
- package/types/Components/components/common/UIKitModal/index.d.ts +3 -0
- package/types/TUICallService/CallService/UIKitModal.d.ts +1 -0
- package/types/TUICallService/locales/en.d.ts +13 -0
- package/types/TUICallService/locales/ja_JP.d.ts +13 -0
- package/types/TUICallService/locales/zh-cn.d.ts +13 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface UIKitModalConfig {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
content: string | ReactNode;
|
|
7
|
+
type: 'info' | 'warning' | 'error' | 'success';
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export type UIKitModalOptions = UIKitModalConfig;
|
|
12
|
+
interface UIKitModalComponentProps extends UIKitModalOptions {
|
|
13
|
+
visible: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function UIKitModalComponent(props: UIKitModalComponentProps): React.ReactPortal;
|
|
16
|
+
export declare const UIKitModal: {
|
|
17
|
+
openModal: (config: UIKitModalOptions) => Promise<{
|
|
18
|
+
action: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface UIKitModalConfig {
|
|
3
|
+
id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
content: string | ReactNode;
|
|
6
|
+
type: 'info' | 'warning' | 'error' | 'success';
|
|
7
|
+
onConfirm?: () => void;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export type UIKitModalOptions = UIKitModalConfig;
|
|
11
|
+
interface UIKitModalState {
|
|
12
|
+
modalData: UIKitModalConfig | null;
|
|
13
|
+
activeModalId: number | null;
|
|
14
|
+
modalOpenTime: number | null;
|
|
15
|
+
}
|
|
16
|
+
interface UIKitModalActions {
|
|
17
|
+
openModal: (config: UIKitModalConfig) => void;
|
|
18
|
+
closeModal: (action?: 'confirm' | 'cancel' | 'mask' | 'timeout') => void;
|
|
19
|
+
getState: () => UIKitModalState & UIKitModalActions;
|
|
20
|
+
}
|
|
21
|
+
export declare const uikitModalState: {
|
|
22
|
+
getState: () => UIKitModalState & UIKitModalActions;
|
|
23
|
+
openModal: (config: UIKitModalConfig) => void;
|
|
24
|
+
closeModal: (action?: "confirm" | "cancel" | "mask" | "timeout") => void;
|
|
25
|
+
subscribe: (listener: () => void) => () => boolean;
|
|
26
|
+
};
|
|
27
|
+
export default uikitModalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function handleModalError(error: any): void;
|
|
@@ -61,6 +61,8 @@ export declare const en: {
|
|
|
61
61
|
"The network is poor during your current call": string;
|
|
62
62
|
"The other user network is poor during the current call": string;
|
|
63
63
|
"TUICallKit init is not complete": string;
|
|
64
|
+
"auto play failed": string;
|
|
65
|
+
"click to resume": string;
|
|
64
66
|
"Video call": string;
|
|
65
67
|
"Voice call": string;
|
|
66
68
|
"Call End": string;
|
|
@@ -125,4 +127,15 @@ export declare const en: {
|
|
|
125
127
|
'accept-error': string;
|
|
126
128
|
'accept-device-error': string;
|
|
127
129
|
'call-error': string;
|
|
130
|
+
'error.10001': string;
|
|
131
|
+
'error.10002': string;
|
|
132
|
+
'error.10004': string;
|
|
133
|
+
'error.10005': string;
|
|
134
|
+
'error.10006': string;
|
|
135
|
+
'error.10007': string;
|
|
136
|
+
'error.10008': string;
|
|
137
|
+
'error.10012': string;
|
|
138
|
+
'error.10013': string;
|
|
139
|
+
'error.10014': string;
|
|
140
|
+
error: string;
|
|
128
141
|
};
|
|
@@ -71,6 +71,8 @@ export declare const ja_JP: {
|
|
|
71
71
|
"The network is poor during your current call": string;
|
|
72
72
|
"The other user network is poor during the current call": string;
|
|
73
73
|
"TUICallKit init is not complete": string;
|
|
74
|
+
"auto play failed": string;
|
|
75
|
+
"click to resume": string;
|
|
74
76
|
timeout: string;
|
|
75
77
|
'kick out': string;
|
|
76
78
|
'Invited group call': string;
|
|
@@ -124,4 +126,15 @@ export declare const ja_JP: {
|
|
|
124
126
|
'accept-error': string;
|
|
125
127
|
'accept-device-error': string;
|
|
126
128
|
'call-error': string;
|
|
129
|
+
'error.10001': string;
|
|
130
|
+
'error.10002': string;
|
|
131
|
+
'error.10004': string;
|
|
132
|
+
'error.10005': string;
|
|
133
|
+
'error.10006': string;
|
|
134
|
+
'error.10007': string;
|
|
135
|
+
'error.10008': string;
|
|
136
|
+
'error.10012': string;
|
|
137
|
+
'error.10013': string;
|
|
138
|
+
'error.10014': string;
|
|
139
|
+
error: string;
|
|
127
140
|
};
|
|
@@ -61,6 +61,8 @@ export declare const zh: {
|
|
|
61
61
|
"The network is poor during your current call": string;
|
|
62
62
|
"The other user network is poor during the current call": string;
|
|
63
63
|
"TUICallKit init is not complete": string;
|
|
64
|
+
"auto play failed": string;
|
|
65
|
+
"click to resume": string;
|
|
64
66
|
"Video call": string;
|
|
65
67
|
"Voice call": string;
|
|
66
68
|
"Call End": string;
|
|
@@ -120,4 +122,15 @@ export declare const zh: {
|
|
|
120
122
|
'accept-error': string;
|
|
121
123
|
'accept-device-error': string;
|
|
122
124
|
'call-error': string;
|
|
125
|
+
'error.10001': string;
|
|
126
|
+
'error.10002': string;
|
|
127
|
+
'error.10004': string;
|
|
128
|
+
'error.10005': string;
|
|
129
|
+
'error.10006': string;
|
|
130
|
+
'error.10007': string;
|
|
131
|
+
'error.10008': string;
|
|
132
|
+
'error.10012': string;
|
|
133
|
+
'error.10013': string;
|
|
134
|
+
'error.10014': string;
|
|
135
|
+
error: string;
|
|
123
136
|
};
|