@product7/feedback-sdk 1.3.3 → 1.3.5

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 (39) hide show
  1. package/dist/feedback-sdk.js +2441 -3240
  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 +76 -0
  7. package/src/core/BaseAPIService.js +4 -0
  8. package/src/index.js +2 -3
  9. package/src/styles/base.js +27 -52
  10. package/src/styles/changelog.js +152 -269
  11. package/src/styles/components.js +489 -0
  12. package/src/styles/design-tokens.js +104 -0
  13. package/src/styles/feedback.js +59 -369
  14. package/src/styles/messenger-core.js +390 -0
  15. package/src/styles/messenger-features.js +347 -0
  16. package/src/styles/messenger-help.js +298 -0
  17. package/src/styles/messenger-themes.js +500 -0
  18. package/src/styles/messenger-views.js +618 -0
  19. package/src/styles/messenger.js +558 -0
  20. package/src/styles/styles.js +24 -2
  21. package/src/styles/surveys.js +354 -0
  22. package/src/widgets/BaseWidget.js +25 -58
  23. package/src/widgets/ButtonWidget.js +3 -18
  24. package/src/widgets/ChangelogWidget.js +7 -48
  25. package/src/widgets/InlineWidget.js +16 -13
  26. package/src/widgets/MessengerWidget.js +37 -51
  27. package/src/widgets/SurveyWidget.js +42 -146
  28. package/src/widgets/TabWidget.js +2 -22
  29. package/src/widgets/messenger/MessengerState.js +49 -46
  30. package/src/widgets/messenger/components/MessengerLauncher.js +10 -5
  31. package/src/widgets/messenger/components/MessengerPanel.js +5 -27
  32. package/src/widgets/messenger/components/NavigationTabs.js +5 -14
  33. package/src/widgets/messenger/views/ChangelogView.js +13 -14
  34. package/src/widgets/messenger/views/ChatView.js +43 -36
  35. package/src/widgets/messenger/views/ConversationsView.js +16 -21
  36. package/src/widgets/messenger/views/HelpView.js +10 -10
  37. package/src/widgets/messenger/views/HomeView.js +11 -16
  38. package/src/widgets/messenger/views/PreChatFormView.js +18 -30
  39. package/src/styles/messengerStyles.js +0 -2328
@@ -1,27 +1,27 @@
1
1
  export const feedbackStyles = `
2
2
  .feedback-widget-button {
3
3
  position: fixed;
4
- z-index: 999999;
4
+ z-index: var(--z-modal);
5
5
  }
6
6
 
7
7
  .feedback-widget-button.position-bottom-right {
8
- bottom: 20px;
9
- right: 20px;
8
+ bottom: var(--spacing-5);
9
+ right: var(--spacing-5);
10
10
  }
11
11
 
12
12
  .feedback-widget-button.position-bottom-left {
13
- bottom: 20px;
14
- left: 20px;
13
+ bottom: var(--spacing-5);
14
+ left: var(--spacing-5);
15
15
  }
16
16
 
17
17
  .feedback-widget-button.position-top-right {
18
- top: 20px;
19
- right: 20px;
18
+ top: var(--spacing-5);
19
+ right: var(--spacing-5);
20
20
  }
21
21
 
22
22
  .feedback-widget-button.position-top-left {
23
- top: 20px;
24
- left: 20px;
23
+ top: var(--spacing-5);
24
+ left: var(--spacing-5);
25
25
  }
26
26
 
27
27
  .feedback-trigger-btn {
@@ -29,26 +29,25 @@ export const feedbackStyles = `
29
29
  display: flex;
30
30
  align-items: center;
31
31
  justify-content: center;
32
- gap: 8px;
32
+ gap: var(--spacing-2);
33
33
  height: 48px;
34
- overflow: visible;
35
- border-radius: 9999px;
34
+ border-radius: var(--radius-full);
36
35
  border: none;
37
- padding: 12px 20px;
38
- font-size: 14px;
39
- font-weight: 500;
36
+ padding: var(--spacing-3) var(--spacing-5);
37
+ font-size: var(--font-size-base);
38
+ font-weight: var(--font-weight-medium);
40
39
  font-family: inherit;
