@chat21/chat21-web-widget 5.0.89-rc.2 → 5.0.89

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 (22) hide show
  1. package/CHANGELOG.md +7 -5
  2. package/package.json +1 -1
  3. package/src/app/app.module.ts +2 -5
  4. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +3 -14
  5. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +10 -26
  6. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +41 -123
  7. package/src/app/component/message/audio/audio.component.html +20 -0
  8. package/src/app/component/message/audio/audio.component.scss +122 -0
  9. package/src/app/component/message/{audio-track/audio-track.component.spec.ts → audio/audio.component.spec.ts} +6 -6
  10. package/src/app/component/message/audio/audio.component.ts +122 -0
  11. package/src/app/component/message/bubble-message/bubble-message.component.html +5 -30
  12. package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -7
  13. package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -1
  14. package/src/app/utils/globals.ts +1 -1
  15. package/src/assets/twp/index-dev.html +0 -1
  16. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +0 -29
  17. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +0 -103
  18. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +0 -23
  19. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +0 -96
  20. package/src/app/component/message/audio-track/audio-track.component.html +0 -32
  21. package/src/app/component/message/audio-track/audio-track.component.scss +0 -107
  22. package/src/app/component/message/audio-track/audio-track.component.ts +0 -147
package/CHANGELOG.md CHANGED
@@ -6,11 +6,13 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
- # 5.0.89-rc.2
10
- - minor fix
9
+ # 5.0.89 in PROD
11
10
 
12
- # 5.0.89-rc.1
13
- - **added**: remove recipientId from storage after conversation is closed
11
+ # 5.0.88 in PROD
12
+
13
+ # 5.0.87 in PROD
14
+
15
+ # 5.0.86 in PROD
14
16
 
15
17
  # 5.0.85-rc.2
16
18
  - **added**: loading progress indicator while closing a conversation
@@ -19,7 +21,7 @@
19
21
  - **added**: hide header restart menu option if conversation is closed
20
22
  - **removed**: continueConversationBeforeTime settings property
21
23
 
22
- # 5.0.85 in PROD
24
+ # 5.0.84 in PROD
23
25
 
24
26
  # 5.0.84-rc.4
25
27
  - **added**: checkAcceptedFile fn on dragleave event conversation-content component
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.89-rc.2",
4
+ "version": "5.0.89",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -15,7 +15,6 @@ import { ConversationContentComponent } from './component/conversation-detail/co
15
15
  import { ConversationFooterComponent } from './component/conversation-detail/conversation-footer/conversation-footer.component';
16
16
  import { ConversationInternalFrameComponent } from './component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component';
17
17
  import { ConversationPreviewComponent } from './component/conversation-detail/conversation-preview/conversation-preview.component';
18
- import { ConversationAudioRecorderComponent } from './component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component';
19
18
  /** CONVERSATION-DETAIL COMPONENTS */
20
19
  import { BubbleMessageComponent } from './component/message/bubble-message/bubble-message.component';
21
20
  import { AvatarComponent } from './component/message/avatar/avatar.component';
@@ -24,7 +23,7 @@ import { ImageComponent } from './component/message/image/image.component';
24
23
  import { InfoMessageComponent } from './component/message/info-message/info-message.component';
25
24
  import { HtmlComponent } from './component/message/html/html.component';
26
25
  import { FrameComponent } from './component/message/frame/frame.component';
27
- import { AudioTrackComponent } from './component/message/audio-track/audio-track.component';
26
+ import { AudioComponent } from './component/message/audio/audio.component';
28
27
  import { UserTypingComponent } from './../chat21-core/utils/user-typing/user-typing.component';
29
28
  /** MESSAGE ATTACHMENTS COMPONENTS */
30
29
  import { MessageAttachmentComponent } from './component/message-attachment/message-attachment.component';
@@ -139,7 +138,6 @@ import { ConfirmCloseComponent } from './modals/confirm-close/confirm-close.comp
139
138
 
140
139
 
141
140
 
