@chat21/chat21-web-widget 5.1.0-rc9 → 5.1.1-rc1

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +110 -8
  2. package/angular.json +2 -2
  3. package/deploy_beta.sh +10 -0
  4. package/deploy_prod.sh +9 -0
  5. package/package.json +2 -2
  6. package/src/app/app.component.html +7 -1
  7. package/src/app/app.component.scss +11 -102
  8. package/src/app/app.component.ts +60 -2
  9. package/src/app/component/conversation-detail/conversation/conversation.component.html +4 -2
  10. package/src/app/component/conversation-detail/conversation/conversation.component.scss +70 -7
  11. package/src/app/component/conversation-detail/conversation/conversation.component.ts +106 -65
  12. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +3 -2
  13. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +7 -15
  14. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +1 -5
  15. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +48 -33
  16. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +13 -8
  17. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +17 -18
  18. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +11 -15
  19. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +54 -17
  20. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +1 -2
  21. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +7 -5
  22. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +0 -3
  23. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -3
  24. package/src/app/component/form/form-builder/form-builder.component.scss +0 -1
  25. package/src/app/component/form/inputs/form-text/form-text.component.scss +0 -1
  26. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +0 -1
  27. package/src/app/component/form/prechat-form/prechat-form.component.scss +1 -3
  28. package/src/app/component/home/home.component.html +41 -0
  29. package/src/app/component/home/home.component.scss +34 -8
  30. package/src/app/component/home/home.component.ts +17 -0
  31. package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
  32. package/src/app/component/last-message/last-message.component.html +0 -2
  33. package/src/app/component/last-message/last-message.component.scss +0 -2
  34. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -5
  35. package/src/app/component/list-conversations/list-conversations.component.scss +0 -2
  36. package/src/app/component/menu-options/menu-options.component.scss +0 -2
  37. package/src/app/component/message/audio/audio.component.html +1 -1
  38. package/src/app/component/message/audio/audio.component.scss +1 -0
  39. package/src/app/component/message/audio/audio.component.ts +0 -1
  40. package/src/app/component/message/avatar/avatar.component.scss +4 -4
  41. package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
  42. package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -1
  43. package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
  44. package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
  45. package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -5
  46. package/src/app/component/message/buttons/text-button/text-button.component.scss +5 -6
  47. package/src/app/component/message/carousel/carousel.component.html +2 -1
  48. package/src/app/component/message/carousel/carousel.component.scss +5 -6
  49. package/src/app/component/message/frame/frame.component.scss +0 -2
  50. package/src/app/component/message/html/html.component.scss +1 -3
  51. package/src/app/component/message/image/image.component.scss +0 -2
  52. package/src/app/component/message/info-message/info-message.component.scss +0 -2
  53. package/src/app/component/message/like-unlike/like-unlike.component.scss +0 -2
  54. package/src/app/component/message/text/text.component.html +4 -4
  55. package/src/app/component/message/text/text.component.scss +2 -4
  56. package/src/app/component/message/text/text.component.ts +0 -2
  57. package/src/app/component/message-attachment/message-attachment.component.scss +2 -1
  58. package/src/app/component/selection-department/selection-department.component.scss +1 -5
  59. package/src/app/component/star-rating-widget/star-rating-widget.component.scss +0 -7
  60. package/src/app/pipe/marked.pipe.ts +18 -7
  61. package/src/app/providers/global-settings.service.ts +108 -9
  62. package/src/app/sass/_variables.scss +15 -2
  63. package/src/app/utils/constants.ts +2 -1
  64. package/src/app/utils/globals.ts +101 -101
  65. package/src/app/utils/utils.ts +0 -85
  66. package/src/assets/i18n/en.json +5 -4
  67. package/src/assets/i18n/es.json +3 -2
  68. package/src/assets/i18n/fr.json +3 -2
  69. package/src/assets/i18n/it.json +3 -2
  70. package/src/assets/twp/chatbot-panel.html +39 -0
  71. package/src/assets/twp/index-dev.html +177 -121
  72. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -1
  73. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +9 -1
  74. package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +14 -0
  75. package/src/chat21-core/utils/constants.ts +2 -0
  76. package/src/chat21-core/utils/user-typing/user-typing.component.scss +0 -1
  77. package/src/chat21-core/utils/utils-message.ts +12 -1
  78. package/src/chat21-core/utils/utils.ts +85 -0
  79. package/src/iframe-style.css +54 -35
