@chat21/chat21-web-widget 5.0.65-rc.1 → 5.0.66

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,10 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.66 in PROD
4
+ - added: LWT e imHere() for presence management
5
+
6
+ ### 5.0.65 in PROD
7
+
3
8
  ### 5.0.65-rc.1
4
9
  - added: disconnectTime tiledesk property to manage the time before disconnecting from messaging system if no interaction is fired while the widget is in closed status
5
10
  - bug-fixed: numbered list reduce the font-size of the bubble-message
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.65-rc.1",
4
+ "version": "5.0.66",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ConversationEmojiiComponent } from './conversation-emojii.component';
4
+
5
+ describe('ConversationEmojiiComponent', () => {
6
+ let component: ConversationEmojiiComponent;
7
+ let fixture: ComponentFixture<ConversationEmojiiComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ConversationEmojiiComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ConversationEmojiiComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,10 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'chat-conversation-emojii',
5
+ templateUrl: './conversation-emojii.component.html',
6
+ styleUrls: ['./conversation-emojii.component.scss']
7
+ })
8
+ export class ConversationEmojiiComponent {
9
+
10
+ }
@@ -78,7 +78,7 @@
78
78
 
79
79
 
80
80
  <!-- EMOJII PICKER-->
81
- <div [style.visibility]="isEmojiiPickerShow?'visible':'hidden'" class="emoji-container">
81
+ <div [style.visibility]="isEmojiiPickerShow?'visible':'hidden'" class="emoji-container" id="emoji-mart-container" #emoji_mart_container>
82
82
  <emoji-mart id="emoji-mart"
83
83
  *ngIf="showEmojiPicker"
84
84
  class="emoji-mart"
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
1
+ import { Component, ComponentFactoryResolver, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
2
2
  import { Globals } from 'src/app/utils/globals';
3
3
  import { MessageModel } from 'src/chat21-core/models/message';
4
4
  import { UploadModel } from 'src/chat21-core/models/upload';
@@ -48,7 +48,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
48
48
  @Output() onBackButton = new EventEmitter()
49
49
 
50
50
  @ViewChild('chat21_file') public chat21_file: ElementRef;
51
-
51
+ @ViewChild('emoji_mart_container', {read: ViewContainerRef}) public divEmojiiContainer: ViewContainerRef;
52
52
  // ========= begin:: send image ======= //
53
53
  selectedFiles: FileList;
54
54
  isFilePendingToUpload: Boolean = false;
@@ -62,6 +62,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
62
62
  conversationHandlerService: ConversationHandlerService
63
63
 
64
64
  showEmojiPicker: boolean = false; //To show/hide emoji picker
65
+ loadPickerModule: boolean = true;
65
66
  emojiiOptions = {
66
67
  emojiPerLine : 9,
67
68
  totalFrequentLines: 1,
@@ -450,7 +451,30 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
450
451
  }
451
452
  }
452
453
 