41
40
  cursor: pointer;
42
- transition: all 0.3s ease;
43
- color: white;
44
- background: #155EEF;
45
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
41
+ transition: all var(--transition-slow);
42
+ color: var(--color-white);
43
+ background: var(--color-primary);
44
+ box-shadow: var(--shadow-md);
46
45
  width: fit-content;
47
46
  }
48
47
 
49
48
  .feedback-trigger-btn:hover:not(:disabled) {
50
49
  transform: translateY(-2px);
51
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
50
+ box-shadow: var(--shadow-lg);
52
51
  }
53
52
 
54
53
  .feedback-trigger-btn:disabled {
@@ -57,7 +56,7 @@ export const feedbackStyles = `
57
56
  }
58
57
 
59
58
  .feedback-trigger-btn:focus-visible {
60
- outline: 2px solid #155EEF;
59
+ outline: 2px solid var(--color-primary);
61
60
  outline-offset: 2px;
62
61
  }
63
62
 
@@ -72,15 +71,15 @@ export const feedbackStyles = `
72
71
  right: -6px;
73
72
  width: 24px;
74
73
  height: 24px;
75
- padding: 4px;
74
+ padding: var(--spacing-1);
76
75
  display: flex;
77
76
  align-items: center;
78
77
  justify-content: center;
79
- background: white;
80
- border-radius: 50%;
78
+ background: var(--color-white);
79
+ border-radius: var(--radius-full);
81
80
  opacity: 0;
82
- transition: opacity 0.2s ease;
83
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
81
+ transition: opacity var(--transition-base);
82
+ box-shadow: var(--shadow-sm);
84
83
  cursor: pointer;
85
84
  }
86
85
 
@@ -89,7 +88,7 @@ export const feedbackStyles = `
89
88
  width: 16px;
90
89
  height: 16px;
91
90
  display: block;
92
- fill: #155EEF;
91
+ fill: var(--color-primary);
93
92
  }
94
93
 
95
94
  .feedback-widget-button:not(.minimized) .feedback-trigger-btn:hover .feedback-minimize-icon {
@@ -97,7 +96,7 @@ export const feedbackStyles = `
97
96
  }
98
97
 
99
98
  .feedback-widget-button.minimized .feedback-trigger-btn {
100
- padding: 12px;
99
+ padding: var(--spacing-3);
101
100
  width: 48px;
102
101
  height: 48px;
103
102
  justify-content: center;
@@ -118,10 +117,10 @@ export const feedbackStyles = `
118
117
  .feedback-panel {
119
118
  position: fixed;
120
119
  bottom: 80px;
121
- right: 24px;
120
+ right: var(--spacing-6);
122
121
  width: 420px;
123
122
  max-height: 500px;
124
- z-index: 1000000;
123
+ z-index: var(--z-popover);
125
124
  transform: translateX(calc(100% + 24px));
126
125
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
127
126
  font-family: inherit;
@@ -131,104 +130,36 @@ export const feedbackStyles = `
131
130
  transform: translateX(0);
132
131
  }
133
132
 
134
- .feedback-panel-backdrop {
135
- position: fixed;
136
- top: 0;
137
- left: 0;
138
- right: 0;
139
- bottom: 0;
140
- background: rgba(0, 0, 0, 0.1);
141
- opacity: 0;
142
- transition: opacity 0.3s ease;
143
- pointer-events: none;
144
- z-index: 999999;
145
- animation: fadeIn 0.3s ease;
146
- }
147
-
148
- .feedback-panel-backdrop.show {
149
- opacity: 1;
150
- pointer-events: auto;
151
- }
152
-
153
133
  .feedback-panel-content {
154
- background: white;
134
+ background: var(--color-white);
155
135
  height: 100%;
156
136
  display: flex;
157
137
  flex-direction: column;
158
- border-radius: 16px;
159
- box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
160
- 0 10px 10px -5px rgba(0, 0, 0, 0.04),
161
- 0 0 0 1px rgba(0, 0, 0, 0.05);
162
- }
163
-
164
- .feedback-panel.theme-dark .feedback-panel-content {
165
- background: #1F2937;
166
- color: white;
138
+ border-radius: var(--radius-2xl);
139
+ box-shadow: var(--shadow-xl);
140
+ border: 1px solid var(--color-border);
167
141
  }
