@chat21/chat21-ionic 3.0.90-rc.1 → 3.0.90-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.90-rc.2
4
+ - added: info and copy icon on received messages
5
+ - added: flash icon to distinguish chat offline message sent also by email
6
+
3
7
  ### 3.0.90-rc.1
4
8
  - added: autofocus on first input
5
9
  - added: tiledesk logo on sidebar
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.90-rc.1",
4
+ "version": "3.0.90-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -110,8 +110,12 @@
110
110
 
111
111
  <div class="bubble-container">
112
112
 
113
- <div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel === TYPE_MSG_EMAIL">
113
+ <div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel.includes(TYPE_MSG_EMAIL)">
114
114
  <ion-icon name="mail"></ion-icon>
115
+ <ion-icon name="flash"
116
+ *ngIf="message?.attributes?.channel.includes('offline_')"
117
+ [ngStyle]="{'color': stylesMap.get('bubbleSentBackground')}">
118
+ </ion-icon>
115
119
  </div>
116
120
 
117
121
  <!--backgroundColor non viene ancora usato -->
@@ -174,18 +178,10 @@
174
178
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
175
179
  (onAfterMessageRender)="onAfterMessageRenderFN($event)"
176
180
  (onElementRendered)="onElementRenderedFN($event)"
177
- (click)="onBubbleMessageClick($event, message, i)">
181
+ (onCopy)="onClickCopyMesage($event)"
182
+ (onInfo)="onClickInfoMesage($event, i)">
178
183
  </chat-bubble-message>
179
184
 
180
- <div class="options-container">
181
- <div class="copy-logo" (click)="onClickCopyMesage($event, message)" *ngIf="message.text.trim() !== ''">
182
- <ion-icon name="copy-outline"></ion-icon>
183
- </div>
184
- <!-- <div class="menu-logo" (click)="onClickBubbleMenu($event, message)">
185
- <ion-icon name="caret-down"></ion-icon>
186
- </div> -->
187
- </div>
188
-
189
185
  </div>
190
186
 
191
187
  <ng-container *ngIf="areVisibleCAR && supportMode">
@@ -211,6 +211,14 @@ ion-item {
211
211
  height: 16px;
212
212
  border-radius: 3px;
213
213
  color: rgb(135, 150, 175);
214
+
215
+ ion-icon[name="flash"]{
216
+ position: absolute;
217
+ top: -5px;
218
+ left: -4px;
219
+ color: var(--bubble-blue);
220
+ font-size: small;
221
+ }
214
222
  }
215
223
 
216
224
  }
@@ -321,27 +329,6 @@ ion-item {
321
329
  }
322
330
  }
323
331
 
324
- .copy-logo{
325
- // background-color: var(--list-bkg-color);
326
- // box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.4);
327
- // position: relative;
328
- // display: flex;
329
- // -webkit-box-align: center;
330
- // align-items: center;
331
- // -webkit-box-pack: center;
332
- // justify-content: center;
333
- // top: 0px;
334
- // right: 50px;
335
- // z-index: 2;
336
- width: 20px;
337
- border-radius: 3px;
338
- color: rgb(135, 150, 175);
339
-
340
- &:hover{
341
- cursor: pointer;
342
- }
343
- }
344
-
345
332
  }
346
333
 
347
334
  .sourcePage-container{
@@ -156,13 +156,13 @@ export class IonConversationDetailComponent extends ConversationContentComponent
156
156
  this.presentPopover(event, message)
157
157
  }
158
158
 
