livechat-assistant 0.0.9 → 0.1.0

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 (64) hide show
  1. package/fesm2022/livechat-assistant.mjs +445 -0
  2. package/fesm2022/livechat-assistant.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/components/chat-history/chat-history.component.d.ts +94 -0
  5. package/lib/components/chat-widget/chat-widget.component.d.ts +17 -0
  6. package/lib/components/help-support/help-support.component.d.ts +15 -0
  7. package/lib/components/home/home.component.d.ts +8 -0
  8. package/lib/components/index.d.ts +2 -0
  9. package/lib/components/message/message.component.d.ts +16 -0
  10. package/lib/components/success-message/success-message.component.d.ts +15 -0
  11. package/lib/components/support-buttons/support-buttons.component.d.ts +12 -0
  12. package/lib/environment/environment.test.d.ts +15 -0
  13. package/lib/livechat-assistant.component.d.ts +5 -0
  14. package/lib/livechat-assistant.service.d.ts +6 -0
  15. package/lib/services/index.d.ts +1 -0
  16. package/lib/services/request.d.ts +12 -0
  17. package/lib/utilities/helper.d.ts +9 -0
  18. package/lib/utilities/index.d.ts +1 -0
  19. package/package.json +26 -19
  20. package/public-api.d.ts +5 -0
  21. package/ng-package.json +0 -10
  22. package/src/lib/components/chat-history/chat-history.component.html +0 -83
  23. package/src/lib/components/chat-history/chat-history.component.scss +0 -0
  24. package/src/lib/components/chat-history/chat-history.component.spec.ts +0 -23
  25. package/src/lib/components/chat-history/chat-history.component.ts +0 -97
  26. package/src/lib/components/chat-widget/chat-widget.component.html +0 -87
  27. package/src/lib/components/chat-widget/chat-widget.component.scss +0 -77
  28. package/src/lib/components/chat-widget/chat-widget.component.spec.ts +0 -23
  29. package/src/lib/components/chat-widget/chat-widget.component.ts +0 -84
  30. package/src/lib/components/help-support/help-support.component.html +0 -106
  31. package/src/lib/components/help-support/help-support.component.scss +0 -0
  32. package/src/lib/components/help-support/help-support.component.spec.ts +0 -23
  33. package/src/lib/components/help-support/help-support.component.ts +0 -46
  34. package/src/lib/components/home/home.component.html +0 -64
  35. package/src/lib/components/home/home.component.scss +0 -0
  36. package/src/lib/components/home/home.component.spec.ts +0 -23
  37. package/src/lib/components/home/home.component.ts +0 -18
  38. package/src/lib/components/index.ts +0 -2
  39. package/src/lib/components/message/message.component.html +0 -119
  40. package/src/lib/components/message/message.component.scss +0 -0
  41. package/src/lib/components/message/message.component.spec.ts +0 -23
  42. package/src/lib/components/message/message.component.ts +0 -48
  43. package/src/lib/components/success-message/success-message.component.html +0 -33
  44. package/src/lib/components/success-message/success-message.component.scss +0 -65
  45. package/src/lib/components/success-message/success-message.component.spec.ts +0 -23
  46. package/src/lib/components/success-message/success-message.component.ts +0 -34
  47. package/src/lib/components/support-buttons/support-buttons.component.html +0 -42
  48. package/src/lib/components/support-buttons/support-buttons.component.scss +0 -49
  49. package/src/lib/components/support-buttons/support-buttons.component.spec.ts +0 -21
  50. package/src/lib/components/support-buttons/support-buttons.component.ts +0 -33
  51. package/src/lib/environment/environment.test.ts +0 -15
  52. package/src/lib/livechat-assistant.component.spec.ts +0 -23
  53. package/src/lib/livechat-assistant.component.ts +0 -15
  54. package/src/lib/livechat-assistant.service.spec.ts +0 -16
  55. package/src/lib/livechat-assistant.service.ts +0 -9
  56. package/src/lib/services/index.ts +0 -1
  57. package/src/lib/services/request.ts +0 -58
  58. package/src/lib/utilities/helper.ts +0 -23
  59. package/src/lib/utilities/index.ts +0 -1
  60. package/src/public-api.ts +0 -10
  61. package/src/styles.css +0 -5
  62. package/tsconfig.lib.json +0 -15
  63. package/tsconfig.lib.prod.json +0 -11
  64. package/tsconfig.spec.json +0 -15
