@chat21/chat21-web-widget 5.0.53 → 5.0.55

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 (49) hide show
  1. package/CHANGELOG.md +38 -2
  2. package/deploy_amazon_prod.sh +11 -2
  3. package/package.json +1 -1
  4. package/src/app/app.component.html +1 -1
  5. package/src/app/app.component.ts +18 -8
  6. package/src/app/app.module.ts +10 -8
  7. package/src/app/component/conversation-detail/conversation/conversation.component.ts +15 -1
  8. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +2 -2
  9. package/src/app/component/form/inputs/form-text/form-text.component.scss +3 -1
  10. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +1 -1
  11. package/src/app/component/home-conversations/home-conversations.component.html +5 -3
  12. package/src/app/component/last-message/last-message.component.html +83 -72
  13. package/src/app/component/last-message/last-message.component.scss +119 -42
  14. package/src/app/component/last-message/last-message.component.spec.ts +2 -2
  15. package/src/app/component/last-message/last-message.component.ts +49 -25
  16. package/src/app/component/list-all-conversations/list-all-conversations.component.ts +1 -1
  17. package/src/app/component/message/bubble-message/bubble-message.component.html +0 -5
  18. package/src/app/component/message/html/html.component.spec.ts +1 -1
  19. package/src/app/component/message/info-message/info-message.component.spec.ts +1 -1
  20. package/src/app/component/message/text/text.component.scss +4 -0
  21. package/src/app/component/message/text/text.component.spec.ts +2 -2
  22. package/src/app/component/message-attachment/message-attachment.component.html +1 -1
  23. package/src/app/component/message-attachment/message-attachment.component.ts +2 -0
  24. package/src/app/{directives → pipe}/html-entites-encode.pipe.spec.ts +0 -0
  25. package/src/app/{directives → pipe}/html-entities-encode.pipe.ts +0 -0
  26. package/src/app/{directives → pipe}/marked.pipe.spec.ts +0 -0
  27. package/src/app/{directives → pipe}/marked.pipe.ts +0 -0
  28. package/src/app/{directives → pipe}/safe-html.pipe.spec.ts +0 -0
  29. package/src/app/{directives → pipe}/safe-html.pipe.ts +0 -0
  30. package/src/app/providers/events.service.spec.ts +16 -0
  31. package/src/app/providers/events.service.ts +76 -0
  32. package/src/app/providers/global-settings.service.ts +11 -12
  33. package/src/app/utils/globals.ts +3 -0
  34. package/src/app/utils/rules.ts +84 -5
  35. package/src/assets/js/chat21client.js +27 -4
  36. package/src/assets/twp/index.html +5 -5
  37. package/src/chat21-core/models/conversation.ts +2 -2
  38. package/src/chat21-core/models/upload.ts +1 -0
  39. package/src/chat21-core/providers/abstract/presence.service.ts +1 -0
  40. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +79 -106
  41. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +4 -0
  42. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +8 -33
  43. package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +13 -156
  44. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +5 -0
  45. package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +23 -4
  46. package/src/chat21-core/utils/utils-message.ts +36 -0
  47. package/src/iframe-style.css +2 -2
  48. package/src/models/project.ts +4 -1
  49. package/src/models/rule.ts +19 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.55 in PROD
4
+ - added: preflight property to /message API body
5
+
6
+ ### 5.0.54 in PROD
7
+
8
+ ### 5.0.53-rc.8
9
+ - bug-fixed: if tiledeskAuth get 401 error do logOut
10
+
11
+ ### 5.0.53-rc.7
12
+ - bug-fixed: start message was shown twice
13
+ - bug-fixed: is showAvailableAgents is false and no conversations exist, 'new conversation' button not displayed
14
+
15
+ ### 5.0.53-rc.6
16
+ - changed: removed wait object from Rule model
17
+ - bug-fixed: splitted message lose original parent message attributes
18
+ - bug-fixed: preChat form element UI padding
19
+
20
+ ### 5.0.53-rc.5
21
+ - changed: minor improvements for last-message component UI
22
+ - changed: last-message UI for long text message and long attachment buttons
23
+ - removed: automatic open widget after 3s on index.html
24
+ - bug-fixed: on click over callout not opens widget correctly if singleConversation is active
25
+
26
+ ### 5.0.53-rc.4
27
+ - added: proactive rules from /widget/botsRules
28
+ - added: imHere method for presence service
29
+ - added: limit parameter to message-attachment component
30
+ - added: send message on attachment button clicked on last-message component
31
+ - added: events service
32
+ - added: /requests/messages tiledesk api
33
+ - added: convertConversationToMessage utils function in last-message component
34
+ - changed: last-message UI
35
+ - upgraded: chat21client.js to v0.1.12.4
36
+ - changed: pipe files moved from /directives folder to /pipe folder
37
+ - changed: moved isSender function from service to utils-message
38
+ - bug-fixed: location.href and document.title is wrong (about:srcdoc)
39
+ - bug-fixed: wait 2s before publish ImHere event to MQTT presence
40
+
3
41
  ### 5.0.53 in PROD
