@adzen/doohbot 1.0.0 → 1.0.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.
Files changed (91) hide show
  1. package/README.md +20 -14
  2. package/fesm2022/adzen-doohbot.mjs +4622 -0
  3. package/fesm2022/adzen-doohbot.mjs.map +1 -0
  4. package/index.d.ts +1301 -0
  5. package/index.d.ts.map +1 -0
  6. package/package.json +29 -57
  7. package/src/lib/app/chat/components/chat-button/chat-button.component.scss +115 -0
  8. package/src/lib/app/chat/components/chat-footer/chat-footer.component.scss +14 -0
  9. package/src/lib/app/chat/components/chat-header/chat-header.component.scss +82 -0
  10. package/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.scss +369 -0
  11. package/src/lib/app/chat/components/chat-message/chat-message.component.scss +235 -0
  12. package/src/lib/app/chat/components/chat-window/chat-window.component.scss +194 -0
  13. package/src/lib/app/chat/components/message-input/message-input.component.scss +59 -0
  14. package/src/lib/app/chat/components/message-list/message-list.component.scss +258 -0
  15. package/src/lib/app/login/login-form.component.scss +213 -0
  16. package/src/lib/app/personalization/personalization-dialog.component.scss +177 -0
  17. package/src/lib/app/personalization/sections/account/account-section.component.scss +209 -0
  18. package/src/lib/app/personalization/sections/instruction/instruction-section.component.scss +63 -0
  19. package/src/lib/app/personalization/sections/preferences/preferences-section.component.scss +199 -0
  20. package/src/lib/app/personalization/sections/terms/terms-section.component.scss +74 -0
  21. package/src/lib/doohbot.component.scss +18 -0
  22. package/{projects/doohbot/src/lib/shared/chips/chips.scss → src/lib/shared/chips/chips.component.scss} +3 -1
  23. package/src/lib/shared/dialog/dialog.component.scss +90 -0
  24. package/src/lib/shared/dropdown-menu/dropdown-menu.component.scss +53 -0
  25. package/src/lib/shared/input-dialog/input-dialog.component.scss +71 -0
  26. package/src/lib/shared/popout/popout.scss +0 -0
  27. package/src/lib/shared/snackbar/snackbar.component.scss +125 -0
  28. package/src/lib/styles/_theme.scss +69 -0
  29. package/src/lib/styles/material-override.scss +338 -0
  30. package/{projects/doohbot/src/lib/utils → src/lib/styles}/utility.scss +85 -33
  31. package/src/lib/theme/index.scss +8 -0
  32. package/src/lib/theme/palettes/aqua.scss +88 -0
  33. package/src/lib/theme/palettes/candy.scss +88 -0
  34. package/src/lib/theme/palettes/doohbot.scss +88 -0
  35. package/src/lib/theme/palettes/forest.scss +88 -0
  36. package/src/lib/theme/palettes/midnight.scss +88 -0
  37. package/src/lib/theme/palettes/slate.scss +88 -0
  38. package/src/lib/theme/palettes/sunset.scss +86 -0
  39. package/src/lib/theme/themes.scss +7 -0
  40. package/src/lib/theme/tokens/semantic.scss +102 -0
  41. package/.editorconfig +0 -17
  42. package/.vscode/extensions.json +0 -4
  43. package/.vscode/launch.json +0 -26
  44. package/.vscode/settings.json +0 -13
  45. package/.vscode/tasks.json +0 -42
  46. package/adzen-doohbot-0.0.1.tgz +0 -0
  47. package/adzen-doohbot-1.0.0.tgz +0 -0
  48. package/angular.json +0 -119
  49. package/projects/doohbot/README.md +0 -63
  50. package/projects/doohbot/ng-package.json +0 -16
  51. package/projects/doohbot/package.json +0 -12
  52. package/projects/doohbot/src/lib/directives/draggable/draggable-dialog.directive.ts +0 -62
  53. package/projects/doohbot/src/lib/directives/draggable/draggable-dialog.module.ts +0 -9
  54. package/projects/doohbot/src/lib/directives/resizable/resizable-dialog.directive.ts +0 -163
  55. package/projects/doohbot/src/lib/directives/resizable/resizable-dialog.module.ts +0 -9
  56. package/projects/doohbot/src/lib/doohbot.html +0 -216
  57. package/projects/doohbot/src/lib/doohbot.scss +0 -568
  58. package/projects/doohbot/src/lib/doohbot.spec.ts +0 -21
  59. package/projects/doohbot/src/lib/doohbot.ts +0 -345
  60. package/projects/doohbot/src/lib/elements/elements.ts +0 -25
  61. package/projects/doohbot/src/lib/helpers/predefined_messages.ts +0 -2
  62. package/projects/doohbot/src/lib/inputs/doohbot-input.ts +0 -25
  63. package/projects/doohbot/src/lib/model/doohbot.intents.ts +0 -24
  64. package/projects/doohbot/src/lib/model/message.ts +0 -13
  65. package/projects/doohbot/src/lib/model/token.ts +0 -3
  66. package/projects/doohbot/src/lib/services/messaging.service.ts +0 -76
  67. package/projects/doohbot/src/lib/shared/chips/chips.html +0 -9
  68. package/projects/doohbot/src/lib/shared/chips/chips.spec.ts +0 -23
  69. package/projects/doohbot/src/lib/shared/chips/chips.ts +0 -18
  70. package/projects/doohbot/src/lib/shared/snackbar/snackbar.html +0 -7
  71. package/projects/doohbot/src/lib/shared/snackbar/snackbar.scss +0 -73
  72. package/projects/doohbot/src/lib/shared/snackbar/snackbar.spec.ts +0 -21
  73. package/projects/doohbot/src/lib/shared/snackbar/snackbar.ts +0 -44
  74. package/projects/doohbot/src/lib/utils/material-override.scss +0 -312
  75. package/projects/doohbot/src/public-api.ts +0 -5
  76. package/projects/doohbot/tsconfig.lib.json +0 -19
  77. package/projects/doohbot/tsconfig.lib.prod.json +0 -11
  78. package/projects/doohbot/tsconfig.spec.json +0 -14
  79. package/projects/doohbot-element/public/favicon.ico +0 -0
  80. package/projects/doohbot-element/src/app/app.config.ts +0 -12
  81. package/projects/doohbot-element/src/app/app.html +0 -1
  82. package/projects/doohbot-element/src/app/app.routes.ts +0 -3
  83. package/projects/doohbot-element/src/app/app.spec.ts +0 -23
  84. package/projects/doohbot-element/src/app/app.ts +0 -10
  85. package/projects/doohbot-element/src/index.html +0 -15
  86. package/projects/doohbot-element/src/main.ts +0 -6
  87. package/projects/doohbot-element/src/styles.scss +0 -15
  88. package/projects/doohbot-element/tsconfig.app.json +0 -15
  89. package/projects/doohbot-element/tsconfig.spec.json +0 -14
  90. package/tsconfig.json +0 -43
  91. /package/{projects/doohbot-element/src/app/app.scss → src/lib/shared/menu-item/menu-item.component.scss} +0 -0
