@chat21/chat21-ionic 3.0.85 → 3.0.86-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.
Files changed (171) hide show
  1. package/CHANGELOG.md +121 -4
  2. package/README.md +2 -2
  3. package/package.json +4 -3
  4. package/src/app/app-routing.module.ts +7 -2
  5. package/src/app/app.component.html +7 -1
  6. package/src/app/app.component.scss +20 -2
  7. package/src/app/app.component.ts +131 -20
  8. package/src/app/app.module.ts +8 -3
  9. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +11 -4
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
  17. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  18. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  20. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  21. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  23. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  24. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  26. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  27. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  29. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  30. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  31. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  33. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  34. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  35. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  37. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  38. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  40. package/src/app/components/canned-response/canned-response.component.html +9 -9
  41. package/src/app/components/canned-response/canned-response.component.scss +14 -7
  42. package/src/app/components/canned-response/canned-response.component.ts +5 -4
  43. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  44. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  45. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
  46. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -44
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  49. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
  50. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -154
  52. package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
  53. package/src/app/components/conversation-info/info-content/info-content.component.ts +5 -6
  54. package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
  55. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
  57. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  58. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  59. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  60. package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
  61. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
  62. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  63. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  64. package/src/app/components/{conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
  65. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  66. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  67. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  68. package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
  69. package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
  70. package/src/app/components/navbar/navbar.component.html +103 -0
  71. package/src/app/components/navbar/navbar.component.scss +249 -0
  72. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  73. package/src/app/components/navbar/navbar.component.ts +195 -0
  74. package/src/app/components/project-item/project-item.component.html +98 -149
  75. package/src/app/components/project-item/project-item.component.scss +43 -35
  76. package/src/app/components/project-item/project-item.component.ts +16 -4
  77. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  78. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
  79. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  80. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  81. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  82. package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
  83. package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
  84. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
  85. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
  86. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
  87. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
  88. package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
  89. package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
  90. package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
  91. package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
  92. package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
  93. package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
  94. package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
  95. package/src/app/modals/send-email/send-email.module.ts +31 -0
  96. package/src/app/modals/send-email/send-email.page.html +46 -0
  97. package/src/app/modals/send-email/send-email.page.scss +161 -0
  98. package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
  99. package/src/app/modals/send-email/send-email.page.ts +89 -0
  100. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  101. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  102. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  103. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  104. package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
  105. package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
  106. package/src/app/pages/conversation-detail/conversation-detail.page.ts +330 -138
  107. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  108. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  109. package/src/app/pages/conversations-list/conversations-list.page.ts +26 -24
  110. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  111. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  112. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  113. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  114. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  115. package/src/app/services/projects/projects.service.spec.ts +12 -0
  116. package/src/app/services/projects/projects.service.ts +43 -0
  117. package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
  118. package/src/app/shared/shared.module.ts +24 -33
  119. package/src/app/utils/toast.spec.ts +7 -0
  120. package/src/app/utils/toast.ts +48 -0
  121. package/src/assets/i18n/ar.json +288 -265
  122. package/src/assets/i18n/az.json +24 -1
  123. package/src/assets/i18n/de.json +25 -2
  124. package/src/assets/i18n/en.json +25 -2
  125. package/src/assets/i18n/es.json +26 -3
  126. package/src/assets/i18n/fr.json +24 -1
  127. package/src/assets/i18n/it.json +24 -1
  128. package/src/assets/i18n/kk.json +25 -2
  129. package/src/assets/i18n/pt.json +25 -2
  130. package/src/assets/i18n/ru.json +24 -1
  131. package/src/assets/i18n/sr.json +287 -264
  132. package/src/assets/i18n/sv.json +25 -2
  133. package/src/assets/i18n/tr.json +25 -2
  134. package/src/assets/i18n/uk.json +25 -2
  135. package/src/assets/i18n/uz.json +24 -1
  136. package/src/assets/js/chat21client.js +1 -1
  137. package/src/assets/sounds/interface-start.mp3 +0 -0
  138. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  139. package/src/chat-config-mqtt-localhost.json +2 -2
  140. package/src/chat-config-native-mqtt.json +3 -0
  141. package/src/chat21-core/models/conversation.ts +0 -1
  142. package/src/chat21-core/models/projects.ts +27 -0
  143. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  144. package/src/chat21-core/providers/logger/customLogger.ts +1 -1
  145. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
  146. package/src/chat21-core/utils/constants.ts +7 -1
  147. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  148. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  149. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  150. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  151. package/src/chat21-core/utils/utils.ts +41 -11
  152. package/src/global.scss +59 -255
  153. package/src/index.html +0 -9
  154. package/src/variables.scss +30 -10
  155. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  156. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  157. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  158. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  159. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  160. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  161. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  162. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  163. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  164. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  165. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  166. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  167. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  168. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  169. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  170. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  171. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,12 +1,17 @@
1
1
  <!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
2
2
  <!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
- <div id="bubble-message"
5
- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? sizeImage?.width + 'px' : null }"
6
- class="messages primary-color">
4
+ <!-- 'width': (isImage(message) || isFrame(message))? sizeImage?.width : null -->
5
+ <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
7
6
 
