@trtc/calls-uikit-vue2 4.4.4 → 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 +1 -1
- package/src/Components/components/base/CustomSelect/CustomSelect.ts +4 -2
- package/src/Components/components/base/CustomSelect/CustomSelect.vue +14 -10
- package/src/Components/components/common/AIAssistant/AISubtitle.vue +4 -2
- package/src/Components/components/common/AIAssistant/components/SubtitleContent.vue +7 -2
- package/src/Components/components/common/AIAssistant/components/SubtitleSettingsH5.vue +3 -1
- package/src/Components/components/common/AIAssistant/components/SubtitleSettingsPC.vue +9 -5
- package/src/Components/hooks/useAIAssistant.ts +1 -1
- package/src/TUICallService/CallService/index.ts +1 -1
- package/src/index.ts +1 -1
- package/tuicall-uikit-vue2.es.js +208 -209
- package/tuicall-uikit-vue2.umd.js +3 -3
- package/types/Components/components/base/CustomSelect/CustomSelect.d.ts +2 -2
- package/types/Components/hooks/useAIAssistant.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,8 @@ export interface SelectOption {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const CustomSelectProps = {
|
|
8
|
-
|
|
8
|
+
// Vue2 compatible: use 'value' instead of 'modelValue'
|
|
9
|
+
value: {
|
|
9
10
|
type: [String, Number],
|
|
10
11
|
default: '',
|
|
11
12
|
},
|
|
@@ -37,7 +38,8 @@ export const CustomSelectProps = {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const CustomSelectEmits = {
|
|
40
|
-
|
|
41
|
+
// Vue2 compatible: use 'input' instead of 'update:modelValue'
|
|
42
|
+
'input': (value: string | number) => true,
|
|
41
43
|
'change': (value: string | number) => true,
|
|
42
44
|
'clear': () => true,
|
|
43
45
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="custom-select-wrapper">
|
|
2
|
+
<div class="custom-select-wrapper" ref="wrapperRef">
|
|
3
3
|
<div
|
|
4
4
|
class="custom-select"
|
|
5
5
|
:class="{ 'is-open': isOpen, 'is-disabled': disabled }"
|
|
6
|
-
@click="toggleDropdown"
|
|
6
|
+
@click.stop="toggleDropdown"
|
|
7
7
|
>
|
|
8
8
|
<span class="select-text">{{ displayText }}</span>
|
|
9
9
|
<svg
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
v-for="option in options"
|
|
29
29
|
:key="option.value"
|
|
30
30
|
class="custom-option"
|
|
31
|
-
:class="{ 'is-selected':
|
|
32
|
-
@click="selectOption(option.value)"
|
|
31
|
+
:class="{ 'is-selected': value === option.value }"
|
|
32
|
+
@click.stop="selectOption(option.value)"
|
|
33
33
|
>
|
|
34
34
|
{{ option.label }}
|
|
35
35
|
</div>
|
|
@@ -38,16 +38,17 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup lang="ts">
|
|
41
|
-
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
|
41
|
+
import { ref, computed, onMounted, onUnmounted } from '../../../../adapter-vue';
|
|
42
42
|
import { CustomSelectProps, CustomSelectEmits, type SelectOption } from './CustomSelect';
|
|
43
43
|
|
|
44
44
|
const props = defineProps(CustomSelectProps);
|
|
45
45
|
const emit = defineEmits(CustomSelectEmits);
|
|
46
46
|
|
|
47
47
|
const isOpen = ref(false);
|
|
48
|
+
const wrapperRef = ref<HTMLElement | null>(null);
|
|
48
49
|
|
|
49
50
|
const displayText = computed(() => {
|
|
50
|
-
const selectedOption = props.options.find(option => option.value === props.
|
|
51
|
+
const selectedOption = props.options.find(option => option.value === props.value);
|
|
51
52
|
return selectedOption ? selectedOption.label : props.placeholder;
|
|
52
53
|
});
|
|
53
54
|
|
|
@@ -57,16 +58,19 @@ const toggleDropdown = () => {
|
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
const selectOption = (value: string | number) => {
|
|
60
|
-
emit
|
|
61
|
+
// Vue2 compatible: emit 'input' event for v-model
|
|
62
|
+
emit('input', value);
|
|
61
63
|
emit('change', value);
|
|
62
64
|
isOpen.value = false;
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
// Close dropdown when clicking outside
|
|
66
|
-
const handleClickOutside = (event:
|
|
68
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
69
|
+
if (!wrapperRef.value) return;
|
|
70
|
+
|
|
67
71
|
const target = event.target as HTMLElement;
|
|
68
|
-
|
|
69
|
-
if (!
|
|
72
|
+
// Check if click is outside the wrapper element
|
|
73
|
+
if (!wrapperRef.value.contains(target)) {
|
|
70
74
|
isOpen.value = false;
|
|
71
75
|
}
|
|
72
76
|
};
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
<!-- Settings Modal Component (Same Level) -->
|
|
22
22
|
<SubtitleSettingsPC
|
|
23
23
|
v-if="isPC"
|
|
24
|
-
|
|
24
|
+
:visible="showSettingsModal"
|
|
25
|
+
@update:visible="showSettingsModal = $event"
|
|
25
26
|
@confirm="handleSettingsConfirm"
|
|
26
27
|
class="ai-subtitle-pc__settings"
|
|
27
28
|
/>
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
<!-- Settings Modal Component (H5) -->
|
|
30
31
|
<SubtitleSettingsH5
|
|
31
32
|
v-else
|
|
32
|
-
|
|
33
|
+
:visible="showSettingsModal"
|
|
34
|
+
@update:visible="showSettingsModal = $event"
|
|
33
35
|
@confirm="handleSettingsConfirm"
|
|
34
36
|
class="ai-subtitle-h5__settings"
|
|
35
37
|
/>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div
|
|
10
10
|
v-show="isH5 || showSettingsIcon"
|
|
11
11
|
:class="['subtitle-content__settings-btn', { 'subtitle-content__settings-btn--h5': isH5 }]"
|
|
12
|
-
@click="
|
|
12
|
+
@click="handleSettingsClick"
|
|
13
13
|
>
|
|
14
14
|
<TKImage
|
|
15
15
|
:src="settingsIcon"
|
|
@@ -56,7 +56,12 @@ const settingsIcon = computed(() => {
|
|
|
56
56
|
const iconSize = '16px';
|
|
57
57
|
|
|
58
58
|
// Events
|
|
59
|
-
defineEmits(['
|
|
59
|
+
const emit = defineEmits(['open-settings']);
|
|
60
|
+
|
|
61
|
+
// Handle settings button click
|
|
62
|
+
const handleSettingsClick = () => {
|
|
63
|
+
emit('open-settings');
|
|
64
|
+
};
|
|
60
65
|
|
|
61
66
|
// Auto scroll to bottom when new messages arrive
|
|
62
67
|
const scrollToBottom = () => {
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
<div class="setting-item">
|
|
16
16
|
<label class="setting-label">{{ t('recognition-language') }}</label>
|
|
17
17
|
<CustomSelect
|
|
18
|
-
|
|
18
|
+
:value="recognitionLanguage"
|
|
19
|
+
@input="handleLanguageChange"
|
|
19
20
|
:options="languageOptions"
|
|
20
21
|
@change="handleLanguageChange"
|
|
21
22
|
/>
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
<div class="setting-item">
|
|
26
27
|
<label class="setting-label">{{ t('translation-language') }}</label>
|
|
27
28
|
<CustomSelect
|
|
28
|
-
|
|
29
|
+
:value="translationLanguage"
|
|
30
|
+
@input="handleTranslationChange"
|
|
29
31
|
:options="translationOptions"
|
|
30
32
|
@change="handleTranslationChange"
|
|
31
33
|
/>
|
|
@@ -35,7 +37,8 @@
|
|
|
35
37
|
<div class="setting-item">
|
|
36
38
|
<label class="setting-label">{{ t('subtitle-display-settings') }}</label>
|
|
37
39
|
<CustomSelect
|
|
38
|
-
|
|
40
|
+
:value="subtitleDisplay"
|
|
41
|
+
@input="handleSubtitleDisplayChange"
|
|
39
42
|
:options="subtitleDisplayOptions"
|
|
40
43
|
@change="handleSubtitleDisplayChange"
|
|
41
44
|
/>
|
|
@@ -69,7 +72,9 @@ interface Emits {
|
|
|
69
72
|
}): void;
|
|
70
73
|
}
|
|
71
74
|
|
|
72
|
-
const props = defineProps<Props>()
|
|
75
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
76
|
+
visible: false
|
|
77
|
+
});
|
|
73
78
|
const emit = defineEmits<Emits>();
|
|
74
79
|
|
|
75
80
|
// Use i18n translation
|
|
@@ -208,7 +213,6 @@ watch(recognitionLanguage, (newRecognitionLang) => {
|
|
|
208
213
|
background: white;
|
|
209
214
|
border-radius: 12px;
|
|
210
215
|
width: 480px;
|
|
211
|
-
height: 430px;
|
|
212
216
|
overflow: hidden;
|
|
213
217
|
}
|
|
214
218
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* AI Assistant Hook
|
|
3
3
|
* @description Vue 3 composable for AI Transcriber functionality
|
|
4
4
|
*/
|
|
5
|
-
import { ref, onMounted, onUnmounted } from 'vue';
|
|
5
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
6
6
|
import { TUIStore, StoreName, NAME } from '../../TUICallService/index';
|
|
7
7
|
import { TranscriberMessage } from '../../TUICallService/CallService/AIAssistant';
|
|
8
8
|
|
|
@@ -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.4.
|
|
30
|
+
const version = '4.4.5';
|
|
31
31
|
import AIAssistant from './AIAssistant'; // 仅 web 支持 AI 实时字幕
|
|
32
32
|
const frameWork = 'vue2.7';
|
|
33
33
|
export { TUIGlobal, TUIStore, uiDesign };
|