@product7/feedback-sdk 1.3.3 → 1.3.4

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 (37) hide show
  1. package/dist/feedback-sdk.js +2321 -3173
  2. package/dist/feedback-sdk.js.map +1 -1
  3. package/dist/feedback-sdk.min.js +1 -1
  4. package/dist/feedback-sdk.min.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/api/services/MessengerService.js +20 -0
  7. package/src/index.js +2 -3
  8. package/src/styles/base.js +27 -52
  9. package/src/styles/changelog.js +152 -269
  10. package/src/styles/components.js +489 -0
  11. package/src/styles/design-tokens.js +104 -0
  12. package/src/styles/feedback.js +59 -369
  13. package/src/styles/messenger-core.js +390 -0
  14. package/src/styles/messenger-features.js +347 -0
  15. package/src/styles/messenger-help.js +298 -0
  16. package/src/styles/messenger-themes.js +500 -0
  17. package/src/styles/messenger-views.js +618 -0
  18. package/src/styles/messenger.js +558 -0
  19. package/src/styles/styles.js +24 -2
  20. package/src/styles/surveys.js +354 -0
  21. package/src/widgets/BaseWidget.js +25 -58
  22. package/src/widgets/ButtonWidget.js +3 -18
  23. package/src/widgets/ChangelogWidget.js +7 -48
  24. package/src/widgets/InlineWidget.js +16 -13
  25. package/src/widgets/MessengerWidget.js +0 -4
  26. package/src/widgets/SurveyWidget.js +42 -146
  27. package/src/widgets/TabWidget.js +2 -22
  28. package/src/widgets/messenger/components/MessengerLauncher.js +10 -5
  29. package/src/widgets/messenger/components/MessengerPanel.js +5 -27
  30. package/src/widgets/messenger/components/NavigationTabs.js +5 -14
  31. package/src/widgets/messenger/views/ChangelogView.js +13 -14
  32. package/src/widgets/messenger/views/ChatView.js +43 -36
  33. package/src/widgets/messenger/views/ConversationsView.js +16 -21
  34. package/src/widgets/messenger/views/HelpView.js +10 -10
  35. package/src/widgets/messenger/views/HomeView.js +11 -16
  36. package/src/widgets/messenger/views/PreChatFormView.js +18 -30
  37. package/src/styles/messengerStyles.js +0 -2328
