@tencentcloud/ai-desk-customer-vue 1.7.4 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.7.5 @2026.6.25
2
+
3
+ ### Features
4
+ - 增加结束会话二次确认弹窗
5
+
6
+ ### Fixed
7
+ - 修复已知问题
8
+
1
9
  ## 1.7.4 @2026.5.26
2
10
 
3
11
  ### Features
@@ -357,14 +357,14 @@ function handlePaste(e: ClipboardEvent) {
357
357
  }
358
358
 
359
359
  function handlePasteText(e: ClipboardEvent) {
360
- e.preventDefault();
361
360
  const html = e.clipboardData?.getData('text/html');
362
361
  const text = e.clipboardData?.getData('text/plain') || '';
363
- // if paste html in pc, paste by tiptap editor default
364
- // if paste text in pc or mobile, parse text to html to render emoji
362
+ if (isH5 && !text) {
363
+ return;
364
+ }
365
+ e.preventDefault();
365
366
  if (isH5 || !html) {
366
- const renderArray = parseTextToRenderArray(text);
367
- insertEditorContent(renderArray);
367
+ insertEditorContent(parseTextToRenderArray(text));
368
368
  }
369
369
  }
370
370
 
@@ -178,7 +178,6 @@
178
178
  v-if="reSendDialogShow"
179
179
  class="resend-dialog"
180
180
  :show="reSendDialogShow"
181
- :isH5="!isPC"
182
181
  :center="true"
183
182
  :isHeaderShow="isPC"
184
183
  @submit="resendMessageConfirm()"