168
142
 
169
143
  .feedback-panel-header {
170
144
  display: flex;
171
145
  align-items: center;
172
146
  justify-content: space-between;
173
- padding: 24px;
174
- border-bottom: 1px solid #E5E7EB;
147
+ padding: var(--spacing-6);
148
+ border-bottom: 1px solid var(--color-border);
175
149
  flex-shrink: 0;
176
150
  }
177
151
 
178
- .feedback-panel.theme-dark .feedback-panel-header {
179
- border-bottom-color: #374151;
180
- }
181
-
182
152
  .feedback-panel-header h3 {
183
153
  margin: 0;
184
- font-size: 18px;
185
- font-weight: 600;
186
- color: #111827;
187
- }
188
-
189
- .feedback-panel.theme-dark .feedback-panel-header h3 {
190
- color: white;
191
- }
192
-
193
- .feedback-panel-close {
194
- background: none;
195
- border: none;
196
- font-size: 24px;
197
- cursor: pointer;
198
- color: #6B7280;
199
- padding: 4px;
200
- width: 32px;
201
- height: 32px;
202
- display: flex;
203
- align-items: center;
204
- justify-content: center;
205
- border-radius: 6px;
206
- transition: all 0.2s ease;
207
- }
208
-
209
- .feedback-panel-close:hover {
210
- background: #F3F4F6;
211
- color: #111827;
212
- }
213
-
214
- .feedback-panel-close:focus-visible {
215
- outline: 2px solid #155EEF;
216
- outline-offset: 2px;
217
- }
218
-
219
- .feedback-panel.theme-dark .feedback-panel-close {
220
- color: #9CA3AF;
221
- }
222
-
223
- .feedback-panel.theme-dark .feedback-panel-close:hover {
224
- background: #374151;
225
- color: white;
154
+ font-size: var(--font-size-xl);
155
+ font-weight: var(--font-weight-semibold);
156
+ color: var(--color-text-primary);
226
157
  }
227
158
 
228
159
  .feedback-panel-body {
229
160
  flex: 1;
230
161
  overflow-y: auto;
231
- padding: 24px;
162
+ padding: var(--spacing-6);
232
163
  }
233
164
 