@@ -1,119 +0,0 @@
1
- <div class="flex flex-col rounded-xl" [class]="noMessage ? 'max-h-[600px]' : 'h-[600px]'">
2
- <div
3
- class="flex items-center justify-between px-4 py-3 dark:bg-neutral-700/20 shadow-xl bg-neutral-50 hover:bg-neutral-800/50 rounded-xl">
4
- <div class="flex items-center gap-3">
5
- <button class="cursor-pointer" (click)="return(4)">
6
- <svg class="w-5 h-5 text-neutral-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
7
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
8
- </svg>
9
- </button>
10
- <img src="https://ui-avatars.com/api/?name=Costa+Quinn&background=0D8ABC&color=fff"
11
- class="w-10 h-10 rounded-full" alt="Agent">
12
- <div>
13
- <h3 class="font-semibold text-neutral-800 dark:text-neutral-200 fs-16">AI Bot</h3>
14
- <p class="text-green-300/80 fs-14">Online</p>
15
- </div>
16
- </div>
17
- </div>
18
-
19
-
20
- <div class="text-center h-full flex flex-col justify-center items-center relative animate-scale-in">
21
- <h2 class="text-2xl font-bold text-gray-800 mb-2 dark:text-neutral-200">Hey Penny!</h2>
22
- <p class="text-gray-600 text-sm dark:text-neutral-200/80">
23
- You can ask me anything.
24
- </p>
25
- </div>
26
-
27
-
28
- @if(noMessage) {
29
- <div class="flex-1 overflow-y-auto px-4 py-6 space-y-4 hideScroll">
30
- @for (message of messages; track $index) {
31
- <div [class.flex-row-reverse]="message.sender === 'customer'" class="flex gap-3 items-start">
32
-
33
- @if (message.sender === 'agent') {
34
- <img src="https://ui-avatars.com/api/?name=Costa+Quinn&background=0D8ABC&color=fff"
35
- class="w-8 h-8 rounded-full flex-shrink-0" alt="Avatar" />
36
- }
37
-
38
- <div [class.items-end]="message.sender === 'customer'" class="flex flex-col max-w-xs">
39
-
40
- <div [class.bg-blue-600]="message.sender === 'customer'"
41
- [class.text-white]="message.sender === 'customer'" [class.bg-white]="message.sender === 'agent'"
42
- [class.text-gray-800]="message.sender === 'agent'" class="rounded-2xl px-4 py-2.5 shadow-sm">
43
- <p class="text-sm whitespace-pre-wrap fs-16 ">{{ message.text }}</p>
44
- </div>
45
- <span class="text-sm text-neutral-300 mt-1 px-1">{{ message.time }}</span>
46
- </div>
47
- </div>
48
- }
49
-
50
-
51
-
52
- @if (isTyping) {
53
- <div class="flex gap-3 items-start">
54
- <img src="https://ui-avatars.com/api/?name=Costa+Quinn&background=0D8ABC&color=fff"
55
- class="w-8 h-8 rounded-full" alt="Agent">
56
- <div class="bg-white rounded-2xl px-4 py-3 shadow-sm">
57
- <div class="flex gap-1">
58
- <span class="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></span>
59
- <span class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.2s"></span>
60
- <span class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.4s"></span>
61
- </div>
62
- </div>
63
- </div>
64
- }
65
- </div>
66
- }
67
- <div>
68
- <div class="flex flex-wrap justify-center gap-1.5 sm:gap-2 bg-transparent scroll-xcontainer">
69
- @for (suggestion of suggestions; track $index) {
70
- <button (click)="newMessage = suggestion; onSendMessage()" class="py-1.5 px-2.5 inline-flex items-center gap-x-1.5 text-sm bg-linear-to-tl from-blue-500 to-blue-800 text-white rounded-lg focus:outline-hidden ">
71
- {{ suggestion }}
72
- </button>
73
- }
74
- </div>
75
- </div>
76
-
77
- <div class="px-4">
78
-
79
- <div class="flex justify-between items-center w-full py-2.5">
80
- <div class="flex gap-2 w-full">
81
- <button (click)="fileInput.click()"
82
- class="text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100">
83
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
84
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
85
- d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
86
- </svg>
87
- </button>
88
- <input #fileInput type="file" class="hidden" (change)="onFileSelect($event)">
89
-
90
- <button class="text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100">
91
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
92
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
93
- d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
94
- </svg>
95
- </button>
96
-
97
- <input [(ngModel)]="newMessage" (keyup.enter)="onSendMessage()" type="text"
98
- placeholder="Type a message..."
99
- class="flex-1 py-3 dark:text-white text-black rounded-md fs-16 focus:outline-none focus:ring-0 focus:ring-none w-full" />
100
- </div>
101
-
102
- <div class="flex gap-2 justify-end">
103
- <button (click)="onSendMessage()" [disabled]="!newMessage.trim()"
104
- class="bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed p-2">
105
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
106
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
107
- d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
108
- </svg>
109
- </button>
110
- <button class="text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100">
111
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
112
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
113
- d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" />
114
- </svg>
115
- </button>
116
- </div>
117
- </div>
118
- </div>
119
- </div>
File without changes
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { MessageComponent } from './message.component';
4
-
5
- describe('MessageComponent', () => {
6
- let component: MessageComponent;
7
- let fixture: ComponentFixture<MessageComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [MessageComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(MessageComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,48 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
2
- import { FormsModule } from '@angular/forms';
3
-
4
- @Component({
5
- selector: 'app-message',
6
- imports: [FormsModule],
7
- templateUrl: './message.component.html',
8
- styleUrl: './message.component.scss',
9
- standalone: true,
10
- changeDetection: ChangeDetectionStrategy.OnPush,
11
- })
12
- export class MessageComponent {
13
- newMessage = '';
14
- noMessage = false;
15
- @Input() isTyping = false;
16
- @Input() messages: any;
17
- @Input() suggestions: string[] = ['Health', 'Learn', 'Technology', 'Science'];
18
-
19
- @Output() sendMessage = new EventEmitter();
20
- @Output() navigate= new EventEmitter<number>();
21
-
22
- onSendMessage() {
23
- if (this.newMessage.trim()) {
24
- this.sendMessage.emit(this.newMessage);
25
- this.newMessage = '';
26
- this.noMessage = true
27
- }
28
- }
29
-
30
- onFileSelect(event: any) {
31
- const file = event.target.files[0];
32
- if (file) {
33
- console.log('File selected:', file.name);
34
- // Handle file upload here
35
- }
36
- }
37
-
38
- return(tabIndex:number) {
39
- this.navigate.emit(tabIndex);
40
- }
41
-
42
- // private scrollToBottom(): void {
43
- // if (this.messagesContainer) {
44
- // const element = this.messagesContainer.nativeElement;
45
- // element.scrollTop = element.scrollHeight;
46
- // }
47
- // }
48
- }
@@ -1,33 +0,0 @@
1
- <div class="bg-white rounded-lg h-[600px]">
2
- <div class="confetti-container">
3
- @for (confetti of confettiArray; track $index) {
4
- <div
5
- [style.left.%]="confetti.left"
6
- [style.animation-delay.s]="confetti.delay"
7
- [style.background-color]="confetti.color"
8
- class="confetti">
9
- </div>
10
- }
11
- </div>
12
-
13
- <div class="p-4 text-center h-full flex flex-col justify-center items-center relative animate-scale-in">
14
- <div class="mb-6 flex justify-center items-center">
15
- <div class="w-16 h-16 bg-teal-100 rounded-full flex items-center justify-center animate-bounce-in">
16
- <svg class="w-8 h-8 text-teal-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
17
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/>
18
- </svg>
19
- </div>
20
- </div>
21
-
22
- <!-- Title -->
23
- <h2 class="text-2xl font-bold text-gray-800 mb-4">Email Delivered!</h2>
24
- <p class="text-gray-600 text-sm mb-2">
25
- You're set on chatting with an online agent or ask your our AI robot your questions.
26
- </p>
27
-
28
- <button (click)="navigateToTab(2)" class="mt-6 bg-blue-600 text-white px-8 py-3 rounded-lg font-medium hover:bg-blue-700 transition">
29
- Start a new chat
30
- </button>
31
-
32
- </div>
33
- </div>
@@ -1,65 +0,0 @@
1
- .confetti-container {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 100%;
7
- pointer-events: none;
8
- overflow: hidden;
9
- z-index: 51;
10
- }
11
-
12
- .confetti {
13
- position: absolute;
14
- width: 10px;
15
- height: 10px;
16
- top: -10%;
17
- opacity: 0;
18
- animation: confetti-fall 3s linear forwards;
19
- }
20
-
21
- @keyframes confetti-fall {
22
- 0% {
23
- top: -10%;
24
- opacity: 1;
25
- transform: translateX(0) rotateZ(0deg);
26
- }
27
- 100% {
28
- top: 100%;
29
- opacity: 0;
30
- transform: translateX(100px) rotateZ(720deg);
31
- }
32
- }
33
-
34
- @keyframes scale-in {
35
- 0% {
36
- transform: scale(0.7);
37
- opacity: 0;
38
- }
39
- 100% {
40
- transform: scale(1);
41
- opacity: 1;
42
- }
43
- }
44
-
45
- @keyframes bounce-in {
46
- 0% {
47
- transform: scale(0);
48
- }
49
- 50% {
50
- transform: scale(1.2);
51
- }
52
- 100% {
53
- transform: scale(1);
54
- }
55
- }
56
-
57
- .animate-scale-in {
58
- animation: scale-in 0.4s ease-out;
59
- }
60
-
61
- .animate-bounce-in {
62
- animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
63
- animation-delay: 0.2s;
64
- animation-fill-mode: backwards;
65
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { SuccessMessageComponent } from './success-message.component';
4
-
5
- describe('SuccessMessageComponent', () => {
6
- let component: SuccessMessageComponent;
7
- let fixture: ComponentFixture<SuccessMessageComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [SuccessMessageComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(SuccessMessageComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,34 +0,0 @@
1
- import { Component, ChangeDetectionStrategy, EventEmitter, Output, } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'app-success-message',
5
- imports: [],
6
- templateUrl: './success-message.component.html',
7
- styleUrl: './success-message.component.scss',
8
- standalone: true,
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- })
11
- export class SuccessMessageComponent {
12
-
13
- @Output() navigate= new EventEmitter<number>();
14
- confettiArray: Array<{left: number, delay: number, color: string}> = [];
15
-
16
- ngOnInit() {
17
- this.generateConfetti();
18
- }
19
-
20
- navigateToTab(tabIndex:number) {
21
- this.navigate.emit(tabIndex);
22
- }
23
- generateConfetti() {
24
- const colors = ['#10B981', '#3B82F6', '#F59E0B', '#EF4444', '#8B5CF6', '#EC4899'];
25
-
26
- for (let i = 0; i < 50; i++) {
27
- this.confettiArray.push({
28
- left: Math.random() * 100,
29
- delay: Math.random() * 2,
30
- color: colors[Math.floor(Math.random() * colors.length)]
31
- });
32
- }
33
- }
34
- }
@@ -1,42 +0,0 @@
1
- <ul class="fab-options z-90 fixed bottom-25 right-5" [class]="cssClass">
2
- <!-- <li>
3
- <span class="fab-label bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white">Chat with Aide on Whatsapp</span>
4
- <a class=" bg-white text-green-600 dark:bg-neutral-800 dark:text-white btn-round btn-fab">
5
- <div class="size-6">
6
- <i class='fi fi-brands-whatsapp fs-20'></i>
7
- </div>
8
- </a>
9
- </li>
10
- <li>
11
- <span class="fab-label bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white">Chat with Aide on Telegram</span>
12
- <a class=" bg-white text-blue-400 dark:bg-neutral-800 dark:text-white btn-round btn-fab">
13
- <div class="size-6">
14
- <i class='fi fi-brands-telegram fs-20'></i>
15
- </div>
16
- </a>
17
- </li> -->
18
- <li>
19
- <span class="fab-label bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white">Live Chat</span>
20
- <a (click)="toggleLivechat()" class="bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white btn-round btn-fab">
21
- <div class="size-6">
22
- <i class='fi fi-rr-robot fs-20'></i>
23
- </div>
24
- </a>
25
- </li>
26
- <!-- <li>
27
- <span class="fab-label bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white">Send us a mail</span>
28
- <a class="bg-white text-neutral-950 dark:bg-neutral-800 dark:text-white btn-round btn-fab">
29
- <div class="size-6">
30
- <i class='fi fi-rr-envelope fs-20'></i>
31
- </div>
32
- </a>
33
- </li> -->
34
- </ul>
35
-
36
- <button class="fixed bottom-5 right-5 main z-90 animated fadeInUp fs-20 bg-linear-to-tl from-blue-500 to-blue-800 text-white btn-round btn-fab btn-fab-button dark:bg-dark" (click)="toggleFab()" (keydown)="toggleFab()">
37
- <div class="size-6">
38
- <i class='fi fi-rr-comment fs-30 relative'></i>
39
- </div>
40
- </button>
41
-
42
- <app-chat-widget [isOpen]="isOpen || false" />
@@ -1,49 +0,0 @@
1
- :host {
2
-
3
- .fadeIn {
4
- opacity: 1 !important;
5
- transform: scale(1) !important;
6
- }
7
-
8
- .fadeOut {
9
- opacity: 0 !important;
10
- transform: scale(0) !important;
11
- }
12
-
13
- .fab-options {
14
- list-style-type: none;
15
- opacity: 0;
16
- transition: all 0.3s ease;
17
- transform: scale(0);
18
- transform-origin: 85% bottom;
19
- li {
20
- display: flex;
21
- justify-content: flex-end;
22
- padding: 5px;
23
-
24
- .btn-fab {
25
- width: 50px !important;
26
- height: 50px !important;
27
- box-shadow: 0 6px 20px rgba(0,0,0,0.2);
28
- i {
29
- position: relative !important;
30
- top: 12px !important;
31
- right: -15px !important;
32
- // margin: 10px auto !important;
33
- }
34
- }
35
-
36
- .fab-label {
37
- padding: 2px 10px;
38
- align-self: center;
39
- user-select: none;
40
- white-space: nowrap;
41
- border-radius: 3px;
42
- font-size: 13px;
43
- font-weight: 400;
44
- box-shadow: 0 6px 20px rgba(0,0,0,0.2);
45
- margin-right: 10px;
46
- }
47
- }
48
- }
49
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { SupportButtonsComponent } from './support-buttons.component';
4
-
5
- describe('SupportButtonsComponent', () => {
6
- let component: SupportButtonsComponent;
7
- let fixture: ComponentFixture<SupportButtonsComponent>;
8
-
9
- beforeEach(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [SupportButtonsComponent]
12
- });
13
- fixture = TestBed.createComponent(SupportButtonsComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,33 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
2
- import { ChatWidgetComponent } from '../chat-widget/chat-widget.component';
3
- import { closeChat, toggleLivechat } from '../../utilities';
4
-
5
- @Component({
6
- selector: 'app-support-buttons',
7
- templateUrl: './support-buttons.component.html',
8
- styleUrls: ['./support-buttons.component.scss'],
9
- standalone: true,
10
- imports: [
11
- ChatWidgetComponent
12
- ],
13
- changeDetection: ChangeDetectionStrategy.OnPush,
14
- })
15
- export class SupportButtonsComponent implements OnInit {
16
- cssClass: 'fadeIn' | 'fadeOut' = 'fadeOut';
17
- isOpen = false;
18
-
19
- constructor() {}
20
-
21
- ngOnInit(): void {
22
- closeChat();
23
- }
24
-
25
- toggleFab() {
26
- closeChat();
27
- this.cssClass = this.cssClass === 'fadeIn' ? 'fadeOut' : 'fadeIn';
28
- }
29
-
30
- toggleLivechat() {
31
- this.isOpen = toggleLivechat();
32
- }
33
- }
@@ -1,15 +0,0 @@
1
- export const chat = {
2
- url: 'https://backoffice.kreador.io',
3
- db: "developer_odoodemo_db",
4
- email: "info@kreador.io",
5
- password: "admin",
6
- payload: {
7
- jsonrpc: "2.0",
8
- method: "call",
9
- params: {
10
- service: "object",
11
- method: "execute_kw",
12
- args: []
13
- }
14
- }
15
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { LivechatAssistantComponent } from './livechat-assistant.component';
4
-
5
- describe('LivechatAssistantComponent', () => {
6
- let component: LivechatAssistantComponent;
7
- let fixture: ComponentFixture<LivechatAssistantComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [LivechatAssistantComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(LivechatAssistantComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,15 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-livechat-assistant',
5
- imports: [],
6
- template: `
7
- <p>
8
- livechat-assistant works!
9
- </p>
10
- `,
11
- styles: ``
12
- })
13
- export class LivechatAssistantComponent {
14
-
15
- }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { LivechatAssistantService } from './livechat-assistant.service';
4
-
5
- describe('LivechatAssistantService', () => {
6
- let service: LivechatAssistantService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(LivechatAssistantService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,9 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
- export class LivechatAssistantService {
7
-
8
- constructor() { }
9
- }
@@ -1 +0,0 @@
1
- export * from './request';
@@ -1,58 +0,0 @@
1
- import { Injectable, OnInit, inject } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { chat } from '../environment/environment.test';
4
-
5
- @Injectable({
6
- providedIn: 'root',
7
- })
8
- export class RequestService {
9
- url: string = chat.url;
10
- private http: HttpClient = inject(HttpClient)
11
- headers: any = {
12
- "content-type": "application/json"
13
- };
14
-
15
- async get(routes: string, custom_url: boolean = false) {
16
- const url = custom_url ? routes : this.url + routes;
17
- return await new Promise(async (resolve, reject) => {
18
- this.http.get(url, this.headers).subscribe((res: any) => {
19
- resolve(res)
20
- }, (err: any) => {
21
- reject(err);
22
- })
23
- });
24
- }
25
-
26
- async post(routes: string, data: any, custom_url: boolean = false) {
27
- const url = routes;
28
- return await new Promise((resolve, reject) => {
29
- this.http.post(url, data, {
30
- headers: this.headers,
31
- withCredentials: true
32
- }).subscribe(
33
- (response) => resolve(response),
34
- (error) => reject(error)
35
- );
36
- });
37
- }
38
-
39
- async update(routes: string, data: any, custom_url: boolean = false) {
40
- const url = custom_url ? routes : this.url + routes;
41
- return await new Promise((resolve, reject) => {
42
- this.http.put(url, data).subscribe(
43
- (response) => resolve(response),
44
- (error) => reject(error)
45
- );
46
- });
47
- }
48
-
49
- async delete(routes: string, data: any = {}, custom_url: boolean = false) {
50
- const url = custom_url ? routes : this.url + routes;
51
- return await new Promise((resolve, reject) => {
52
- this.http.delete(url, data).subscribe(
53
- (response) => resolve(response),
54
- (error) => reject(error)
55
- );
56
- });
57
- }
58
- }
@@ -1,23 +0,0 @@
1
- export let isOpen: boolean;
2
- export let confettiArray: Array<{left: number, delay: number, color: string}> = [];
3
-
4
- export const isChatOpen = ()=> {
5
- return isOpen;
6
- }
7
-
8
- export const closeChat=()=> {
9
- document.body.classList.remove("show-chatbot");
10
- isOpen = false;
11
- }
12
-
13
- export const toggleLivechat = () => {
14
- if (isOpen) {
15
- document.body.classList.remove("show-chatbot");
16
- isOpen = false;
17
- } else {
18
- document.body.classList.toggle("show-chatbot");
19
- isOpen = true;
20
- }
21
- return isOpen;
22
- }
23
-
@@ -1 +0,0 @@
1
- export * from './helper'