@tencentcloud/ai-desk-customer-vue 1.7.3 → 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 +14 -0
- package/components/CustomerServiceChat/index-web.vue +3 -0
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +5 -5
- package/components/CustomerServiceChat/message-list/index-web.vue +70 -9
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +16 -7
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +7 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue +7 -48
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue +6 -16
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-plugin-web.vue +6 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-image-web.vue +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-large-stream.vue +2 -16
- package/components/CustomerServiceChat/message-list/message-elements/message-video-web.vue +20 -8
- package/components/CustomerServiceChat/message-toolbar-button/index.vue +11 -0
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-end-human-service.vue +108 -1
- package/components/CustomerServiceChat/style/h5.scss +2 -0
- package/components/common/Dialog/index.vue +28 -7
- package/components/common/Dialog/style/h5.scss +1 -9
- package/components/common/Dialog/style/web.scss +25 -11
- package/components/common/ImagePreviewer/image-item-web.vue +9 -1
- package/components/common/ImagePreviewer/index-web.vue +179 -42
- package/locales/en/aidesk.ts +4 -0
- package/locales/es/aidesk.ts +4 -0
- package/locales/fil/aidesk.ts +4 -0
- package/locales/id/aidesk.ts +5 -1
- package/locales/ja/aidesk.ts +4 -0
- package/locales/ko/aidesk.ts +4 -0
- package/locales/ms/aidesk.ts +4 -0
- package/locales/ru/aidesk.ts +4 -0
- package/locales/th/aidesk.ts +4 -0
- package/locales/vi/aidesk.ts +4 -0
- package/locales/zh_cn/aidesk.ts +4 -0
- package/locales/zh_tw/aidesk.ts +4 -0
- package/package.json +1 -1
- package/utils/utils.ts +24 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
@wheel.stop="handleWheel"
|
|
14
14
|
>
|
|
15
15
|
<ul
|
|
16
|
+
v-if="!props.imageUrl"
|
|
16
17
|
ref="ulRef"
|
|
17
18
|
class="image-list"
|
|
18
19
|
:style="{
|
|
@@ -31,40 +32,59 @@
|
|
|
31
32
|
<ImageItem
|
|
32
33
|
:zoom="zoom"
|
|
33
34
|
:rotate="rotate"
|
|
35
|
+
:translateX="translateX"
|
|
36
|
+
:translateY="translateY"
|
|
34
37
|
:src="getImageUrl(item)"
|
|
35
38
|
:messageItem="item"
|
|
36
39
|
/>
|
|
37
40
|
</li>
|
|
38
41
|
</ul>
|
|
42
|
+
<ul
|
|
43
|
+
v-else
|
|
44
|
+
ref="ulRef"
|
|
45
|
+
class="image-list"
|
|
46
|
+
:style="{ width: '100%' }"
|
|
47
|
+
>
|
|
48
|
+
<li class="image-item">
|
|
49
|
+
<ImageItem
|
|
50
|
+
:zoom="zoom"
|
|
51
|
+
:rotate="rotate"
|
|
52
|
+
:translateX="translateX"
|
|
53
|
+
:translateY="translateY"
|
|
54
|
+
:src="props.imageUrl"
|
|
55
|
+
/>
|
|
56
|
+
</li>
|
|
57
|
+
</ul>
|
|
39
58
|
</div>
|
|
40
59
|
<div
|
|
41
|
-
v-show="isPC"
|
|
42
60
|
class="icon icon-close"
|
|
43
61
|
@click="close"
|
|
44
62
|
>
|
|
45
63
|
<Icon
|
|
46
64
|
:file="iconClose"
|
|
47
|
-
width="
|
|
48
|
-
height="
|
|
65
|
+
width="14px"
|
|
66
|
+
height="14px"
|
|
49
67
|
/>
|
|
50
68
|
</div>
|
|
51
69
|
<div
|
|
52
|
-
v-if="isPC && currentImageIndex > 0"
|
|
70
|
+
v-if="isPC && !props.imageUrl && currentImageIndex > 0"
|
|
53
71
|
class="image-button image-button-left"
|
|
54
72
|
@click="goPrev"
|
|
55
73
|
>
|
|
56
74
|
<Icon :file="iconArrowLeft" />
|
|
57
75
|
</div>
|
|
58
76
|
<div
|
|
59
|
-
v-if="isPC && currentImageIndex < imageList.length - 1"
|
|
77
|
+
v-if="isPC && !props.imageUrl && currentImageIndex < imageList.length - 1"
|
|
60
78
|
class="image-button image-button-right"
|
|
61
79
|
@click="goNext"
|
|
62
80
|
>
|
|
63
81
|
<Icon :file="iconArrowLeft" />
|
|
64
82
|
</div>
|
|
65
|
-
<div
|
|
83
|
+
<div
|
|
84
|
+
v-if="isPC"
|
|
85
|
+
:class="['actions-bar', isMobile && 'actions-bar-h5']"
|
|
86
|
+
>
|
|
66
87
|
<div
|
|
67
|
-
v-if="isPC"
|
|
68
88
|
class="icon-zoom-in"
|
|
69
89
|
@click="zoomIn"
|
|
70
90
|
>
|
|
@@ -75,7 +95,6 @@
|
|
|
75
95
|
/>
|
|
76
96
|
</div>
|
|
77
97
|
<div
|
|
78
|
-
v-if="isPC"
|
|
79
98
|
class="icon-zoom-out"
|
|
80
99
|
@click="zoomOut"
|
|
81
100
|
>
|
|
@@ -86,7 +105,6 @@
|
|
|
86
105
|
/>
|
|
87
106
|
</div>
|
|
88
107
|
<div
|
|
89
|
-
v-if="isPC"
|
|
90
108
|
class="icon-refresh-left"
|
|
91
109
|
@click="rotateLeft"
|
|
92
110
|
>
|
|
@@ -97,7 +115,6 @@
|
|
|
97
115
|
/>
|
|
98
116
|
</div>
|
|
99
117
|
<div
|
|
100
|
-
v-if="isPC"
|
|
101
118
|
class="icon-refresh-right"
|
|
102
119
|
@click="rotateRight"
|
|
103
120
|
>
|
|
@@ -107,7 +124,7 @@
|
|
|
107
124
|
height="27px"
|
|
108
125
|
/>
|
|
109
126
|
</div>
|
|
110
|
-
<span class="image-counter">
|
|
127
|
+
<span v-if="!props.imageUrl" class="image-counter">
|
|
111
128
|
{{ currentImageIndex + 1 }} / {{ imageList.length }}
|
|
112
129
|
</span>
|
|
113
130
|
</div>
|
|
@@ -154,10 +171,12 @@ const props = withDefaults(
|
|
|
154
171
|
defineProps<{
|
|
155
172
|
imageList: IMessageModel[];
|
|
156
173
|
currentImage: IMessageModel;
|
|
174
|
+
imageUrl?: string;
|
|
157
175
|
}>(),
|
|
158
176
|
{
|
|
159
177
|
imageList: () => [] as IMessageModel[],
|
|
160
178
|
messageItem: () => ({} as IMessageModel),
|
|
179
|
+
imageUrl: '',
|
|
161
180
|
},
|
|
162
181
|
);
|
|
163
182
|
|
|
@@ -175,14 +194,33 @@ const minZoom = ref(0.1);
|
|
|
175
194
|
const currentImageIndex = ref(0);
|
|
176
195
|
const image = ref();
|
|
177
196
|
const ulRef = ref();
|
|
197
|
+
const translateX = ref(0);
|
|
198
|
+
const translateY = ref(0);
|
|
178
199
|
// touch
|
|
179
200
|
let startX = 0;
|
|
201
|
+
let startY = 0;
|
|
202
|
+
let baseTranslateX = 0;
|
|
203
|
+
let baseTranslateY = 0;
|
|
180
204
|
const touchStore = {} as touchesPosition;
|
|
181
205
|
let moveFlag = false;
|
|
182
206
|
let twoTouchesFlag = false;
|
|
183
207
|
let timer: number | null = null;
|
|
208
|
+
// double tap to zoom
|
|
209
|
+
let lastTapTime = 0;
|
|
210
|
+
let lastTapX = 0;
|
|
211
|
+
let lastTapY = 0;
|
|
212
|
+
let singleTapTimer: number | null = null;
|
|
213
|
+
let dblTapStep = 0;
|
|
214
|
+
const DOUBLE_TAP_DELAY = 300;
|
|
215
|
+
const DOUBLE_TAP_DIST = 30;
|
|
216
|
+
const TAP_MOVE_THRESHOLD = 10;
|
|
217
|
+
const DBL_TAP_ZOOM_LEVELS = [2, 3.5];
|
|
184
218
|
|
|
185
219
|
watchEffect(() => {
|
|
220
|
+
if (props.imageUrl) {
|
|
221
|
+
currentImageIndex.value = 0;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
186
224
|
currentImageIndex.value = props.imageList.findIndex((message: any) => {
|
|
187
225
|
return message.ID === props?.currentImage?.ID;
|
|
188
226
|
});
|
|
@@ -204,6 +242,8 @@ const handleTouchMove = (e: any) => {
|
|
|
204
242
|
if (e.touches && e.touches.length === 2) {
|
|
205
243
|
twoTouchesFlag = true;
|
|
206
244
|
handleTwoTouches(e);
|
|
245
|
+
} else if (e.touches && e.touches.length === 1 && zoom.value > 1) {
|
|
246
|
+
handleOneTouchPan(e);
|
|
207
247
|
}
|
|
208
248
|
};
|
|
209
249
|
|
|
@@ -225,26 +265,46 @@ const handleTouchEnd = (e: any) => {
|
|
|
225
265
|
}
|
|
226
266
|
// H5 touch move to left to go to prev image
|
|
227
267
|
// H5 touch move to right to go to next image
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
268
|
+
const endX = e?.changedTouches[0]?.pageX ?? 0;
|
|
269
|
+
const endY = e?.changedTouches[0]?.pageY ?? 0;
|
|
270
|
+
const isTap = Math.hypot(endX - startX, endY - startY) < TAP_MOVE_THRESHOLD;
|
|
271
|
+
if (moveFlag && !isTap) {
|
|
272
|
+
if (timer === null) {
|
|
273
|
+
moveEndX = endX;
|
|
274
|
+
X = moveEndX - startX;
|
|
275
|
+
if (zoom.value <= 1 && !props.imageUrl) {
|
|
234
276
|
if (X > 100) {
|
|
235
277
|
goPrev();
|
|
236
278
|
} else if (X < -100) {
|
|
237
279
|
goNext();
|
|
238
280
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
281
|
+
}
|
|
282
|
+
timer = setTimeout(() => {
|
|
283
|
+
timer = null;
|
|
284
|
+
}, 200);
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
const now = Date.now();
|
|
288
|
+
const dist = Math.hypot(endX - lastTapX, endY - lastTapY);
|
|
289
|
+
if (now - lastTapTime < DOUBLE_TAP_DELAY && dist < DOUBLE_TAP_DIST) {
|
|
290
|
+
if (singleTapTimer !== null) {
|
|
291
|
+
clearTimeout(singleTapTimer);
|
|
292
|
+
singleTapTimer = null;
|
|
293
|
+
}
|
|
294
|
+
lastTapTime = 0;
|
|
295
|
+
dblTapZoom(endX, endY);
|
|
296
|
+
} else {
|
|
297
|
+
lastTapTime = now;
|
|
298
|
+
lastTapX = endX;
|
|
299
|
+
lastTapY = endY;
|
|
300
|
+
if (singleTapTimer !== null) {
|
|
301
|
+
clearTimeout(singleTapTimer);
|
|
302
|
+
}
|
|
303
|
+
singleTapTimer = setTimeout(() => {
|
|
304
|
+
singleTapTimer = null;
|
|
242
305
|
close();
|
|
243
|
-
|
|
306
|
+
}, DOUBLE_TAP_DELAY);
|
|
244
307
|
}
|
|
245
|
-
timer = setTimeout(() => {
|
|
246
|
-
timer = null;
|
|
247
|
-
}, 200);
|
|
248
308
|
}
|
|
249
309
|
};
|
|
250
310
|
|
|
@@ -265,9 +325,19 @@ const handleWheel = (e: any) => {
|
|
|
265
325
|
|
|
266
326
|
const moveInit = (e: any) => {
|
|
267
327
|
startX = e?.changedTouches[0]?.pageX;
|
|
328
|
+
startY = e?.changedTouches[0]?.pageY;
|
|
329
|
+
baseTranslateX = translateX.value;
|
|
330
|
+
baseTranslateY = translateY.value;
|
|
268
331
|
moveFlag = false;
|
|
269
332
|
};
|
|
270
333
|
|
|
334
|
+
const handleOneTouchPan = (e: any) => {
|
|
335
|
+
const touch = e?.touches[0];
|
|
336
|
+
if (!touch) return;
|
|
337
|
+
translateX.value = baseTranslateX + (touch.pageX - startX);
|
|
338
|
+
translateY.value = baseTranslateY + (touch.pageY - startY);
|
|
339
|
+
};
|
|
340
|
+
|
|
271
341
|
const twoTouchesInit = (e: any) => {
|
|
272
342
|
const touch1 = e?.touches[0];
|
|
273
343
|
const touch2 = e?.touches[1];
|
|
@@ -314,7 +384,24 @@ const handleTwoTouches = (e: any) => {
|
|
|
314
384
|
touchStore.pageX2 as number,
|
|
315
385
|
touchStore.pageY2 as number,
|
|
316
386
|
);
|
|
317
|
-
|
|
387
|
+
const newZoom = Math.min(Math.max(0.5, zoom.value * touchZoom), 4);
|
|
388
|
+
// anchor zoom at the midpoint of two fingers
|
|
389
|
+
const wrapperRect = image.value?.getBoundingClientRect?.();
|
|
390
|
+
if (wrapperRect) {
|
|
391
|
+
const centerX = wrapperRect.left + wrapperRect.width / 2;
|
|
392
|
+
const centerY = wrapperRect.top + wrapperRect.height / 2;
|
|
393
|
+
const midX = (touch1.pageX + touch2.pageX) / 2;
|
|
394
|
+
const midY = (touch1.pageY + touch2.pageY) / 2;
|
|
395
|
+
const ratio = newZoom / zoom.value;
|
|
396
|
+
translateX.value = midX - centerX - (midX - centerX - translateX.value) * ratio;
|
|
397
|
+
translateY.value = midY - centerY - (midY - centerY - translateY.value) * ratio;
|
|
398
|
+
}
|
|
399
|
+
zoom.value = newZoom;
|
|
400
|
+
// refresh anchor for the next move frame
|
|
401
|
+
touchStore.pageX1 = touch1.pageX;
|
|
402
|
+
touchStore.pageY1 = touch1.pageY;
|
|
403
|
+
touchStore.pageX2 = touch2.pageX;
|
|
404
|
+
touchStore.pageY2 = touch2.pageY;
|
|
318
405
|
};
|
|
319
406
|
|
|
320
407
|
onMounted(() => {
|
|
@@ -357,9 +444,39 @@ const goPrev = () => {
|
|
|
357
444
|
const initStyle = () => {
|
|
358
445
|
zoom.value = 1;
|
|
359
446
|
rotate.value = 0;
|
|
447
|
+
translateX.value = 0;
|
|
448
|
+
translateY.value = 0;
|
|
449
|
+
dblTapStep = 0;
|
|
450
|
+
lastTapTime = 0;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// 1st double tap: zoom to 1.5x; 2nd: 2.5x; 3rd: reset to 1x
|
|
454
|
+
const dblTapZoom = (x: number, y: number) => {
|
|
455
|
+
const wrapperRect = image.value?.getBoundingClientRect?.();
|
|
456
|
+
if (!wrapperRect) return;
|
|
457
|
+
if (dblTapStep >= DBL_TAP_ZOOM_LEVELS.length) {
|
|
458
|
+
// reset to original size
|
|
459
|
+
zoom.value = 1;
|
|
460
|
+
translateX.value = 0;
|
|
461
|
+
translateY.value = 0;
|
|
462
|
+
dblTapStep = 0;
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const targetZoom = DBL_TAP_ZOOM_LEVELS[dblTapStep];
|
|
466
|
+
// anchor zoom at the double tap point (same formula as handleTwoTouches)
|
|
467
|
+
const centerX = wrapperRect.left + wrapperRect.width / 2;
|
|
468
|
+
const centerY = wrapperRect.top + wrapperRect.height / 2;
|
|
469
|
+
const ratio = targetZoom / zoom.value;
|
|
470
|
+
translateX.value = x - centerX - (x - centerX - translateX.value) * ratio;
|
|
471
|
+
translateY.value = y - centerY - (y - centerY - translateY.value) * ratio;
|
|
472
|
+
zoom.value = targetZoom;
|
|
473
|
+
dblTapStep += 1;
|
|
360
474
|
};
|
|
361
475
|
|
|
362
476
|
const getImageUrl = (message: IMessageModel) => {
|
|
477
|
+
if (props.imageUrl) {
|
|
478
|
+
return props.imageUrl;
|
|
479
|
+
}
|
|
363
480
|
if (isPC) {
|
|
364
481
|
return message?.payload?.imageInfoArray[0]?.url;
|
|
365
482
|
} else {
|
|
@@ -368,6 +485,11 @@ const getImageUrl = (message: IMessageModel) => {
|
|
|
368
485
|
};
|
|
369
486
|
|
|
370
487
|
const save = () => {
|
|
488
|
+
// bare url preview mode: download the url directly
|
|
489
|
+
if (props.imageUrl) {
|
|
490
|
+
downloadImgInWeb(props.imageUrl);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
371
493
|
const imageMessage = props.imageList[
|
|
372
494
|
currentImageIndex.value
|
|
373
495
|
] as IMessageModel;
|
|
@@ -383,6 +505,14 @@ const save = () => {
|
|
|
383
505
|
|
|
384
506
|
};
|
|
385
507
|
|
|
508
|
+
const getExtFromUrl = (src: string) => {
|
|
509
|
+
const pathname = src.split('?')[0].split('#')[0];
|
|
510
|
+
const dotIndex = pathname.lastIndexOf('.');
|
|
511
|
+
if (dotIndex < 0) return 'jpg';
|
|
512
|
+
const ext = pathname.slice(dotIndex + 1).toLowerCase();
|
|
513
|
+
return ext && ext.length <= 5 ? ext : 'jpg';
|
|
514
|
+
};
|
|
515
|
+
|
|
386
516
|
const downloadImgInWeb = (src: string) => {
|
|
387
517
|
const option: any = {
|
|
388
518
|
mode: 'cors',
|
|
@@ -390,16 +520,23 @@ const downloadImgInWeb = (src: string) => {
|
|
|
390
520
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
391
521
|
}),
|
|
392
522
|
};
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
523
|
+
let extension: string;
|
|
524
|
+
if (props.imageUrl) {
|
|
525
|
+
// bare url preview mode: derive extension from url
|
|
526
|
+
extension = getExtFromUrl(src);
|
|
527
|
+
} else {
|
|
528
|
+
const imageMessage = props.imageList[
|
|
529
|
+
currentImageIndex.value
|
|
530
|
+
] as IMessageModel;
|
|
531
|
+
const imageFormat: number = imageMessage?.payload?.imageFormat;
|
|
532
|
+
if (!imageFormatMap.has(imageFormat)) {
|
|
533
|
+
Toast({
|
|
534
|
+
message: TUITranslateService.t('Component.暂不支持下载此类型图片'),
|
|
535
|
+
type: TOAST_TYPE.ERROR,
|
|
536
|
+
});
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
extension = imageFormatMap.get(imageFormat) as string;
|
|
403
540
|
}
|
|
404
541
|
// If the browser supports fetch, use blob to download, so as to avoid the browser clicking the a tag and jumping to the preview of the new page
|
|
405
542
|
if ((window as any).fetch) {
|
|
@@ -409,14 +546,14 @@ const downloadImgInWeb = (src: string) => {
|
|
|
409
546
|
const a = document.createElement('a');
|
|
410
547
|
const url = window.URL.createObjectURL(blob);
|
|
411
548
|
a.href = url;
|
|
412
|
-
a.download = url + '.' +
|
|
549
|
+
a.download = url + '.' + extension;
|
|
413
550
|
a.click();
|
|
414
551
|
});
|
|
415
552
|
} else {
|
|
416
553
|
const a = document.createElement('a');
|
|
417
554
|
a.href = src;
|
|
418
555
|
a.target = '_blank';
|
|
419
|
-
a.download = src + '.' +
|
|
556
|
+
a.download = src + '.' + extension;
|
|
420
557
|
a.click();
|
|
421
558
|
}
|
|
422
559
|
};
|
|
@@ -438,7 +575,7 @@ onUnmounted(() => {
|
|
|
438
575
|
bottom: 5%;
|
|
439
576
|
padding: 12px;
|
|
440
577
|
border-radius: 6px;
|
|
441
|
-
background:
|
|
578
|
+
background: #fff;
|
|
442
579
|
|
|
443
580
|
&-h5 {
|
|
444
581
|
padding: 6px;
|
|
@@ -465,7 +602,7 @@ onUnmounted(() => {
|
|
|
465
602
|
|
|
466
603
|
.image-previewer {
|
|
467
604
|
position: fixed;
|
|
468
|
-
z-index:
|
|
605
|
+
z-index: 9999;
|
|
469
606
|
width: 100vw;
|
|
470
607
|
height: 100vh;
|
|
471
608
|
background: rgba(#000, 0.3);
|
|
@@ -558,8 +695,8 @@ onUnmounted(() => {
|
|
|
558
695
|
border-radius: 50%;
|
|
559
696
|
top: 3%;
|
|
560
697
|
right: 3%;
|
|
561
|
-
padding:
|
|
562
|
-
background:
|
|
698
|
+
padding: 8px;
|
|
699
|
+
background: #fff;
|
|
563
700
|
display: flex;
|
|
564
701
|
|
|
565
702
|
&::before,
|
|
@@ -585,7 +722,7 @@ onUnmounted(() => {
|
|
|
585
722
|
position: absolute;
|
|
586
723
|
bottom: 5%;
|
|
587
724
|
right: 5%;
|
|
588
|
-
padding:
|
|
725
|
+
padding: 8px;
|
|
589
726
|
border-radius: 6px;
|
|
590
727
|
background: rgba(255, 255, 255, 0.8);
|
|
591
728
|
}
|
package/locales/en/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/es/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/fil/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/id/aidesk.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/locales/ja/aidesk.ts
CHANGED
|
@@ -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/locales/ko/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/ms/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/ru/aidesk.ts
CHANGED
|
@@ -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/locales/th/aidesk.ts
CHANGED
|
@@ -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/locales/vi/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/zh_cn/aidesk.ts
CHANGED
|
@@ -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;
|
package/locales/zh_tw/aidesk.ts
CHANGED
|
@@ -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
package/utils/utils.ts
CHANGED
|
@@ -59,6 +59,30 @@ export const handleSkeletonSize = (
|
|
|
59
59
|
return { width: maxWidth, height: height * (maxWidth / width) };
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
const IMAGE_EXTENSIONS = ['gif', 'jpeg', 'jpg', 'png', 'bmp', 'webp'];
|
|
63
|
+
const VIDEO_EXTENSIONS = ['mov', 'mp4'];
|
|
64
|
+
|
|
65
|
+
export function getMediaTypeByUrl(url?: string, name?: string): 'image' | 'video' | 'file' {
|
|
66
|
+
const source = name || url || '';
|
|
67
|
+
if (!source) {
|
|
68
|
+
return 'file';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const pathname = source.split(/[?#]/)[0];
|
|
72
|
+
const dotIndex = pathname.lastIndexOf('.');
|
|
73
|
+
if (dotIndex < 0) {
|
|
74
|
+
return 'file';
|
|
75
|
+
}
|
|
76
|
+
const ext = pathname.slice(dotIndex + 1).toLowerCase();
|
|
77
|
+
if (IMAGE_EXTENSIONS.includes(ext)) {
|
|
78
|
+
return 'image';
|
|
79
|
+
}
|
|
80
|
+
if (VIDEO_EXTENSIONS.includes(ext)) {
|
|
81
|
+
return 'video';
|
|
82
|
+
}
|
|
83
|
+
return 'file';
|
|
84
|
+
}
|
|
85
|
+
|
|
62
86
|
// Image loading complete
|
|
63
87
|
export function getImgLoad(container: any, className: string, callback: any) {
|
|
64
88
|
const images = container?.querySelectorAll(`.${className}`) || [];
|