159
- onClickCopyMesage(event, message: MessageModel){
159
+ onClickCopyMesage(message: MessageModel){
160
160
  this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickCopyMesage');
161
161
  navigator.clipboard.writeText(message.text)
162
162
  this.presentToast()
163
163
  }
164
164
 
165
- onBubbleMessageClick(event: any, message: MessageModel, index: number){
165
+ onClickInfoMesage(message: MessageModel, index: number){
166
166
  if(message && message.attributes && message.attributes.sourcePage){
167
167
  this.showSourceInfo = !this.showSourceInfo
168
168
  this.showSourceInfoIndex = index
@@ -2,10 +2,18 @@
2
2
  <!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
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">
5
+ <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
6
6
 
7
+ <div class="options-container" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message)">
8
+ <div class="info-logo" (click)="onClickInfoMessage($event, message)" *ngIf="message?.attributes && message?.attributes?.sourcePage">
9
+ <ion-icon name="information-circle-outline"></ion-icon>
10
+ </div>
11
+ <div class="copy-logo" (click)="onClickCopyMesage($event, message)" *ngIf="message.text.trim() !== '' && (!isImage(message) || !isFrame(message))">
12
+ <ion-icon name="copy-outline"></ion-icon>
13
+ </div>
14
+ </div>
7
15
 
8
- <div>
16
+ <div >
9
17
 
10
18
  <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
11
19
  [style.color]="convertColorToRGBA(fontColor, 65)"
@@ -47,7 +55,7 @@
47
55
 
48
56
 
49
57
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
50
- <div *ngIf="message?.text">
58
+ <div *ngIf="message?.text" style="display: flex; margin: 0px 0px 0px 0px;">
51
59
 
52
60
  <chat-text *ngIf="message?.type !=='html'"
53
61
  [text]="message?.text"
@@ -5,12 +5,56 @@
5
5
  border-radius: 8px;
6
6
  padding: 0;
7
7
  word-wrap: break-word;
8
+ position: relative;
8
9
  // padding: 14px;
9
10
  // padding: 6px 6px 6px 6px;
10
11
  // box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
11
12
  // -webkit-animation: heartbeat 1.5s ease-in-out both;
12
13
  // animation: heartbeat 1.5s ease-in-out both;
13
14
 
15
+ &:hover{
16
+ .options-container > .copy-logo{
17
+ // display: flex;
18
+ visibility: visible;
19
+ }
20
+ }
21
+
22
+ .options-container{
23
+ display: flex;
24
+ position: absolute;
25
+ top: 0px;
26
+ right: -40px;
27
+ height: 16px;
28
+ // margin: 5px;
29
+ z-index: 2;
30
+
31
+ .copy-logo,
32
+ .info-logo{
33
+ // display: none;
34
+ display: flex;
35
+ visibility: hidden;
36
+ -webkit-box-align: center;
37
+ align-items: center;
38
+ -webkit-box-pack: center;
39
+ /* width: 20px; */
40
+ height: 16px;
41
+ border-radius: 3px;
42
+ color: rgb(135, 150, 175);
43
+ text-align: left;
44
+ justify-content: center;
45
+ font-size: initial;
46
+
47
+ &:hover{
48
+ cursor: pointer;
49
+ }
50
+ }
51
+
52
+ .info-logo{
53
+ display: flex;
54
+ visibility: visible;
55
+ }
56
+ }
57
+
14
58
  .message_sender_fullname{
15
59
  font-size: 12px;
16
60
  font-weight: 600;
@@ -25,6 +25,9 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
25
25
  @Output() onBeforeMessageRender = new EventEmitter();
26
26
  @Output() onAfterMessageRender = new EventEmitter();
27
27
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
28
+ @Output() onCopy = new EventEmitter<MessageModel>();
29
+ @Output() onInfo = new EventEmitter<MessageModel>();
30
+
28
31
  isImage = isImage;
29
32
  isFile = isFile;
30
33
  isFrame = isFrame;
@@ -178,6 +181,15 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
178
181
  }, showDelay);
179
182
  }
180
183
 
184
+
185
+ onClickCopyMesage(event, message){
186
+ this.onCopy.emit(message)
187
+ }
188
+
189
+ onClickInfoMessage(event, message){
190
+ this.onInfo.emit(message)
191
+ }
192
+
181
193
  // ========= begin:: event emitter function ============//
182
194
 
183
195
  // returnOpenAttachment(event: String) {
@@ -1022,7 +1022,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1022
1022
  this.sendEmail(msg).subscribe(status => {
1023
1023
  if(status){
1024
1024
  //SEND MESSAGE ALSO AS EMAIL
1025
- attributes['channel']= TYPE_MSG_EMAIL
1025
+ attributes['channel']= 'offline_'+TYPE_MSG_EMAIL
1026
1026
  }
1027
1027
 
1028
1028
  this.conversationHandlerService.sendMessage(