@chat21/chat21-web-widget 5.0.83 → 5.0.84-rc.2
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 +6 -0
- package/package.json +1 -1
- package/src/app/app.module.ts +5 -2
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +29 -0
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +103 -0
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +23 -0
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +96 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +14 -3
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +26 -10
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +131 -49
- package/src/app/component/message/audio-track/audio-track.component.html +32 -0
- package/src/app/component/message/audio-track/audio-track.component.scss +107 -0
- package/src/app/component/message/{audio/audio.component.spec.ts → audio-track/audio-track.component.spec.ts} +6 -6
- package/src/app/component/message/audio-track/audio-track.component.ts +147 -0
- package/src/app/component/message/bubble-message/bubble-message.component.html +31 -15
- package/src/app/component/message/bubble-message/bubble-message.component.scss +7 -0
- package/src/app/component/message/bubble-message/bubble-message.component.ts +1 -0
- package/src/app/utils/globals.ts +1 -1
- package/src/assets/twp/blank.html +3 -6
- package/src/assets/twp/chatbot-panel.html +5 -13
- package/src/assets/twp/index-dev.html +8 -16
- package/src/assets/twp/index.html +7 -13
- package/src/assets/twp/tiledesk_widget_files/bootstrap.min.css +4 -3
- package/src/assets/twp/tiledesk_widget_files/bootstrap.min.js +3 -4
- package/src/assets/twp/tiledesk_widget_files/jquery.min.js +2 -2
- package/src/app/component/message/audio/audio.component.html +0 -20
- package/src/app/component/message/audio/audio.component.scss +0 -122
- package/src/app/component/message/audio/audio.component.ts +0 -122
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
#audio_container{
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
#play-icon,
|
|
6
|
-
#pause-icon {
|
|
7
|
-
margin: 20px 2.5% 10px 2.5%;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.time {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
width: 37px;
|
|
13
|
-
text-align: center;
|
|
14
|
-
font-size: 20px;
|
|
15
|
-
margin: 28.5px 0 18.5px 0;
|
|
16
|
-
float: left;
|
|
17
|
-
}
|
|
18
|
-
output {
|
|
19
|
-
display: inline-block;
|
|
20
|
-
width: 32px;
|
|
21
|
-
text-align: center;
|
|
22
|
-
font-size: 20px;
|
|
23
|
-
margin: 10px 2.5% 0 5%;
|
|
24
|
-
float: left;
|
|
25
|
-
clear: left;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
input[type="range"] {
|
|
29
|
-
position: relative;
|
|
30
|
-
-webkit-appearance: none;
|
|
31
|
-
width: 48%;
|
|
32
|
-
margin: 0;
|
|
33
|
-
padding: 0;
|
|
34
|
-
height: 19px;
|
|
35
|
-
margin: 30px 2.5% 20px 2.5%;
|
|
36
|
-
float: left;
|
|
37
|
-
outline: none;
|
|
38
|
-
}
|
|
39
|
-
input[type="range"]::-webkit-slider-runnable-track {
|
|
40
|
-
width: 100%;
|
|
41
|
-
height: 3px;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
|
|
44
|
-
}
|
|
45
|
-
input[type="range"]::before {
|
|
46
|
-
position: absolute;
|
|
47
|
-
content: "";
|
|
48
|
-
top: 8px;
|
|
49
|
-
left: 0;
|
|
50
|
-
width: var(--seek-before-width);
|
|
51
|
-
height: 3px;
|
|
52
|
-
background-color: #007db5;
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
}
|
|
55
|
-
input[type="range"]::-webkit-slider-thumb {
|
|
56
|
-
position: relative;
|
|
57
|
-
-webkit-appearance: none;
|
|
58
|
-
box-sizing: content-box;
|
|
59
|
-
border: 1px solid #007db5;
|
|
60
|
-
height: 15px;
|
|
61
|
-
width: 15px;
|
|
62
|
-
border-radius: 50%;
|
|
63
|
-
background-color: #fff;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
margin: -7px 0 0 0;
|
|
66
|
-
}
|
|
67
|
-
input[type="range"]:active::-webkit-slider-thumb {
|
|
68
|
-
transform: scale(1.2);
|
|
69
|
-
background: #007db5;
|
|
70
|
-
}
|
|
71
|
-
input[type="range"]::-moz-range-track {
|
|
72
|
-
width: 100%;
|
|
73
|
-
height: 3px;
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
|
|
76
|
-
}
|
|
77
|
-
input[type="range"]::-moz-range-progress {
|
|
78
|
-
background-color: #007db5;
|
|
79
|
-
}
|
|
80
|
-
input[type="range"]::-moz-focus-outer {
|
|
81
|
-
border: 0;
|
|
82
|
-
}
|
|
83
|
-
input[type="range"]::-moz-range-thumb {
|
|
84
|
-
box-sizing: content-box;
|
|
85
|
-
border: 1px solid #007db5;
|
|
86
|
-
height: 15px;
|
|
87
|
-
width: 15px;
|
|
88
|
-
border-radius: 50%;
|
|
89
|
-
background-color: #fff;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
}
|
|
92
|
-
input[type="range"]:active::-moz-range-thumb {
|
|
93
|
-
transform: scale(1.2);
|
|
94
|
-
background: #007db5;
|
|
95
|
-
}
|
|
96
|
-
input[type="range"]::-ms-track {
|
|
97
|
-
width: 100%;
|
|
98
|
-
height: 3px;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
background: transparent;
|
|
101
|
-
border: solid transparent;
|
|
102
|
-
color: transparent;
|
|
103
|
-
}
|
|
104
|
-
input[type="range"]::-ms-fill-lower {
|
|
105
|
-
background-color: #007db5;
|
|
106
|
-
}
|
|
107
|
-
input[type="range"]::-ms-fill-upper {
|
|
108
|
-
background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
|
|
109
|
-
}
|
|
110
|
-
input[type="range"]::-ms-thumb {
|
|
111
|
-
box-sizing: content-box;
|
|
112
|
-
border: 1px solid #007db5;
|
|
113
|
-
height: 15px;
|
|
114
|
-
width: 15px;
|
|
115
|
-
border-radius: 50%;
|
|
116
|
-
background-color: #fff;
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
}
|
|
119
|
-
input[type="range"]:active::-ms-thumb {
|
|
120
|
-
transform: scale(1.2);
|
|
121
|
-
background: #007db5;
|
|
122
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
|
2
|
-
// import lottieWeb from 'https://cdn.skypack.dev/lottie-web';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'chat-audio',
|
|
6
|
-
templateUrl: './audio.component.html',
|
|
7
|
-
styleUrls: ['./audio.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class AudioComponent implements OnInit {
|
|
10
|
-
|
|
11
|
-
@Input() metadata: any;
|
|
12
|
-
@Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
|
|
13
|
-
|
|
14
|
-
uidAudioPlayng: string = ''
|
|
15
|
-
divPlay: HTMLAudioElement
|
|
16
|
-
playState: HTMLElement
|
|
17
|
-
status: 'play' | 'pause' = 'play'
|
|
18
|
-
|
|
19
|
-
constructor(private elementRef: ElementRef) { }
|
|
20
|
-
|
|
21
|
-
ngOnInit() {
|
|
22
|
-
// this.divPlay = this.elementRef.nativeElement.querySelector('#audio_container').querySelector('#audio_msg')
|
|
23
|
-
// this.playState= this.elementRef.nativeElement.querySelector('#audio_container').querySelector('#duration')
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
onPlayPause(status: string){
|
|
27
|
-
// const divPlay = (<HTMLAudioElement>document.getElementById('audio_msg'));
|
|
28
|
-
if(status === 'play') {
|
|
29
|
-
this.divPlay.play();
|
|
30
|
-
this.status = 'pause'
|
|
31
|
-
} else {
|
|
32
|
-
this.divPlay.pause();
|
|
33
|
-
this.status = 'play'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
pauseAudioMsg(e) {
|
|
38
|
-
try {
|
|
39
|
-
// stop all audio
|
|
40
|
-
if (this.uidAudioPlayng) {
|
|
41
|
-
const divPlay = (<HTMLAudioElement>document.getElementById(this.uidAudioPlayng));
|
|
42
|
-
divPlay.pause();
|
|
43
|
-
// console.log('> pausa: ', divPlay);
|
|
44
|
-
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.log('> Error is: ', error);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
// console.log(e.target.id);
|
|
51
|
-
if (this.uidAudioPlayng) {
|
|
52
|
-
this.uidAudioPlayng = '';
|
|
53
|
-
}
|
|
54
|
-
} catch (error) {
|
|
55
|
-
console.log('> Error is: ', error);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
playAudioMsg(e) {
|
|
60
|
-
// stop all audio
|
|
61
|
-
if (this.uidAudioPlayng) {
|
|
62
|
-
const divPlay = (<HTMLAudioElement>document.getElementById(this.uidAudioPlayng));
|
|
63
|
-
divPlay.pause();
|
|
64
|
-
// console.log('> pausa: ', divPlay);
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
// console.log(e.target.id);
|
|
68
|
-
// set uid audio playng
|
|
69
|
-
this.uidAudioPlayng = e.target.id;
|
|
70
|
-
} catch (error) {
|
|
71
|
-
console.log('> Error is: ', error);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
updateTimeAudioMsg(ev){
|
|
76
|
-
var currTime = Math.floor(ev.target.currentTime);
|
|
77
|
-
var duration = Math.floor(ev.target.duration);
|
|
78
|
-
|
|
79
|
-
let minutes = 0;
|
|
80
|
-
if(currTime > 60){
|
|
81
|
-
minutes = Math.floor(currTime / 60);
|
|
82
|
-
}
|
|
83
|
-
const seconds = currTime - minutes * 60
|
|
84
|
-
// console.log('timeeee', minutes + ':' + seconds )
|
|
85
|
-
// this.playState.innerHTML = minutes + ':' + seconds
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @param uid
|
|
93
|
-
*/
|
|
94
|
-
playPausaAudioMsg(uid: string) {
|
|
95
|
-
// console.log('playPausaAudioMsg: ', uid);
|
|
96
|
-
const that = this;
|
|
97
|
-
try {
|
|
98
|
-
const divPause = (<HTMLAudioElement>document.getElementById(that.uidAudioPlayng));
|
|
99
|
-
const divPlay = (<HTMLAudioElement>document.getElementById(uid));
|
|
100
|
-
if (divPause) {
|
|
101
|
-
divPause.pause();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (that.uidAudioPlayng === uid) {
|
|
105
|
-
that.uidAudioPlayng = '';
|
|
106
|
-
} else {
|
|
107
|
-
if (divPlay) {
|
|
108
|
-
setTimeout(function() {
|
|
109
|
-
// if (that.g.autoplay_activated) {
|
|
110
|
-
// divPlay.play();
|
|
111
|
-
// }
|
|
112
|
-
this.uidAudioPlayng = uid;
|
|
113
|
-
}, 300);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
} catch (error) {
|
|
118
|
-
console.log('> Error is: ', error);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|