234
165
  .feedback-form {
@@ -237,178 +168,23 @@ export const feedbackStyles = `
237
168
  height: 100%;
238
169
  }
239
170
 
240
- .feedback-form-group {
241
- display: flex;
242
- flex-direction: column;
243
- gap: 8px;
244
- margin-bottom: 20px;
245
- }
246
-
247
- .feedback-form-group:last-child {
248
- margin-bottom: 0;
249
- }
250
-
251
- .feedback-form-group label {
252
- font-size: 14px;
253
- font-weight: 500;
254
- line-height: 1.25;
255
- color: #374151;
256
- }
257
-
258
- .feedback-panel.theme-dark .feedback-form-group label {
259
- color: #D1D5DB;
260
- }
261
-
262
- .feedback-form-group input {
263
- height: 44px;
264
- width: 100%;
265
- border-radius: 8px;
266
- border: 1px solid #D1D5DB;
267
- padding: 10px 14px;
268
- font-size: 15px;
269
- font-weight: 400;
270
- line-height: 1.5;
271
- color: #1F2937;
272
- font-family: inherit;
273
- outline: none;
274
- transition: all 0.2s ease;
275
- }
276
-
277
- .feedback-form-group input::placeholder {
278
- font-size: 15px;
279
- color: #9CA3AF;
280
- }
281
-
282
- .feedback-form-group input:focus {
283
- border-color: #155EEF;
284
- box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
285
- }
286
-
287
- .feedback-form-group input:focus-visible {
288
- outline: none;
289
- }
290
-
291
- .feedback-form-group textarea {
292
- min-height: 200px;
293
- width: 100%;
294
- resize: vertical;
295
- border-radius: 8px;
296
- border: 1px solid #D1D5DB;
297
- padding: 10px 14px;
298
- font-size: 15px;
299
- font-weight: 400;
300
- line-height: 1.5;
301
- color: #1F2937;
302
- font-family: inherit;
303
- outline: none;
304
- transition: all 0.2s ease;
305
- }
306
-
307
- .feedback-form-group textarea::placeholder {
308
- font-size: 15px;
309
- color: #9CA3AF;
310
- }
311
-
312
- .feedback-form-group textarea:focus {
313
- border-color: #155EEF;
314
- box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
315
- }
316
-
317
- .feedback-form-group textarea:focus-visible {
318
- outline: none;
319
- }
320
-
321
- .feedback-panel.theme-dark .feedback-form-group input,
322
- .feedback-panel.theme-dark .feedback-form-group textarea {
323
- background: #374151;
324
- border-color: #4B5563;
325
- color: white;
326
- }
327
-
328
- .feedback-panel.theme-dark .feedback-form-group input::placeholder,
329
- .feedback-panel.theme-dark .feedback-form-group textarea::placeholder {
330
- color: #6B7280;
331
- }
332
-
333
- .feedback-btn {
334
- position: relative;
335
- display: inline-flex;
336
- align-items: center;
337
- justify-content: center;
338
- overflow: hidden;
339
- border-radius: 8px;
340
- border: none;
341
- height: 44px;
342
- padding: 10px 18px;
343
- font-size: 15px;
344
- font-weight: 500;
345
- font-family: inherit;
346
- cursor: pointer;
347
- transition: all 0.2s ease;
348
- }
349
-
350
- .feedback-btn:disabled {
351
- opacity: 0.6;
352
- cursor: not-allowed;
353
- }
354
-
355
- .feedback-btn:focus-visible {
356
- outline: 2px solid #155EEF;
357
- outline-offset: 2px;
358
- }
359
-
360
- .feedback-btn-submit {
361
- background: #155EEF;
362
- color: white;
363
- width: 100%;
364
- }
365
-
366
- .feedback-btn-submit:hover:not(:disabled) {
367
- background: #4338ca;
368
- }
369
-
370
- .feedback-btn-submit:active:not(:disabled) {
371
- background: #3730a3;
372
- }
373
-
374
- .feedback-btn-cancel {
375
- background: transparent;
376
- color: #6B7280;
377
- border: 1px solid #D1D5DB;
378
- }
379
-
380
- .feedback-btn-cancel:hover:not(:disabled) {
381
- background: #F9FAFB;
382
- border-color: #9CA3AF;
383
- color: #374151;
384
- }
385
-
386
- .feedback-panel.theme-dark .feedback-btn-cancel {
387
- color: #D1D5DB;
388
- border-color: #4B5563;
389
- }
390
-
391
- .feedback-panel.theme-dark .feedback-btn-cancel:hover:not(:disabled) {
392
- background: #374151;
393
- }
394
-
395
171
  .feedback-form-actions {
396
172
  display: flex;
397
173
  flex-direction: column;
398
- gap: 12px;
174
+ gap: var(--spacing-3);
399
175
  margin-top: auto;
400
- padding-top: 24px;
176
+ padding-top: var(--spacing-6);
401
177
  }
402
178
 
403
179
  .feedback-error {
404
- color: #DC2626;
405
- font-size: 14px;
406
- font-weight: 400;
407
- margin-top: 8px;
408
- padding: 12px;
409
- background: #FEE2E2;
410
- border: 1px solid #FECACA;
411
- border-radius: 8px;
180
+ color: var(--color-error-dark);
181
+ font-size: var(--font-size-base);
182
+ font-weight: var(--font-weight-normal);
183
+ margin-top: var(--spacing-2);
184
+ padding: var(--spacing-3);
185
+ background: var(--color-error-light);
186
+ border: 1px solid var(--color-error-border);
187
+ border-radius: var(--radius-md);
412
188
  display: none;
413
189
  }
414
190
 
@@ -416,89 +192,14 @@ export const feedbackStyles = `
416
192
  display: block;
417
193
  }
418
194
 
