@trtc/calls-uikit-react 4.4.0 → 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 +1 -1
- 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 +7 -1
- package/src/TUICallService/const/index.ts +1 -0
- package/src/TUICallService/locales/en.ts +12 -0
- package/src/TUICallService/locales/ja_JP.ts +12 -0
- package/src/TUICallService/locales/zh-cn.ts +12 -0
- package/src/index.ts +1 -1
- package/tuicall-uikit-react.es.js +2115 -2012
- 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 +11 -0
- package/types/TUICallService/locales/ja_JP.d.ts +11 -0
- package/types/TUICallService/locales/zh-cn.d.ts +11 -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;
|
|
@@ -127,4 +127,15 @@ export declare const en: {
|
|
|
127
127
|
'accept-error': string;
|
|
128
128
|
'accept-device-error': string;
|
|
129
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;
|
|
130
141
|
};
|
|
@@ -126,4 +126,15 @@ export declare const ja_JP: {
|
|
|
126
126
|
'accept-error': string;
|
|
127
127
|
'accept-device-error': string;
|
|
128
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;
|
|
129
140
|
};
|
|
@@ -122,4 +122,15 @@ export declare const zh: {
|
|
|
122
122
|
'accept-error': string;
|
|
123
123
|
'accept-device-error': string;
|
|
124
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;
|
|
125
136
|
};
|