@chat21/chat21-ionic 3.0.79 → 3.0.80-rc.1

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 (138) hide show
  1. package/CHANGELOG.md +62 -2
  2. package/README.md +2 -2
  3. package/package.json +1 -1
  4. package/src/app/app.component.html +7 -1
  5. package/src/app/app.component.scss +18 -2
  6. package/src/app/app.component.ts +73 -15
  7. package/src/app/app.module.ts +3 -1
  8. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +75 -23
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +162 -85
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +39 -2
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -19
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -25
  16. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  17. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  18. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  19. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  20. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  21. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  22. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  23. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  24. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  25. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  26. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +2 -2
  27. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  28. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  29. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  30. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  31. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +62 -20
  32. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  33. package/src/app/components/canned-response/canned-response.component.html +4 -4
  34. package/src/app/components/canned-response/canned-response.component.scss +1 -1
  35. package/src/app/components/canned-response/canned-response.component.ts +1 -0
  36. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  37. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  38. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +61 -42
  39. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  40. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +9 -25
  41. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +6 -5
  42. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
  43. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +4 -83
  44. package/src/app/components/conversation-info/info-content/info-content.component.html +2 -1
  45. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -2
  46. package/src/app/components/conversation-info/info-direct/info-direct.component.html +1 -9
  47. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +0 -2
  48. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  49. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  50. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  51. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  52. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  53. 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
  54. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  55. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  56. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  57. 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
  58. 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
  59. package/src/app/components/navbar/navbar.component.html +103 -0
  60. package/src/app/components/navbar/navbar.component.scss +249 -0
  61. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  62. package/src/app/components/navbar/navbar.component.ts +189 -0
  63. package/src/app/components/project-item/project-item.component.html +98 -149
  64. package/src/app/components/project-item/project-item.component.scss +42 -35
  65. package/src/app/components/project-item/project-item.component.ts +16 -4
  66. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +3 -3
  67. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +2 -7
  68. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  69. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  70. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  71. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  72. package/src/app/pages/contacts-directory/contacts-directory.page.scss +41 -0
  73. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  74. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  75. package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -23
  76. package/src/app/pages/conversation-detail/conversation-detail.page.scss +40 -250
  77. package/src/app/pages/conversation-detail/conversation-detail.page.ts +183 -72
  78. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  79. package/src/app/pages/conversations-list/conversations-list.page.scss +11 -2
  80. package/src/app/pages/conversations-list/conversations-list.page.ts +25 -22
  81. package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
  82. package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
  83. package/src/app/pages/loader-preview/loader-preview.page.scss +4 -0
  84. package/src/app/pages/loader-preview/loader-preview.page.ts +1 -2
  85. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  86. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  87. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  88. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  89. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  90. package/src/app/services/projects/projects.service.spec.ts +12 -0
  91. package/src/app/services/projects/projects.service.ts +43 -0
  92. package/src/app/services/tiledesk/tiledesk.service.ts +1 -25
  93. package/src/app/shared/shared.module.ts +24 -33
  94. package/src/assets/i18n/ar.json +278 -265
  95. package/src/assets/i18n/az.json +14 -1
  96. package/src/assets/i18n/de.json +15 -2
  97. package/src/assets/i18n/en.json +15 -2
  98. package/src/assets/i18n/es.json +15 -2
  99. package/src/assets/i18n/fr.json +14 -1
  100. package/src/assets/i18n/it.json +14 -1
  101. package/src/assets/i18n/kk.json +15 -2
  102. package/src/assets/i18n/pt.json +15 -2
  103. package/src/assets/i18n/ru.json +14 -1
  104. package/src/assets/i18n/sr.json +277 -264
  105. package/src/assets/i18n/sv.json +15 -2
  106. package/src/assets/i18n/tr.json +15 -2
  107. package/src/assets/i18n/uk.json +15 -2
  108. package/src/assets/i18n/uz.json +14 -1
  109. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  110. package/src/chat21-core/models/conversation.ts +0 -1
  111. package/src/chat21-core/models/projects.ts +27 -0
  112. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  113. package/src/chat21-core/utils/constants.ts +5 -1
  114. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  115. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  116. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  117. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  118. package/src/chat21-core/utils/utils.ts +38 -10
  119. package/src/global.scss +48 -56
  120. package/src/index.html +2 -2
  121. package/src/variables.scss +30 -10
  122. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  123. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  124. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  125. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  126. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  127. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  128. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  129. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  130. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  131. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  132. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  133. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  134. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  135. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  136. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  137. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  138. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -33,6 +33,59 @@
33
33
  }
