@tencentcloud/ai-desk-customer-vue 1.6.3 → 1.6.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.6.4 @2025.11.25
2
+
3
+ ### Features
4
+ - 支持区分用户端上行消息的来源(用户输入或用户点击分支选项)
5
+
6
+ ### Fixed
7
+ - vue2 已知问题
8
+
1
9
  ## 1.6.3 @2025.11.13
2
10
 
3
11
  ### Features
@@ -8,7 +8,9 @@
8
8
  {{ TUITranslateService.t("AIDesk.感谢您的反馈,我们会持续优化改进") }}
9
9
  </span>
10
10
  </div>
11
- <Icon :file="DialogCloseIcon" width="20px" height="20px" @click="closeFeedbackModal"/>
11
+ <div @click="closeFeedbackModal">
12
+ <Icon :file="DialogCloseIcon" width="20px" height="20px"/>
13
+ </div>
12
14
  </div>
13
15
 
14
16
  <div class="dialog-select-container">
@@ -86,6 +88,7 @@
86
88
  </template>
87
89
  <script lang="ts">
88
90
  import vue from '../../../adapter-vue';
91
+ import { vueVersion } from '../../../adapter-vue-web';
89
92
  import Icon from '../../common/Icon.vue';
90
93
  import { StoreName, TUIStore, TUITranslateService, TUIChatService } from '@tencentcloud/chat-uikit-engine';
91
94
  import GreenCheck from '../../../assets/green_check.svg';
@@ -178,7 +181,20 @@ export default {
178
181
  }
179
182
 
180
183
  const dialogButtonClick = (item) => {
181
- item.isSelected = !item.isSelected;
184
+ if (vueVersion === 3) {
185
+ // vue 3
186
+ item.isSelected = !item.isSelected;
187
+ } else {
188
+ // vue 2.6 or vue 2.7
189
+ const index = feedbackButtonList.value.findIndex(i => i.id === item.id);
190
+ if (index === -1) return;
191
+ const newList = feedbackButtonList.value.slice();
192
+ newList[index] = {
193
+ ...newList[index],
194
+ isSelected: !newList[index].isSelected
195
+ };
196
+ feedbackButtonList.value = newList;
197
+ }
182
198
  };
183
199
 
184
200
  const isSubmitEnabled = computed(() => {
@@ -212,12 +228,6 @@ export default {
212
228
  const onDislike = (messageInfo) => {
213
229
  _messageInfo = messageInfo;
214
230
  };
215
-
216
- expose({
217
- onLike,
218
- onDislike,
219
- });
220
-
221
231
  return {
222
232
  isPC,
223
233
  GreenCheck,
@@ -230,6 +240,8 @@ export default {
230
240
  submit,
231
241
  isSubmitEnabled,
232
242
  feedbackButtonListFromStore,
243
+ onLike,
244
+ onDislike,
233
245
  };
234
246
  }
235
247
  }
@@ -20,7 +20,7 @@
20
20
  :enableInput="props.enableInput"
21
21
  :enableTyping="props.enableTyping"
22
22
  :enableDragUpload="props.enableDragUpload"
23
- :isInAudioMode="isInAudioMode"
23
+ :isInAudioModeFromProps="isInAudioMode"
24
24
  :shouldShowToolbar="shouldShowToolbar"
25
25
  :shouldShowEmoji="shouldShowEmoji"
26
26
  :shouldShowAudio="shouldShowAudio"
@@ -60,7 +60,7 @@ import MessageInputButton from './message-input-button.vue';
60
60
  import MessageInputQuote from './message-input-quote/index.vue';
61
61
  import { sendMessages, sendTyping } from '../utils/sendMessage';
62
62
  import { transformTextWithEmojiNamesToKeys } from '../emoji-config';
63
- import { isPC,isH5 } from '../../../utils/env';
63
+ import { isPC, isH5 } from '../../../utils/env';
64
64
  import Icon from '../../common/Icon.vue';
65
65
  import emojiIcon from '../../../assets/emoji.png';
66
66
  import toolIcon from '../../../assets/more_tools.png';
@@ -68,9 +68,8 @@ import sendButtonIcon from '../../../assets/send_button_h5.svg';
68
68
  import audioIcon from '../../../assets/audio-blue.svg';
69
69
  import keyboardIcon from '../../../assets/keyboard-icon.svg';
70
70
  import { INPUT_TOOLBAR_TYPE } from '../../../constant';
71
- import { onUnmounted } from 'vue';
72
71
  import Log from '../../../utils/logger';
73
- const { ref, onMounted, onBeforeUnmount, computed } = vue;
72
+ const { ref, onMounted, onBeforeUnmount, computed, onUnmounted } = vue;
74
73
 
75
74
  const props = defineProps({
76
75
  isMuted: {
@@ -116,7 +116,7 @@ const props = defineProps({
116
116
  type: Boolean,
117
117
  default: true,
118
118
  },
119
- isInAudioMode:{
119
+ isInAudioModeFromProps:{
120
120
  type: Boolean,
121
121
  default: false,
122
122
  },
@@ -146,7 +146,7 @@ let editor: Editor | null = null;
146
146
  const fileMap = new Map<string, any>();
147
147
  const recorder = ref();
148
148
  const recordTime = ref(0);
149
- const isInAudioMode = ref(props.isInAudioMode);
149
+ const isInAudioMode = ref(props.isInAudioModeFromProps);
150
150
  const isRecording = ref(false);
151
151
  let startRecordY = 0;
152
152
  const recordCancel = ref(false);
@@ -194,7 +194,7 @@ function focusEditor() {
194
194
  }
195
195
 
196
196
  watch(
197
- () => [props.isInAudioMode],
197
+ () => [props.isInAudioModeFromProps],
198
198
  (newValue) => {
199
199
  isInAudioMode.value = newValue[0];
200
200
  }
@@ -130,9 +130,17 @@ export default {
130
130
  return props.message && JSONToObject(props.message?.payload?.data);
131
131
  });
132
132
  const sendTextMessage = async (payload: TextMessagePayload, cloudCustomData?: string) => {
133
+ let cloudCustomDataFinal = cloudCustomData || '';
134
+ if (!cloudCustomDataFinal) {
135
+ cloudCustomDataFinal = JSON.stringify({
136
+ deskExtInfo: {
137
+ isPresetContent : 1
138
+ }
139
+ });
140
+ }
133
141
  await TUIChatService.sendTextMessage({
134
142
  payload,
135
- cloudCustomData: cloudCustomData || '',
143
+ cloudCustomData: cloudCustomDataFinal,
136
144
  needReadReceipt: isEnabledMessageReadReceiptGlobal()
137
145
  });
138
146
  emit('messageSent');
@@ -62,7 +62,10 @@ export default {
62
62
  taskID: props.payload.taskInfo?.taskID,
63
63
  nodeID: props.payload.taskInfo?.nodeID,
64
64
  env: props.payload.taskInfo?.env,
65
- }
65
+ },
66
+ deskExtInfo: {
67
+ isPresetContent: 1
68
+ },
66
69
  });
67
70
  }
68
71
  emit('input-click', branch, cloudCustomData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Vue2/Vue3 UIKit for AI Desk",
5
5
  "main": "index",
6
6
  "keywords": [