@chat21/chat21-web-widget 5.0.94-rc6 → 5.0.94-rc7
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 +3 -0
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +26 -26
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.0.94-rc7
|
|
10
|
+
- **added**: touchstart and touchend events for mobile mic footer button
|
|
11
|
+
|
|
9
12
|
# 5.0.94-rc6
|
|
10
13
|
- **bug-fixed**: logoChat is not rendered if contains special characters (ex. "(" or ")" ) in the name of the resource
|
|
11
14
|
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
<div class="audio-recorder">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<button *ngIf="audioUrl" (click)="deleteRecording()">
|
|
3
|
+
<span class="v-align-center">
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm80-160h80v-360h-80v360Zm160 0h80v-360h-80v360Z"/></svg>
|
|
5
|
+
<!-- <i class="material-icons">delete_outline</i> -->
|
|
6
|
+
</span>
|
|
7
|
+
</button>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<button *ngIf="!audioUrl" class="mic-button" (mousedown)="startRecording()" (mouseup)="stopRecording()">
|
|
17
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
|
|
18
|
-
<path d="M480-400q-50 0-85-35t-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35Zm0-240Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm40-360q17 0 28.5-11.5T520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480Z"/>
|
|
19
|
-
</svg>
|
|
20
|
-
</button>
|
|
21
|
-
<!-- <button *ngIf="isRecording" (click)="stopRecording()"><i class="material-icons">pause_circle_outline</i></button> -->
|
|
9
|
+
<chat-audio class="test" *ngIf="audioBlob && audioUrl"
|
|
10
|
+
[audioBlob] = "audioBlob"
|
|
11
|
+
[color]="'var(--chat-footer-color)'"
|
|
12
|
+
[fontSize]="stylesMap.get('fontSize')"
|
|
13
|
+
[stylesMap]="stylesMap">
|
|
14
|
+
</chat-audio>
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
<button *ngIf="!audioUrl" class="mic-button" (mousedown)="startRecording($event)" (mouseup)="stopRecording($event)" (touchstart)="startRecording($event)" (touchend)="stopRecording($event)">
|
|
17
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
|
|
18
|
+
<path d="M480-400q-50 0-85-35t-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35Zm0-240Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm40-360q17 0 28.5-11.5T520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480Z"/>
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
<!-- <button *ngIf="isRecording" (click)="stopRecording()"><i class="material-icons">pause_circle_outline</i></button> -->
|
|
22
|
+
|
|
23
|
+
<button *ngIf="audioUrl" (click)="sendMessage()">
|
|
24
|
+
<span class="v-align-center">
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="20" width="24" viewBox="0 0 24 20" xml:space="preserve">
|
|
26
|
+
<path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
|
|
27
|
+
</svg>
|
|
28
|
+
</span>
|
|
29
|
+
</button>
|
|
30
30
|
|
|
31
31
|
</div>
|
|
@@ -29,8 +29,12 @@ export class ConversationAudioRecorderComponent {
|
|
|
29
29
|
constructor(private sanitizer: DomSanitizer) {}
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
startRecording() {
|
|
32
|
+
startRecording(event: Event) {
|
|
33
33
|
// console.log('startRecording');
|
|
34
|
+
if (event.type === 'touchstart') {
|
|
35
|
+
event.preventDefault(); // Blocca il successivo mousedown
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
this.startTime = Date.now();
|
|
35
39
|
navigator.mediaDevices.getUserMedia({ audio: true })
|
|
36
40
|
.then(stream => {
|
|
@@ -55,7 +59,12 @@ export class ConversationAudioRecorderComponent {
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
stopRecording() {
|
|
62
|
+
stopRecording(event: Event) {
|
|
63
|
+
|
|
64
|
+
if (event.type === 'touchend') {
|
|
65
|
+
event.preventDefault(); // Previene il mouseup successivo
|
|
66
|
+
}
|
|
67
|
+
|
|
59
68
|
let endTime = Date.now();
|
|
60
69
|
let time = endTime - this.startTime;
|
|
61
70
|
if(time > 500){
|