@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trtc/calls-uikit-vue2",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "main": "./tuicall-uikit-vue2.umd.js",
5
5
  "module": "./tuicall-uikit-vue2.es.js",
6
6
  "types": "./types/index.d.ts",
@@ -5,7 +5,8 @@ export interface SelectOption {
5
5
  }
6
6
 
7
7
  export const CustomSelectProps = {
8
- modelValue: {
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
- 'update:modelValue': (value: string | number) => true,
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': modelValue === option.value }"
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.modelValue);
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('update:modelValue', value);
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: Event) => {
68
+ const handleClickOutside = (event: MouseEvent) => {
69
+ if (!wrapperRef.value) return;
70
+
67
71
  const target = event.target as HTMLElement;
68
- const wrapper = target.closest('.custom-select-wrapper');
69
- if (!wrapper) {
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
- v-model:visible="showSettingsModal"
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
- v-model:visible="showSettingsModal"
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="$emit('openSettings')"
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(['openSettings']);
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 = () => {
@@ -121,7 +121,9 @@ interface Emits {
121
121
  }): void;
122
122
  }
123
123
 
124
- const props = defineProps<Props>();
124
+ const props = withDefaults(defineProps<Props>(), {
125
+ visible: false
126
+ });
125
127
  const emit = defineEmits<Emits>();
126
128
 
127
129
  // Use i18n translation
@@ -15,7 +15,8 @@
15
15
  <div class="setting-item">
16
16
  <label class="setting-label">{{ t('recognition-language') }}</label>
17
17
  <CustomSelect
18
- v-model="recognitionLanguage"
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
- v-model="translationLanguage"
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
- v-model="subtitleDisplay"
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.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 };
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ const TUICallType = {
37
37
  AUDIO_CALL: 1,
38
38
  VIDEO_CALL: 2,
39
39
  };
40
- const Version = '4.4.4'; // basic-demo 原来上报使用
40
+ const Version = '4.4.5'; // basic-demo 原来上报使用
41
41
 
42
42
  // 输出产物
43
43
  export {