8
7
 
9
8
  <div>
9
+
10
+ <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
11
+ [style.color]="convertColorToRGBA(fontColor, 65)"
12
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
13
+ {{message?.sender_fullname}}
14
+ </div>
10
15
  <!-- message type:: image -->
11
16
  <!-- <div *ngIf="message.type == 'image' && message.metadata" [ngStyle] = "{ 'max-width': getSizeImg(message).width, 'max-height': getSizeImg(message).height }">
12
17
  <img class="message-contentX message-content-imageX" [src]="message.metadata.src" />
@@ -29,8 +34,8 @@
29
34
  <!-- [height]="getMetadataSize(message.metadata).height"> -->
30
35
  <chat-frame *ngIf="isFrame(message)"
31
36
  [metadata]="message.metadata"
32
- [width]="message.metadata.width"
33
- [height]="message.metadata.height"
37
+ [width]="sizeImage?.width"
38
+ [height]="sizeImage?.width"
34
39
  (onElementRendered)="onElementRenderedFN($event)">
35
40
  </chat-frame>
36
41
 
@@ -43,14 +48,10 @@
43
48
 
44
49
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
45
50
  <div *ngIf="message?.text">
46
- <span class="message-date"> {{message.timestamp | date:'HH:mm' }} </span>
47
- <!-- <ng-template #timeTooltipLeft>
48
- <span> {{message.timestamp | amCalendar }} </span>
49
- </ng-template> -->
50
51
 
51
52
  <chat-text *ngIf="message?.type !=='html'"
52
53
  [text]="message?.text"
53
- [color]="textColor"
54
+ [color]="fontColor"
54
55
  [message]="message"
55
56
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
56
57
  (onAfterMessageRender)="returnOnAfterMessageRender($event)">
@@ -60,20 +61,6 @@
60
61
  [htmlText]="message?.text">
61
62
  </chat-html>
62
63
 
63
- <ng-container *ngIf="areVisibleCAR && supportMode">
64
- <ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
65
- (click)="presentCreateCannedResponseModal()" tooltip="{{addAsCannedResponseTooltipText}}"
66
- [options]="tooltipOptions" placement="bottom">
67
- <ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
68
- </ion-button>
69
- </ng-container>
70
- <!-- <ng-container *ngIf="supportMode">
71
- <ion-button shape="round" size="small" class="btn-add-msg emoji" ion-button fill="clear"
72
- (click)="presentEmojiiModal()" tooltip="{{addAsCannedResponseTooltipText}}"
73
- [options]="tooltipOptions" placement="bottom">
74
- <ion-icon slot="icon-only" name="happy-outline" style="font-size: 1em;"> </ion-icon>
75
- </ion-button>
76
- </ng-container> -->
77
64
  </div>
78
65
  </div>
79
66
 
@@ -11,6 +11,11 @@
11
11
  // -webkit-animation: heartbeat 1.5s ease-in-out both;
12
12
  // animation: heartbeat 1.5s ease-in-out both;