4
42
 
5
43
  ### 5.0.53-rc.3
@@ -10,7 +48,6 @@
10
48
  - removed: jquery plugin
11
49
  - removed: relativeLinkResolution from forRoot in RooterModule
12
50
 
13
-
14
51
  ### 5.0.53-rc.2
15
52
  - added: angular 15 engine
16
53
  - added: custom tooltip directive
@@ -26,7 +63,6 @@
26
63
  - removed: document.write() injection
27
64
  - removed: unused html test file
28
65
 
29
-
30
66
  ### 5.0.52 in PROD
31
67
 
32
68
  ### 5.0.52-rc.4
@@ -5,10 +5,19 @@ echo "version $version"
5
5
  # --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
6
6
  ng build --configuration="prod" --aot=true --base-href --output-hashing none --build-optimizer=true --vendor-chunk=true
7
7
 
8
+ #### FIREBASE #####
9
+ # cd dist
10
+ # # aws s3 sync . s3://tiledesk-widget/v5/latest/
11
+ # aws s3 sync . s3://tiledesk-widget/v5/$version/ --cache-control max-age=300
12
+ # aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
13
+ # cd ..
14
+
15
+
16
+ # #### MQTT #####
8
17
  cd dist
9
18
  # aws s3 sync . s3://tiledesk-widget/v5/latest/
10
- aws s3 sync . s3://tiledesk-widget/v5/$version/ --cache-control max-age=300
11
- aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
19
+ aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=300
20
+ aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=300
12
21
  cd ..
13
22
 
14
23
  aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.53",
4
+ "version": "5.0.55",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -115,7 +115,7 @@
115
115
  *******************************************
116
116
  tabindex -> 20 -->
117
117
  <chat-eyeeye-catcher-card *ngIf="g.senderId"
118
- (onOpenChat)="onOpenChatEyeEyeCatcherCard()"
118
+ (onOpenChat)="onOpenCloseWidget($event)"
119
119
  (onCloseEyeCatcherCard)="onCloseEyeCatcherCard($event)">
120
120
  </chat-eyeeye-catcher-card>
121
121
 
@@ -148,7 +148,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
148
148
  that.disposeWidget();
149
149
  return;
150
150
  }
151
-
151
+
152
152
  if(conversation.is_new && conversation.sender !== this.g.senderId && !isInfo(conversation)){
153
153
  that.manageTabNotification();
154
154
  }
@@ -167,9 +167,12 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
167
167
  } else {
168
168
  // if(conversation.is_new && isJustRecived(this.g.startedAt.getTime(), conversation.timestamp)){
169
169
  //widget closed
170
- that.lastConversation = conversation;
171
- that.g.isOpenNewMessage = true;
172
- that.logger.debug('[APP-COMP] lastconversationnn', that.lastConversation)
170
+ if(conversation.is_new && conversation.sender !== this.g.senderId && !isInfo(conversation)){
171
+ that.lastConversation = conversation;
172
+ that.g.isOpenNewMessage = true;
173
+ that.logger.debug('[APP-COMP] lastconversationnn', that.lastConversation)
174
+ }
175
+
173
176
 
174
177
  let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
175
178
  that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
@@ -398,6 +401,12 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
398
401
  that.showWidget();
399
402
  }
400
403
 