142
-
143
141
  const appInitializerFn = (appConfig: AppConfigService, brandService: BrandService, logger: NGXLogger) => {
144
142
  return async() => {
145
143
  let customLogger = new CustomLogger(logger)
@@ -278,7 +276,6 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
278
276
  ConversationFooterComponent,
279
277
  ConversationPreviewComponent,
280
278
  ConversationInternalFrameComponent,
281
- ConversationAudioRecorderComponent,
282
279
  BubbleMessageComponent,
283
280
  AvatarComponent,
284
281
  FrameComponent,
@@ -290,7 +287,6 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
290
287
  ActionButtonComponent,
291
288
  LinkButtonComponent,
292
289
  TextButtonComponent,
293
- AudioTrackComponent,
294
290
  UserTypingComponent,
295
291
  /**DIRECTIVES */
296
292
  HtmlEntitiesEncodePipe,
@@ -299,6 +295,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
299
295
  SafeHtmlPipe,
300
296
  LikeUnlikeComponent,
301
297
  TooltipDirective,
298
+ AudioComponent,
302
299
  CarouselComponent,
303
300
  NetworkOfflineComponent,
304
301
  ConfirmCloseComponent
@@ -7,7 +7,7 @@
7
7
  <!-- TEXTAREA + ICONS: conv active-->
8
8
  <div class="textarea-container" *ngIf="!hideTextAreaContent && !hideTextReply">
9
9
 
10
- <div *ngIf="!isStopRec" class="icons-container">
10
+ <div class="icons-container">
11
11
  <!-- ICON ATTACHMENT -->
12
12
  <label *ngIf="showAttachmentButton == true" tabindex="1502" aria-label="allegati" for="chat21-file" class="chat21-textarea-button" [class.active]="!isFilePendingToUpload && !hideTextReply" id="chat21-start-upload-doc">
13
13
  <span class="v-align-center">
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
 
47
- <div *ngIf="!isStopRec" class="visible-text-area" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
47
+ <div class="visible-text-area" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
48
48
  <!-- isFilePendingToUpload || -->
49
49
  <textarea
50
50
  [attr.disabled] = "(hideTextReply)? true : null"
@@ -67,24 +67,13 @@
67
67
  </div>
68
68
 
69
69
  <!-- ICON SEND -->
70
- <div *ngIf="textInputTextArea && !isStopRec" tabindex="-1" class="chat21-textarea-button" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
70
+ <div tabindex="-1" class="chat21-textarea-button" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
71
71
  <span class="v-align-center">
72
72
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="24" width="24" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
73
73
  <path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
74
74
  </svg>
75
75
  </span>
76
76
  </div>
77
-
78
- <!-- ICON REC -->
79
- <div *ngIf="!textInputTextArea" tabindex="-1" class="chat21-audio-button" [class.active]="isStopRec" id="chat21-button-rec">
80
- <chat-audio-recorder
81
- (startRecordingEvent)="onStartRecording()"
82
- (deleteRecordingEvent)="onDeleteRecording()"
83
- (endRecordingEvent)="onEndRecording($event)"
84
- (sendRecordingEvent)="onSendRecording($event)"
85
- [stylesMap]="stylesMap">
86
- </chat-audio-recorder>
87
- </div>
88
77
  </div>
89
78
 
90
79
 
@@ -7,16 +7,14 @@
7
7
  display: flex;
8
8
  width: 100%;
9
9
  align-items: center;
10
- gap: 0px;
10
+ gap: 10px;
11
11
  justify-content: space-between;
12
12
  }
13
13
 
14
14
  .icons-container{
15
15
  display: flex;
16
16
  align-self: flex-end;
17
- margin-left: 8px;
18
- gap: 2px;
19
- margin-right: 8px;
17
+ margin-left: 8px
20
18
  }
21
19
 
22
20
  .visible-text-area {
@@ -33,6 +31,7 @@
33
31
  .chat21-textarea-button {
34
32
  fill: var(--icon-fill-color);
35
33
  pointer-events: auto;
34
+
36
35
  height: var(--chat-footer-height);
37
36
  bottom: 22px;
38
37
  opacity: 0.3;
@@ -186,29 +185,11 @@ textarea:active{
186
185
  }
187
186
 
188
187
  #chat21-button-send {
188
+ // right: 8px;
189
+ // bottom: 0;
189
190
  display: flex;
190
191
  align-self: flex-end;
191
- margin: 0 8px;
192
- width: 34px;
193
- text-align: center;
194
- justify-content: center;
195
- }
196
-
197
- #chat21-button-rec {
198
- display: flex;
199
- width: 34px;
200
- text-align: center;
201
- justify-content: center;
202
- height: var(--chat-footer-height);
203
- &.active{
204
- width: 100%;
205
- }
206
- chat-audio-recorder {
207
- width: 100%;
208
- display: flex;
209
- align-items: center;
210
- justify-content: center;
211
- }
192
+ margin: 0 8px
212
193
  }
213
194
 
214
195
  #chat21-file{
@@ -356,4 +337,7 @@ textarea:active{
356
337
  // left: 10px;
357
338
  border: none;
358
339
  margin: -2px -2px 0px;
359
- }
340
+
341
+ }
342
+
343
+
@@ -60,8 +60,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
60
60
  // ========= end:: send image ========= //