13
13
 
14
+ .message_sender_fullname{
15
+ font-size: 12px;
16
+ font-weight: 600;
17
+ }
18
+
14
19
  p {
15
20
  font-size: 1.4em;
16
21
  margin: 0;
@@ -48,16 +53,7 @@
48
53
 
49
54
  }
50
55
  // > .button-native
51
- .btn-add-msg {
52
- border-radius: 50%;
53
- --padding-end: 7px;
54
- --padding-start: 7px;
55
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
56
-
57
- ion-icon{
58
- font-size: 1.2em;
59
- }
60
- }
56
+
61
57
 
62
58
 
63
59
 
@@ -50,7 +50,7 @@ describe('BubbleMessageComponent', () => {
50
50
  isSender: false
51
51
  }
52
52
  component.message = messages
53
- component.textColor = 'black'
53
+ component.fontColor = 'black'
54
54
  fixture.detectChanges()
55
55
  const textChild = fixture.debugElement.query(By.css('chat-text'))
56
56
  textChild.properties.text
@@ -76,7 +76,7 @@ describe('BubbleMessageComponent', () => {
76
76
  isSender: false
77
77
  }
78
78
  component.message = messages
79
- component.textColor = 'black'
79
+ component.fontColor = 'black'
80
80
  fixture.detectChanges()
81
81
  const textChild = fixture.debugElement.query(By.css('chat-text'))
82
82
  expect(textChild.properties.text).toEqual(messages.text)
@@ -1,15 +1,15 @@
1
1
  import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
3
  import { MessageModel } from 'src/chat21-core/models/message';
4
- import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
4
+ import { MAX_WIDTH_IMAGES, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
5
5
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
6
- import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
6
+ import { isFile, isFrame, isImage, messageType } from 'src/chat21-core/utils/utils-message';
7
7
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
8
8
  import { TranslateService } from '@ngx-translate/core';
9
9
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
10
10
  import * as moment from 'moment';
11
- import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
12
11
  import { ModalController } from '@ionic/angular';
12
+ import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
13
13
  @Component({
14
14
  selector: 'chat-bubble-message',
15
15
  templateUrl: './bubble-message.component.html',
@@ -18,16 +18,25 @@ import { ModalController } from '@ionic/angular';
18
18
  export class BubbleMessageComponent implements OnInit, OnChanges {
19
19
 
20
20
  @Input() message: MessageModel;
21
- @Input() textColor: string;
22
- @Input() areVisibleCAR: boolean;
23
- @Input() supportMode: boolean;
21
+ @Input() isSameSender: boolean;
22
+ @Input() fontColor: string;
23
+ @Input() fontSize: string;
24
+ @Input() fontFamily: string;
24
25
  @Output() onBeforeMessageRender = new EventEmitter();
25
26
  @Output() onAfterMessageRender = new EventEmitter();
26
27
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
27
28
  isImage = isImage;
28
29
  isFile = isFile;
29
30
  isFrame = isFrame;
30
- @Input() addAsCannedResponseTooltipText : string;
31
+ convertColorToRGBA = convertColorToRGBA
32
+
33
+ // ========== begin:: check message type functions ======= //
34
+ messageType = messageType;
35
+
36
+ MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
37
+ MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
38
+ // ========== end:: check message type functions ======= //
39
+
31
40
  public browserLang: string;
32
41
 
33
42
  tooltipOptions = {
@@ -194,25 +203,6 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
194
203
  this.onElementRendered.emit({element: event.element, status: event.status})
195
204
  }
196
205
 
197
- async presentCreateCannedResponseModal(): Promise<any> {
198
- this.logger.log('[BUBBLE-MESSAGE] PRESENT CREATE CANNED RESPONSE MODAL ')
199
- const attributes = {
200
- message: this.message,
201
- }
202
- const modal: HTMLIonModalElement = await this.modalController.create({
203
- component: CreateCannedResponsePage,
204
- componentProps: attributes,
205
- swipeToClose: false,
206
- backdropDismiss: false,
207
- })
208
- modal.onDidDismiss().then((dataReturned: any) => {
209
- //
210
- this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
211
- })
212
-
213
- return await modal.present()
214
- }
215
-
216
206
 
217
207
  // printMessage(message, messageEl, component) {
218
208
  // const messageOBJ = { message: message, sanitizer: this.sanitizer, messageEl: messageEl, component: component}
@@ -1,3 +1,7 @@
1
- <div #actionButton id="actionButton" class="button-in-msg action" (click)="actionButtonAction()" title="{{button?.value}}">
1
+ <div #actionButton id="actionButton" class="button-in-msg action"
2
+ title="{{button?.value}}"
3
+ (click)="actionButtonAction()"
4
+ (mouseover)="onMouseOver($event)"
5
+ (mouseout)="onMouseOut($event)">
2
6
  {{button.value}}
3
7
  </div>
@@ -1,12 +1,11 @@
1
1
  // @import '../../../../../sass/variables';
2
2
 
3
3
  div {
4
- --bck-msg-sent: #62a8ea;
5
- --col-msg-sent:#ffffff;
6
- --light-white: #f7f7f7;
7
- --black: #1a1a1a;
8
- --gray: #aaaaaa;
9
- --blue: rgb(42, 106, 193);
4
+ --backgroundColor: --basic-blue;
5
+ --textColor: --bck-msg-sent;
6
+ --hoverBackgroundColor: --bck-msg-sent;
7
+ --hoverTextColor: --basic-blue;
8
+ --buttonFontSize: --button-in-msg-font-size;
10
9
  }
11
10
 
12
11
  .button-in-msg {
@@ -15,32 +14,32 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor);
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor);
31
30
  line-height: 16px;
32
31
  }
33
32
 
34
33
  .action {
35
- background: white;
34
+ background: var(--backgroundColor);
36
35
  transition: background-color .6s ease;
37
36
  &:focus,
38
37
  &:hover {
39
- color: white;
40
- background: var(--blue);
38
+ color: var(--hoverTextColor);
39
+ background: var(--hoverBackgroundColor);
41
40
  .icon-button-action {
42
41
  svg {
43
- fill: white;
42
+ fill: var(--hoverTextColor);
44
43
  }
45
44
  }
46
45
  }
@@ -80,4 +79,12 @@ div {
80
79
  // height: 200px;
81
80
  // }
82
81
  // }
83
- }
82
+ }
83
+
84
+
85
+ .disabled {
86
+ // border: 1px solid #999999;
87
+ // background-color: #cccccc;
88
+ // color: #666666;
89
+ pointer-events: none;
90
+ }
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
2
2
 
3
3
  @Component({
4
4
  selector: 'chat-action-button-attachment',
@@ -8,16 +8,36 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@ang
8
8
  export class ActionButtonComponent implements OnInit {
9
9
 
10
10
  @Input() button: any;
11
- @Input() themeColor: string;
12
- @Input() foregroundColor: string;
11
+ @Input() fontSize: string;
12
+ @Input() backgroundColor: string;
13
+ @Input() textColor: string;
14
+ @Input() hoverBackgroundColor: string;
15
+ @Input() hoverTextColor: string;
13
16
  @Output() onButtonClicked = new EventEmitter();
17
+
14
18
  public type: string = "action"
15
19
  constructor(private elementRef: ElementRef) { }
16
20
 
17
21
  ngOnInit() {
22
+ }
23
+
24
+ ngOnChanges(changes: SimpleChanges){
18
25
  //decomment if element should have same color of themeColor and fregroundColor
19
- // this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
20
- // this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
26
+ if(this.fontSize) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--buttonFontSize', this.fontSize);
27
+ if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--backgroundColor', this.backgroundColor);
28
+ if(this.textColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--textColor', this.textColor);
29
+ if(this.hoverBackgroundColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--hoverBackgroundColor', this.hoverBackgroundColor);
30
+ if(this.hoverTextColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--hoverTextColor', this.hoverTextColor);
31
+ }
32
+
33
+ onMouseOver(event){
34
+ // if(this.themeColor) this.elementRef.nativeElement.querySelector('.action').style.background = this.themeColor
35
+ // if(this.foregroundColor) this.elementRef.nativeElement.querySelector('.action').style.color = this.foregroundColor
36
+ }
37
+
38
+ onMouseOut(event){
39
+ // this.elementRef.nativeElement.querySelector('.action').style.color = '';
40
+ // this.elementRef.nativeElement.querySelector('.action').style.background = ''
21
41
  }
22
42
 
23
43
  actionButtonAction(){
@@ -1,4 +1,5 @@
1
- <div class="button-in-msg url" (click)="actionButtonUrl()" title="{{button?.value}}">
1
+ <div class="button-in-msg url" (click)="actionButtonUrl()" title="{{button?.value}}"
2
+ (mouseover)="onMouseOver($event)" (mouseout)="onMouseOut($event)">
2
3
  <span *ngIf="button?.target !== 'self'" class="icon-button-action">
3
4
  <!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="12px" height="12px">
4
5
  <path d="M0 0h24v24H0z" fill="none"/>
@@ -1,12 +1,11 @@
1
1
  // @import '../../../../../sass/variables';
2
2
 
3
3
  div {
4
- --bck-msg-sent: #62a8ea;
5
- --col-msg-sent:#ffffff;
6
- --light-white: #f7f7f7;
7
- --black: #1a1a1a;
8
- --gray: #aaaaaa;
9
- --blue: rgb(42, 106, 193);
4
+ --backgroundColor: --basic-blue;
5
+ --textColor: --bck-msg-sent;
6
+ --hoverBackgroundColor: --bck-msg-sent;
7
+ --hoverTextColor: --basic-blue;
8
+ --buttonFontSize: --button-in-msg-font-size;
10
9
  }
11
10
 
12
11
  .button-in-msg {
@@ -15,19 +14,19 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor);
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor);
31
30
  line-height: 16px;
32
31
  }
33
32
 
@@ -38,23 +37,23 @@ div {
38
37
  top: -1px;
39
38
  right: 1px;
40
39
  svg {
41
- fill: var(--blue);
40
+ fill: var(--textColor);
42
41
  }
43
42
  }
44
43
  .icon-button-action-self{
45
44
  position: absolute;
46
45
  right: 1px;
47
46
  svg {
48
- fill: var(--blue);
47
+ fill: var(--textColor);
49
48
  }
50
49
  }
51
50
  &:focus,
52
51
  &:hover {
53
- color: white;
54
- background: var(--blue);
52
+ color: var(--hoverTextColor);
53
+ background: var(--hoverBackgroundColor);
55
54
  .icon-button-action, .icon-button-action-self {
56
55
  svg {
57
- fill: white;
56
+ fill: var(--hoverTextColor);
58
57
  }
59
58
  }
60
59
  }
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
2
2
 
3
3
  @Component({
4
4
  selector: 'chat-link-button-attachment',
@@ -8,16 +8,35 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@ang
8
8
  export class LinkButtonComponent implements OnInit {
9
9
 
10
10
  @Input() button: any;
11
- @Input() themeColor: string;
12
- @Input() foregroundColor: string;
11
+ @Input() fontSize: string;
12
+ @Input() backgroundColor: string;
13
+ @Input() textColor: string;
14
+ @Input() hoverBackgroundColor: string;
15
+ @Input() hoverTextColor: string;
13
16
  @Output() onButtonClicked = new EventEmitter();
14
17
  public type: string = "url"
15
18
  constructor(private elementRef: ElementRef) { }
16
19
 
17
20
  ngOnInit() {
21
+ }
22
+
23
+ ngOnChanges(changes: SimpleChanges){
18
24
  //decomment if element should have same color of themeColor and fregroundColor
19
- // this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
20
- // this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
25
+ if(this.fontSize) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--buttonFontSize', this.fontSize);
26
+ if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--backgroundColor', this.backgroundColor);
27
+ if(this.textColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--textColor', this.textColor);
28
+ if(this.hoverBackgroundColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--hoverBackgroundColor', this.hoverBackgroundColor);
29
+ if(this.hoverTextColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--hoverTextColor', this.hoverTextColor);
30
+ }
31
+
32
+ onMouseOver(event){
33
+ // if(this.themeColor) this.elementRef.nativeElement.querySelector('.url').style.background = this.themeColor
34
+ // if(this.foregroundColor) this.elementRef.nativeElement.querySelector('.url').style.color = this.foregroundColor
35
+ }
36
+
37
+ onMouseOut(event){
38
+ // this.elementRef.nativeElement.querySelector('.url').style.color = '';
39
+ // this.elementRef.nativeElement.querySelector('.url').style.background = ''
21
40
  }
22
41
 
23
42
  actionButtonUrl(){
@@ -1,3 +1,8 @@
1
- <div class="button-in-msg text" (click)="actionButtonText()" title="{{button?.value}}">
1
+ <div class="button-in-msg text"
2
+ [ngClass]="{'disabled': isConversationArchived}"
3
+ title="{{button?.value}}"
4
+ (click)="actionButtonText()"
5
+ (mouseover)="onMouseOver($event)"
6
+ (mouseout)="onMouseOut($event)">
2
7
  {{button?.value}}
3
8
  </div>
@@ -1,11 +1,10 @@
1
1
  // @import '../../../../../sass/variables';
2
2
  div {
3
- --bck-msg-sent: #62a8ea;
4
- --col-msg-sent:#ffffff;
5
- --light-white: #f7f7f7;
6
- --black: #1a1a1a;
7
- --gray: #aaaaaa;
8
- --blue: rgb(42, 106, 193);
3
+ --backgroundColor: --basic-blue;
4
+ --textColor: --bck-msg-sent;
5
+ --hoverBackgroundColor: --bck-msg-sent;
6
+ --hoverTextColor: --basic-blue;
7
+ --buttonFontSize: --button-in-msg-font-size;
9
8
  }
10
9
 
11
10
 
@@ -15,19 +14,19 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor); //$blue
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor); //$blue
31
30
  line-height: 16px;
32
31
  }
33
32
 
@@ -36,11 +35,11 @@ div {
36
35
  transition: background-color .6s ease;
37
36
  &:focus,
38
37
  &:hover {
39
- color: white;
40
- background: var(--blue);
38
+ color: var(--hoverTextColor);
39
+ background: var(--hoverBackgroundColor);
41
40
  .icon-button-action {
42
41
  svg {
43
- fill: var(--black);
42
+ fill: --black;
44
43
  }
45
44
  }
46
45
  }
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
2
2
 
3
3
 
4
4
  @Component({
@@ -9,16 +9,37 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@ang
9
9
  export class TextButtonComponent implements OnInit {
10
10
 
11
11
  @Input() button: any;
12
- @Input() themeColor: string;
13
- @Input() foregroundColor: string;
12
+ @Input() isConversationArchived: boolean;
13
+ @Input() fontSize: string;
14
+ @Input() backgroundColor: string;
15
+ @Input() textColor: string;
16
+ @Input() hoverBackgroundColor: string;
17
+ @Input() hoverTextColor: string;
14
18
  @Output() onButtonClicked = new EventEmitter();
19
+
15
20
  public type: string = "text"
16
21
  constructor(private elementRef: ElementRef) { }
17
22
 
18
23
  ngOnInit() {
24
+ }
25
+
26
+ ngOnChanges(changes: SimpleChanges){
19
27
  //decomment if element should have same color of themeColor and fregroundColor
20
- // this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
21
- // this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
28
+ if(this.fontSize) this.elementRef.nativeElement.querySelector('.text').style.setProperty('--buttonFontSize', this.fontSize);
29
+ if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.text').style.setProperty('--backgroundColor', this.backgroundColor);
30
+ if(this.textColor) this.elementRef.nativeElement.querySelector('.text').style.setProperty('--textColor', this.textColor);
31
+ if(this.hoverBackgroundColor) this.elementRef.nativeElement.querySelector('.text').style.setProperty('--hoverBackgroundColor', this.hoverBackgroundColor);
32
+ if(this.hoverTextColor) this.elementRef.nativeElement.querySelector('.text').style.setProperty('--hoverTextColor', this.hoverTextColor);
33
+ }
34
+
35
+ onMouseOver(event){
36
+ // if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.text').style.background = this.textColor
37
+ // if(this.textColor) this.elementRef.nativeElement.querySelector('.text').style.color = this.backgroundColor
38
+ }
39
+
40
+ onMouseOut(event){
41
+ // this.elementRef.nativeElement.querySelector('.text').style.color = '';
42
+ // this.elementRef.nativeElement.querySelector('.text').style.background = ''
22
43
  }
23
44
 
24
45
  actionButtonText(){
@@ -1,3 +1,9 @@
1
- <div [ngStyle] = "{ 'max-width': '100%', 'width': width, 'height': height + 'px' }">
2
- <iframe allowfullscreen width = "100%" height = "100%" style= "border:none; border-radius: 8px 8px 0 0 " [src]="url" ></iframe>
1
+ <div [ngStyle] = "{ 'max-width': '100%', 'width': width, 'height': height }">
2
+ <div *ngIf="loading" class="loader" [ngStyle] = "{ 'width': width , 'height': height }"></div>
3
+ <iframe allowfullscreen
4
+ [ngClass]="{'isLoadingImage': loading}"
5
+ width = "100%" height = "100%"
6
+ [src]="url"
7
+ (load)="onLoaded($event)">
8
+ </iframe>
3
9
  </div>
@@ -0,0 +1,36 @@
1
+
2
+ :host{
3
+ // --borderRadius: #{$border-radius-bubble-message};
4
+ --borderRadius: 8px 8px 0px 0px;
5
+ }
6
+
7
+ .loader {
8
+ float: left;
9
+ // position: absolute;
10
+ z-index: 1000;
11
+ // background-color: #ccc;
12
+ border-radius: var(--borderRadius);
13
+ background-image: linear-gradient(90deg, transparent 0px, #e8e8e8 40px, transparent 80px);
14
+ background-size: 600px;
15
+ animation: shine-loader 1.6s infinite linear;
16
+ }
17
+
18
+ .isLoadingImage {
19
+ // position: relative;
20
+ // top: 6px;
21
+ display: none;
22
+ }
23
+
24
+ iframe {
25
+ border:none;
26
+ border-radius: var(--borderRadius)
27
+ }
28
+
29
+ @keyframes shine-loader {
30
+ 0% {
31
+ background-position: -32px;
32
+ }
33
+ 40%, 100% {
34
+ background-position: 208px;
35
+ }
36
+ }
@@ -9,8 +9,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
9
9
  export class FrameComponent implements OnInit {
10
10
 
11
11
  @Input() metadata: any;
12
- @Input() width: string;
13
- @Input() height: string;
12
+ @Input() width: number;
13
+ @Input() height: number;
14
14
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
15
15
 
16
16
  url: any;
@@ -1,4 +1,3 @@
1
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2
1
  import { Component, ElementRef, Input, OnInit, SimpleChange, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
3
2
 
4
3
  @Component({
@@ -1,11 +1,12 @@
1
1
  <!-- [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" style="position: relative; " -->
2
- <div [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" class="c21-img-container">
2
+ <div [ngStyle]="{'max-height': height +'px' }" class="c21-img-container">
3
3
  <div *ngIf="loading" class="loader" [ngStyle]="{ 'width': width , 'height': height }"></div>
4
4
  <!-- [tooltip]="timeTooltipRight" [options]="tooltipOptions" placement="bottom" content-type="template" -->
5
5
  <img id="myImg"
6
6
  class="message-contentX message-content-imageX"
7
7
  [ngClass]="{'isLoadingImage': loading}"
8
- [ngStyle]="{ 'width': width , 'height': height }"
8
+ [width]="width"
9
+ [height]="height"
9
10
  [src]="metadata.src"
10
11
  (load)="onLoaded($event)"
11
12
  (click)="openImageViewerModal(metadata.src, metadata.name)" />