404
+ if(this.g.botsRules){
405
+ const rules = new Rules(that.tiledeskRequestsService, that.appStorageService,that.g)
406
+ rules.initRules(that.g.windowContext, that.g.tiledeskToken, user, that.generateNewUidConversation(), that.g.botsRules)
407
+ }
408
+
409
+
401
410
  } else if (state && state === AUTH_STATE_OFFLINE) {
402
411
  /** non sono loggato */
403
412
  that.logger.info('[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: ');
@@ -783,11 +792,11 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
783
792
  if (CLIENT_BROWSER) {
784
793
  attributes['client'] = CLIENT_BROWSER;
785
794
  }
786
- if (location.href) {
787
- attributes['sourcePage'] = location.href;
795
+ if (this.g.windowContext.window.location) {
796
+ attributes['sourcePage'] = this.g.windowContext.window.location.href;
788
797
  }
789
- if(document.title){
790
- attributes['sourceTitle'] = document.title;
798
+ if(this.g.windowContext.window.document){
799
+ attributes['sourceTitle'] = this.g.windowContext.window.document.title;
791
800
  }
792
801
  if (projectid) {
793
802
  attributes['projectId'] = projectid;
@@ -1493,6 +1502,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1493
1502
  // this.g.windowContext.window.document.title = this.tabTitle
1494
1503
  } else {
1495
1504
  // TAB IS ACTIVE --> restore title and DO NOT SOUND
1505
+ this.presenceService.imHere()
1496
1506
  clearInterval(this.setIntervalTime)
1497
1507
  this.setIntervalTime = null;
1498
1508
  this.isTabVisible = true;
@@ -1,3 +1,4 @@
1
+ import { EventsService } from './providers/events.service';
1
2
 
2
3
  // ************** COMPONENTS ************** //
3
4
  import { AppComponent } from './app.component';
@@ -61,9 +62,9 @@ import { PickerModule } from '@ctrl/ngx-emoji-mart';
61
62
  import { INGXLoggerMetadata, LoggerModule, NGXLogger, NgxLoggerLevel, NGXLoggerServerService, TOKEN_LOGGER_SERVER_SERVICE } from "ngx-logger";
62
63
 
63
64
  //DIRECTIVES
64
- import { HtmlEntitiesEncodePipe } from './directives/html-entities-encode.pipe';
65
- import { MarkedPipe } from './directives/marked.pipe';
66
- import { SafeHtmlPipe } from './directives/safe-html.pipe';
65
+ import { HtmlEntitiesEncodePipe } from './pipe/html-entities-encode.pipe';
66
+ import { MarkedPipe } from './pipe/marked.pipe';
67
+ import { SafeHtmlPipe } from './pipe/safe-html.pipe';
67
68
 
68
69
  //LOGGER SERVICES
69
70
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
@@ -193,7 +194,7 @@ export function conversationHandlerFactory(chat21Service: Chat21Service, appConf
193
194
  }
194
195
  }
195
196
 
196
- export function typingFactory(appConfig: AppConfigService) {
197
+ export function typingFactory(chat21Service: Chat21Service, appConfig: AppConfigService) {
197
198
  const config = appConfig.getConfig()
198
199
  if (config.chatEngine === CHAT_ENGINE_MQTT) {
199
200
  return new MQTTTypingService();
@@ -202,10 +203,10 @@ export function typingFactory(appConfig: AppConfigService) {
202
203
  }
203
204
  }
204
205
 
205
- export function presenceFactory(appConfig: AppConfigService) {
206
+ export function presenceFactory(chat21Service: Chat21Service, appConfig: AppConfigService) {
206
207
  const config = appConfig.getConfig()
207
208
  if (config.chatEngine === CHAT_ENGINE_MQTT) {
208
- return new MQTTPresenceService();
209
+ return new MQTTPresenceService(chat21Service);
209
210
  } else {
210
211
  return new FirebasePresenceService();
211
212
  }
@@ -319,6 +320,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
319
320
  Rules,
320
321
  GlobalSettingsService,
321
322
  SettingsSaverService,
323
+ EventsService,
322
324
  StarRatingWidgetService,
323
325
  {
324
326
  provide: APP_INITIALIZER,
@@ -363,12 +365,12 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
363
365
  {
364
366
  provide: PresenceService,
365
367
  useFactory: presenceFactory,
366
- deps: [AppConfigService]
368
+ deps: [Chat21Service, AppConfigService]
367
369
  },
368
370
  {
369
371
  provide: TypingService,
370
372
  useFactory: typingFactory,
371
- deps: [AppConfigService]
373
+ deps: [Chat21Service, AppConfigService]
372
374
  },
373
375
  {
374
376
  provide: UploadService,
@@ -1,3 +1,4 @@
1
+ import { EventsService } from './../../../providers/events.service';
1
2
  import { ChatManager } from 'src/chat21-core/providers/chat-manager';
2
3
 
3
4
  import { ConversationFooterComponent } from './../conversation-footer/conversation-footer.component';
@@ -182,7 +183,8 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
182
183
  public typingService: TypingService,
183
184
  private tiledeskRequestService: TiledeskRequestsService,
184
185
  private changeDetectorRef: ChangeDetectorRef,
185
- private elementRef: ElementRef
186
+ private elementRef: ElementRef,
187
+ private events: EventsService
186
188
  ) { }
187
189
 
188
190
  onResize(event){
@@ -828,6 +830,18 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
828
830
  this.subscriptions.push(subscribe);
829
831
  }
830
832
 
833
+ subscribtionKey = 'lastMessage:attachmentButtonClicked';
834
+ this.events.subscribe('lastMessage:attachmentButtonClicked', (event: any) => {
835
+ this.logger.debug('[CONV-COMP] ***** lastMessage:attachmentButtonClicked *****', event);
836
+ if (event) {
837
+ const conversationUid = event.message.conversation_with; //support-group-...
838
+ if(this.conversationId === conversationUid){
839
+ this.onAttachmentButtonClicked(event)
840
+ }
841
+ }
842
+ });
843
+
844
+
831
845
  }
832
846
 
833
847
  checkMessagesLegntForTranscriptDownloadMenuOption(){
@@ -2,8 +2,8 @@ import { MomentModule } from 'ngx-moment';
2
2
  import { async, ComponentFixture, TestBed, waitForAsync, inject } from '@angular/core/testing';
3
3
 
4
4
  import { ConversationContentComponent } from './conversation-content.component';
5
- import { MarkedPipe } from '../../../directives/marked.pipe';
6
- import { HtmlEntitiesEncodePipe } from '../../../directives/html-entities-encode.pipe';
5
+ import { MarkedPipe } from '../../../pipe/marked.pipe';
6
+ import { HtmlEntitiesEncodePipe } from '../../../pipe/html-entities-encode.pipe';
7
7
  import { UploadService } from '../../../../chat21-core/providers/abstract/upload.service';
8
8
  import { CustomLogger } from '../../../../chat21-core/providers/logger/customLogger';
9
9
  import { LoggerInstance } from '../../../../chat21-core/providers/logger/loggerInstance';
@@ -86,6 +86,8 @@ input[type='text'].errors{
86
86
  position: relative;
87
87
  padding-bottom: 0px; //7px;
88
88
  margin: 35px 0px 0px; //27px 0 0;
89
+ display: flex;
90
+ width: 100%;
89
91
  }
90
92
  .form-group label.control-label {
91
93
  font-size: 11px;
@@ -107,7 +109,7 @@ input {
107
109
  border-radius: $chat-footer-border-radius;
108
110
  font-weight: 400;
109
111
  height: 48px;
110
- padding: 16px;
112
+ padding: 0px 16px;
111
113
  font-size: 14px;
112
114
  line-height: 1.42857143;
113
115
  display: block;
@@ -103,7 +103,7 @@ textarea {
103
103
  border-radius: $chat-footer-border-radius;
104
104
  font-weight: 400;
105
105
  // height: 36px;
106
- padding: 16px;
106
+ padding: 0px 16px;
107
107
  font-size: 14px;
108
108
  line-height: 1.42857143;
109
109
  display: block;
@@ -35,8 +35,8 @@
35
35
  <div class="c21-body">
36
36
 
37
37
 
38
-
39
- <div *ngIf="(!listConversations || listConversations.length == 0) && g.showAvailableAgents === true && availableAgents && availableAgents.length > 1" style="margin: 20px 30px;">
38
+ <!--CASE: no conversations EXIST - >1 agents is available -->
39
+ <div *ngIf="(!listConversations || listConversations.length == 0) && availableAgents && availableAgents.length > 1 && g.showAvailableAgents === true" style="margin: 20px 30px;">
40
40
  <div *ngFor="let agent of availableAgents" class="c21-pallozzo">
41
41
  <div class="c21-ball" [ngStyle] = "{ 'background-color':setColorFromString(agent.firstname) }" >
42
42
  <span class="c21-ball-label">{{avatarPlaceholder(agent.firstname)}}</span>
@@ -45,6 +45,7 @@
45
45
  </div>
46
46
  </div>
47
47
 
48
+ <!--CASE: no conversations EXIST - 1 agents is available -->
48
49
  <div class="flex-container" *ngIf="(!listConversations || listConversations.length == 0) && availableAgents && availableAgents.length === 1 && g.showAvailableAgents === true">
49
50
  <div *ngFor="let agent of availableAgents" class="c21-pallozzo flex-inline-agent ">
50
51
  <div class="c21-ball" [ngStyle] = "{ 'background-color':setColorFromString(agent.firstname) }" >
@@ -65,7 +66,8 @@
65
66
  </button>
66
67
  </div>
67
68
 
68
- <div *ngIf="(availableAgents && availableAgents.length > 1 ) || (listConversations && listConversations.length > 0 || (availableAgents && availableAgents.length === 0 ) )">
69
+ <!--CASE: conversations EXIST OR >1 agents is available OR showAvailableAgents=FALSE -->
70
+ <div *ngIf="(availableAgents && availableAgents.length > 1 ) || (listConversations && listConversations.length > 0 || (availableAgents && availableAgents.length === 0 ) || g.showAvailableAgents === false )">
69
71
  <chat-list-conversations *ngIf="(listConversations && listConversations.length > 0)"
70
72
  [listConversations]="listConversations"
71
73
  [limit]="3"
@@ -1,83 +1,94 @@
1
- <div *ngIf="conversation && g.isOpenNewMessage" id="messagePreview">
1
+ <div *ngIf="conversation && g.isOpenNewMessage" id="messagePreview" >
2
2
  <!-- message recipient:: -->
3
- <div role="messaggio" id="new_message">
4
3
 
5
- <div class="headerPreviewMessage">
4
+ <div class="headerPreviewMessage">
6
5
 
7
- <div class="boxButtons">
8
-
9
- <div role="button" tabindex="0" class="buttonMore" (click)="openConversationByID(conversation)">
10
- <span>View more</span>
11
- </div>
6
+ <div class="boxButtons">
7
+
8
+ <div role="button" tabindex="0" class="buttonMore" (click)="openConversationByID(conversation)">
9
+ <span>View more</span>
10
+ </div>
12
11
 
13
- <div aria-label="Dismiss" role="button" tabindex="0" class="buttonClose" (click)="closeMessagePreview()">
14
- <span>
15
- <svg aria-labelledby="altIconTitle" height="20px" role="img" viewBox="0 0 24 24" width="20px" xmlns="http://www.w3.org/2000/svg" style="fill: rgb(255, 255, 255);">
16
- <path d="M0 0h24v24H0V0z" fill="none"></path>
17
- <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"></path>
18
- </svg>
19
- </span>
20
- </div>
21
-
22
- </div>
12
+ <div aria-label="Dismiss" role="button" tabindex="0" class="buttonClose" (click)="closeMessagePreview()">
13
+ <span>
14
+ <svg aria-labelledby="altIconTitle" height="20px" role="img" viewBox="0 0 24 24" width="20px" xmlns="http://www.w3.org/2000/svg" style="fill: rgb(255, 255, 255);">
15
+ <path d="M0 0h24v24H0V0z" fill="none"></path>
16
+ <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"></path>
17
+ </svg>
18
+ </span>
19
+ </div>
23
20
 
24
21
  </div>
22
+
23
+ </div>
24
+
25
+
26
+ <div>
27
+ <!-- <div role="messaggio" class="c21-text message_sender_fullname">{{conversation.sender_fullname}}</div> -->
28
+ <!-- <img *ngIf="conversation.type == 'image' && conversation.metadata" class="message-content message-content-image"
29
+ [src]="conversation.metadata.src" [width]="getSizeImg(conversation).width"
30
+ [height]="getSizeImg(conversation).height" /> -->
31
+
25
32
 
26
- <div class="previewNewMessagge" (click)="openConversationByID(conversation)">
27
- <div role="messaggio" class="c21-text message_sender_fullname">{{conversation.sender_fullname}}</div>
28
- <!-- <img *ngIf="conversation.type == 'image' && conversation.metadata" class="message-content message-content-image"
29
- [src]="conversation.metadata.src" [width]="getSizeImg(conversation).width"
30
- [height]="getSizeImg(conversation).height" /> -->
31
-
32
- <!-- <div *ngIf="isImage(conversation)" class="c21-img">
33
- <chat-image *ngIf="isImage(conversation)"
34
- [metadata]="conversation?.metadata"
35
- [width]="getMetadataSize(conversation?.metadata).width"
36
- [height]="getMetadataSize(conversation?.metadata).height">
37
- </chat-image>
38
- </div> -->
39
-
40
-
41
- <div *ngIf="conversation.type == 'text'" class="c21-box-text">
42
- <div *ngIf="isPopupUrl(conversation.last_message_text); then contentPopup else contentNewTab">here
43
- is ignored</div>
44
- <ng-template #contentPopup>
45
- <p class="c21-link"
46
- (click)="popupUrl(g.windowContext, conversation.last_message_text,'windowName')">{{strip_tags(conversation.last_message_text)}}
47
- </p>
48
- </ng-template>
49
- <ng-template #contentNewTab>
50
- <p class="c21-text overflow4Lines" [innerHTML]="conversation.last_message_text | htmlEntitiesEncode | marked"></p>
51
- </ng-template>
52
-
53
- <!-- NOT AVAILABLE WITH FIREBASE DUE TO INCOMPATIBILITY WITH conversation OBJECT-->
54
- <!-- <div *ngIf="conversation.attributes && conversation.attributes.attachment " class="slide-in-left" >
55
- <chat-message-attachment
56
- style="height: 100%; display: block;"
57
- [message]="conversation"
58
- [isLastMessage] = "true"
59
- [stylesMap]="stylesMap"
60
- (onAttachmentButtonClicked)="onAttachmentButtonClicked($event)">
61
- </chat-message-attachment>
62
- </div> -->
63
- </div>
64
-
65
- <div class="c21-time c21-text">
66
- <time *ngIf="conversation.timestamp !== '{.sv: timestamp}'" >{{conversation.timestamp | amTimeAgo}} </time>
67
- </div>
68
-
69
- <div class="c21-icon-avatar">
70
- <div class="c21-avatar-image profile_image">
71
- <chat-avatar-image class="slide-in-left"
72
- [senderID]="conversation.sender"
73
- [senderFullname]="conversation.sender_fullname"
74
- [baseLocation]="baseLocation">
75
- </chat-avatar-image>
76
- <!-- <img src="{{conversation.image}}" onError="this.src = 'https://s3.eu-west-1.amazonaws.com/tiledesk-widget/dev/2.0.4-beta.7/assets/images/avatar_bot_tiledesk.svg'" /> -->
77
- </div>
78
- </div>
33
+ <div class="previewNewMessagge msg_container" (click)="openConversationByID(conversation)">
34
+
35
+ <!-- <div *ngIf="isImage(conversation)">
36
+ <chat-image
37
+ [metadata]="fileSelected"
38
+ [width]="fileSelected?.width"
39
+ [height]="fileSelected?.height">
40
+ </chat-image>
41
+ </div>
42
+
43
+ <div *ngIf="conversation.type == 'text'" class="c21-box-text">
44
+ <chat-text
45
+ [text]="conversation?.last_message_text"
46
+ [fontSize]="stylesMap?.get('fontSize')"
47
+ [fontFamily]="stylesMap?.get('fontFamily')">
48
+ </chat-text>
49
+ </div> -->
50
+
51
+ <chat-bubble-message class="messages no-background"
52
+ [class.emoticon]="isEmojii(message?.text)"
53
+ [ngClass]="{'button-in-msg' : message?.metadata && message?.metadata?.button}"
54
+ [message]="message"
55
+ [fontColor]="stylesMap.get('bubbleReceivedTextColor')"
56
+ [fontSize]="stylesMap.get('fontSize')"
57
+ [fontFamily]="stylesMap.get('fontFamily')"
58
+ [stylesMap]="stylesMap">
59
+ </chat-bubble-message>
60
+
61
+ <div class="c21-icon-avatar">
62
+ <div class="c21-avatar-image profile_image">
63
+ <chat-avatar-image class="slide-in-left"
64
+ [senderID]="message?.sender"
65
+ [senderFullname]="message?.sender_fullname"
66
+ [baseLocation]="baseLocation">
67
+ </chat-avatar-image>
68
+ </div>
69
+ </div>
70
+
71
+ </div>
72
+
73
+ <div *ngIf="message.attributes && message.attributes.attachment " class="conversations-buttons">
74
+ <chat-message-attachment
75
+ style="height: 100%; display: block;"
76
+ [message]="message"
77
+ [isLastMessage] = "true"
78
+ [limit]="3"
79
+ [stylesMap]="stylesMap"
80
+ (onAttachmentButtonClicked)="onAttachmentButtonClicked($event)">
81
+ </chat-message-attachment>
79
82
  </div>
80
83
 
81
- </div>
84
+
85
+
86
+
87
+ <!-- <div class="c21-time c21-text">
88
+ <time *ngIf="conversation.timestamp !== '{.sv: timestamp}'" >{{conversation.timestamp | amTimeAgo}} </time>
89
+ </div> -->
90
+
91
+
92
+ </div>
82
93
 
83
94
  </div>