453
- onEmojiiPickerClicked(){
454
+ async onEmojiiPickerClicked(){
455
+ // if(this.loadPickerModule){
456
+ // this.loadPickerModule = false;
457
+ // const { default: PickerModule} = await import("@ctrl/ngx-emoji-mart");
458
+ // import('../conversation-emojii/conversation-emojii.component').then(({ConversationEmojiiComponent})=> {
459
+ // this.divEmojiiContainer.clear();
460
+ // const instance = this.divEmojiiContainer.createComponent(ConversationEmojiiComponent);
461
+ // this.divEmojiiContainer.createEmbeddedView()
462
+ // this.divEmojiiContainer.insert(instance.hostView);
463
+ // });
464
+ // // this.divEmojiiContainer.nativeElement.insertAdjacentHTML('afterbegin', '<emoji-mart id="emoji-mart"' +
465
+ // // // '*ngIf="showEmojiPicker"'+
466
+ // // 'class="emoji-mart"'+
467
+ // // '[showPreview]="emojiiOptions?.showPreview"'+
468
+ // // // '[color]="stylesMap?.get("themeColor")"' +
469
+ // // '[perLine]="emojiiOptions?.emojiPerLine"'+
470
+ // // '[totalFrequentLines]="emojiiOptions?.totalFrequentLines"'+
471
+ // // '[enableSearch]="emojiiOptions?.enableSearch"'+
472
+ // // '[darkMode]="emojiiOptions?.darkMode"'+
473
+ // // '[include]="emojiiOptions?.include"'+
474
+ // // '(emojiSelect)="addEmoji($event)">'+
475
+ // // '</emoji-mart>')
476
+
477
+ // }
454
478
  //OPEN EMOJII PICKER
455
479
  this.onEmojiiPickerShow.emit(!this.isEmojiiPickerShow)
456
480
  }
@@ -4,7 +4,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
4
4
 
5
5
  // services
6
6
  import { Globals } from '../utils/globals';
7
- import { convertColorToRGBA, detectIfIsMobile, getImageUrlThumb, getParameterByName, stringToBoolean } from '../utils/utils';
7
+ import { convertColorToRGBA, detectIfIsMobile, getImageUrlThumb, getParameterByName, stringToBoolean, stringToNumber } from '../utils/utils';
8
8
 
9
9
  import { TemplateBindingParseResult } from '@angular/compiler';
10
10
  import { AppStorageService } from '../../chat21-core/providers/abstract/app-storage.service';
@@ -1740,7 +1740,7 @@ export class GlobalSettingsService {
1740
1740
 
1741
1741
  TEMP = getParameterByName(windowContext, 'tiledesk_disconnetTime');
1742
1742
  if (TEMP) {
1743
- globals.disconnetTime = +TEMP;
1743
+ globals.disconnetTime = stringToNumber(TEMP);
1744
1744
  }
1745
1745
 
1746
1746
  }
@@ -389,7 +389,7 @@ export class Globals {
389
389
  /**enable user to set a telegram number to chat with */
390
390
  this.fileUploadAccept = "image/*,.pdf,.txt"
391
391
  /**enable auto disconnect from messaging after a defined amount of time (s)*/
392
- this.disconnetTime = 10
392
+ this.disconnetTime = 60
393
393
 
394
394
  this.showWaitTime = true;
395
395
 
@@ -979,12 +979,12 @@ class Chat21Client {
979
979
  // clean: true,
980
980
  reconnectPeriod: 1000,
981
981
  // connectTimeout: 30 * 1000,
982
- // will: {
983
- // topic: this.presence_topic,
984
- // payload: '{"disconnected":true}',
985
- // qos: 1,
986
- // retain: true
987
- // },
982
+ will: {
983
+ topic: this.presence_topic,
984
+ payload: '{"disconnected":true}',
985
+ qos: 1,
986
+ retain: true
987
+ },
988
988
  clientId: this.client_id,
989
989
  username: 'JWT',
990
990
  password: jwt,
@@ -115,7 +115,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
115
115
  return;
116
116
  }
117
117
 
118
- if (msg.attributes && msg.attributes.commands && msg.attributes.commands.lenght > 0 ) {
118
+ if (msg.attributes && msg.attributes.commands) {
119
119
  this.logger.debug('[MQTTConversationHandlerSERVICE] splitted message::::', this.messages, msg)
120
120
  this.addCommandMessage(msg)
121
121
  } else {
@@ -143,7 +143,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
143
143
  // return;
144
144
  // }
145
145
 
146
- if (msg.attributes && msg.attributes.commands && msg.attributes.commands.lenght > 0) {
146
+ if (msg.attributes && msg.attributes.commands) {
147
147
  this.logger.debug('[MQTTConversationHandlerSERVICE] splitted message::::', msg)
148
148
  this.addCommandMessage(msg)
149
149
  } else {
@@ -72,9 +72,9 @@ export class MQTTPresenceService extends PresenceService {
72
72
 
73
73
  public imHere(): void {
74
74
  this.logger.debug('[MQTT-PRESENCE] imHere', this.tenant);
75
- // setTimeout(() => {
76
- // this.chat21Service.chatClient.ImHere()
77
- // }, 2000);
75
+ setTimeout(() => {
76
+ this.chat21Service.chatClient.ImHere()
77
+ }, 2000);
78
78
  }
79
79
 
80
80
  /**