@chat21/chat21-web-widget 5.0.91-rc1 → 5.0.91-rc3
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/component/conversation-detail/conversation/conversation.component.html +1 -1
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +2 -2
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +18 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +2 -2
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +1 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +1 -1
- package/src/app/component/message/audio-track/audio-track.component.html +1 -1
- package/src/app/component/message/audio-track/audio-track.component.scss +7 -7
- package/src/app/component/message/audio-track/audio-track.component.ts +16 -1
- package/src/app/providers/global-settings.service.ts +6 -6
- package/src/app/sass/_variables.scss +1 -0
- package/src/app/utils/globals.ts +2 -2
- package/src/assets/twp/index-dev.html +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.0.91-rc3
|
|
10
|
+
- **added**: showAudioRecorderFooterButton property variable
|
|
11
|
+
|
|
12
|
+
# 5.0.91-rc2
|
|
13
|
+
- **changed**: colors for chat-audio-track component managed
|
|
14
|
+
|
|
9
15
|
# 5.0.91-rc1
|
|
10
16
|
- **changed**: enabled showRegisterAudioFooterButton button
|
|
11
17
|
|
package/package.json
CHANGED
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
[userEmail]="g?.userEmail"
|
|
120
120
|
[showAttachmentFooterButton]="g?.showAttachmentFooterButton"
|
|
121
121
|
[showEmojiFooterButton]="g?.showEmojiFooterButton"
|
|
122
|
-
[
|
|
122
|
+
[showAudioRecorderFooterButton]="g?.showAudioRecorderFooterButton"
|
|
123
123
|
[hideTextAreaContent]="(g?.singleConversation && hideTextAreaContent) || (isConversationArchived && !g?.allowReopen)"
|
|
124
124
|
[isConversationArchived]="isConversationArchived"
|
|
125
125
|
[hideTextReply]="hideFooterTextReply"
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
</span>
|
|
7
7
|
</button>
|
|
8
8
|
|
|
9
|
-
<chat-audio-track *ngIf="audioBlob && audioUrl"
|
|
9
|
+
<chat-audio-track class="test" *ngIf="audioBlob && audioUrl"
|
|
10
10
|
[audioBlob] = "audioBlob"
|
|
11
|
-
[color]="
|
|
11
|
+
[color]="'var(--chat-footer-color)'"
|
|
12
12
|
[fontSize]="stylesMap.get('fontSize')"
|
|
13
13
|
[stylesMap]="stylesMap">
|
|
14
14
|
</chat-audio-track>
|
|
@@ -20,15 +20,32 @@
|
|
|
20
20
|
gap: 8px
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
chat-audio-track {
|
|
23
|
+
::ng-deep chat-audio-track.test {
|
|
24
24
|
display: flex;
|
|
25
25
|
width: 80%;
|
|
26
26
|
margin: 8px 0;
|
|
27
27
|
pointer-events: auto;
|
|
28
28
|
border-radius: var(--chat-footer-border-radius);
|
|
29
29
|
background-color: var(--chat-footer-background-color);
|
|
30
|
+
|
|
31
|
+
// --hoverBackgroundColor: var(--textColor);
|
|
32
|
+
// --hoverTextColor:var(--backgroundColor);
|
|
33
|
+
|
|
34
|
+
button.play-pause{
|
|
35
|
+
svg{
|
|
36
|
+
fill: var(--chat-footer-color) !important;
|
|
37
|
+
}
|
|
38
|
+
&:hover{
|
|
39
|
+
color: var(--chat-footer-background-color) !important;
|
|
40
|
+
background-color: var(--chat-footer-color) !important;
|
|
41
|
+
svg{
|
|
42
|
+
fill: var(--chat-footer-background-color) !important;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
30
46
|
}
|
|
31
47
|
|
|
48
|
+
|
|
32
49
|
button {
|
|
33
50
|
font-size: 16px;
|
|
34
51
|
border: none;
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
69
|
<!-- ICON SEND -->
|
|
70
|
-
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !
|
|
70
|
+
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !showAudioRecorderFooterButton" tabindex="-1" class="chat21-textarea-button" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
|
|
71
71
|
<span class="v-align-center">
|
|
72
72
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="24" width="24" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
|
73
73
|
<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"/>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
78
|
<!-- ICON REC -->
|
|
79
|
-
<div *ngIf="
|
|
79
|
+
<div *ngIf="showAudioRecorderFooterButton && !textInputTextArea" tabindex="-1" class="chat21-audio-button" [class.active]="isStopRec" id="chat21-button-rec">
|
|
80
80
|
<chat-audio-recorder
|
|
81
81
|
(startRecordingEvent)="onStartRecording()"
|
|
82
82
|
(deleteRecordingEvent)="onDeleteRecording()"
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts
CHANGED
|
@@ -29,7 +29,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
29
29
|
@Input() userEmail: string;
|
|
30
30
|
@Input() showAttachmentFooterButton: boolean;
|
|
31
31
|
@Input() showEmojiFooterButton: boolean
|
|
32
|
-
@Input()
|
|
32
|
+
@Input() showAudioRecorderFooterButton: boolean
|
|
33
33
|
// @Input() showContinueConversationButton: boolean;
|
|
34
34
|
@Input() isConversationArchived: boolean;
|
|
35
35
|
@Input() hideTextAreaContent: boolean;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<!-- <i class="material-icons">play_arrow</i> -->
|
|
13
13
|
</button>
|
|
14
14
|
<button *ngIf="isPlaying" class="play-pause" (click)="playPauseAudio()">
|
|
15
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
|
|
15
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" >
|
|
16
16
|
<path d="M560-200v-560h160v560H560Zm-320 0v-560h160v560H240Z"/>
|
|
17
17
|
</svg>
|
|
18
18
|
<!-- <i class="material-icons">pause</i> -->
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
:host {
|
|
3
3
|
--backgroundColor: #{var(--blue)};
|
|
4
4
|
--textColor: #{var(--bck-msg-sent)};
|
|
5
|
-
--hoverBackgroundColor:
|
|
6
|
-
--hoverTextColor:
|
|
7
|
-
--max-width: #{var(--button-in-msg-max-width)};
|
|
5
|
+
--hoverBackgroundColor: var(--textColor);
|
|
6
|
+
--hoverTextColor:var(--backgroundColor);
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.audio-container{
|
|
@@ -39,8 +38,8 @@ button {
|
|
|
39
38
|
font-size: 16px;
|
|
40
39
|
border: none;
|
|
41
40
|
background-color: transparent;
|
|
42
|
-
color: var(--
|
|
43
|
-
fill: var(--
|
|
41
|
+
color: var(--textColor);
|
|
42
|
+
fill: var(--textColor);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.waveformCanvas {
|
|
@@ -72,10 +71,11 @@ button {
|
|
|
72
71
|
.play-pause:hover {
|
|
73
72
|
// background-color: #ddd;
|
|
74
73
|
// background-color: rgb(82, 160, 252);
|
|
75
|
-
background-color:
|
|
74
|
+
background-color: var(--hoverBackgroundColor);
|
|
75
|
+
color: var(--hoverTextColor);
|
|
76
76
|
svg{
|
|
77
77
|
//fill:#fff;
|
|
78
|
-
fill:
|
|
78
|
+
fill: var(--hoverTextColor)
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
.duration {
|
|
@@ -26,7 +26,10 @@ export class AudioTrackComponent implements AfterViewInit {
|
|
|
26
26
|
currentTime: number = 0;
|
|
27
27
|
isPlaying: boolean = false;
|
|
28
28
|
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(
|
|
30
|
+
private sanitizer: DomSanitizer,
|
|
31
|
+
private elementRef: ElementRef
|
|
32
|
+
) {}
|
|
30
33
|
|
|
31
34
|
ngAfterViewInit() {
|
|
32
35
|
console.log('stylesssss', this.stylesMap)
|
|
@@ -39,6 +42,11 @@ export class AudioTrackComponent implements AfterViewInit {
|
|
|
39
42
|
this.audioUrl = this.sanitizer.bypassSecurityTrustUrl(this.rawAudioUrl);
|
|
40
43
|
this.setupAudioContext();
|
|
41
44
|
}
|
|
45
|
+
|
|
46
|
+
if(this.stylesMap.get('bubbleSentBackground')) this.elementRef.nativeElement.querySelector('.audio-container').style.setProperty('--backgroundColor', this.extractFirstColor(this.stylesMap.get('bubbleSentBackground')));
|
|
47
|
+
if(this.stylesMap.get('bubbleSentTextColor')) this.elementRef.nativeElement.querySelector('.audio-container').style.setProperty('--textColor', this.stylesMap.get('bubbleSentTextColor'));
|
|
48
|
+
if(this.stylesMap.get('bubbleSentBackground')) this.elementRef.nativeElement.querySelector('.audio-container').style.setProperty('--hoverBackgroundColor', this.stylesMap.get('bubbleSentTextColor'));
|
|
49
|
+
if(this.stylesMap.get('bubbleSentTextColor')) this.elementRef.nativeElement.querySelector('.audio-container').style.setProperty('--hoverTextColor', this.extractFirstColor(this.stylesMap.get('bubbleSentBackground')));
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
async setupAudioContext() {
|
|
@@ -144,4 +152,11 @@ export class AudioTrackComponent implements AfterViewInit {
|
|
|
144
152
|
}
|
|
145
153
|
});
|
|
146
154
|
}
|
|
155
|
+
|
|
156
|
+
extractFirstColor(gradient: string): string | null {
|
|
157
|
+
const colorRegex = /rgba?\((\d+,\s*\d+,\s*\d+(,\s*\d+(\.\d+)?)?)\)/;
|
|
158
|
+
const match = gradient.match(colorRegex);
|
|
159
|
+
return match ? match[0] : null;
|
|
160
|
+
}
|
|
161
|
+
|
|
147
162
|
}
|
|
@@ -512,8 +512,8 @@ export class GlobalSettingsService {
|
|
|
512
512
|
if (variables.hasOwnProperty('showAttachmentFooterButton')) {
|
|
513
513
|
globals['showAttachmentFooterButton'] = variables['showAttachmentFooterButton'];
|
|
514
514
|
}
|
|
515
|
-
if (variables.hasOwnProperty('
|
|
516
|
-
globals['
|
|
515
|
+
if (variables.hasOwnProperty('showAudioRecorderFooterButton')) {
|
|
516
|
+
globals['showAudioRecorderFooterButton'] = variables['showAudioRecorderFooterButton'];
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
}
|
|
@@ -1056,10 +1056,10 @@ export class GlobalSettingsService {
|
|
|
1056
1056
|
if (TEMP !== undefined) {
|
|
1057
1057
|
globals.showEmojiFooterButton = (TEMP === true) ? true : false;
|
|
1058
1058
|
}
|
|
1059
|
-
TEMP = tiledeskSettings['
|
|
1059
|
+
TEMP = tiledeskSettings['showAudioRecorderFooterButton'];
|
|
1060
1060
|
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showEmojiFooterButton:: ', TEMP]);
|
|
1061
1061
|
if (TEMP !== undefined) {
|
|
1062
|
-
globals.
|
|
1062
|
+
globals.showAudioRecorderFooterButton = (TEMP === true) ? true : false;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
@@ -1335,9 +1335,9 @@ export class GlobalSettingsService {
|
|
|
1335
1335
|
if (TEMP !== null) {
|
|
1336
1336
|
this.globals.showEmojiFooterButton = (TEMP === true) ? true : false;
|
|
1337
1337
|
}
|
|
1338
|
-
TEMP = el.nativeElement.getAttribute('
|
|
1338
|
+
TEMP = el.nativeElement.getAttribute('showAudioRecorderFooterButton');
|
|
1339
1339
|
if (TEMP !== null) {
|
|
1340
|
-
this.globals.
|
|
1340
|
+
this.globals.showAudioRecorderFooterButton = (TEMP === true) ? true : false;
|
|
1341
1341
|
}
|
|
1342
1342
|
|
|
1343
1343
|
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -218,7 +218,7 @@ export class Globals {
|
|
|
218
218
|
|
|
219
219
|
showEmojiFooterButton: boolean // ******* new ********
|
|
220
220
|
showAttachmentFooterButton: boolean // ******* new ********
|
|
221
|
-
|
|
221
|
+
showAudioRecorderFooterButton: boolean // ******* new ********
|
|
222
222
|
constructor(
|
|
223
223
|
) { }
|
|
224
224
|
|
|
@@ -419,7 +419,7 @@ export class Globals {
|
|
|
419
419
|
/** show/hide attachment option in footer chat-detail page */
|
|
420
420
|
this.showAttachmentFooterButton = true;
|
|
421
421
|
/** show/hide rec audio option in footer chat-detail page */
|
|
422
|
-
this.
|
|
422
|
+
this.showAudioRecorderFooterButton = true;
|
|
423
423
|
|
|
424
424
|
// ============ END: SET EXTERNAL PARAMETERS ==============//
|
|
425
425
|
|
|
@@ -1352,10 +1352,10 @@
|
|
|
1352
1352
|
window.Tiledesk('restart')
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
|
-
function
|
|
1356
|
-
let status = document.querySelector('input[name="
|
|
1357
|
-
window.tiledeskSettings['
|
|
1358
|
-
console.log('
|
|
1355
|
+
function onClickshowAudioRecorderFooterButton(){
|
|
1356
|
+
let status = document.querySelector('input[name="showAudioRecorderFooterButton"]:checked').value
|
|
1357
|
+
window.tiledeskSettings['showAudioRecorderFooterButton'] = stringToBoolean(status)
|
|
1358
|
+
console.log('onClickshowAudioRecorderFooterButton:', window.tiledeskSettings)
|
|
1359
1359
|
window.Tiledesk('restart')
|
|
1360
1360
|
}
|
|
1361
1361
|
|
|
@@ -2402,13 +2402,13 @@
|
|
|
2402
2402
|
</div>
|
|
2403
2403
|
|
|
2404
2404
|
<div class="row">
|
|
2405
|
-
<div class="col-md-5 formElement"><span><em><strong>
|
|
2405
|
+
<div class="col-md-5 formElement"><span><em><strong>showAudioRecorderFooterButton</strong></em></span></div>
|
|
2406
2406
|
<div class="col-md-5">
|
|
2407
|
-
<input class="form-check-input" type="radio" name="
|
|
2408
|
-
<input class="form-check-input" type="radio" name="
|
|
2407
|
+
<input class="form-check-input" type="radio" name="showAudioRecorderFooterButton" value="true" checked><label>True</label>
|
|
2408
|
+
<input class="form-check-input" type="radio" name="showAudioRecorderFooterButton" value="false"><label>False</label>
|
|
2409
2409
|
</div>
|
|
2410
2410
|
<div class="col-md-2">
|
|
2411
|
-
<button class="btn btn-light" onclick="
|
|
2411
|
+
<button class="btn btn-light" onclick="onClickshowAudioRecorderFooterButton()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2412
2412
|
</div>
|
|
2413
2413
|
</div>
|
|
2414
2414
|
|