@chat21/chat21-web-widget 5.0.65 → 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 +3 -0
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.html +1 -0
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.scss +0 -0
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +23 -0
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.ts +10 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +1 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +27 -3
- package/src/app/utils/globals.ts +1 -1
- package/src/assets/js/chat21client.js +6 -6
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +2 -2
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.html
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p>conversation-emojii works!</p>
|
package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.scss
ADDED
|
File without changes
|
|
@@ -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
|
+
});
|
package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.ts
ADDED
|
@@ -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
|
+
}
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html
CHANGED
|
@@ -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"
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts
CHANGED
|
@@ -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
|
}
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
this.chat21Service.chatClient.ImHere()
|
|
77
|
+
}, 2000);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|