34
34
  }
35
35
 
36
+ .manage_conversation_info_container{
37
+ height: 34px;
38
+ display: flex;
39
+ -webkit-box-align: center;
40
+ align-items: center;
41
+ position: fixed;
42
+ transition: transform 300ms ease-in-out 0s;
43
+ transform: translate(0px);
44
+ right: 300px;
45
+ top: 60px;
46
+ z-index:10;
47
+ background: linear-gradient(to right, rgba(226, 232, 239, 0) 128px, rgb(226, 232, 239) 128px);
48
+
49
+ &.close{
50
+ right: 0px;
51
+ &:not(.mobile){
52
+ top: calc(60px + var(--padding-conversation-detail));
53
+ }
54
+ }
55
+
56
+ &.mobile{
57
+ right: 0px;
58
+ }
59
+ &:not(.mobile):not(.close){
60
+ right: calc(300px + var(--padding-conversation-detail));
61
+ top: calc(60px + var(--padding-conversation-detail));
62
+ }
63
+ &::before{
64
+ content: "";
65
+ width: 102px;
66
+ height: 34px;
67
+ background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjM0IiB2aWV3Qm94PSIwIDAgMTAyIDM0IiB3aWR0aD0iMTAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0ibTEwMiAwaC0xMDJsLjA3MTQwOC40MTk3NTNjMTEuMzE5MTkyLS4wMTU1NTggMjIuMjg4MTkyIDMuOTIwMzM3IDMxLjAxMjA5MiAxMS4xMjc2NDdsNy40ODk0IDYuNTAyIDEuNjUwOCAxLjQyMjkgNi42OTU1IDUuNzhjNi41Mzc0IDUuNjQwNSAxNC44ODU3IDguNzQ1MSAyMy41MjI3IDguNzQ3N2gzMS41NTQxeiIKICAgICAgICAgIGZpbGw9IiNlMmU4ZWYiLz4KPC9zdmc+);
68
+ position: relative;
69
+ left: 50px;
70
+ z-index: -1;
71
+ }
72
+
73
+ ion-button {
74
+ text-transform: unset;
75
+ color: var(--basic-blue);
76
+ &:hover {
77
+ --background-hover: transparent;
78
+ text-decoration: underline;
79
+ text-decoration-color: var(--basic-blue);
80
+ }
81
+ }
82
+
83
+ ion-icon{
84
+ margin: 5px;
85
+ }
86
+ }
87
+
88
+
36
89
  ion-item {
37
90
  --padding-end: 0px;
38
91
  --inner-padding-end: 0px;
@@ -60,12 +113,33 @@ ion-item {
60
113
 
61
114
  .message_sender_fullname {
62
115
  font-size: 0.9em;
63
- margin: 0 0 1px 10px;
116
+ margin: 0px 10px 0px 10px;
64
117
  // color: var(--gray);
65
118
  font-weight: 500;
66
119
  color: #080f1a;
67
120
  }
68
121
 
122
+ .typing_container{
123
+ display:flex;
124
+ align-items: center;
125
+
126
+ user-typing {
127
+ text-align: right;
128
+ }
129
+ .typing_info{
130
+ color: var(--basic-gray);
131
+ margin-left: 10px;
132
+ font-size: 12px;
133
+ animation: blinker 1s linear infinite;
134
+
135
+ @keyframes blinker {
136
+ 50% {
137
+ opacity: 0;
138
+ }
139
+ }
140
+ }
141
+ }
142
+
69
143
  .messages {
70
144
  border-radius: 18px;
71
145
  padding: 0;
@@ -82,12 +156,16 @@ ion-item {
82
156
  align-items: flex-end;
83
157
  justify-content: flex-end;
84
158
  // padding: 2px 0px 4px 40px;
85
- padding: 2px 0px 14px 40px; // edited to display the date at the bottom of the "message bubble"
159
+ padding: 0px 0px 6px 40px;
160
+
161
+ &:hover .message-date-hover, &:hover .btn-add-msg{
162
+ display: block;
163
+ }
164
+
86
165
  .msg_sent {
87
166
  background-color: var(--bubble-blue);
88
167
  color: var(--col-msg-sent);
89
- margin-right: 4px;
90
- margin-left: 4px;
168
+ margin: 0px 0px 0px 0px;
91
169
  max-width: calc(100% - 70px);
92
170
  min-width: 14px;
93
171
  border-top-right-radius: 8px;
@@ -112,8 +190,17 @@ ion-item {
112
190
 
113
191
  /** recive message **/
114
192
  .base_receive {
115
- // padding: 0px 0px 6px 0px;
116
- padding: 0px 0px 15px 0px; // edited to display the date at the bottom of the "message bubble"
193
+ padding: 0px 20px 6px 0px;
194
+ .message-date{
195
+ color: #647491;
196
+ font-size: 12px;
197
+ align-self: center;
198
+ }
199
+
200
+
201
+ &:hover .message-date-hover, &:hover .btn-add-msg{
202
+ display: block;
203
+ }
117
204
  /* avatar */
118
205
  .content-avatar {
119
206
  position: relative;
@@ -142,12 +229,12 @@ ion-item {
142
229
  }
143
230
  /* message */
144
231
  .msg_receive {
145
- background-color: var(--light-white);
146
- color: #1a1a1a;
232
+ background-color: var(--bck-msg-received);
233
+ color: var(--col-msg-received);
147
234
  // max-width: 260px;
148
235
  max-width: calc(100% - 70px);
149
236
  min-width: 14px;
150
- margin: 0 20px 4px 10px;
237
+ margin: 0 0px 0px 10px;
151
238
  height: fit-content;
152
239
  width: auto;
153
240
  border-top-left-radius: 8px;
@@ -167,63 +254,93 @@ ion-item {
167
254
  .has-metadata {
168
255
  max-width: 100% !important;
169
256
  }
257
+
170
258
  }
171
259
 
172
- .time {
173
- margin-bottom: 20px;
260
+ .message-date-hover{
261
+ color: #647491;
262
+ font-size: 12px;
263
+ align-self: center;
264
+
265
+ display: none;
266
+
267
+ }
268
+
269
+ .btn-add-msg {
270
+ border-radius: 50%;
271
+ --padding-end: 7px;
272
+ --padding-start: 7px;
273
+ box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.13);
274
+ display: none;
275
+ align-self: center;
276
+ margin: 0px 5px;
277
+
278
+ ion-icon{
279
+ font-size: 1.2em;
280
+ color: var(--basic-blue)
281
+ }
282
+
283
+ .add-canned-response-add-icon{
284
+ color: var(--basic-blue);
285
+ cursor: pointer;
286
+ position: relative;
287
+ top: 6px;
288
+ left: -6px;
289
+ font-size: 9px;
290
+ }
174
291
  }
175
292
 
176
- // Loading Spinner
177
- .spinner {
178
- // margin: 100px auto 0;
179
- width: 90px;
293
+ /* LOADING */
294
+ /*http://tobiasahlin.com/spinkit/*/
295
+ #chat21-spinner {
296
+ display: none;
297
+ width: 70px;
180
298
  min-height: 20px;
181
- padding: 7px;
299
+ margin: 20px auto 0;
182
300
  text-align: center;
183
301
  }
184
-
185
- .spinner > div {
186
- width: 10px;
187
- height: 10px;
188
- background-color: rgb(255, 255, 255);
189
-
302
+ #chat21-spinner.active {
303
+ display: block;
304
+ }
305
+ #chat21-spinner > div {
306
+ width: 12px;
307
+ height: 12px;
308
+ background-color: var(--bubble-blue);
190
309
  border-radius: 100%;
191
310
  display: inline-block;
192
311
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
193
312
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
194
313
  }
195
-
196
- .spinner .bounce1 {
314
+ #chat21-spinner .chat21-bounce1 {
197
315
  -webkit-animation-delay: -0.32s;
198
316
  animation-delay: -0.32s;
199
317
  }
200
-
201
- .spinner .bounce2 {
318
+ #chat21-spinner .chat21-bounce2 {
202
319
  -webkit-animation-delay: -0.16s;
203
320
  animation-delay: -0.16s;
204
321
  }
205
-
322
+ #chat21-spinner span {
323
+ display: block;
324
+ margin: 0.5em 0 0 0;
325
+ color: var(--col-msg-sent);
326
+ /* text-transform: uppercase; */
327
+ font-family: 'Roboto', sans-serif;
328
+ -webkit-animation: pulse 2000ms linear infinite;
329
+ -moz-animation: pulse 2000ms linear infinite;
330
+ animation: pulse 2000ms linear infinite;
331
+ text-align: center;
332
+ }
206
333
  @-webkit-keyframes sk-bouncedelay {
207
- 0%,
208
- 80%,
209
- 100% {
210
- -webkit-transform: scale(0);
211
- }
212
- 40% {
213
- -webkit-transform: scale(1);
214
- }
334
+ 0%, 80%, 100% { -webkit-transform: scale(0) }
335
+ 40% { -webkit-transform: scale(1.0) }
215
336
  }
216
-
217
337
  @keyframes sk-bouncedelay {
218
- 0%,
219
- 80%,
220
- 100% {
221
- -webkit-transform: scale(0);
222
- transform: scale(0);
223
- }
224
- 40% {
225
- -webkit-transform: scale(1);
226
- transform: scale(1);
338
+ 0%, 80%, 100% {
339
+ -webkit-transform: scale(0);
340
+ transform: scale(0);
341
+ } 40% {
342
+ -webkit-transform: scale(1.0);
343
+ transform: scale(1.0);
227
344
  }
228
345
  }
229
346
 
@@ -245,28 +362,6 @@ ion-item {
245
362
  // left: -26px;
246
363
  }
247
364
 
248
- :host .base_receive .msg_receive ::ng-deep div > div > div > ion-button.canned {
249
- display: none;
250
- position: absolute;
251
- top: -3px;
252
- right: -31px;
253
- }
254
-
255
- :host .base_receive .msg_receive ::ng-deep div > div > div >ion-button.emoji {
256
- display: none;
257
- position: absolute;
258
- top: -3px;
259
- right: -51px;
260
- }
261
-
262
- // :host .base_receive .msg_receive:hover ::ng-deep div > div > ion-button {
263
- :host .base_receive:hover .msg_receive ::ng-deep div > div > div > ion-button {
264
- display: block;
265
- // position: absolute;
266
- // top: -11px;
267
- // left: 91px;
268
- }
269
-
270
365
  // ---------------------------------------------------------
271
366
  // Long date divider
272
367
  // ---------------------------------------------------------
@@ -295,24 +390,6 @@ ion-item {
295
390
  color: #64748b;
296
391
  }
297
392
 
298
- // ---------------------------------------------------------
299
- // message date
300
- // ---------------------------------------------------------
301
- :host .base_sent .msg_sent ::ng-deep div > div > div > .message-date {
302
- position: absolute;
303
- bottom: -11px;
304
- color: #64748b;
305
- font-size: 10px;
306
- right: 0px;
307
- }
308
-
309
- :host .base_receive .msg_receive ::ng-deep div > div > .message-date {
310
- position: absolute;
311
- bottom: -11px;
312
- color: #64748b;
313
- font-size: 10px;
314
- left: 0px;
315
- }
316
393
  // ---------------------------------------------------------
317
394
  // emoticon
318
395
  // ---------------------------------------------------------
@@ -1,5 +1,6 @@
1
+ import { MessageModel } from 'src/chat21-core/models/message';
1
2
  import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
2
- import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
3
+ import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter, SimpleChange, SimpleChanges } from '@angular/core';
3
4
 
4
5
 
5
6
  import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
@@ -13,6 +14,8 @@ import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk
13
14
  import { TranslateService } from '@ngx-translate/core';
14
15
  import * as moment from 'moment';
15
16
  import { AppConfigProvider } from 'src/app/services/app-config';
17
+ import { ModalController } from '@ionic/angular';
18
+ import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page';
16
19
  @Component({
17
20
  selector: 'ion-conversation-detail',
18
21
  templateUrl: './ion-conversation-detail.component.html',
@@ -24,14 +27,17 @@ export class IonConversationDetailComponent extends ConversationContentComponent
24
27
  @Input() channelType: string;
25
28
  @Input() areVisibleCAR: boolean;
26
29
  @Input() supportMode: boolean;
30
+ @Input() isMobile: boolean;
27
31
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
28
32
  @Output() onAddUploadingBubble = new EventEmitter<boolean>();
29
-
33
+ @Output() onOpenCloseInfoConversation = new EventEmitter<boolean>();
34
+
30
35
  public public_Key: any
31
36
  public uploadProgress: number = 100
32
37
  public fileType: any
33
38
  public browserLang: string;
34
39
  public addAsCannedResponseTooltipText: string;
40
+ public openInfoConversation: boolean = true;
35
41
  isImage = isImage;
36
42
  isFile = isFile;
37
43
  isFrame = isFrame;
@@ -58,6 +64,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
58
64
  public tiledeskAuthService: TiledeskAuthService,
59
65
  private translate: TranslateService,
60
66
  public appConfigProvider: AppConfigProvider,
67
+ public modalController: ModalController,
61
68
  ) {
62
69
  super(cdref, uploadService)
63
70
 
@@ -66,6 +73,11 @@ export class IonConversationDetailComponent extends ConversationContentComponent
66
73
  ngOnInit() {
67
74
  this.listenToUploadFileProgress();
68
75
  this.setMomentLocaleAndGetTranslation();
76
+
77
+ }
78
+
79
+ ngOnChanges(changes: SimpleChanges){
80
+ this.isMobile? this.openInfoConversation = false: null;
69
81
  }
70
82
 
71
83
 
@@ -136,6 +148,11 @@ export class IonConversationDetailComponent extends ConversationContentComponent
136
148
  this.onElementRendered.emit(event)
137
149
  }
138
150
 
151
+ onOpenCloseInfoConversationFN(){
152
+ this.openInfoConversation = !this.openInfoConversation
153
+ this.onOpenCloseInfoConversation.emit(this.openInfoConversation)
154
+ }
155
+
139
156
  /**
140
157
  * Track by function for ngFor loops
141
158
  *
@@ -147,4 +164,24 @@ export class IonConversationDetailComponent extends ConversationContentComponent
147
164
  // console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn item', item)
148
165
  return item.uid || index;
149
166
  }
167
+
168
+
169
+ async presentCreateCannedResponseModal(message: MessageModel): Promise<any> {
170
+ this.logger.log('[BUBBLE-MESSAGE] PRESENT CREATE CANNED RESPONSE MODAL ')
171
+ const attributes = {
172
+ message: message,
173
+ }
174
+ const modal: HTMLIonModalElement = await this.modalController.create({
175
+ component: CreateCannedResponsePage,
176
+ componentProps: attributes,
177
+ swipeToClose: false,
178
+ backdropDismiss: false,
179
+ })
180
+ modal.onDidDismiss().then((dataReturned: any) => {
181
+ //
182
+ this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
183
+ })
184
+
185
+ return await modal.present()
186
+ }
150
187
  }
@@ -7,6 +7,12 @@
7
7
 
8
8
 
9
9
  <div>
10
+
11
+ <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
12
+ [style.color]="convertColorToRGBA(fontColor, 65)"
13
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 0px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
14
+ {{message?.sender_fullname}}
15
+ </div>
10
16
  <!-- message type:: image -->
11
17
  <!-- <div *ngIf="message.type == 'image' && message.metadata" [ngStyle] = "{ 'max-width': getSizeImg(message).width, 'max-height': getSizeImg(message).height }">
12
18
  <img class="message-contentX message-content-imageX" [src]="message.metadata.src" />
@@ -43,14 +49,10 @@
43
49
 
44
50
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
45
51
  <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
52
 
51
53
  <chat-text *ngIf="message?.type !=='html'"
52
54
  [text]="message?.text"
53
- [color]="textColor"
55
+ [color]="fontColor"
54
56
  [message]="message"
55
57
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
56
58
  (onAfterMessageRender)="returnOnAfterMessageRender($event)">
@@ -60,20 +62,6 @@
60
62
  [htmlText]="message?.text">
61
63
  </chat-html>
62
64
 
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
65
  </div>
78
66
  </div>
79
67
 
@@ -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,16 @@
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
11
  import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
12
12
  import { ModalController } from '@ionic/angular';
13
+ import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
13
14
  @Component({
14
15
  selector: 'chat-bubble-message',
15
16
  templateUrl: './bubble-message.component.html',
@@ -18,16 +19,25 @@ import { ModalController } from '@ionic/angular';
18
19
  export class BubbleMessageComponent implements OnInit, OnChanges {
19
20
 
20
21
  @Input() message: MessageModel;
21
- @Input() textColor: string;
22
- @Input() areVisibleCAR: boolean;
23
- @Input() supportMode: boolean;
22
+ @Input() isSameSender: boolean;
23
+ @Input() fontColor: string;
24
+ @Input() fontSize: string;
25
+ @Input() fontFamily: string;
24
26
  @Output() onBeforeMessageRender = new EventEmitter();
25
27
  @Output() onAfterMessageRender = new EventEmitter();
26
28
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
27
29
  isImage = isImage;
28
30
  isFile = isFile;
29
31
  isFrame = isFrame;
30
- @Input() addAsCannedResponseTooltipText : string;
32
+ convertColorToRGBA = convertColorToRGBA
33
+
34
+ // ========== begin:: check message type functions ======= //
35
+ messageType = messageType;
36
+
37
+ MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
38
+ MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
39
+ // ========== end:: check message type functions ======= //
40
+
31
41
  public browserLang: string;
32
42
 
33
43
  tooltipOptions = {
@@ -194,25 +204,6 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
194
204
  this.onElementRendered.emit({element: event.element, status: event.status})
195
205
  }
196
206
 
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
207
 
217
208
  // printMessage(message, messageEl, component) {
218
209
  // 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
+ }