@@ -1,568 +0,0 @@
1
- @use 'utils/material-override' as *;
2
- @use 'utils/utility' as *;
3
-
4
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
5
- @import url('https://fonts.googleapis.com/icon?family=Material+Icons');
6
-
7
- /* Default / system theme fallback */
8
- :host(.light-theme) {
9
- --primary-color: #4f46e5;
10
- --secondary-color: #6c757d;
11
- --background-color: #f8f9fa;
12
- --chat-input-color: var(--background-color);
13
- --white: #ffffff;
14
- --black: #000000;
15
- --text-color: #333;
16
- --secondary-text-color: #858585;
17
- --hint-text-color: var(--secondary-text-color);
18
- --font-family: 'Roboto', Arial, sans-serif;
19
- --user-message-color: var(--primary-color);
20
- --bot-message-color: #e9ecef;
21
- --user-text-color: #fff;
22
- --bot-text-color: #333;
23
- --border-color: #ccc;
24
- --border-shadow-color: 0 4px 16px rgba(0, 0, 0, 0.25);
25
- --border-top-color: #dddddd00;
26
- --typing-indicator-color: #999;
27
- --avatar-filter: invert(48%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(96%) contrast(91%);
28
- --red: #ff0000;
29
- --light-red: #f28b8b;
30
- }
31
-
32
- /* Dark theme */
33
- :host(.dark-theme) {
34
- --primary-color: #4f46e5;
35
- --secondary-color: #9ca3af;
36
- --background-color: #1a1a1a;
37
- --chat-input-color: var(--background-color);
38
- --white: #ffffff;
39
- --black: #000000;
40
- --text-color: #f5f5f5;
41
- --secondary-text-color: #a1a1a1;
42
- --hint-text-color: var(--secondary-text-color);
43
- --font-family: 'Roboto', Arial, sans-serif;
44
- --user-message-color: var(--primary-color);
45
- --bot-message-color: #333;
46
- --user-text-color: #fff;
47
- --bot-text-color: #fff;
48
- --border-color: #444;
49
- --border-shadow-color: 0 4px 16px rgba(0, 0, 0, 0.75);
50
- --border-top-color: #44444400;
51
- --typing-indicator-color: #bbb;
52
- --avatar-filter: invert(100%) brightness(100%);
53
- --red: #ff0000;
54
- --light-red: #f28b8b;
55
- }
56
-
57
- :root(.dark-theme) {
58
- --tooltip-background: tomato;
59
- --tooltip-text-color: white;
60
- --tooltip-font-size: 16px;
61
- }
62
-
63
- :root(.dark-theme) {
64
- --tooltip-background: tomato;
65
- --tooltip-text-color: white;
66
- --tooltip-font-size: 16px;
67
- }
68
-
69
- .my-library-tooltip {
70
- background-color: var(--my-tooltip-background);
71
- color: var(--my-tooltip-text-color);
72
- font-size: var(--my-tooltip-font-size);
73
- }
74
-
75
- /* Webkit browsers (Chrome, Edge, Safari) */
76
- .chat-messages::-webkit-scrollbar {
77
- width: 8px; /* width of vertical scrollbar */
78
- }
79
-
80
- .chat-messages::-webkit-scrollbar-track {
81
- background: var(--secondary-color); /* track color */
82
- border-radius: 4px;
83
- }
84
-
85
- .chat-messages::-webkit-scrollbar-thumb {
86
- background-color: var(--primary-color); /* scroll handle color */
87
- border-radius: 4px;
88
- }
89
-
90
- .chat-messages::-webkit-scrollbar-thumb:hover {
91
- background-color: var(--primary-color);
92
- }
93
-
94
- /* Firefox */
95
- .chat-messages {
96
- scrollbar-width: thin;
97
- scrollbar-color: var(--primary-color) var(--background-color);
98
- }
99
-
100
- /* Welcome screen */
101
- .welcome-screen {
102
- display: flex;
103
- flex-direction: column;
104
- justify-content: center;
105
- align-items: center;
106
- text-align: center;
107
- height: 100%;
108
- padding: 0 20px;
109
- }
110
-
111
- .welcome-image {
112
- width: 80px;
113
- margin-bottom: 30px;
114
- }
115
-
116
- .welcome-screen h3 {
117
- margin: 0 0 5px 0;
118
- color: var(--text-color);
119
- font-family: var(--font-family);
120
- font-size: 24px;
121
- }
122
-
123
- .welcome-screen p {
124
- margin: 0;
125
- color: var(--secondary-text-color);
126
- font-size: 14px;
127
- font-family: var(--font-family);
128
- }
129
-
130
- /* Chat container */
131
- .doohbot-container {
132
- position: fixed;
133
- bottom: 20px;
134
- right: 20px;
135
- z-index: 1000;
136
- }
137
-
138
- /* Sidebar button */
139
- .chat-sidebar {
140
- position: fixed;
141
- right: 0px;
142
- top: 50%;
143
- transform: translateY(-50%);
144
- z-index: 1000;
145
- background: var(--primary-color);
146
- color: white;
147
- width: 40px;
148
- height: 120px;
149
- border-radius: 20px 0px 0px 20px;
150
- display: flex;
151
- justify-content: center;
152
- align-items: center;
153
- }
154
-
155
- /* Existing FAB */
156
- .chat-fab {
157
- position: fixed;
158
- bottom: 24px;
159
- right: 24px;
160
- width: 56px;
161
- height: 56px;
162
- border-radius: 50%;
163
- background: var(--primary-color);
164
- color: white;
165
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
166
- border: none;
167
- cursor: pointer;
168
- z-index: 1000;
169
- }
170
-
171
- .chat-fab svg,
172
- .chat-fab mat-icon {
173
- width: 24px;
174
- height: 24px;
175
- }
176
-
177
- .chat-fab:hover {
178
- transform: scale(1.1);
179
- }
180
-
181
- .chat-trigger:hover {
182
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
183
- transform: scale(1.05);
184
- }
185
-
186
- .alert-badge {
187
- position: absolute;
188
- top: -4px;
189
- right: -4px;
190
- background: var(--red);
191
- color: var(--white);
192
- border-radius: 50%;
193
- min-width: 18px;
194
- height: 18px;
195
- font-size: 11px;
196
- display: flex;
197
- align-items: center;
198
- justify-content: center;
199
- font-weight: bold;
200
- line-height: 1;
201
- }
202
-
203
- /* Chat window */
204
- .chat-window {
205
- width: 410px;
206
- height: 550px;
207
- background-color: var(--background-color);
208
- border-radius: 20px;
209
- box-shadow: var(--border-shadow-color);
210
- display: flex;
211
- flex-direction: column;
212
- overflow: hidden;
213
- animation: slide-in 0.5s ease;
214
- position: fixed;
215
- right: 20px;
216
- bottom: 20px;
217
- user-select: none;
218
- }
219
-
220
- @media (max-width: 768px) {
221
- .chat-window {
222
- width: 95%;
223
- height: calc(100vh - 20px);
224
- }
225
- }
226
-
227
- @media (max-width: 480px) {
228
- .chat-window {
229
- width: 90%;
230
- height: calc(100vh - 40px);
231
- }
232
- }
233
-
234
- .chat-window.fullscreen {
235
- width: 98vw;
236
- height: 96vh;
237
- border-radius: 20px;
238
- position: absolute;
239
- top: 50%;
240
- left: 50%;
241
- transform: translate(-50%, -50%);
242
- user-select: none;
243
- }
244
-
245
- /* Slide-in animation */
246
- @keyframes slide-in {
247
- from {
248
- transform: translateY(100%);
249
- opacity: 0;
250
- }
251
- to {
252
- transform: translateY(0);
253
- opacity: 1;
254
- }
255
- }
256
-
257
- /* Chat header */
258
- .chat-header {
259
- display: flex;
260
- justify-content: space-between;
261
- align-items: center;
262
- padding: 10px 20px;
263
- background-color: var(--primary-color);
264
- color: var(--white);
265
- cursor: move;
266
- user-select: none;
267
- }
268
-
269
- .chat-header:active {
270
- cursor: grabbing;
271
- }
272
-
273
- .chat-title {
274
- display: flex;
275
- align-items: center;
276
- gap: 6px;
277
- font-family: var(--font-family);
278
- }
279
-
280
- .chat-logo {
281
- width: 45px;
282
- height: 45px;
283
- object-fit: contain;
284
- }
285
-
286
- .chat-header h2 {
287
- margin: 0;
288
- font-size: 1.2rem;
289
- }
290
-
291
- /* Header buttons: fullscreen + close (directly in header) */
292
- .header-button {
293
- background: none;
294
- border: none;
295
- color: var(--white);
296
- cursor: pointer;
297
- font-size: 1.5rem;
298
- }
299
-
300
- .header-button :hover {
301
- transform: scale(1.1);
302
- }
303
-
304
- /* Chat messages */
305
- .chat-messages {
306
- flex-grow: 1;
307
- padding: 20px;
308
- overflow-y: auto;
309
- display: flex;
310
- flex-direction: column;
311
- gap: 10px;
312
- scroll-behavior: smooth;
313
- }
314
-
315
- /* Message wrapper */
316
- .message-wrapper {
317
- display: flex;
318
- align-items: flex-end;
319
- gap: 8px;
320
- margin-bottom: 6px;
321
- }
322
-
323
- .message-wrapper.user {
324
- justify-content: flex-end;
325
- }
326
-
327
- .message-wrapper.bot {
328
- justify-content: flex-start;
329
- }
330
-
331
- /* Message bubbles */
332
- .message {
333
- padding: 10px 15px;
334
- border-radius: 20px;
335
- max-width: 80%;
336
- overflow-y: auto;
337
- word-wrap: break-word;
338
- font-family: var(--font-family);
339
-
340
- .message-time {
341
- font-size: 11px;
342
- color: var(--secondary-color);
343
- text-align: right;
344
- margin-top: 4px;
345
- }
346
- }
347
-
348
- .message.user {
349
- background-color: var(--primary-color);
350
- color: var(--user-text-color);
351
- align-self: flex-end;
352
- }
353
-
354
- .message.bot {
355
- background-color: var(--bot-message-color);
356
- color: var(--bot-text-color);
357
- align-self: flex-start;
358
- }
359
-
360
- /* Bot avatar */
361
- .bot-avatar {
362
- width: 24px;
363
- height: 24px;
364
- border-radius: 50%;
365
- object-fit: cover;
366
- border: 1px solid var(--border-color);
367
- filter: var(--avatar-filter);
368
- }
369
-
370
- .user-avatar {
371
- width: 24px;
372
- height: 24px;
373
- border-radius: 50%;
374
- object-fit: cover;
375
- border: 1px solid var(--border-color);
376
- filter: var(--avatar-filter);
377
- }
378
-
379
- /* Typing indicator */
380
- .typing-indicator {
381
- display: flex;
382
- align-items: center;
383
- justify-content: center;
384
- gap: 4px;
385
- }
386
-
387
- .typing-indicator span {
388
- width: 8px;
389
- height: 8px;
390
- background-color: var(--typing-indicator-color);
391
- border-radius: 50%;
392
- animation: blink 1.4s infinite both;
393
- }
394
-
395
- .typing-indicator span:nth-child(2) {
396
- animation-delay: 0.2s;
397
- }
398
-
399
- .typing-indicator span:nth-child(3) {
400
- animation-delay: 0.4s;
401
- }
402
-
403
- @keyframes blink {
404
- 0%,
405
- 80%,
406
- 100% {
407
- opacity: 0.2;
408
- }
409
- 40% {
410
- opacity: 1;
411
- }
412
- }
413
-
414
- /* Chat input */
415
- .chat-input {
416
- display: flex;
417
- padding: 10px;
418
- border-top: 1px solid var(--border-top-color);
419
- background-color: var(--background-color);
420
- }
421
-
422
- .chat-input input {
423
- flex-grow: 1;
424
- background-color: var(--chat-input-color);
425
- border: 1px solid var(--border-color);
426
- border-radius: 20px;
427
- padding: 10px 15px;
428
- font-size: 14px;
429
- color: var(--text-color);
430
- caret-color: var(--hint-text-color);
431
- font-family: var(--font-family);
432
- }
433
-
434
- .chat-input button {
435
- background-color: var(--primary-color);
436
- color: var(--white);
437
- border: none;
438
- border-radius: 50%;
439
- width: 40px;
440
- height: 40px;
441
- margin-left: 10px;
442
- cursor: pointer;
443
- display: flex;
444
- justify-content: center;
445
- align-items: center;
446
- }
447
-
448
- .chat-input button :hover {
449
- transform: scale(1.1);
450
- }
451
-
452
- .terms-conditions {
453
- font-size: 0.8rem;
454
- color: var(--text-color);
455
- margin-top: 5px;
456
- margin-bottom: 10px;
457
- display: flex;
458
- justify-content: center;
459
- align-items: center;
460
- }
461
-
462
- .terms-conditions a {
463
- color: var(--secondary-color);
464
- text-decoration: underline;
465
- font-family: var(--font-family);
466
- }
467
-
468
- .terms-conditions a:hover {
469
- color: var(--primary-color);
470
- }
471
-
472
- // ::ng-deep.mat-menu-override {
473
- // .mat-mdc-menu-content {
474
- // background-color: #4f46e5 !important; // menu background
475
- // border-radius: 12px !important;
476
-
477
- // .mat-mdc-menu-item {
478
- // color: white !important; // text color
479
- // mat-icon {
480
- // color: white !important; // icon color
481
- // }
482
-
483
- // &:hover {
484
- // background-color: #413abc !important; // hover background
485
- // color: whitesmoke !important; // hover text color
486
- // mat-icon {
487
- // color: whitesmoke !important; // hover icon color
488
- // }
489
- // }
490
- // }
491
- // }
492
- // }
493
-
494
- // ***** Material Override Starts Here *****
495
-
496
- // < --- MatMenu Override --->
497
-
498
- ::ng-deep.mat-menu-override {
499
- background: #4f46e5 !important;
500
- color: white !important;
501
- border-radius: 8px !important;
502
- padding: 4px 0 !important;
503
-
504
- .mat-mdc-menu-item {
505
- color: white !important; // text color
506
- mat-icon {
507
- color: white !important; // icon color
508
- }
509
-
510
- &:hover {
511
- background-color: #413abc !important; // hover background
512
- color: whitesmoke !important; // hover text color
513
- mat-icon {
514
- color: whitesmoke !important; // hover icon color
515
- }
516
- }
517
- }
518
- }
519
-
520
- // < --- MatTooltip Override --->
521
-
522
- ::ng-deep.mat-mdc-tooltip-panel {
523
- background-color: #4f46e5 !important;
524
- color: white !important;
525
- border-radius: 8px !important;
526
-
527
- .mat-mdc-tooltip-content {
528
- font-size: 10px !important;
529
- padding: 8px 16px !important;
530
- font-family: 'Roboto', Arial, sans-serif !important;
531
- }
532
- }
533
-
534
- // ***** Material Override Ends Here *****
535
-
536
- .theme-item {
537
- display: flex !important;
538
- align-items: center !important;
539
- gap: 1px; // space between dot and text
540
- }
541
-
542
- .check-icon {
543
- font-size: 14px;
544
- line-height: 1;
545
- display: flex;
546
- align-items: center;
547
- justify-content: center;
548
- }
549
-
550
- // <--- Theme Selector --->
551
-
552
- .theme-selector {
553
- display: flex;
554
- align-items: center;
555
- padding: 4px 12px;
556
- gap: 8px;
557
- }
558
-
559
- .theme-btn {
560
- background: none;
561
- border: none;
562
- color: white;
563
- transition: color 0.2s ease;
564
- }
565
-
566
- .theme-btn.selected {
567
- color: black;
568
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { Doohbot } from './doohbot';
3
-
4
- describe('Doohbot', () => {
5
- let component: Doohbot;
6
- let fixture: ComponentFixture<Doohbot>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [Doohbot],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(Doohbot);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });