@trtc/calls-uikit-react 4.4.3-beta.1 → 4.4.3

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 (35) hide show
  1. package/package.json +4 -3
  2. package/src/Components/components/common/UIKitModal/UIKitModal.tsx +250 -0
  3. package/src/Components/components/common/UIKitModal/UIKitModalState.ts +177 -0
  4. package/src/Components/components/common/UIKitModal/index.module.scss +176 -0
  5. package/src/Components/components/common/UIKitModal/index.ts +3 -0
  6. package/src/TUICallService/CallService/UIKitModal.ts +72 -6
  7. package/src/TUICallService/CallService/bellContext.ts +25 -2
  8. package/src/TUICallService/CallService/engineEventHandler.ts +6 -1
  9. package/src/TUICallService/CallService/index.ts +56 -33
  10. package/src/TUICallService/CallService/miniProgram.ts +0 -12
  11. package/src/TUICallService/TUIStore/callStore.ts +1 -1
  12. package/src/TUICallService/UIKitModal/UIKitModal.ts +117 -0
  13. package/src/TUICallService/UIKitModal/index.ts +2 -0
  14. package/src/TUICallService/UIKitModal/type.ts +15 -0
  15. package/src/TUICallService/locales/en.ts +2 -1
  16. package/src/TUICallService/locales/ja_JP.ts +2 -1
  17. package/src/TUICallService/locales/zh-cn.ts +2 -1
  18. package/src/TUICallService/utils/common-utils.ts +1 -1
  19. package/src/index.ts +1 -1
  20. package/tuicall-uikit-react.es.js +4040 -4533
  21. package/tuicall-uikit-react.umd.js +3 -33
  22. package/types/Components/components/common/UIKitModal/UIKitModal.d.ts +21 -0
  23. package/types/Components/components/common/UIKitModal/UIKitModalState.d.ts +27 -0
  24. package/types/Components/components/common/UIKitModal/index.d.ts +3 -0
  25. package/types/TUICallService/CallService/bellContext.d.ts +3 -0
  26. package/types/TUICallService/CallService/index.d.ts +2 -2
  27. package/types/TUICallService/CallService/miniProgram.d.ts +0 -1
  28. package/types/TUICallService/UIKitModal/UIKitModal.d.ts +4 -0
  29. package/types/TUICallService/UIKitModal/index.d.ts +2 -0
  30. package/types/TUICallService/UIKitModal/type.d.ts +13 -0
  31. package/types/TUICallService/locales/en.d.ts +1 -0
  32. package/types/TUICallService/locales/ja_JP.d.ts +1 -0
  33. package/types/TUICallService/locales/zh-cn.d.ts +1 -0
  34. package/src/TUICallService/utils/validate/validateStatus.ts +0 -26
  35. package/types/TUICallService/utils/validate/validateStatus.d.ts +0 -5