419
- .feedback-panel.theme-dark .feedback-error {
420
- background: #7F1D1D;
421
- border-color: #991B1B;
422
- color: #FCA5A5;
423
- }
424
-
425
- /* ==================== SUCCESS NOTIFICATION ==================== */
426
- .feedback-success-notification {
427
- position: fixed;
428
- top: 24px;
429
- right: 24px;
430
- z-index: 1000002;
431
- background: white;
432
- border: 1px solid #D1FAE5;
433
- border-radius: 12px;
434
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
435
- animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
436
- min-width: 320px;
437
- }
438
-
439
- .feedback-success-content {
440
- display: flex;
441
- align-items: center;
442
- padding: 16px 20px;
443
- gap: 12px;
444
- }
445
-
446
- .feedback-success-icon {
447
- width: 20px;
448
- height: 20px;
449
- border-radius: 50%;
450
- background: #10B981;
451
- color: white;
452
- display: flex;
453
- align-items: center;
454
- justify-content: center;
455
- font-size: 12px;
456
- font-weight: 600;
457
- flex-shrink: 0;
458
- }
459
-
460
- .feedback-success-content span {
461
- color: #065F46;
462
- font-weight: 500;
463
- font-size: 14px;
464
- flex: 1;
465
- }
466
-
467
- .feedback-success-close {
468
- background: none;
469
- border: none;
470
- color: #6B7280;
471
- cursor: pointer;
472
- font-size: 20px;
473
- padding: 0;
474
- width: 24px;
475
- height: 24px;
476
- display: flex;
477
- align-items: center;
478
- justify-content: center;
479
- transition: all 0.2s ease;
480
- border-radius: 4px;
481
- flex-shrink: 0;
482
- }
483
-
484
- .feedback-success-close:hover {
485
- background: #F3F4F6;
486
- color: #374151;
487
- }
488
-
489
- .feedback-success-close:focus-visible {
490
- outline: 2px solid #155EEF;
491
- outline-offset: 2px;
492
- }
493
-
494
195
  @media (max-width: 768px) {
495
196
  .feedback-widget-button {
496
- bottom: 16px;
497
- right: 16px;
197
+ bottom: var(--spacing-4);
198
+ right: var(--spacing-4);
498
199
  }
499
200
 
500
201
  .feedback-widget-button.position-bottom-left {
501
- left: 16px;
202
+ left: var(--spacing-4);
502
203
  }
503
204
 
504
205
  .feedback-minimize-icon,
@@ -524,7 +225,7 @@ export const feedbackStyles = `
524
225
  height: 85vh;
525
226
  max-height: 85vh;
526
227
  transform: translateY(100%);
527
- border-radius: 20px 20px 0 0;
228
+ border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
528
229
  }
529
230
 
530
231
  .feedback-panel.open {
@@ -532,43 +233,32 @@ export const feedbackStyles = `
532
233
  }
533
234
 
534
235
  .feedback-panel-content {
535
- border-radius: 20px 20px 0 0;
236
+ border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
536
237
  }
537
238
 
538
239
  .feedback-panel-header {
539
- padding: 20px;
240
+ padding: var(--spacing-5);
540
241
  position: relative;
541
242
  }
542
243
 
543
244
  .feedback-panel-header::before {
544
245
  content: '';
545
246
  position: absolute;
546
- top: 8px;
247
+ top: var(--spacing-2);
547
248
  left: 50%;
548
249
  transform: translateX(-50%);
549
250
  width: 40px;
550
251
  height: 4px;
551
- background: #D1D5DB;
252
+ background: var(--color-neutral-300);
552
253
  border-radius: 2px;
553
254
  }
554
255
 
555
- .feedback-panel.theme-dark .feedback-panel-header::before {
556
- background: #4B5563;
557
- }
558
-
559
256
  .feedback-panel-body {
560
- padding: 20px;
257
+ padding: var(--spacing-5);
561
258
  }
562
259
 
563
260
  .feedback-form-group textarea {
564
261
  min-height: 150px;
565
262
  }
566
-
567
- .feedback-success-notification {
568
- top: 16px;
569
- right: 16px;
570
- left: 16px;
571
- min-width: auto;
572
- }
573
263
  }
574
- `;
264
+ `;