@@ -949,4 +948,7 @@ defineExpose({
949
948
  z-index: 1000;
950
949
  width: 100%;
951
950
  }
951
+ .delDialog-title {
952
+ font-size: 16px;
953
+ }
952
954
  </style>
@@ -349,6 +349,11 @@ const updatePopoverPosition = () => {
349
349
  position: relative;
350
350
  }
351
351
 
352
+ .toolbar-button:hover {
353
+ border-color: #3b82f6;
354
+ color: #3b82f6;
355
+ }
356
+
352
357
  .toolbar-button:first-child {
353
358
  margin-left: 5px;
354
359
  }
@@ -357,6 +362,11 @@ const updatePopoverPosition = () => {
357
362
  border: none;
358
363
  background-color: #fff;
359
364
  box-shadow: 0px 2px 2px 0px rgba(70, 98, 140, 0.06);
365
+ -webkit-tap-highlight-color: transparent;
366
+ }
367
+
368
+ .toolbar-button-h5:active {
369
+ background-color: #f5f7fa;
360
370
  }
361
371
 
362
372
  .toolbar-button-icon {
@@ -425,6 +435,7 @@ const updatePopoverPosition = () => {
425
435
  box-shadow: none;
426
436
  }
427
437
  .overflow-popover-item:hover {
438
+ color: #3b82f6;
428
439
  background: #f9fafc;
429
440
  }
430
441
 
@@ -1,21 +1,52 @@
1
1
  <template>
2
- <div :class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '', isClicked ? 'end-conversation-button-clicked' : '']" @click="onClick">
2
+ <div :class="['toolbar-button', 'end-human-service', isH5 ? 'toolbar-button-h5' : '', isClicked ? 'end-conversation-button-clicked' : '']" @click="onClick" v-bind="$attrs">
3
3
  <Icon v-if="props.icon" class="toolbar-button-icon" :file="props.icon" width="14px" height="14px"/>
4
4
  <div class="toolbar-button-text">
5
5
  {{ props.title || TUITranslateService.t('AIDesk.结束会话') }}
6
6
  </div>
7
7
  </div>
8
+ <Dialog
9
+ v-if="dialogShow"
10
+ class="end-conversation-dialog"
11
+ :show="dialogShow"
12
+ :center="true"
13
+ :isHeaderShow="false"
14
+ :confirmText="TUITranslateService.t('AIDesk.确认结束')"
15
+ :cancelText="TUITranslateService.t('AIDesk.再想想')"
16
+ :confirmBtnClass="'end-conversation-dialog__confirm-btn'"
17
+ @submit="onEndConversationConfirm"
18
+ @update:show="(e) => (dialogShow = e)"
19
+ >
20
+ <template #icon>
21
+ <div class="end-conversation-dialog-icon">
22
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
23
+ <path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path>
24
+ <line x1="12" y1="2" x2="12" y2="12"></line>
25
+ </svg>
26
+ </div>
27
+ </template>
28
+ <div class="end-conversation-dialog-content">
29
+ <p class="end-conversation-dialog-title">
30
+ {{ TUITranslateService.t('AIDesk.确定要结束本次会话吗?') }}
31
+ </p>
32
+ <p class="end-conversation-dialog-desc">
33
+ {{ TUITranslateService.t('AIDesk.结束后将无法继续与当前客服对话') }}
34
+ </p>
35
+ </div>
36
+ </Dialog>
8
37
  </template>
9
38
  <script lang="ts" setup>
10
39
  import vue from '../../../adapter-vue';
11
40
  const { ref, onMounted, onUnmounted } = vue;
12
41
  import { isH5 } from '../../../utils/env';
13
42
  import Icon from '../../common/Icon.vue';
43
+ import Dialog from '../../common/Dialog/index.vue';
14
44
  import { TUITranslateService, TUIChatService, IConversationModel, TUIStore, StoreName } from '../../../@aidesk/uikit-engine';
15
45
  import { CUSTOM_MESSAGE_SRC } from '../../../constant';
16
46
  import { isEnabledMessageReadReceiptGlobal, getTo } from '../../../utils/utils';
17
47
  const currentConversation = ref<IConversationModel>();
18
48
  const isClicked = ref(false);
49
+ const dialogShow = ref(false);
19
50
  interface IProps {
20
51
  title?:string;
21
52
  icon?:string | undefined;
@@ -45,6 +76,13 @@ const onCurrentConversationUpdate = (conversation: IConversationModel) => {
45
76
  };
46
77
 
47
78
  const onClick = () => {
79
+ if (isClicked.value || !currentConversation.value) {
80
+ return;
81
+ }
82
+ dialogShow.value = true;
83
+ }
84
+
85
+ const onEndConversationConfirm = () => {
48
86
  if (isClicked.value || !currentConversation.value) {
49
87
  return;
50
88
  }
@@ -72,4 +110,73 @@ const onClick = () => {
72
110
  color: #97A3B4;
73
111
  cursor: default;
74
112
  }
113
+
114
+ .toolbar-button.end-human-service:not(.overflow-popover-item):hover {
115
+ border-color: #ef4444;
116
+ color: #ef4444;
117
+ background: #fef2f2;
118
+ }
119
+
120
+ .overflow-popover-item.end-human-service:hover {
121
+ color: #ef4444;
122
+ background: #fef2f2;
123
+ }
124
+
125
+ .end-conversation-dialog .end-conversation-dialog-icon {
126
+ width: 56px;
127
+ height: 56px;
128
+ border-radius: 50%;
129
+ background: linear-gradient(135deg, #fef3c7, #fde68a);
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ color: #d97706;
134
+ }
135
+
136
+ .end-conversation-dialog .end-conversation-dialog-icon svg {
137
+ width: 28px;
138
+ height: 28px;
139
+ }
140
+
141
+ .end-conversation-dialog .end-conversation-dialog-content {
142
+ display: flex;
143
+ flex-direction: column;
144
+ align-items: center;
145
+ text-align: center;
146
+ }
147
+
148
+ .end-conversation-dialog .end-conversation-dialog-title {
149
+ font-size: 18px;
150
+ font-weight: 600;
151
+ margin: 0 0 8px;
152
+ }
153
+
154
+ .end-conversation-dialog .end-conversation-dialog-desc {
155
+ font-size: 14px;
156
+ color: #666;
157
+ margin: 0;
158
+ }
159
+
160
+ .end-conversation-dialog .dialog-main-content {
161
+ flex-direction: column;
162
+ margin-bottom: 24px;
163
+ }
164
+
165
+ .end-conversation-dialog .dialog-main {
166
+ background: #fff;
167
+ border-radius: 16px;
168
+ width: 380px;
169
+ padding: 32px 28px 24px;
170
+ text-align: center;
171
+ box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
172
+ }
173
+
174
+ .end-conversation-dialog .btn.end-conversation-dialog__confirm-btn {
175
+ border: 0;
176
+ background: linear-gradient(135deg, #ef4444, #dc2626);
177
+ color: #fff;
178
+ box-shadow: 0 2px 8px rgba(239, 68, 68, .3);
179
+ }
180
+
181
+
75
182
  </style>
@@ -8,6 +8,8 @@
8
8
  background-image:url("../../../assets/background_mobile.png");
9
9
  background-size: cover;
10
10
  height: 100vh;
11
+ // iOS Safari 100vh 包含浏览器工具栏,会遮挡底部输入框;使用动态视口单位 dvh
12
+ height: 100dvh;
11
13
  &-message-list {
12
14
  flex: 1;
13
15
  overflow: hidden;
@@ -22,10 +22,13 @@
22
22
  @click="close"
23
23
  />
24
24
  </header>
25
- <div
26
- class="dialog-main-content"
27
- :class="[isH5 ? 'dialog-main-content-uniapp' : '']"
28
- >
25
+ <div class="dialog-main-content">
26
+ <div
27
+ v-if="$slots.icon"
28
+ class="dialog-main-icon"
29
+ >
30
+ <slot name="icon" />
31
+ </div>
29
32
  <slot />
30
33
  </div>
31
34
  <footer
@@ -34,15 +37,17 @@
34
37
  >
35
38
  <button
36
39
  class="btn btn-cancel"
40
+ :class="cancelBtnClass"
37
41
  @click="close"
38
42
  >
39
- {{ TUITranslateService.t('取消') }}
43
+ {{ cancelText || TUITranslateService.t('取消') }}
40
44
  </button>
41
45
  <button
42
46
  class="btn btn-default"
47
+ :class="confirmBtnClass"
43
48
  @click="submit"
44
49
  >
45
- {{ TUITranslateService.t('确定') }}
50
+ {{ confirmText || TUITranslateService.t('确定') }}
46
51
  </button>
47
52
  </footer>
48
53
  </main>
@@ -52,7 +57,7 @@
52
57
  <script lang="ts" setup>
53
58
  import vue from '../../../adapter-vue';
54
59
  import { TUITranslateService } from '../../../@aidesk/uikit-engine';
55
- import { isPC, isH5 } from '../../../utils/env';
60
+ import { isPC } from '../../../utils/env';
56
61
  const { ref, watchEffect } = vue;
57
62
  const clickType = {
58
63
  OUTSIDE: 'outside',
@@ -83,6 +88,22 @@ const props = defineProps({
83
88
  type: Boolean,
84
89
  default: false,
85
90
  },
91
+ confirmText: {
92
+ type: String,
93
+ default: '',
94
+ },
95
+ cancelText: {
96
+ type: String,
97
+ default: '',
98
+ },
99
+ confirmBtnClass: {
100
+ type: String,
101
+ default: '',
102
+ },
103
+ cancelBtnClass: {
104
+ type: String,
105
+ default: '',
106
+ },
86
107
  });
87
108
 
88
109
  const showDialog = ref(false);
@@ -5,8 +5,7 @@
5
5
 
6
6
  .dialog {
7
7
  &-main {
8
- border-radius: 0;
9
- padding: 0;
8
+ border-radius: 10px;
10
9
  display: flex;
11
10
  flex-direction: column;
12
11
  overflow: hidden;
@@ -23,16 +22,9 @@
23
22
  display: flex;
24
23
  justify-content: center;
25
24
  align-items: center;
26
- margin-bottom: 0;
27
-
28
- &-uniapp {
29
- padding: 40px 0;
30
- }
31
25
  }
32
26
 
33
27
  &-footer {
34
- border-top: 1px solid #DDD;
35
-
36
28
  .btn {
37
29
  flex: 1;
38
30
  margin: 0;
@@ -4,15 +4,15 @@
4
4
  height: 100%;
5
5
  left: 0;
6
6
  top: 0;
7
- z-index: 6;
7
+ z-index: 9999;
8
8
  display: flex;
9
9
  justify-content: center;
10
10
  align-items: center;
11
11
 
12
12
  &-main {
13
13
  min-width: 368px;
14
- border-radius: 10px;
15
- padding: 20px 30px;
14
+ border-radius: 12px;
15
+ padding: 32px 28px 24px;
16
16
 
17
17
  &-header {
18
18
  display: flex;
@@ -35,27 +35,41 @@
35
35
  margin-bottom: 20px;
36
36
  }
37
37
 
38
+ &-icon {
39
+ display: flex;
40
+ justify-content: center;
41
+ margin-bottom: 12px;
42
+ }
43
+
38
44
  &-footer {
39
45
  display: flex;
40
- justify-content: flex-end;
46
+ justify-content: center;
47
+ gap: 12px;
41
48
  }
42
49
  }
43
50
  }
44
51
 
45
52
  .btn {
46
- padding: 8px 20px;
47
- margin: 0 6px;
48
- border-radius: 4px;
49
- border: none;
53
+ flex: 1;
54
+ margin: 0;
55
+ padding: 11px 0;
56
+ border: 0;
57
+ border-radius: 9px;
58
+ background: #efefef;
50
59
  font-size: 14px;
60
+ font-weight: 500;
61
+ color: #666;
51
62
  text-align: center;
52
63
  line-height: 20px;
64
+ cursor: pointer;
65
+ transition: all .2s;
53
66
 
54
67
  &:disabled {
55
- opacity: 0.3;
68
+ opacity: .3;
56
69
  }
57
70
 
58
- &:last-child {
59
- margin-right: 0;
71
+ &-default {
72
+ background: #006eff;
73
+ color: #fff;
60
74
  }
61
75
  }
@@ -42,5 +42,9 @@ const AIDesk = {
42
42
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Once a review has been submitted for more than 3 minutes, it cannot be modified.",
43
43
  "不能发送空白消息": "Unable to send blank message",
44
44
  "确认转人工": "Confirm transfer to agent",
45
+ "确定要结束本次会话吗?": "Are you sure you want to end this conversation?",
46
+ "结束后将无法继续与当前客服对话": "You will not be able to continue chatting with the current agent after ending.",
47
+ "再想想": "Cancel",
48
+ "确认结束": "Confirm",
45
49
  }
46
50
  export default AIDesk;
@@ -42,5 +42,9 @@ const AIDesk = {
42
42
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Una valoración enviada hace más de 3 minutos no puede modificarse.",
43
43
  "不能发送空白消息": "No se puede enviar un mensaje vacío",
44
44
  "确认转人工": "Confirmar transferencia a agente",
45
+ "确定要结束本次会话吗?": "¿Estás seguro de que quieres finalizar esta conversación?",
46
+ "结束后将无法继续与当前客服对话": "No podrás continuar chateando con el agente actual después de finalizar.",
47
+ "再想想": "Cancelar",
48
+ "确认结束": "Confirmar",
45
49
  }
46
50
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Kapag lumipas na ang 3 minuto mula sa pagsusumite ng review, hindi na ito mababago.",
42
42
  "不能发送空白消息": "Hindi maaaring magpadala ng blangkong mensahe",
43
43
  "确认转人工": "Kumpirmahin ang paglipat sa ahente",
44
+ "确定要结束本次会话吗?": "Sigurado ka bang gusto mong tapusin ang pag-uusap na ito?",
45
+ "结束后将无法继续与当前客服对话": "Hindi mo na maipagpapatuloy ang pakikipag-usap sa kasalukuyang ahente pagkatapos itong tapusin.",
46
+ "再想想": "Kanselahin",
47
+ "确认结束": "Kumpirmahin",
44
48
  }
45
49
  export default AIDesk;
@@ -40,6 +40,10 @@ const AIDesk = {
40
40
  "结束排队": "Keluar dari antrian",
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Ulasan yang dikirim lebih dari 3 menit tidak dapat diubah.",
42
42
  "不能发送空白消息": "Tidak dapat mengirim pesan kosong",
43
- "确认转人工": "Konfirmasi transfer ke agen",
43
+ "确认转人工": "Konfirmasi transfer ke agen",
44
+ "确定要结束本次会话吗?": "Apakah Anda yakin ingin mengakhiri percakapan ini?",
45
+ "结束后将无法继续与当前客服对话": "Anda tidak akan dapat melanjutkan percakapan dengan agen saat ini setelah diakhiri.",
46
+ "再想想": "Batal",
47
+ "确认结束": "Konfirmasi",
44
48
  }
45
49
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "レビューは投稿から3分経過すると変更できません。",
42
42
  "不能发送空白消息": "空白のメッセージは送信できません",
43
43
  "确认转人工": "人工サービスに転送する",
44
+ "确定要结束本次会话吗?": "このセッションを終了してもよろしいですか?",
45
+ "结束后将无法继续与当前客服对话": "終了後、現在のカスタマーサポートとの会話を継続することはできません。",
46
+ "再想想": "キャンセル",
47
+ "确认结束": "確認",
44
48
  }
45
49
  export default AIDesk;
@@ -42,5 +42,9 @@ const AIDesk = {
42
42
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "리뷰는 제출 후 3분이 지나면 수정할 수 없습니다.",
43
43
  "不能发送空白消息": "빈 메시지를 보낼 수 없습니다",
44
44
  "确认转人工": "상담사 연결",
45
+ "确定要结束本次会话吗?": "이 대화를 종료하시겠습니까?",
46
+ "结束后将无法继续与当前客服对话": "종료 후에는 현재 상담원과 계속 대화할 수 없습니다.",
47
+ "再想想": "취소",
48
+ "确认结束": "확인",
45
49
  }
46
50
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Ulasan yang dihantar lebih dari 3 minit tidak boleh diubah.",
42
42
  "不能发送空白消息": "Tidak dapat menghantar mesej kosong",
43
43
  "确认转人工": "Sahkan pindah kepada ejen",
44
+ "确定要结束本次会话吗?": "Adakah anda pasti ingin menamatkan perbualan ini?",
45
+ "结束后将无法继续与当前客服对话": "Anda tidak akan dapat meneruskan perbualan dengan ejen semasa selepas tamat.",
46
+ "再想想": "Batal",
47
+ "确认结束": "Sahkan",
44
48
  }
45
49
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Отзыв нельзя изменить после истечения 3 минут с момента отправки.",
42
42
  "不能发送空白消息": "Невозможно отправить пустое сообщение",
43
43
  "确认转人工": "Подтвердить перевод на оператора",
44
+ "确定要结束本次会话吗?": "Вы уверены, что хотите завершить этот разговор?",
45
+ "结束后将无法继续与当前客服对话": "После завершения вы не сможете продолжить общение с текущим оператором.",
46
+ "再想想": "Отмена",
47
+ "确认结束": "Подтвердить",
44
48
  }
45
49
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "รีวิวที่ส่งไปแล้วเกิน 3 นาทีจะไม่สามารถแก้ไขได้",
42
42
  "不能发送空白消息": "ไม่สามารถส่งข้อความว่างได้",
43
43
  "确认转人工": "ยืนยันการโอนย้ายไปยังเจ้าหน้าที่",
44
+ "确定要结束本次会话吗?": "คุณแน่ใจหรือไม่ว่าต้องการสิ้นสุดการสนทนานี้?",
45
+ "结束后将无法继续与当前客服对话": "คุณจะไม่สามารถสนทนากับเจ้าหน้าที่ปัจจุบันต่อได้หลังจากสิ้นสุด",
46
+ "再想想": "ยกเลิก",
47
+ "确认结束": "ยืนยัน",
44
48
  }
45
49
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "Đánh giá sau khi gửi hơn 3 phút sẽ không thể chỉnh sửa.",
42
42
  "不能发送空白消息": "Không thể gửi tin nhắn trống",
43
43
  "确认转人工": "Xác nhận chuyển tiếp sang nhân viên",
44
+ "确定要结束本次会话吗?": "Bạn có chắc chắn muốn kết thúc cuộc trò chuyện này không?",
45
+ "结束后将无法继续与当前客服对话": "Bạn sẽ không thể tiếp tục trò chuyện với nhân viên hỗ trợ hiện tại sau khi kết thúc.",
46
+ "再想想": "Hủy",
47
+ "确认结束": "Xác nhận",
44
48
  }
45
49
  export default AIDesk;
@@ -42,5 +42,9 @@ const AIDesk = {
42
42
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "评价提交超过3分钟,无法更改。感谢您的反馈!",
43
43
  "不能发送空白消息": "不能发送空白消息",
44
44
  "确认转人工": "确认转人工",
45
+ "确定要结束本次会话吗?": "确定要结束本次会话吗?",
46
+ "结束后将无法继续与当前客服对话": "结束后将无法继续与当前客服对话",
47
+ "再想想": "再想想",
48
+ "确认结束": "确认结束",
45
49
  }
46
50
  export default AIDesk;
@@ -41,5 +41,9 @@ const AIDesk = {
41
41
  "评价提交超过3分钟,无法更改。感谢您的反馈!": "評價提交超過3分鐘,無法更改。感謝您的反饋!",
42
42
  "不能发送空白消息": "不能發送空白訊息",
43
43
  "确认转人工": "確認轉人工",
44
+ "确定要结束本次会话吗?": "確定要結束本次會話嗎?",
45
+ "结束后将无法继续与当前客服对话": "結束後將無法繼續與當前客服對話",
46
+ "再想想": "再想想",
47
+ "确认结束": "確認結束",
44
48
  }
45
49
  export default AIDesk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Vue2/Vue3 UIKit for AI Desk",
5
5
  "main": "index",
6
6
  "keywords": [