@@ -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,3 @@
1
+ export { UIKitModal, UIKitModalComponent } from './UIKitModal';
2
+ export type { UIKitModalConfig, UIKitModalOptions } from './UIKitModal';
3
+ export { uikitModalState } from './UIKitModalState';
@@ -5,6 +5,7 @@ export declare class BellContext {
5
5
  private _calleeBellFilePath;
6
6
  private _callRole;
7
7
  private _callStatus;
8
+ private _isPlaying;
8
9
  constructor();
9
10
  setBellSrc(): void;
10
11
  setBellProperties(bellParams: IBellParams): void;
@@ -12,6 +13,8 @@ export declare class BellContext {
12
13
  stop(): Promise<void>;
13
14
  setBellMute(enable: boolean): Promise<void>;
14
15
  destroy(): void;
16
+ private _delay;
17
+ private _delayCallback;
15
18
  private _handleAudioInterruptionBegin;
16
19
  private _handleAudioInterruptionEnd;
17
20
  private _addListenBellContextEvent;
@@ -15,7 +15,6 @@ export default class TUICallService {
15
15
  private _bellContext;
16
16
  private _isFromChat;
17
17
  private _currentGroupId;
18
- private _preDevicePermission;
19
18
  private _offlinePushInfo;
20
19
  private _permissionCheckTimer;
21
20
  private _chatCombine;
@@ -49,6 +48,7 @@ export default class TUICallService {
49
48
  enableAISubtitle(enable: boolean): void;
50
49
  callExperimentalAPI(jsonStr: string): void;
51
50
  accept(): Promise<void>;
51
+ private _handleAcceptResponse;
52
52
  hangup(): Promise<void>;
53
53
  reject(): Promise<void>;
54
54
  openCamera(videoViewDomID: string): Promise<void>;
@@ -87,7 +87,7 @@ export default class TUICallService {
87
87
  private _getFeatureButtonDefaultState;
88
88
  private _updateCallDuration;
89
89
  private _stopTimer;
90
- private _cleanupAllAvoidRepeatCallState;
90
+ private _cleanupAvoidRepeatCallState;
91
91
  private _resetCallStore;
92
92
  getGroupMemberList(count: number, offset: number): Promise<any>;
93
93
  getGroupProfile(): Promise<any>;
@@ -3,5 +3,4 @@ export declare function initialUI(): void;
3
3
  export declare function checkRunPlatform(): void;
4
4
  export declare function initAndCheckRunEnv(): void;
5
5
  export declare function beforeCall(type: CallMediaType, that: any): Promise<CallStatus.IDLE | CallStatus.CALLING>;
6
- export declare function handlePackageError(error: any): void;
7
6
  export declare function handleNoPusherCapabilityError(): void;
@@ -0,0 +1,4 @@
1
+ import type { UIKitModalOptions, UIKitModalResult } from './type';
2
+ export declare const UIKitModal: {
3
+ openModal: (config: UIKitModalOptions) => Promise<UIKitModalResult>;
4
+ };
@@ -0,0 +1,2 @@
1
+ export { UIKitModal } from './UIKitModal';
2
+ export type { UIKitModalOptions, UIKitModalResult, ModalType } from './type';
@@ -0,0 +1,13 @@
1
+ export type ModalType = 'info' | 'warning' | 'error' | 'success';
2
+ export interface UIKitModalOptions {
3
+ id: number;
4
+ title: string;
5
+ content: string;
6
+ type: ModalType;
7
+ onConfirm?: () => void;
8
+ onCancel?: () => void;
9
+ }
10
+ export interface UIKitModalResult {
11
+ action: 'confirm' | 'cancel';
12
+ raw?: any;
13
+ }
@@ -136,5 +136,6 @@ export declare const en: {
136
136
  'error.10008': string;
137
137
  'error.10012': string;
138
138
  'error.10013': string;
139
+ 'error.10014': string;
139
140
  error: string;
140
141
  };
@@ -135,5 +135,6 @@ export declare const ja_JP: {
135
135
  'error.10008': string;
136
136
  'error.10012': string;
137
137
  'error.10013': string;
138
+ 'error.10014': string;
138
139
  error: string;
139
140
  };
@@ -131,5 +131,6 @@ export declare const zh: {
131
131
  'error.10008': string;
132
132
  'error.10012': string;
133
133
  'error.10013': string;
134
+ 'error.10014': string;
134
135
  error: string;
135
136
  };
@@ -1,26 +0,0 @@
1
- import { NAME } from "../../const/index";
2
- import { t } from '../../locales/index';
3
-
4
- interface IStatusValidateParams {
5
- engineInstance?: boolean;
6
- }
7
-
8
- export function statusValidate (config: IStatusValidateParams) {
9
- return function (target, propertyName: string, descriptor: PropertyDescriptor) {
10
- let method = descriptor.value;
11
- descriptor.value = function (...args: Array<any>) {
12
- doValidate.call(this, config, args, propertyName);
13
- return method.apply(this, args);
14
- };
15
- return descriptor;
16
- };
17
- }
18
-
19
- function doValidate(config) {
20
- if (config?.engineInstance && !this._tuiCallEngine) {
21
- const error = `${NAME.PREFIX} ${t('TUICallKit init is not complete')}`;
22
- console.error(error);
23
- throw error;
24
- }
25
- }
26
-
@@ -1,5 +0,0 @@
1
- interface IStatusValidateParams {
2
- engineInstance?: boolean;
3
- }
4
- export declare function statusValidate(config: IStatusValidateParams): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
- export {};