@trtc/calls-uikit-vue 4.4.2 → 4.4.5
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/TUICallKit.vue +1 -1
- package/src/Components/assets/aiAssistant/desktop/subtitleSettings.svg +4 -0
- package/src/Components/assets/aiAssistant/mobile/close-aiAssistant.svg +7 -0
- package/src/Components/assets/aiAssistant/mobile/open-aiAssistant.svg +7 -0
- package/src/Components/assets/aiAssistant/mobile/subtitleSettings.svg +3 -0
- package/src/Components/components/base/CustomSelect/CustomSelect.ts +45 -0
- package/src/Components/components/base/CustomSelect/CustomSelect.vue +199 -0
- package/src/Components/components/common/AIAssistant/AISubtitle.vue +155 -37
- package/src/Components/components/common/AIAssistant/components/AITranscriberSwitchH5.vue +35 -0
- package/src/Components/components/common/AIAssistant/components/AITranscriberSwitchPC.vue +89 -0
- package/src/Components/components/common/AIAssistant/components/SubtitleContent.vue +234 -0
- package/src/Components/components/common/AIAssistant/components/SubtitleSettingsH5.vue +534 -0
- package/src/Components/components/common/AIAssistant/components/SubtitleSettingsPC.vue +294 -0
- package/src/Components/components/common/TopBar/TopBar.vue +41 -15
- package/src/Components/hooks/index.ts +1 -0
- package/src/Components/hooks/useAIAssistant.ts +142 -0
- package/src/Components/hooks/useGetVolumeMap.ts +2 -2
- package/src/TUICallService/CallService/AIAssistant.ts +285 -39
- package/src/TUICallService/CallService/UIKitModal.ts +14 -6
- package/src/TUICallService/CallService/bellContext.ts +25 -2
- package/src/TUICallService/CallService/engineEventHandler.ts +6 -1
- package/src/TUICallService/CallService/index.ts +72 -39
- package/src/TUICallService/CallService/miniProgram.ts +0 -12
- package/src/TUICallService/TUIStore/callStore.ts +6 -1
- package/src/TUICallService/UIKitModal/UIKitModal.ts +117 -0
- package/src/TUICallService/UIKitModal/index.ts +2 -0
- package/src/TUICallService/UIKitModal/type.ts +15 -0
- package/src/TUICallService/const/index.ts +4 -0
- package/src/TUICallService/interface/ICallStore.ts +5 -0
- package/src/TUICallService/locales/en.ts +15 -0
- package/src/TUICallService/locales/ja_JP.ts +15 -0
- package/src/TUICallService/locales/zh-cn.ts +15 -0
- package/src/TUICallService/utils/common-utils.ts +1 -1
- package/src/index.ts +1 -1
- package/stats.html +1 -1
- package/tuicall-uikit-vue.es.js +4199 -3474
- package/tuicall-uikit-vue.umd.js +2 -2
- package/types/Components/components/base/CustomSelect/CustomSelect.d.ts +41 -0
- package/types/Components/hooks/index.d.ts +1 -0
- package/types/Components/hooks/useAIAssistant.d.ts +19 -0
- package/types/TUICallService/CallService/AIAssistant.d.ts +72 -15
- package/types/TUICallService/CallService/bellContext.d.ts +3 -0
- package/types/TUICallService/CallService/index.d.ts +4 -3
- package/types/TUICallService/CallService/miniProgram.d.ts +0 -1
- package/types/TUICallService/UIKitModal/UIKitModal.d.ts +4 -0
- package/types/TUICallService/UIKitModal/index.d.ts +2 -0
- package/types/TUICallService/UIKitModal/type.d.ts +13 -0
- package/types/TUICallService/interface/ICallStore.d.ts +4 -0
- package/types/TUICallService/locales/en.d.ts +14 -0
- package/types/TUICallService/locales/ja_JP.d.ts +14 -0
- package/types/TUICallService/locales/zh-cn.d.ts +14 -0
- package/types/tsconfig.tsbuildinfo +1 -1
- package/src/Components/components/common/AIAssistant/AIAssistant.ts +0 -130
- package/src/Components/components/common/AIAssistant/index.ts +0 -11
- package/types/Components/components/common/AIAssistant/AIAssistant.d.ts +0 -40
- package/types/Components/components/common/AIAssistant/index.d.ts +0 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface SelectOption {
|
|
2
|
+
value: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const CustomSelectProps: {
|
|
7
|
+
value: {
|
|
8
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
type: () => SelectOption[];
|
|
13
|
+
default: () => any[];
|
|
14
|
+
};
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
disabled: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
clearable: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
values: string[];
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
width: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const CustomSelectEmits: {
|
|
38
|
+
input: (value: string | number) => boolean;
|
|
39
|
+
change: (value: string | number) => boolean;
|
|
40
|
+
clear: () => boolean;
|
|
41
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Assistant composable hook
|
|
3
|
+
* Provides reactive state management for AI transcription functionality
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAIAssistant(): {
|
|
6
|
+
isAITranscriberEnabled: import("@vue/reactivity").Ref<any>;
|
|
7
|
+
isAITranscriberRunning: import("@vue/reactivity").Ref<any>;
|
|
8
|
+
subtitleInfoList: import("@vue/reactivity").Ref<{
|
|
9
|
+
roundId: string;
|
|
10
|
+
sender: string;
|
|
11
|
+
nick?: string;
|
|
12
|
+
text: string;
|
|
13
|
+
end: boolean;
|
|
14
|
+
translation: {
|
|
15
|
+
language: string;
|
|
16
|
+
text: string;
|
|
17
|
+
}[];
|
|
18
|
+
}[]>;
|
|
19
|
+
};
|
|
@@ -1,15 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
export declare enum RealtimeTranscriberEvent {
|
|
2
|
+
onReceiveTranscriberMessage = "onReceiveTranscriberMessage",
|
|
3
|
+
onRealtimeTranscriberStarted = "onRealtimeTranscriberStarted",
|
|
4
|
+
onRealtimeTranscriberStopped = "onRealtimeTranscriberStopped",
|
|
5
|
+
onRealtimeTranscriberError = "onRealtimeTranscriberError"
|
|
6
|
+
}
|
|
7
|
+
export type TranscriberLanguage = string;
|
|
8
|
+
export interface TranscriberMessage {
|
|
9
|
+
segmentId: string;
|
|
10
|
+
speakerUserId: string;
|
|
11
|
+
sourceText: string;
|
|
12
|
+
translationTexts?: Map<string, string>;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
isCompleted: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RealtimeTranscriberEventInfoMap {
|
|
17
|
+
[RealtimeTranscriberEvent.onReceiveTranscriberMessage]: {
|
|
18
|
+
roomId: string | number;
|
|
19
|
+
message: TranscriberMessage;
|
|
20
|
+
};
|
|
21
|
+
[RealtimeTranscriberEvent.onRealtimeTranscriberStarted]: {
|
|
22
|
+
roomId: string | number;
|
|
23
|
+
transcriberRobotId: string;
|
|
24
|
+
sourceLanguage: string;
|
|
25
|
+
};
|
|
26
|
+
[RealtimeTranscriberEvent.onRealtimeTranscriberStopped]: {
|
|
27
|
+
roomId: string | number;
|
|
28
|
+
transcriberRobotId: string;
|
|
29
|
+
};
|
|
30
|
+
[RealtimeTranscriberEvent.onRealtimeTranscriberError]: {
|
|
31
|
+
roomId: string | number;
|
|
32
|
+
transcriberRobotId: string;
|
|
33
|
+
error: number;
|
|
34
|
+
errorMessage: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export type RealtimeTranscriberEventCallback = <T extends RealtimeTranscriberEvent>(eventInfo: RealtimeTranscriberEventInfoMap[T]) => void;
|
|
38
|
+
export default class AIAssistant {
|
|
39
|
+
static instance: AIAssistant;
|
|
40
|
+
private _callService;
|
|
41
|
+
private eventListeners;
|
|
42
|
+
constructor(options: {
|
|
43
|
+
callService: any;
|
|
44
|
+
});
|
|
45
|
+
static getInstance(options: {
|
|
46
|
+
callService: any;
|
|
47
|
+
}): AIAssistant;
|
|
48
|
+
/**
|
|
49
|
+
* Get AI Transcriber Manager instance
|
|
50
|
+
* @returns AITranscriberManager instance or null if not available
|
|
51
|
+
*/
|
|
52
|
+
private getTranscriberManager;
|
|
53
|
+
private triggerEvent;
|
|
54
|
+
startRealtimeTranscriber: (config: {
|
|
55
|
+
sourceLanguage: TranscriberLanguage;
|
|
56
|
+
translationLanguages?: TranscriberLanguage[];
|
|
57
|
+
}) => Promise<any>;
|
|
58
|
+
stopRealtimeTranscriber: () => Promise<void>;
|
|
59
|
+
updateRealTimeTranscriber: (config: {
|
|
60
|
+
sourceLanguage: TranscriberLanguage;
|
|
61
|
+
translationLanguages?: TranscriberLanguage[];
|
|
62
|
+
}) => Promise<any>;
|
|
63
|
+
subscribeEvent: (event: RealtimeTranscriberEvent, callback: RealtimeTranscriberEventCallback) => void;
|
|
64
|
+
unsubscribeEvent: (event: RealtimeTranscriberEvent, callback: RealtimeTranscriberEventCallback) => void;
|
|
65
|
+
private onReceiveTranscriberMessage;
|
|
66
|
+
private onRealtimeTranscriberStarted;
|
|
67
|
+
private onRealtimeTranscriberStopped;
|
|
68
|
+
private onRealtimeTranscriberError;
|
|
69
|
+
bindEvent: () => void;
|
|
70
|
+
unbindEvent: () => void;
|
|
71
|
+
reset: () => void;
|
|
72
|
+
}
|
|
@@ -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;
|
|
@@ -8,6 +8,7 @@ export { TUIGlobal, TUIStore, uiDesign };
|
|
|
8
8
|
export default class TUICallService {
|
|
9
9
|
static instance: TUICallService;
|
|
10
10
|
_tuiCallEngine: any;
|
|
11
|
+
_aiAssistant: any;
|
|
11
12
|
private _tim;
|
|
12
13
|
private _TUICore;
|
|
13
14
|
private _timerId;
|
|
@@ -15,7 +16,6 @@ export default class TUICallService {
|
|
|
15
16
|
private _bellContext;
|
|
16
17
|
private _isFromChat;
|
|
17
18
|
private _currentGroupId;
|
|
18
|
-
private _preDevicePermission;
|
|
19
19
|
private _offlinePushInfo;
|
|
20
20
|
private _permissionCheckTimer;
|
|
21
21
|
private _chatCombine;
|
|
@@ -39,6 +39,7 @@ export default class TUICallService {
|
|
|
39
39
|
setSelfInfo(params: ISelfInfoParams): Promise<void>;
|
|
40
40
|
enableVirtualBackground(enable: boolean): Promise<void>;
|
|
41
41
|
enableAIVoice(enable: boolean): Promise<void>;
|
|
42
|
+
enableAITranscriber(enable: boolean): Promise<void>;
|
|
42
43
|
setCallingBell(filePath?: string): Promise<void>;
|
|
43
44
|
enableMuteMode(enable: boolean): Promise<void>;
|
|
44
45
|
hideFeatureButton(buttonName: FeatureButton): void;
|
|
@@ -46,9 +47,9 @@ export default class TUICallService {
|
|
|
46
47
|
setRemoteViewBackgroundImage(userId: string, url: string): void;
|
|
47
48
|
setLayoutMode(layoutMode: LayoutMode): void;
|
|
48
49
|
setCameraDefaultState(isOpen: boolean): void;
|
|
49
|
-
enableAISubtitle(enable: boolean): void;
|
|
50
50
|
callExperimentalAPI(jsonStr: string): void;
|
|
51
51
|
accept(): Promise<void>;
|
|
52
|
+
private _handleAcceptResponse;
|
|
52
53
|
hangup(): Promise<void>;
|
|
53
54
|
reject(): Promise<void>;
|
|
54
55
|
openCamera(videoViewDomID: string): Promise<void>;
|
|
@@ -87,7 +88,7 @@ export default class TUICallService {
|
|
|
87
88
|
private _getFeatureButtonDefaultState;
|
|
88
89
|
private _updateCallDuration;
|
|
89
90
|
private _stopTimer;
|
|
90
|
-
private
|
|
91
|
+
private _cleanupAvoidRepeatCallState;
|
|
91
92
|
private _resetCallStore;
|
|
92
93
|
getGroupMemberList(count: number, offset: number): Promise<any>;
|
|
93
94
|
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,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
|
+
}
|
|
@@ -138,4 +138,18 @@ export declare const en: {
|
|
|
138
138
|
'error.10013': string;
|
|
139
139
|
'error.10014': string;
|
|
140
140
|
error: string;
|
|
141
|
+
'ai-subtitle': string;
|
|
142
|
+
'ai-subtitle-settings': string;
|
|
143
|
+
'recognition-language': string;
|
|
144
|
+
'translation-language': string;
|
|
145
|
+
'subtitle-display-settings': string;
|
|
146
|
+
'subtitle-display-bilingual': string;
|
|
147
|
+
'no-translation': string;
|
|
148
|
+
'show-bilingual': string;
|
|
149
|
+
'show-original-only': string;
|
|
150
|
+
save: string;
|
|
151
|
+
'select-recognition-language': string;
|
|
152
|
+
'select-translation-language': string;
|
|
153
|
+
confirm: string;
|
|
154
|
+
'recognition-and-translation-settings': string;
|
|
141
155
|
};
|
|
@@ -137,4 +137,18 @@ export declare const ja_JP: {
|
|
|
137
137
|
'error.10013': string;
|
|
138
138
|
'error.10014': string;
|
|
139
139
|
error: string;
|
|
140
|
+
'ai-subtitle': string;
|
|
141
|
+
'ai-subtitle-settings': string;
|
|
142
|
+
'recognition-language': string;
|
|
143
|
+
'translation-language': string;
|
|
144
|
+
'subtitle-display-settings': string;
|
|
145
|
+
'subtitle-display-bilingual': string;
|
|
146
|
+
'no-translation': string;
|
|
147
|
+
'show-bilingual': string;
|
|
148
|
+
'show-original-only': string;
|
|
149
|
+
save: string;
|
|
150
|
+
'select-recognition-language': string;
|
|
151
|
+
'select-translation-language': string;
|
|
152
|
+
confirm: string;
|
|
153
|
+
'recognition-and-translation-settings': string;
|
|
140
154
|
};
|
|
@@ -133,4 +133,18 @@ export declare const zh: {
|
|
|
133
133
|
'error.10013': string;
|
|
134
134
|
'error.10014': string;
|
|
135
135
|
error: string;
|
|
136
|
+
'ai-subtitle': string;
|
|
137
|
+
'ai-subtitle-settings': string;
|
|
138
|
+
'recognition-language': string;
|
|
139
|
+
'translation-language': string;
|
|
140
|
+
'subtitle-display-settings': string;
|
|
141
|
+
'subtitle-display-bilingual': string;
|
|
142
|
+
'no-translation': string;
|
|
143
|
+
'show-bilingual': string;
|
|
144
|
+
'show-original-only': string;
|
|
145
|
+
save: string;
|
|
146
|
+
'select-recognition-language': string;
|
|
147
|
+
'select-translation-language': string;
|
|
148
|
+
confirm: string;
|
|
149
|
+
'recognition-and-translation-settings': string;
|
|
136
150
|
};
|