@@ -0,0 +1,618 @@
1
+ export const messengerViewsStyles = `
2
+ .messenger-home-view {
3
+ background: linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 40%);
4
+ }
5
+
6
+ .messenger-home-header {
7
+ padding: 20px;
8
+ background: linear-gradient(180deg, rgba(88, 86, 214, 0.2) 0%, transparent 100%);
9
+ }
10
+
11
+ .messenger-home-header-top {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ margin-bottom: 24px;
16
+ }
17
+
18
+ .messenger-home-logo {
19
+ width: 32px;
20
+ height: 32px;
21
+ }
22
+
23
+ .messenger-home-logo img {
24
+ width: 100%;
25
+ height: 100%;
26
+ border-radius: 8px;
27
+ object-fit: cover;
28
+ }
29
+
30
+ .messenger-home-logo-default {
31
+ width: 32px;
32
+ height: 32px;
33
+ background: linear-gradient(135deg, #5856d6, #007aff);
34
+ border-radius: 8px;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ color: white;
39
+ }
40
+
41
+ .messenger-home-avatars {
42
+ flex: 1;
43
+ display: flex;
44
+ justify-content: flex-end;
45
+ margin-right: 12px;
46
+ }
47
+
48
+ .messenger-home-welcome {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 4px;
52
+ }
53
+
54
+ .messenger-home-greeting {
55
+ font-size: 15px;
56
+ color: rgba(255, 255, 255, 0.5);
57
+ }
58
+
59
+ .messenger-home-question {
60
+ font-size: 18px;
61
+ font-weight: 600;
62
+ color: white;
63
+ }
64
+
65
+ .messenger-home-body {
66
+ flex: 1;
67
+ padding: 20px;
68
+ overflow-y: auto;
69
+ }
70
+
71
+ .messenger-home-message-btn {
72
+ width: 100%;
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: space-between;
76
+ padding: 16px 20px;
77
+ background: #2c2c2e;
78
+ border: none;
79
+ border-radius: 24px;
80
+ color: white;
81
+ font-size: 15px;
82
+ font-weight: 500;
83
+ cursor: pointer;
84
+ transition: all 0.2s ease;
85
+ margin-bottom: 20px;
86
+ }
87
+
88
+ .messenger-home-message-btn:hover {
89
+ background: #3c3c3e;
90
+ transform: translateX(4px);
91
+ }
92
+
93
+ .messenger-home-message-btn svg {
94
+ opacity: 0.6;
95
+ }
96
+
97
+ .messenger-home-continue-btn {
98
+ flex-direction: column;
99
+ align-items: flex-start;
100
+ gap: 2px;
101
+ position: relative;
102
+ }
103
+
104
+ .messenger-home-continue-btn > i {
105
+ position: absolute;
106
+ right: 20px;
107
+ top: 50%;
108
+ transform: translateY(-50%);
109
+ }
110
+
111
+ .messenger-home-continue-info {
112
+ display: flex;
113
+ flex-direction: column;
114
+ gap: 2px;
115
+ text-align: left;
116
+ }
117
+
118
+ .messenger-home-continue-label {
119
+ font-size: 14px;
120
+ font-weight: 600;
121
+ }
122
+
123
+ .messenger-home-continue-preview {
124
+ font-size: 12px;
125
+ opacity: 0.6;
126
+ font-weight: 400;
127
+ }
128
+
129
+ .messenger-home-featured {
130
+ background: #2c2c2e;
131
+ border-radius: 12px;
132
+ overflow: hidden;
133
+ margin-bottom: 20px;
134
+ }
135
+
136
+ .messenger-home-featured-image {
137
+ width: 100%;
138
+ height: 120px;
139
+ object-fit: cover;
140
+ }
141
+
142
+ .messenger-home-featured-content {
143
+ padding: 16px;
144
+ }
145
+
146
+ .messenger-home-featured-content h3 {
147
+ margin: 0 0 8px;
148
+ font-size: 16px;
149
+ font-weight: 600;
150
+ color: white;
151
+ }
152
+
153
+ .messenger-home-featured-content p {
154
+ margin: 0;
155
+ font-size: 14px;
156
+ color: rgba(255, 255, 255, 0.6);
157
+ }
158
+
159
+ .messenger-home-changelog-section {
160
+ margin-top: 20px;
161
+ display: flex;
162
+ flex-direction: column;
163
+ gap: 16px;
164
+ }
165
+
166
+ .messenger-home-changelog-card {
167
+ background: #2c2c2e;
168
+ border-radius: 16px;
169
+ overflow: hidden;
170
+ cursor: pointer;
171
+ transition: all 0.2s ease;
172
+ }
173
+
174
+ .messenger-home-changelog-card:hover {
175
+ background: #3c3c3e;
176
+ transform: translateY(-2px);
177
+ }
178
+
179
+ .messenger-home-changelog-cover {
180
+ width: 100%;
181
+ height: 140px;
182
+ overflow: hidden;
183
+ position: relative;
184
+ border-radius: 12px;
185
+ margin: 12px 12px 0 12px;
186
+ padding-bottom: 12px;
187
+ width: calc(100% - 24px);
188
+ }
189
+
190
+ .messenger-home-changelog-cover img {
191
+ width: 100%;
192
+ height: 100%;
193
+ object-fit: cover;
194
+ border-radius: 12px;
195
+ }
196
+
197
+ .messenger-home-changelog-cover-text {
198
+ position: absolute;
199
+ bottom: 12px;
200
+ left: 12px;
201
+ right: 12px;
202
+ color: #ffffff;
203
+ font-size: 14px;
204
+ font-weight: 600;
205
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
206
+ line-height: 1.3;
207
+ }
208
+
209
+ .messenger-home-changelog-card-content {
210
+ padding: 16px;
211
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
212
+ }
213
+
214
+ .messenger-home-changelog-card-title {
215
+ margin: 0 0 8px 0;
216
+ font-size: 14px;
217
+ font-weight: 600;
218
+ color: #ffffff;
219
+ line-height: 1.3;
220
+ }
221
+
222
+ .messenger-home-changelog-card-desc {
223
+ margin: 0;
224
+ font-size: 14px;
225
+ color: rgba(255, 255, 255, 0.7);
226
+ line-height: 1.5;
227
+ display: -webkit-box;
228
+ -webkit-line-clamp: 3;
229
+ -webkit-box-orient: vertical;
230
+ overflow: hidden;
231
+ }
232
+
233
+
234
+ .messenger-conversations-header {
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: space-between;
238
+ padding: 20px;
239
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
240
+ }
241
+
242
+ .messenger-conversations-header h2 {
243
+ margin: 0;
244
+ font-size: 20px;
245
+ font-weight: 600;
246
+ color: white;
247
+ }
248
+
249
+ .messenger-conversations-body {
250
+ flex: 1;
251
+ overflow-y: auto;
252
+ padding: 4px 12px 12px 12px;
253
+ }
254
+
255
+ .messenger-conversations-empty {
256
+ display: flex;
257
+ flex-direction: column;
258
+ align-items: center;
259
+ justify-content: center;
260
+ height: 100%;
261
+ text-align: center;
262
+ padding: 40px;
263
+ }
264
+
265
+ .messenger-conversations-empty-icon {
266
+ color: rgba(255, 255, 255, 0.3);
267
+ margin-bottom: 16px;
268
+ }
269
+
270
+ .messenger-conversations-empty h3 {
271
+ margin: 0 0 8px;
272
+ font-size: 18px;
273
+ font-weight: 600;
274
+ color: white;
275
+ }
276
+
277
+ .messenger-conversations-empty p {
278
+ margin: 0;
279
+ font-size: 14px;
280
+ color: rgba(255, 255, 255, 0.5);
281
+ }
282
+
283
+ .messenger-conversation-item {
284
+ display: flex;
285
+ align-items: flex-start;
286
+ gap: 12px;
287
+ padding: 10px 16px;
288
+ border-radius: 12px;
289
+ cursor: pointer;
290
+ transition: background 0.2s ease;
291
+ }
292
+
293
+ .messenger-conversation-item:hover {
294
+ background: rgba(255, 255, 255, 0.05);
295
+ }
296
+
297
+ .messenger-conversation-avatars {
298
+ flex-shrink: 0;
299
+ padding-top: 2px;
300
+ }
301
+
302
+ .messenger-conversation-content {
303
+ flex: 1;
304
+ min-width: 0;
305
+ }
306
+
307
+ .messenger-conversation-header {
308
+ display: flex;
309
+ align-items: center;
310
+ justify-content: space-between;
311
+ margin-bottom: 4px;
312
+ gap: 12px;
313
+ }
314
+
315
+ .messenger-conversation-title {
316
+ font-size: 15px;
317
+ font-weight: 400;
318
+ color: #ffffff;
319
+ line-height: 1.3;
320
+ }
321
+
322
+ .messenger-conversation-time {
323
+ font-size: 13px;
324
+ color: rgba(255, 255, 255, 0.5);
325
+ flex-shrink: 0;
326
+ }
327
+
328
+ .messenger-conversation-preview {
329
+ display: flex;
330
+ align-items: center;
331
+ gap: 8px;
332
+ }
333
+
334
+ .messenger-unread-dot {
335
+ width: 8px;
336
+ height: 8px;
337
+ background: #ef4444;
338
+ border-radius: 50%;
339
+ flex-shrink: 0;
340
+ }
341
+
342
+ .messenger-conversation-message {
343
+ font-size: 14px;
344
+ color: rgba(255, 255, 255, 0.7);
345
+ white-space: nowrap;
346
+ overflow: hidden;
347
+ text-overflow: ellipsis;
348
+ line-height: 1.4;
349
+ }
350
+
351
+ .messenger-conversation-item.unread .messenger-conversation-title {
352
+ font-weight: 400;
353
+ color: #ffffff;
354
+ }
355
+
356
+ .messenger-conversation-item.unread .messenger-conversation-message {
357
+ color: rgba(255, 255, 255, 0.9);
358
+ }
359
+
360
+ .messenger-conversations-footer {
361
+ padding: 16px;
362
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
363
+ }
364
+
365
+ .messenger-new-message-btn {
366
+ width: 100%;
367
+ display: flex;
368
+ align-items: center;
369
+ gap: 12px;
370
+ padding: 12px 16px;
371
+ background: #2c2c2e;
372
+ border: none;
373
+ border-radius: 24px;
374
+ color: white;
375
+ font-size: 14px;
376
+ font-weight: 500;
377
+ cursor: pointer;
378
+ transition: all 0.2s ease;
379
+ }
380
+
381
+ .messenger-new-message-btn:hover {
382
+ background: #3c3c3e;
383
+ }
384
+
385
+ .messenger-new-message-btn span {
386
+ flex: 1;
387
+ text-align: left;
388
+ }
389
+
390
+ .messenger-new-message-btn svg {
391
+ opacity: 0.6;
392
+ }
393
+
394
+ .messenger-chat-header {
395
+ display: flex;
396
+ align-items: center;
397
+ gap: 12px;
398
+ padding: 16px 20px;
399
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
400
+ }
401
+
402
+ .messenger-chat-header-info {
403
+ flex: 1;
404
+ display: flex;
405
+ align-items: center;
406
+ gap: 10px;
407
+ }
408
+
409
+ .messenger-chat-title {
410
+ font-size: 16px;
411
+ font-weight: 500;
412
+ color: white;
413
+ }
414
+
415
+ .messenger-chat-view {
416
+ position: relative;
417
+ overflow: visible;
418
+ }
419
+
420
+ .messenger-chat-messages {
421
+ flex: 1;
422
+ overflow-y: auto;
423
+ padding: 16px;
424
+ display: flex;
425
+ flex-direction: column;
426
+ gap: 16px;
427
+ }
428
+
429
+ .messenger-chat-empty {
430
+ flex: 1;
431
+ display: flex;
432
+ flex-direction: column;
433
+ align-items: center;
434
+ justify-content: center;
435
+ text-align: center;
436
+ padding: 40px;
437
+ }
438
+
439
+ .messenger-chat-empty-avatars {
440
+ margin-bottom: 16px;
441
+ }
442
+
443
+ .messenger-chat-empty h3 {
444
+ margin: 0 0 8px;
445
+ font-size: 18px;
446
+ font-weight: 600;
447
+ color: white;
448
+ }
449
+
450
+ .messenger-chat-empty p {
451
+ margin: 0;
452
+ font-size: 14px;
453
+ color: rgba(255, 255, 255, 0.5);
454
+ max-width: 240px;
455
+ }
456
+
457
+ .messenger-message {
458
+ display: flex;
459
+ gap: 8px;
460
+ max-width: 85%;
461
+ }
462
+
463
+ .messenger-message-own {
464
+ align-self: flex-end;
465
+ flex-direction: column;
466
+ align-items: flex-end;
467
+ }
468
+
469
+ .messenger-message-received {
470
+ align-self: flex-start;
471
+ }
472
+
473
+ .messenger-message-wrapper {
474
+ display: flex;
475
+ flex-direction: column;
476
+ }
477
+
478
+ .messenger-message-sender {
479
+ font-size: 12px;
480
+ font-weight: 500;
481
+ color: rgba(255, 255, 255, 0.6);
482
+ margin-bottom: 4px;
483
+ margin-left: 12px;
484
+ }
485
+
486
+ .messenger-message-bubble {
487
+ padding: 12px 16px;
488
+ border-radius: 18px;
489
+ word-wrap: break-word;
490
+ }
491
+
492
+ .messenger-message-own .messenger-message-bubble {
493
+ background: rgb(29, 78, 216);
494
+ color: white;
495
+ border-bottom-right-radius: 4px;
496
+ }
497
+
498
+ .messenger-message-received .messenger-message-bubble {
499
+ background: #2c2c2e;
500
+ color: white;
501
+ border-bottom-left-radius: 4px;
502
+ }
503
+
504
+ .messenger-message-content {
505
+ font-size: 15px;
506
+ line-height: 1.4;
507
+ }
508
+
509
+ .messenger-message-time {
510
+ font-size: 11px;
511
+ color: rgba(255, 255, 255, 0.4);
512
+ margin-top: 4px;
513
+ padding: 0 4px;
514
+ }
515
+
516
+ .messenger-message-avatar {
517
+ flex-shrink: 0;
518
+ margin-top: auto;
519
+ }
520
+
521
+ .messenger-closed-banner {
522
+ display: flex;
523
+ align-items: center;
524
+ justify-content: center;
525
+ gap: 8px;
526
+ padding: 12px 16px;
527
+ margin: 16px;
528
+ background: rgba(52, 199, 89, 0.12);
529
+ color: #34c759;
530
+ border-radius: 12px;
531
+ font-size: 13px;
532
+ font-weight: 500;
533
+ }
534
+
535
+ .messenger-chat-compose {
536
+ display: flex;
537
+ align-items: center;
538
+ gap: 8px;
539
+ padding: 12px 16px;
540
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
541
+ background: #1c1c1e;
542
+ }
543
+
544
+ .messenger-compose-input-wrapper {
545
+ flex: 1;
546
+ background: #2c2c2e;
547
+ border-radius: 10px;
548
+ padding: 8px 16px;
549
+ }
550
+
551
+ .messenger-compose-input {
552
+ width: 100%;
553
+ background: transparent;
554
+ border: none;
555
+ outline: none;
556
+ color: white;
557
+ font-size: 15px;
558
+ line-height: 1.4;
559
+ resize: none;
560
+ max-height: 120px;
561
+ font-family: inherit;
562
+ }
563
+
564
+ .messenger-compose-input::placeholder {
565
+ color: rgba(255, 255, 255, 0.4);
566
+ }
567
+
568
+ .messenger-compose-send {
569
+ width: 40px;
570
+ height: 40px;
571
+ background: #007aff;
572
+ border: none;
573
+ border-radius: 50%;
574
+ color: white;
575
+ cursor: pointer;
576
+ display: flex;
577
+ align-items: center;
578
+ justify-content: center;
579
+ transition: all 0.2s ease;
580
+ flex-shrink: 0;
581
+ }
582
+
583
+ .messenger-compose-send:hover:not(:disabled) {
584
+ background: #0066d6;
585
+ transform: scale(1.05);
586
+ }
587
+
588
+ .messenger-compose-send:disabled {
589
+ background: #3c3c3e;
590
+ color: rgba(255, 255, 255, 0.3);
591
+ cursor: not-allowed;
592
+ }
593
+
594
+ .messenger-compose-attach {
595
+ width: 40px;
596
+ height: 40px;
597
+ background: transparent;
598
+ border: none;
599
+ border-radius: 50%;
600
+ color: rgba(255, 255, 255, 0.5);
601
+ cursor: pointer;
602
+ display: flex;
603
+ align-items: center;
604
+ justify-content: center;
605
+ transition: all 0.2s ease;
606
+ flex-shrink: 0;
607
+ }
608
+
609
+ .messenger-compose-attach:hover:not(:disabled) {
610
+ color: rgba(255, 255, 255, 0.85);
611
+ background: rgba(255, 255, 255, 0.08);
612
+ }
613
+
614
+ .messenger-compose-attach:disabled {
615
+ opacity: 0.3;
616
+ cursor: not-allowed;
617
+ }
618
+ `;