@@ -1,6 +1,6 @@
1
1
  import { Component, ComponentFactoryResolver, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
2
2
  import { Globals } from 'src/app/utils/globals';
3
- import { checkAcceptedFile, isEmoji, isAllowedUrlInText } from 'src/app/utils/utils';
3
+ import { checkAcceptedFile } from 'src/app/utils/utils';
4
4
  import { MessageModel } from 'src/chat21-core/models/message';
5
5
  import { UploadModel } from 'src/chat21-core/models/upload';
6
6
  import { ConversationHandlerService } from 'src/chat21-core/providers/abstract/conversation-handler.service';
@@ -10,7 +10,7 @@ import { UploadService } from 'src/chat21-core/providers/abstract/upload.service
10
10
  import { ChatManager } from 'src/chat21-core/providers/chat-manager';
11
11
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
12
12
  import { TYPE_MSG_FILE, TYPE_MSG_IMAGE, TYPE_MSG_TEXT } from 'src/chat21-core/utils/constants';
13
- import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
13
+ import { convertColorToRGBA, isAllowedUrlInText, isEmoji } from 'src/chat21-core/utils/utils';
14
14
  import { findAndRemoveEmoji, isImage } from 'src/chat21-core/utils/utils-message';
15
15
  import { ProjectModel } from 'src/models/project';
16
16
 
@@ -50,7 +50,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
50
50
  @Output() onChangeTextArea = new EventEmitter<any>();
51
51
  @Output() onAttachmentFileButtonClicked = new EventEmitter<any>();
52
52
  @Output() onNewConversationButtonClicked = new EventEmitter();
53
- @Output() onBackButton = new EventEmitter()
54
53
 
55
54
  @ViewChild('chat21_file') public chat21_file: ElementRef;
56
55
  // @ViewChild('emojii_container', {read: ViewContainerRef}) selector;
@@ -325,6 +324,11 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
325
324
  this.logger.log('[CONV-FOOTER] SEND MESSAGE: ', msg, type, metadata, additional_attributes);
326
325
 
327
326
 
327
+ let checkUrlDomain = this.checkForUrlDomain(this.textInputTextArea)
328
+ if(!checkUrlDomain){
329
+ return
330
+ }
331
+
328
332
  if (msg && msg.trim() !== '' || type === TYPE_MSG_IMAGE || type === TYPE_MSG_FILE ) {
329
333
 
330
334
  // msg = htmlEntities(msg);
@@ -534,7 +538,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
534
538
  }
535
539
 
536
540
  checkForUrlDomain(text){
537
- if(this.project && this.project.settings?.allowed_urls === true){
541
+ if(this.project && this.project.settings?.allowed_urls === true && this.project.settings?.allowed_urls_list){
538
542
  this.showAlertUrl = !isAllowedUrlInText(text, this.project.settings?.allowed_urls_list);
539
543
  if(this.showAlertUrl){
540
544
  return false
@@ -554,16 +558,13 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
554
558
  this.resizeInputField()
555
559
  this.setWritingMessages(this.textInputTextArea)
556
560
 
561
+ //reset alert to defalt values before checking again
562
+ this.showAlertEmoji= false;
563
+ this.showAlertUrl = false;
557
564
  let check = this.checkForEmojii(this.textInputTextArea)
558
565
  if(!check){
559
566
  return;
560
567
  }
561
-
562
- let checkUrlDomain = this.checkForUrlDomain(this.textInputTextArea)
563
- if(!checkUrlDomain){
564
- return
565
- }
566
-
567
568
  }
568
569
 
569
570
  onSendPressed(event) {
@@ -634,7 +635,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
634
635
  this.onEmojiiPickerShow.emit(false); //de-activate emojii picker on select
635
636
 
636
637
  let check = this.checkForEmojii(this.textInputTextArea)
637
- console.log('chekkkkkkk', check)
638
638
  if(!check){
639
639
  return;
640
640
  }
@@ -654,10 +654,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
654
654
  // this.restoreTextArea()
655
655
  // }
656
656
 
657
- onBackButtonFN(){
658
- this.onBackButton.emit(false)
659
- }
660
-
661
657
  setFocusOnId(id) {
662
658
  if(!this.isMobile){
663
659
  setTimeout(function () {
@@ -8,19 +8,13 @@
8
8
 
9
9
  <!-- ICON CLOSE CHAT -->
10
10
  <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-close c21-button-clean" [ngStyle]="{'display': (hideHeaderCloseButton)?'none':'flex'}" (click)="closeWidget()">
11
- <!-- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
12
- width="24px" height="24px" viewBox="0 0 24 24">
13
- <path fill="none" d="M0 0h24v24H0V0z" />
14
- <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
15
- <title id="altIconTitle">{{ translationMap?.get('BUTTON_CLOSE_TO_ICON') }}</title>
16
- </svg> -->
17
11
  <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
18
12
  width="24px" height="24px" viewBox="0 0 24 24">
19
13
  <path d="M19.35,9.21c.2-.2.2-.51,0-.71l-.71-.71c-.2-.2-.51-.2-.71,0l-5.94,5.94-5.94-5.94c-.2-.2-.51-.2-.71,0l-.71.71c-.2.2-.2.51,0,.71l7,7c.2.2.51.2.71,0l7-7Z"/>
20
14
  <title id="altIconTitle">{{ translationMap?.get('BUTTON_CLOSE_TO_ICON') }}</title>
21
15
  </svg>
22
16
  </button>
23
-
17
+
24
18
  <!-- ICON MENU OPTION -->
25
19
  <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="toggleMenu()" >
26
20
  <svg aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
@@ -31,6 +25,38 @@
31
25
  </svg>
32
26
  </button>
33
27
 
28
+
29
+ <!-- ICON MAXIMIZE -->
30
+ <button *ngIf="size === 'min' && !fullscreenMode" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('max')" >
31
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
32
+ width="17" height="17" viewBox="0 0 17 17">
33
+ <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z"></path>
34
+ <title id="altIconTitle">{{ translationMap?.get('MAXIMIZE') }}</title>
35
+ </svg>
36
+ </button>
37
+
38
+ <!-- ICON MINIMIZE -->
39
+ <button *ngIf="size==='top' && !fullscreenMode" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('min')" >
40
+ <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
41
+ width="17" height="17" viewBox="0 0 17 17">
42
+ <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85"></path>
43
+ <title id="altIconTitle">{{ translationMap?.get('MINIMIZE') }}</title>
44
+ </svg>
45
+ </button>
46
+
47
+ <!-- ICON TOP -->
48
+ <button *ngIf="size==='max' && !fullscreenMode" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('top')" >
49
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
50
+ width="17" height="17" viewBox="0 0 17 17">
51
+ <path d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
52
+ <path d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
53
+ <path d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
54
+ <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
55
+ </svg>
56
+ </button>
57
+
58
+
59
+
34
60
  <!-- ICON BACK -->
35
61
  <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="1530" aria-label=" indietro " class="c21-header-button c21-left c21-button-clean" [ngStyle]="{'display': (hideHeaderBackButton)?'none':'flex'}" (click)="returnHome()">
36
62
  <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
@@ -123,23 +149,34 @@
123
149
  </div> -->
124
150
 
125
151
  <!-- ICON MAXIMIZE -->
126
- <!-- <div class="c21-header-button c21-right" *ngIf="heightStatus==='min'" (click)="maximizeMinimize('max')">
127
- <svg role="img" aria-labelledby="altIconTitle" [class="icon-menu" xmlns="http://www.w3.org/2000/svg"
128
- width="17" height="17" viewBox="0 0 62 62">
129
- <path d="M61,2H33a1,1,0,0,0-1,1V9a1,1,0,0,0,1,1H48.344L2.293,56.051a1,1,0,0,0,0,1.414l4.243,4.242a1,1,0,0,0,1.414,0L54,15.656V31a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V3A1,1,0,0,0,61,2Z"></path>
152
+ <div class="c21-header-button c21-right" *ngIf="size === 'min' && !fullscreenMode" (click)="onChangeSize('max')">
153
+ <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
154
+ width="17" height="17" viewBox="0 0 17 17">
155
+ <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z" fill="currentColor"></path>
130
156
  <title id="altIconTitle">{{ translationMap?.get('MAXIMIZE') }}</title>
131
157
  </svg>
132
158
  <span class="label-menu-item">{{ translationMap?.get('MAXIMIZE') }}</span>
133
- </div> -->
159
+ </div>
134
160
  <!-- ICON MINIMIZE -->
135
- <!-- <div class="c21-header-button c21-right" *ngIf="heightStatus==='max'" (click)="maximizeMinimize('min')">
136
- <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" transform="rotate(180)" xmlns="http://www.w3.org/2000/svg"
137
- width="17" height="17" viewBox="0 0 62 62">
138
- <path d="M61,2H33a1,1,0,0,0-1,1V9a1,1,0,0,0,1,1H48.344L2.293,56.051a1,1,0,0,0,0,1.414l4.243,4.242a1,1,0,0,0,1.414,0L54,15.656V31a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V3A1,1,0,0,0,61,2Z"></path>
161
+ <div class="c21-header-button c21-right" *ngIf="(size==='max' || size==='top') && !fullscreenMode" (click)="onChangeSize('min')">
162
+ <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
163
+ width="17" height="17" viewBox="0 0 17 17">
164
+ <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85" fill="currentColor"></path>
139
165
  <title id="altIconTitle">{{ translationMap?.get('MINIMIZE') }}</title>
140
166
  </svg>
141
167
  <span class="label-menu-item">{{ translationMap?.get('MINIMIZE') }}</span>
142
- </div> -->
168
+ </div>
169
+ <!-- ICON TOP -->
170
+ <div class="c21-header-button c21-right" *ngIf="size!=='top' && !fullscreenMode" (click)="onChangeSize('top')">
171
+ <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
172
+ width="17" height="17" viewBox="0 0 17 17">
173
+ <path fill="currentColor" d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
174
+ <path fill="currentColor" d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
175
+ <path fill="currentColor" d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
176
+ <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
177
+ </svg>
178
+ <span class="label-menu-item">{{ translationMap?.get('CENTER') }}</span>
179
+ </div>
143
180
 
144
181
  <!-- ICON LOGOUT -->
145
182
  <div class="c21-header-button c21-right" *ngIf="!hideSignOutOptionMenu" (click)="signOut()">
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  /* SET SCROLLBAR */
4
3
  // ============= CSS c21-header ================= //
@@ -24,7 +23,7 @@
24
23
  .c21-title {
25
24
  position: absolute;
26
25
  left: 50px;
27
- right: 100px;
26
+ right: 140px;
28
27
  display: flex;
29
28
  align-items: center;
30
29
  width: auto;
@@ -22,6 +22,8 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
22
22
  @Input() nameUserTypingNow: string;
23
23
  @Input() typingLocation: string;
24
24
  @Input() isTrascriptDownloadEnabled: boolean;
25
+ @Input() fullscreenMode: boolean;
26
+ @Input() size: 'min' | 'max' | 'top';
25
27
  @Input() hideCloseConversationOptionMenu: boolean;
26
28
  @Input() hideHeaderCloseButton: boolean;
27
29
  @Input() hideHeaderBackButton: boolean;
@@ -57,8 +59,8 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
57
59
  private API_URL: string;
58
60
  private logger: LoggerService = LoggerInstance.getInstance()
59
61
  constructor(
60
- public g: Globals,
61
- public appConfigService: AppConfigService,) {
62
+ public appConfigService: AppConfigService
63
+ ) {
62
64
  this.API_URL = this.appConfigService.getConfig().apiUrl;
63
65
  }
64
66
 
@@ -103,12 +105,12 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
103
105
  this.onMenuOptionClick.emit(HEADER_MENU_OPTION.LOGOUT)
104
106
  }
105
107
  /**
106
- * @param status : string 'max' || 'min'
108
+ * @param status : string 'max' || 'min' || 'top'
107
109
  */
108
- maximizeMinimize(status){
109
- this.heightStatus = status
110
+ onChangeSize(status){
110
111
  if(status === 'min') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MINIMIZE)
111
112
  if(status === 'max') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MAXIMIZE)
113
+ if(status === 'top') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.TOP)
112
114
  this.onMenuOptionShow.emit(false)
113
115
  }
114
116
  toggleSound() {
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
-
4
1
  :host .c21-content ::ng-deep > chat-image {
5
2
 
6
3
  div {
@@ -3,8 +3,6 @@
3
3
  * EYE-CATCHER CARD & EYE-CATCHER CARD CLOSE BTN
4
4
  * *********************************************
5
5
  */
6
- // @import 'src/app/sass/variables';
7
-
8
6
 
9
7
 
10
8
 
@@ -182,7 +180,7 @@
182
180
  width: 100%;
183
181
  height: auto;
184
182
  vertical-align: middle;
185
- font-family: 'Helvetica Neue', 'Apple Color Emoji', Helvetica, Arial, sans-serif;
183
+ font-family: var(--font-family-callout);
186
184
  font-weight: normal;
187
185
  word-wrap: break-word;
188
186
  margin: 0px;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  .c21-label-button {
4
3
  font-size: 1.2em !important;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  :host {
4
3
  --foregroundColor: #0000;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  :host {
4
3
  --foregroundColor: #0000;
@@ -1,5 +1,3 @@
1
- // @import '../../../sass/variables';
2
- // @import '../../../sass/normalize.css';
3
1
 
4
2
  #chat21-prechat-form {
5
3
  background-color: #ffffff;
@@ -8,7 +6,7 @@
8
6
  .c21-header {
9
7
  overflow: hidden;
10
8
  width: 100%;
11
- height: 52px;
9
+ height: var(--chat-header-height);
12
10
  .c21-header-button {
13
11
  .c21-close-button.c21-small {
14
12
  width: 31px;
@@ -6,8 +6,49 @@
6
6
  <div class="c21-header" (click)="hideMenuOptions()" [ngStyle]="{'color': g.themeForegroundColor, 'background-image': g.colorGradient }" >
7
7
 
8
8
  <div class="c21-header-container">
9
+
10
+
11
+
12
+
9
13
  <!-- ICON CLOSE CHAT -->
10
14
  <div class="c21-header-button" [ngStyle]="{'display': (g.hideHeaderCloseButton)?'none':'block'}">
15
+
16
+ <!-- ICON MAXIMIZE -->
17
+ <div *ngIf="size === 'min' && !fullscreenMode" class="c21-size-button">
18
+ <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-close-button-body" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('max')" >
19
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
20
+ width="17" height="17" viewBox="0 0 17 17">
21
+ <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z"></path>
22
+ <title id="altIconTitle">{{ translationMap?.get('MAXIMIZE') }}</title>
23
+ </svg>
24
+ </button>
25
+ </div>
26
+
27
+ <!-- ICON MINIMIZE -->
28
+ <div *ngIf="size==='top' && !fullscreenMode" class="c21-size-button">
29
+ <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-close-button-body" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('min')" >
30
+ <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
31
+ width="17" height="17" viewBox="0 0 17 17">
32
+ <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85"></path>
33
+ <title id="altIconTitle">{{ translationMap?.get('MINIMIZE') }}</title>
34
+ </svg>
35
+ </button>
36
+ </div>
37
+
38
+ <!-- ICON TOP -->
39
+ <div *ngIf="size==='max' && !fullscreenMode" class="c21-size-button">
40
+ <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-close-button-body" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('top')" >
41
+ <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
42
+ width="17" height="17" viewBox="0 0 17 17">
43
+ <path d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
44
+ <path d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
45
+ <path d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
46
+ <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
47
+ </svg>
48
+ </button>
49
+ </div>
50
+
51
+
11
52
  <div class="c21-close-button">
12
53
  <button tabindex="2001" aria-label=" chiudi chat" class="c21-close-button-body" (click)="f21_close()">
13
54
  <!-- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
@@ -1,8 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
-
5
-
6
1
  #chat21-home-component {
7
2
  position: absolute;
8
3
  width: 100%;
@@ -89,7 +84,6 @@
89
84
  }
90
85
 
91
86
  .c21-text {
92
- font-family: 'Google Sans';
93
87
  .c21-text-welcome {
94
88
  overflow: hidden;
95
89
  line-height: 1.2em;
@@ -130,7 +124,6 @@
130
124
  }
131
125
  }
132
126
  .c21-text {
133
- font-family: 'Roboto';
134
127
  margin: 0 0 0 15px;
135
128
 
136
129
  .c21-text-welcome {
@@ -150,6 +143,39 @@
150
143
  }
151
144
  }
152
145
  }
146
+
147
+ .c21-size-button {
148
+ position: absolute;
149
+ width: 35px;
150
+ height: 35px;
151
+ top: 0;
152
+ right: 35px;
153
+ margin: 10px;
154
+ z-index: 10;
155
+ justify-content: center;
156
+ button {
157
+ display: flex;
158
+ cursor: pointer;
159
+ width: 35px;
160
+ height: 35px;
161
+ border-radius: 8px;
162
+ padding: 0px;
163
+ margin: 0px;
164
+ display: flex;
165
+ align-items: center;
166
+ border: none;
167
+ background-color: rgba(0, 0, 0, 0);
168
+ &:hover {
169
+ background-color: rgba(0, 0, 0, 0.4);
170
+ }
171
+ svg {
172
+ margin: 0 auto;
173
+ fill: #ffffff;
174
+ }
175
+ }
176
+
177
+ }
178
+
153
179
  }
154
180
 
155
181
  // .c21-header-container::after{
@@ -308,7 +334,7 @@
308
334
  font-weight: 500;
309
335
  line-height: 22px;
310
336
 
311
- font-family: Mulish, sans-serif;
337
+ font-family: var(--font-family-powered-by);
312
338
  letter-spacing: 0.24px;
313
339
  -webkit-font-smoothing: antialiased;
314
340
 
@@ -6,6 +6,7 @@ import { LoggerService } from '../../../chat21-core/providers/abstract/logger.se
6
6
  import { LoggerInstance } from '../../../chat21-core/providers/logger/loggerInstance';
7
7
  import { convertColorToRGBA } from '../../../chat21-core/utils/utils';
8
8
  import { Globals } from '../../utils/globals';
9
+ import { HEADER_MENU_OPTION } from '../../utils/constants';
9
10
 
10
11
  @Component({
11
12
  selector: 'chat-home',
@@ -23,6 +24,11 @@ export class HomeComponent implements OnInit, AfterViewInit {
23
24
  @Input() hideSettings: boolean;
24
25
  @Input() hideNewConversationButton: boolean;
25
26
  @Input() stylesMap: Map<string, string>
27
+ @Input() size: 'min' | 'max' | 'top';
28
+ @Input() fullscreenMode: boolean;
29
+ @Input() hideHeaderConversationOptionsMenu: boolean;
30
+ @Input() isButtonsDisabled: boolean;
31
+ @Input() translationMap: Map<string, string>;
26
32
  @Output() onNewConversation = new EventEmitter<string>();
27
33
  @Output() onConversationSelected = new EventEmitter<ConversationModel>();
28
34
  @Output() onOpenAllConvesations = new EventEmitter();
@@ -30,6 +36,8 @@ export class HomeComponent implements OnInit, AfterViewInit {
30
36
  @Output() onSignOut = new EventEmitter();
31
37
  @Output() onImageLoaded = new EventEmitter<ConversationModel>();
32
38
  @Output() onConversationLoaded = new EventEmitter<ConversationModel>();
39
+ @Output() onMenuOptionClick = new EventEmitter<string>();
40
+
33
41
  // ========= end:: Input/Output values ===========/
34
42
 
35
43
 
@@ -197,6 +205,15 @@ export class HomeComponent implements OnInit, AfterViewInit {
197
205
  this.onSignOut.emit();
198
206
  }
199
207
 
208
+ /**
209
+ * @param status : string 'max' || 'min' || 'top'
210
+ */
211
+ onChangeSize(status) {
212
+ if(status === 'min') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MINIMIZE)
213
+ if(status === 'max') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MAXIMIZE)
214
+ if(status === 'top') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.TOP)
215
+ }
216
+
200
217
  // ========= end:: ACTIONS ============//
201
218
 
202
219
  addAnimation() {
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
1
  #c21-app-list-conversations{
5
2
  position: relative;
6
3
  display: block;
@@ -36,8 +36,6 @@
36
36
  [message]="message"
37
37
  [isSameSender]="isSameSender(message?.sender, i)"
38
38
  [fontColor]="stylesMap.get('bubbleReceivedTextColor')"
39
- [fontSize]="stylesMap.get('fontSize')"
40
- [fontFamily]="stylesMap.get('fontFamily')"
41
39
  [stylesMap]="stylesMap"
42
40
  (onElementRendered)="onElementRenderedFN($event)">
43
41
  </chat-bubble-message>
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host .c21-avatar-image ::ng-deep > chat-avatar-image {
4
2
 
5
3
  .c21-icon-avatar {
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
1
  #c21-app-list-all-conversations {
5
2
  position: relative;
6
3
  display: block;
@@ -18,7 +15,7 @@
18
15
  .c21-header {
19
16
  overflow: hidden;
20
17
  width: 100%;
21
- height: 52px;
18
+ height: var(--chat-header-height);
22
19
  position: relative;
23
20
  margin: 0;
24
21
  padding: 0;
@@ -67,7 +64,7 @@
67
64
 
68
65
  .c21-header-container{
69
66
  position: relative;
70
- height: 52px;
67
+ height: 100%;
71
68
  width: 100%;
72
69
  margin: 0 auto;
73
70
 
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host .c21-msg ::ng-deep > a > img {
4
2
  max-width: 24% !important;
5
3
  vertical-align: middle;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  #c21-menu-options{
4
2
 
5
3
  .modal-menu-options {
@@ -17,7 +17,7 @@
17
17
  </svg>
18
18
  <!-- <i class="material-icons">pause</i> -->
19
19
  </button>
20
- <div class="duration" [style.color]="color" [style.font-size]="fontSize" >
20
+ <div class="duration" [style.color]="color">
21
21
  <span *ngIf="!isPlaying">{{ audioDuration ? formatTime(audioDuration) : '00:00' }}</span>
22
22
  <span *ngIf="isPlaying">{{ formatTime(currentTime) }}</span>
23
23
  </div>
@@ -80,6 +80,7 @@ button {
80
80
  }
81
81
  .duration {
82
82
  padding: 0 3px;
83
+ font-size: var(--font-size-bubble-message);
83
84
  }
84
85
  }
85
86
 
@@ -17,7 +17,6 @@ export class AudioComponent implements AfterViewInit {
17
17
  @Input() audioBlob: Blob | null = null;
18
18
  @Input() metadata: any | null = null;
19
19
  @Input() color: string;
20
- @Input() fontSize: string;
21
20
  @Input() stylesMap: Map<string, string>;
22
21
 
23
22
  audioUrl: SafeUrl | null = null;
@@ -3,10 +3,10 @@
3
3
  position: relative;
4
4
  padding: 0;
5
5
  margin: 0;
6
- height: 40px;
7
- width: 40px;
8
- min-height: 40px;
9
- min-width: 40px;
6
+ height: var(--avatar-height);
7
+ width: var(--avatar-width);
8
+ min-height: var(--avatar-height);
9
+ min-width: var(--avatar-width);
10
10
  line-height: 40px;
11
11
  border-radius: 50%;
12
12
  overflow: hidden;
@@ -25,7 +25,7 @@
25
25
 
26
26
  <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
27
27
  [style.color]="fullnameColor"
28
- [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
28
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '12px 16px 8px 16px': '12px 16px 0px 16px'}" class="message_sender_fullname">
29
29
  {{message?.sender_fullname}}
30
30
  </div>
31
31
  <!-- message type:: image -->
@@ -61,7 +61,6 @@
61
61
  <chat-audio *ngIf="isAudio(message)"
62
62
  [metadata]="message.metadata"
63
63
  [color]="fontColor"
64
- [fontSize]="fontSize"
65
64
  [stylesMap]="stylesMap">
66
65
  </chat-audio>
67
66
 
@@ -82,8 +81,6 @@
82
81
  <chat-text *ngIf="message?.type !=='html'"
83
82
  [text]="message?.text"
84
83
  [color]="fontColor"
85
- [fontSize]="fontSize"
86
- [fontFamily]="fontFamily"
87
84
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
88
85
  (onAfterMessageRender)="onAfterMessageRenderFN($event)">
89
86
  </chat-text>
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
  /* ====== SET MESSAGES ====== */
3
2
 
4
3
  .messages {
@@ -18,8 +18,6 @@ export class BubbleMessageComponent implements OnInit {
18
18
  @Input() message: MessageModel;
19
19
  @Input() isSameSender: boolean;
20
20
  @Input() fontColor: string;
21
- @Input() fontSize: string;
22
- @Input() fontFamily: string;
23
21
  @Input() stylesMap: Map<string, string>;
24
22
  @Output() onBeforeMessageRender = new EventEmitter();
25
23
  @Output() onAfterMessageRender = new EventEmitter();