61
61
 
62
62
  // isNewConversation = true;
63
- isStartRec: boolean = false;
64
- isStopRec: boolean = false;
65
63
  textInputTextArea: string;
66
64
  conversationHandlerService: ConversationHandlerService
67
65
 
@@ -101,7 +99,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
101
99
  }
102
100
 
103
101
  ngAfterViewInit() {
104
- this.logger.log('[CONV-FOOTER] --------ngAfterViewInit: conversation-footer-------- ');
102
+ this.logger.debug('[CONV-FOOTER] --------ngAfterViewInit: conversation-footer-------- ');
105
103
  // setTimeout(() => {
106
104
  this.showEmojiPicker = true
107
105
  // }, 500);
@@ -111,18 +109,19 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
111
109
  // START LOAD IMAGE //
112
110
  /** load the selected image locally and open the pop up preview */
113
111
  detectFiles(event) {
114
- this.logger.log('[CONV-FOOTER] detectFiles: ', event);
112
+ this.logger.debug('[CONV-FOOTER] detectFiles: ', event);
113
+
115
114
  if (event) {
116
115
  this.selectedFiles = event.target.files;
117
- this.logger.log('[CONV-FOOTER] AppComponent:detectFiles::selectedFiles', this.selectedFiles);
116
+ this.logger.debug('[CONV-FOOTER] AppComponent:detectFiles::selectedFiles', this.selectedFiles);
118
117
  // this.onAttachmentButtonClicked.emit(this.selectedFiles)
119
118
  if (this.selectedFiles == null) {
120
119
  this.isFilePendingToUpload = false;
121
120
  } else {
122
121
  this.isFilePendingToUpload = true;
123
122
  }
124
- this.logger.log('[CONV-FOOTER] AppComponent:detectFiles::selectedFiles::isFilePendingToUpload', this.isFilePendingToUpload);
125
- this.logger.log('[CONV-FOOTER] fileChange: ', event.target.files);
123
+ this.logger.debug('[CONV-FOOTER] AppComponent:detectFiles::selectedFiles::isFilePendingToUpload', this.isFilePendingToUpload);
124
+ this.logger.debug('[CONV-FOOTER] fileChange: ', event.target.files);
126
125
  if (event.target.files.length <= 0) {
127
126
  this.isFilePendingToUpload = false;
128
127
  } else {
@@ -185,18 +184,16 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
185
184
  }
186
185
  }
187
186
 
188
-
189
-
190
187
 
191
188
  loadFile() {
192
- this.logger.log('[CONV-FOOTER] that.fileXLoad: ', this.arrayFilesLoad);
189
+ this.logger.debug('[CONV-FOOTER] that.fileXLoad: ', this.arrayFilesLoad);
193
190
  // at the moment I only manage the upload of one image at a time
194
191
  if (this.arrayFilesLoad[0] && this.arrayFilesLoad[0].file) {
195
192
  const fileXLoad = this.arrayFilesLoad[0].file;
196
193
  const uid = this.arrayFilesLoad[0].uid;
197
194
  const type = this.arrayFilesLoad[0].type;
198
195
  const size = this.arrayFilesLoad[0].size
199
- this.logger.log('[CONV-FOOTER] that.fileXLoad: ', type);
196
+ this.logger.debug('[CONV-FOOTER] that.fileXLoad: ', type);
200
197
  let metadata;
201
198
  if (type.startsWith('image') && !type.includes('svg')) {
202
199
  metadata = {
@@ -217,7 +214,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
217
214
  'size': size
218
215
  };
219
216
  }
220
- this.logger.log('[CONV-FOOTER] metadata -------> ', metadata);
217
+ this.logger.debug('[CONV-FOOTER] metadata -------> ', metadata);
221
218
  // this.scrollToBottom();
222
219
  // 1 - aggiungo messaggio localmente
223
220
  // this.addLocalMessageImage(metadata);
@@ -234,20 +231,17 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
234
231
 
235
232
  uploadSingle(metadata, file, messageText?: string) {
236
233
  const that = this;
237
- try {
238
- const send_order_btn = <HTMLInputElement>document.getElementById('chat21-start-upload-doc');
239
- send_order_btn.disabled = true;
240
- } catch (error) {
241
- that.logger.log('[CONV-FOOTER] error::', error);
242
- }
243
- that.logger.log('[CONV-FOOTER] AppComponent::uploadSingle::', metadata, file);
234
+ const send_order_btn = <HTMLInputElement>document.getElementById('chat21-start-upload-doc');
235
+ send_order_btn.disabled = true;
236
+ that.logger.debug('[CONV-FOOTER] AppComponent::uploadSingle::', metadata, file);
244
237
  // const file = this.selectedFiles.item(0);
245
238
  const currentUpload = new UploadModel(file);
239
+
246
240
  // const uploadTask = this.upSvc.pushUpload(currentUpload);
247
241
  // uploadTask.then(snapshot => {
248
242
  // return snapshot.ref.getDownloadURL(); // Will return a promise with the download link
249
243
  // }).then(downloadURL => {
250
- // that.logger.log('[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL', downloadURL]);
244
+ // that.logger.debug('[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL', downloadURL]);
251
245
  // that.g.wdLog([`Successfully uploaded file and got download link - ${downloadURL}`]);
252
246
 
253
247
  // metadata.src = downloadURL;
@@ -267,8 +261,8 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
267
261
  // this.resetLoadImage();
268
262
 
269
263
  this.uploadService.upload(this.senderId, currentUpload).then(data => {
270
- that.logger.log('[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL', data);
271
- that.logger.log(`[CONV-FOOTER] Successfully uploaded file and got download link - ${data}`);
264
+ that.logger.debug('[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL', data);
265
+ that.logger.debug(`[CONV-FOOTER] Successfully uploaded file and got download link - ${data}`);
272
266
 
273
267
  metadata.src = data.src;
274
268
  metadata.downloadURL = data.downloadURL;
@@ -297,7 +291,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
297
291
  that.logger.error(`[CONV-FOOTER] uploadSingle:: Failed to upload file and get link - ${error}`);
298
292
  that.isFilePendingToUpload = false;
299
293
  });
300
- that.logger.log('[CONV-FOOTER] reader-result: ', file);
294
+ that.logger.debug('[CONV-FOOTER] reader-result: ', file);
301
295
  }
302
296
 
303
297
  /**
@@ -310,7 +304,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
310
304
  sendMessage(msg: string, type: string, metadata?: any, additional_attributes?: any) { // sponziello
311
305
  (metadata) ? metadata = metadata : metadata = '';
312
306
  this.onEmojiiPickerShow.emit(false)
313
- this.logger.log('[CONV-FOOTER] SEND MESSAGE: ', msg, type, metadata, additional_attributes);
307
+ this.logger.debug('[CONV-FOOTER] SEND MESSAGE: ', msg, type, metadata, additional_attributes);
314
308
  if (msg && msg.trim() !== '' || type === TYPE_MSG_IMAGE || type === TYPE_MSG_FILE ) {
315
309
 
316
310
  // msg = htmlEntities(msg);
@@ -393,7 +387,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
393
387
  }
394
388
 
395
389
  private restoreTextArea() {
396
- // that.logger.log('[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea');
390
+ // that.logger.debug('[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea');
397
391
  this.resizeInputField();
398
392
  const textArea = (<HTMLInputElement>document.getElementById('chat21-main-message-context'));
399
393
  this.textInputTextArea = ''; // clear the textarea
@@ -403,7 +397,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
403
397
  if(textArea.style.height > this.HEIGHT_DEFAULT){
404
398
  document.getElementById('chat21-button-send').style.removeProperty('right')
405
399
  }
406
- this.logger.log('[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea::textArea:', 'restored');
400
+ this.logger.debug('[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea::textArea:', 'restored');
407
401
  }
408
402
  this.setFocusOnId('chat21-main-message-context');
409
403
  }
@@ -417,7 +411,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
417
411
  try {
418
412
  const target = document.getElementById('chat21-main-message-context') as HTMLInputElement;
419
413
  // tslint:disable-next-line:max-line-length
420
- // that.logger.log('[CONV-FOOTER] H:: this.textInputTextArea', (document.getElementById('chat21-main-message-context') as HTMLInputElement).value , target.style.height, target.scrollHeight, target.offsetHeight, target.clientHeight);
414
+ // that.logger.debug('[CONV-FOOTER] H:: this.textInputTextArea', (document.getElementById('chat21-main-message-context') as HTMLInputElement).value , target.style.height, target.scrollHeight, target.offsetHeight, target.clientHeight);
421
415
  target? target.style.height = '100%': null;
422
416
  if (target && target.value === '\n') {
423
417
  target.value = '';
@@ -437,104 +431,28 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
437
431
  }
438
432
  }
439
433
 
440
-
441
-
442
- onStartRecording() {
443
- this.isStartRec = true;
444
- this.isStopRec = false;
445
- }
446
-
447
- onDeleteRecording(){
448
- this.isStartRec = false;
449
- this.isStopRec = false;
450
- }
451
-
452
- onEndRecording(audioBlob: Blob | null) {
453
- this.isStartRec = false;
454
- this.isStopRec = true;
455
- }
456
-
457
-
458
-
459
- onSendRecording(audioBlob: Blob | null) {
460
- this.isStartRec = false;
461
- if (audioBlob) {
462
- this.convertBlobToBase64(audioBlob);
463
- this.isStopRec = false;
464
- } else {
465
- this.isStopRec = false;
466
- }
467
- }
468
-
469
-
470
-
471
- // Funzione per convertire Blob in Base64 usando FileReader
472
- async convertBlobToBase64(audioBlob: Blob) {
473
- let that = this;
474
- if (audioBlob) {
475
- this.isFilePendingToUpload = true;
476
- } else {
477
- this.isFilePendingToUpload = false;
478
- }
479
- const type = audioBlob.type;
480
- const size = audioBlob.size;
481
- const reader = new FileReader();
482
- reader.readAsDataURL(audioBlob);
483
- //reader.addEventListener('load', function () {
484
- reader.onloadend = () => {
485
- that.isFileSelected = true;
486
- // const base64data = reader.result as string;
487
- that.logger.log('[CONV-FOOTER] onload file');
488
- const fileXLoad = {
489
- src: reader.result.toString(),
490
- title: 'audio-file'
491
- };
492
- const uid = (new Date().getTime()).toString(36);
493
- that.arrayFilesLoad[0] = { uid: uid, file: fileXLoad, type: type, size: size };
494
- that.logger.log('[CONV-FOOTER] OK: ', that.arrayFilesLoad[0]);
495
- // SEND MESSAGE
496
- let metadata = {
497
- 'name': 'audio-file',
498
- 'src': fileXLoad.src,
499
- 'type': type,
500
- 'uid': uid,
501
- 'size': size
502
- };
503
-
504
- const file = new File([audioBlob], "audio-file.mp3", {
505
- type: audioBlob.type,
506
- lastModified: Date.now()
507
- });
508
-
509
- that.uploadSingle(metadata, file, '');
510
- };
511
- //}, false);
512
- }
513
-
514
-
515
-
516
434
  onTextAreaChange(){
517
435
  this.resizeInputField()
518
436
  this.setWritingMessages(this.textInputTextArea)
519
437
  }
520
438
 
521
439
  onSendPressed(event) {
522
- this.logger.log('[CONV-FOOTER] onSendPressed:event', event);
440
+ this.logger.debug('[CONV-FOOTER] onSendPressed:event', event);
523
441
  event.preventDefault();
524
- this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
442
+ this.logger.debug('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
525
443
  if (this.isFilePendingToUpload) {
526
- this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed', 'is a file');
444
+ this.logger.debug('[CONV-FOOTER] AppComponent::onSendPressed', 'is a file');
527
445
  // its a file
528
446
  this.loadFile();
529
447
  this.isFilePendingToUpload = false;
530
448
  // disabilito pulsanti
531
- this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
449
+ this.logger.debug('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
532
450
  } else {
533
451
  if ( this.textInputTextArea && this.textInputTextArea.length > 0 ) {
534
- this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed', 'is a message');
452
+ this.logger.debug('[CONV-FOOTER] AppComponent::onSendPressed', 'is a message');
535
453
  // its a message
536
454
  if (this.textInputTextArea.trim() !== '') {
537
- // that.logger.log('[CONV-FOOTER] sendMessage -> ', this.textInputTextArea);
455
+ // that.logger.debug('[CONV-FOOTER] sendMessage -> ', this.textInputTextArea);
538
456
  // this.resizeInputField();
539
457
  // this.messagingService.sendMessage(msg, TYPE_MSG_TEXT);
540
458
  // this.setDepartment();
@@ -608,7 +526,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
608
526
  setTimeout(function () {
609
527
  const textarea = document.getElementById(id);
610
528
  if (textarea) {
611
- // that.logger.log('[CONV-FOOTER] 1--------> FOCUSSSSSS : ', textarea);
529
+ // that.logger.debug('[CONV-FOOTER] 1--------> FOCUSSSSSS : ', textarea);
612
530
  textarea.setAttribute('value', ' ');
613
531
  textarea.focus();
614
532
  }
@@ -648,7 +566,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
648
566
  this.textInputTextArea = ((document.getElementById('chat21-main-message-context') as HTMLInputElement).value);
649
567
  if (keyCode === 13) { // ENTER pressed
650
568
  if (this.textInputTextArea && this.textInputTextArea.trim() !== '') {
651
- // that.logger.log('[CONV-FOOTER] sendMessage -> ', this.textInputTextArea);
569
+ // that.logger.debug('[CONV-FOOTER] sendMessage -> ', this.textInputTextArea);
652
570
  // this.resizeInputField();
653
571
  // this.messagingService.sendMessage(msg, TYPE_MSG_TEXT);
654
572
  // this.setDepartment();
@@ -680,14 +598,14 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
680
598
  this.resizeInputField()
681
599
  const items = (event.clipboardData || event.originalEvent.clipboardData).items;
682
600
  let file = null;
683
- this.logger.log('[CONV-FOOTER] onPaste items ', items);
601
+ this.logger.debug('[CONV-FOOTER] onPaste items ', items);
684
602
  for (const item of items) {
685
- this.logger.log('[CONV-FOOTER] onPaste item ', item);
686
- this.logger.log('[CONV-FOOTER] onPaste item.type ', item.type);
603
+ this.logger.debug('[CONV-FOOTER] onPaste item ', item);
604
+ this.logger.debug('[CONV-FOOTER] onPaste item.type ', item.type);
687
605
  if (item.type.startsWith("image")) {
688
606
  // SEND TEXT MESSAGE IF EXIST
689
607
  // if(this.textInputTextArea){
690
- // this.logger.log('[CONV-FOOTER] onPaste texttt ', this.textInputTextArea);
608
+ // this.logger.debug('[CONV-FOOTER] onPaste texttt ', this.textInputTextArea);
691
609
  // this.sendMessage(this.textInputTextArea, TYPE_MSG_TEXT)
692
610
  // }
693
611
 
@@ -697,12 +615,12 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
697
615
  this.logger.error('[CONV-FOOTER] onPaste - error while restoring textArea:',e)
698
616
  }
699
617
 
700
- this.logger.log('[CONV-FOOTER] onPaste item.type', item.type);
618
+ this.logger.debug('[CONV-FOOTER] onPaste item.type', item.type);
701
619
  file = item.getAsFile();
702
620
  const data = {target: new ClipboardEvent('').clipboardData || new DataTransfer()};
703
621
  data.target.items.add(new File([file], file.name, { type: file.type }));
704
- this.logger.log('[CONV-FOOTER] onPaste data', data);
705
- this.logger.log('[CONV-FOOTER] onPaste file ', file);
622
+ this.logger.debug('[CONV-FOOTER] onPaste data', data);
623
+ this.logger.debug('[CONV-FOOTER] onPaste file ', file);
706
624
  this.detectFiles(data)
707
625
  }
708
626
  }
@@ -711,15 +629,15 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
711
629
  onDrop(event){
712
630
  const items = event.dataTransfer.files;
713
631
  let file = null;
714
- this.logger.log('[CONV-FOOTER] onDrop items ', items);
632
+ this.logger.debug('[CONV-FOOTER] onDrop items ', items);
715
633
  for (const item of items) {
716
- this.logger.log('[CONV-FOOTER] onDrop item ', item);
717
- this.logger.log('[CONV-FOOTER] onDrop item.type ', item.type);
634
+ this.logger.debug('[CONV-FOOTER] onDrop item ', item);
635
+ this.logger.debug('[CONV-FOOTER] onDrop item.type ', item.type);
718
636
 
719
637
  const data = {target: {files: new DataTransfer()}}
720
638
  data.target.files = items
721
- this.logger.log('[CONV-FOOTER] onDrop data', data);
722
- this.logger.log('[CONV-FOOTER] onDrop file ', file);
639
+ this.logger.debug('[CONV-FOOTER] onDrop data', data);
640
+ this.logger.debug('[CONV-FOOTER] onDrop file ', file);
723
641
  this.detectFiles(data)
724
642
  }
725
643
  }
@@ -0,0 +1,20 @@
1
+
2
+
3
+ <div id="audio_container" #audio_container>
4
+
5
+ <audio aria-label="traccia audio" #audio_msg controls controlsList="nodownload" id="audio_msg" (pause)="pauseAudioMsg($event)" (play)="playAudioMsg($event)" (timeupdate)="updateTimeAudioMsg($event)">
6
+ <source [src]="metadata?.src" [type]="metadata?.type">
7
+ <!-- {{metadata?.src}} -->
8
+ <!-- controlsList="nodownload" -->
9
+ </audio>
10
+
11
+ <!-- <button id="play-icon" (click)="onPlayPause('play')" *ngIf="status === 'play'">
12
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M10 8.64L15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z"/></svg>
13
+ </button>
14
+ <button id="pause-icon" (click)="onPlayPause('pause')" *ngIf="status === 'pause'">
15
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>
16
+ </button>
17
+ <div id="duration" #duration>0:00</div>
18
+ <input type="range" id="seek-slider" max="100" value="0"> -->
19
+ </div>
20
+
@@ -0,0 +1,122 @@
1
+ #audio_container{
2
+ display: flex;
3
+ }
4
+
5
+ #play-icon,
6
+ #pause-icon {
7
+ margin: 20px 2.5% 10px 2.5%;
8
+ }
9
+
10
+ .time {
11
+ display: inline-block;
12
+ width: 37px;
13
+ text-align: center;
14
+ font-size: 20px;
15
+ margin: 28.5px 0 18.5px 0;
16
+ float: left;
17
+ }
18
+ output {
19
+ display: inline-block;
20
+ width: 32px;
21
+ text-align: center;
22
+ font-size: 20px;
23
+ margin: 10px 2.5% 0 5%;
24
+ float: left;
25
+ clear: left;
26
+ }
27
+
28
+ input[type="range"] {
29
+ position: relative;
30
+ -webkit-appearance: none;
31
+ width: 48%;
32
+ margin: 0;
33
+ padding: 0;
34
+ height: 19px;
35
+ margin: 30px 2.5% 20px 2.5%;
36
+ float: left;
37
+ outline: none;
38
+ }
39
+ input[type="range"]::-webkit-slider-runnable-track {
40
+ width: 100%;
41
+ height: 3px;
42
+ cursor: pointer;
43
+ background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
44
+ }
45
+ input[type="range"]::before {
46
+ position: absolute;
47
+ content: "";
48
+ top: 8px;
49
+ left: 0;
50
+ width: var(--seek-before-width);
51
+ height: 3px;
52
+ background-color: #007db5;
53
+ cursor: pointer;
54
+ }
55
+ input[type="range"]::-webkit-slider-thumb {
56
+ position: relative;
57
+ -webkit-appearance: none;
58
+ box-sizing: content-box;
59
+ border: 1px solid #007db5;
60
+ height: 15px;
61
+ width: 15px;
62
+ border-radius: 50%;
63
+ background-color: #fff;
64
+ cursor: pointer;
65
+ margin: -7px 0 0 0;
66
+ }
67
+ input[type="range"]:active::-webkit-slider-thumb {
68
+ transform: scale(1.2);
69
+ background: #007db5;
70
+ }
71
+ input[type="range"]::-moz-range-track {
72
+ width: 100%;
73
+ height: 3px;
74
+ cursor: pointer;
75
+ background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
76
+ }
77
+ input[type="range"]::-moz-range-progress {
78
+ background-color: #007db5;
79
+ }
80
+ input[type="range"]::-moz-focus-outer {
81
+ border: 0;
82
+ }
83
+ input[type="range"]::-moz-range-thumb {
84
+ box-sizing: content-box;
85
+ border: 1px solid #007db5;
86
+ height: 15px;
87
+ width: 15px;
88
+ border-radius: 50%;
89
+ background-color: #fff;
90
+ cursor: pointer;
91
+ }
92
+ input[type="range"]:active::-moz-range-thumb {
93
+ transform: scale(1.2);
94
+ background: #007db5;
95
+ }
96
+ input[type="range"]::-ms-track {
97
+ width: 100%;
98
+ height: 3px;
99
+ cursor: pointer;
100
+ background: transparent;
101
+ border: solid transparent;
102
+ color: transparent;
103
+ }
104
+ input[type="range"]::-ms-fill-lower {
105
+ background-color: #007db5;
106
+ }
107
+ input[type="range"]::-ms-fill-upper {
108
+ background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));
109
+ }
110
+ input[type="range"]::-ms-thumb {
111
+ box-sizing: content-box;
112
+ border: 1px solid #007db5;
113
+ height: 15px;
114
+ width: 15px;
115
+ border-radius: 50%;
116
+ background-color: #fff;
117
+ cursor: pointer;
118
+ }
119
+ input[type="range"]:active::-ms-thumb {
120
+ transform: scale(1.2);
121
+ background: #007db5;
122
+ }