@textback/notification-widget 2.0.1-110396 → 2.0.1-13997

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 (81) hide show
  1. package/build/index.js +2 -5
  2. package/build/sdk.js +2 -2
  3. package/package.json +4 -5
  4. package/readme.md +11 -90
  5. package/server.js +220 -224
  6. package/src/libraries/localization/getLocale.js +17 -17
  7. package/src/libraries/localization/locales/cs.js +21 -23
  8. package/src/libraries/localization/locales/en.js +21 -23
  9. package/src/libraries/localization/locales/pl.js +21 -23
  10. package/src/libraries/localization/locales/ro.js +21 -23
  11. package/src/libraries/localization/locales/ru.js +21 -22
  12. package/src/libraries/localization/locales/uk.js +21 -23
  13. package/src/sdk/channels/facebook.js +1 -1
  14. package/src/sdk/channels/factory.js +33 -33
  15. package/src/sdk/channels/skype.js +1 -1
  16. package/src/sdk/channels/telegram.js +2 -2
  17. package/src/sdk/channels/viber.js +1 -1
  18. package/src/sdk/channels/vk.js +147 -158
  19. package/src/sdk/channels/whatsapp.js +21 -27
  20. package/src/sdk/sdk.js +5 -42
  21. package/src/sdk/utils/appInsights.js +2 -2
  22. package/src/sdk/utils/cookies.js +1 -18
  23. package/src/sdk/utils/loadDeepLink.js +13 -40
  24. package/src/sdk/widget/widget.js +107 -159
  25. package/src/widget/components/index.js +48 -52
  26. package/src/widget/components/tb-notification-button/facebook.js +48 -55
  27. package/src/widget/components/tb-notification-button/skype.js +47 -0
  28. package/src/widget/components/tb-notification-button/styles.scss +16 -240
  29. package/src/widget/components/tb-notification-button/telegram.js +48 -55
  30. package/src/widget/components/tb-notification-button/viber.js +49 -56
  31. package/src/widget/components/tb-notification-button/vk.js +83 -92
  32. package/src/widget/components/tb-notification-button/whatsapp.js +51 -58
  33. package/src/widget/components/tb-notification-widget/index.js +473 -694
  34. package/src/widget/components/tb-notification-widget/normalize.scss +1 -2
  35. package/src/widget/components/tb-notification-widget/styles.scss +180 -543
  36. package/src/widget/config.js +1 -1
  37. package/src/widget/icons/icon_facebook_circle.svg +2 -0
  38. package/src/widget/icons/icon_tg_circle.svg +10 -0
  39. package/src/widget/icons/icon_viber_circle.svg +10 -0
  40. package/src/widget/icons/icon_viber_new.svg +1 -1
  41. package/src/widget/icons/icon_vk_circle.svg +1 -1
  42. package/src/widget/icons/icon_whatsapp.svg +4 -4
  43. package/src/widget/icons/icon_whatsapp_circle.svg +2 -2
  44. package/src/widget/icons/icon_whatsapp_new.svg +2 -2
  45. package/src/widget/icons/text-back-badge.png +0 -0
  46. package/src/widget/locales/cz.js +20 -0
  47. package/src/widget/locales/en.js +20 -42
  48. package/src/widget/locales/index.js +8 -8
  49. package/src/widget/locales/pl.js +20 -42
  50. package/src/widget/locales/ro.js +19 -40
  51. package/src/widget/locales/ru.js +20 -41
  52. package/src/widget/locales/uk.js +20 -41
  53. package/src/widget/utils/getLocale.js +14 -16
  54. package/src/widget/utils/stringifyAttributes.js +1 -1
  55. package/src/widget/utils/text.js +8 -9
  56. package/src/widget/widget.entry.js +1 -0
  57. package/tests/gf.html +2 -2
  58. package/v8-compile-cache-0/5.1.281.102/zSvstszSagentzS_workzS5zSszSnode_moduleszSwebpack-clizSbinzScli.js.BLOB +0 -0
  59. package/v8-compile-cache-0/5.1.281.102/zSvstszSagentzS_workzS5zSszSnode_moduleszSwebpack-clizSbinzScli.js.MAP +1 -0
  60. package/views/examples.ejs +47 -51
  61. package/views/sdk.html +17 -35
  62. package/webpack.dev.js +2 -2
  63. package/src/sdk/channels/whatsappb.js +0 -27
  64. package/src/widget/components/tb-notification-button/whatsappb.js +0 -58
  65. package/src/widget/components/tb-nw-wahunter/index.js +0 -261
  66. package/src/widget/components/tb-nw-wahunter/styles.scss +0 -471
  67. package/src/widget/icons/icon_chat_window.svg +0 -1
  68. package/src/widget/icons/icon_close.svg +0 -1
  69. package/src/widget/icons/icon_whatsapp_hollow.svg +0 -128
  70. package/src/widget/icons/icon_whatsappb.svg +0 -147
  71. package/src/widget/icons/icon_whatsappb_circle.svg +0 -4
  72. package/src/widget/icons/icon_whatsappb_new.svg +0 -127
  73. package/src/widget/icons/paper-plane-arrow.svg +0 -3
  74. package/src/widget/icons/tb-logo-dark-en.svg +0 -17
  75. package/src/widget/icons/tb-logo-dark-ru.svg +0 -17
  76. package/src/widget/icons/tb-logo-dark.svg +0 -16
  77. package/src/widget/icons/tb-logo-light-en.svg +0 -17
  78. package/src/widget/icons/tb-logo-light-ru.svg +0 -17
  79. package/src/widget/icons/tb-logo-white.svg +0 -16
  80. package/src/widget/icons/tb-logo.svg +0 -16
  81. package/src/widget/locales/cs.js +0 -42
@@ -1,543 +1,180 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');
2
-
3
- @mixin hidden {
4
- visibility: hidden;
5
- opacity: 0;
6
- }
7
-
8
- @mixin visible {
9
- visibility: visible;
10
- opacity: 1;
11
- }
12
-
13
- tb-notification-widget {
14
- color: #333;
15
-
16
- &.tb-no-api-call {
17
- display: block;
18
- }
19
-
20
- all: initial;
21
- display: inline-block;
22
- font-family: 'Open Sans',
23
- 'Droid Sans',
24
- Arial,
25
- sans-serif;
26
- line-height: 1.42857;
27
-
28
- #tb-notification-widget-inner.tb-notification-widget-inner {
29
- .hidden {
30
- display: none;
31
- }
32
-
33
- .tb-pallet-dark {
34
- background-color: #2e2e2e;
35
- color: #fff;
36
-
37
- #tb-notification-brand-badge {
38
- color: #fff;
39
- fill: #fff;
40
- }
41
- }
42
-
43
- .tb-pallet-light {
44
- $color-tb-badge-dark-text: #777777;
45
-
46
- #tb-notification-brand-badge {
47
- color: $color-tb-badge-dark-text;
48
- fill: $color-tb-badge-dark-text;
49
- }
50
- }
51
-
52
-
53
- @keyframes spin {
54
- from {
55
- transform: rotate(0deg);
56
- }
57
-
58
- to {
59
- transform: rotate(360deg);
60
- }
61
- }
62
-
63
- tb-notification-widget-overlay {
64
- display: block;
65
- text-align: center;
66
- position: fixed;
67
- z-index: 11000;
68
- left: 0;
69
- top: 0;
70
- width: 100%;
71
- height: 100%;
72
- overflow-x: hidden;
73
- overflow-y: auto;
74
- background-color: rgba(0, 0, 0, 0.4);
75
-
76
- &.hidden {
77
- display: none;
78
- }
79
-
80
- &:before {
81
- display: inline-block;
82
- vertical-align: middle;
83
- content: " ";
84
- height: 100%;
85
- }
86
- }
87
-
88
- tb-notification-widget-popup {
89
- box-sizing: content-box;
90
- display: inline-block;
91
- position: relative;
92
- background-color: #fefefe;
93
- margin: 0px auto;
94
- width: 240px;
95
- padding: 20px 35px 24px 35px;
96
- box-shadow: 0px 0px 2px 1px rgb(126, 126, 126);
97
- border-radius: 5px;
98
- vertical-align: middle;
99
-
100
- span.tb-notification-widget-close-icon {
101
- line-height: 1;
102
- opacity: 1;
103
- text-shadow: none;
104
- position: absolute;
105
- right: 10px;
106
- top: 5px;
107
- color: #aaa;
108
- float: right;
109
- font-weight: bold;
110
- font-size: 28px;
111
- }
112
-
113
- span.tb-notification-widget-close-icon {
114
-
115
- &:hover,
116
- &:active {
117
- opacity: 1;
118
- color: black;
119
- text-decoration: none;
120
- cursor: pointer;
121
- }
122
- }
123
- }
124
-
125
- tb-notification-widget-popup-body,
126
- tb-notification-widget-popup-main,
127
- tb-notification-widget-image {
128
- display: block;
129
- }
130
-
131
- .tb-popup-with-image {
132
- min-width: 300px;
133
- width: 95%;
134
- box-sizing: border-box;
135
- font-size: 13px;
136
- padding: 0;
137
-
138
- tb-widget-header-container {
139
- font-size: 1.5em;
140
- line-height: 1.3;
141
- margin-bottom: 0.4em;
142
- }
143
-
144
- tb-widget-description-container {
145
- font-size: 1.1em;
146
- margin-bottom: 1.3em;
147
- }
148
- }
149
-
150
- .tb-popup-vertical {
151
- max-width: 680px;
152
- }
153
-
154
- .tb-popup-horizontal {
155
- max-width: 780px;
156
- }
157
-
158
-
159
- .tb-notification-widget-popup-body {
160
- &_image-align_top,
161
- &_image-align_left,
162
- &_image-align_right {
163
- display: flex;
164
- flex-direction: column;
165
-
166
- tb-notification-widget-popup-main {
167
- padding: 1em 10% 3em;
168
- }
169
-
170
- tb-notification-widget-image {
171
- padding: 20% 0;
172
- background-size: cover;
173
- background-position: center;
174
- background-repeat: no-repeat;
175
- border-radius: 4px 4px 0px 0px;
176
-
177
- img {
178
- display: none;
179
- }
180
- }
181
- }
182
-
183
- &_image-align_none {
184
- tb-notification-widget-popup-main {
185
- padding: 3em 10% 4em;
186
- }
187
-
188
- tb-notification-widget-image {
189
- display: none;
190
- }
191
- }
192
- }
193
-
194
-
195
-
196
- tb-notification-widget-icon_body img {
197
- width: 24px;
198
- margin-bottom: 14px;
199
- }
200
-
201
- tb-widget-header-container {
202
- display: block;
203
- font-size: 14px;
204
- font-weight: 600;
205
- margin-bottom: 11px;
206
- }
207
-
208
- tb-widget-header-line {
209
- display: block;
210
- margin: 0;
211
- padding: 0;
212
- }
213
-
214
- tb-widget-description-container {
215
- display: block;
216
- font-size: 11px;
217
- margin-bottom: 23px;
218
- }
219
-
220
- tb-widget-description-line {
221
- display: block;
222
- margin: 5px 0;
223
- padding: 0;
224
- }
225
-
226
- #tb-notification-brand-badge {
227
- font-size: 9px;
228
- height: 2.5em;
229
- display: inline-flex;
230
- align-items: center;
231
- font-family: Montserrat, 'Open Sans', 'Droid Sans', Arial, sans-serif;
232
- text-decoration: none;
233
-
234
- svg {
235
- position: relative;
236
- height: 100%;
237
- top: 0.24em;
238
- margin-left: 0.3em;
239
- }
240
-
241
- .st2 {
242
- fill: inherit;
243
- }
244
- }
245
-
246
- tb-notification-widget-popup,
247
- tb-notification-widget-corner-popup {
248
- #tb-notification-brand-badge {
249
- width: 14em;
250
- position: absolute;
251
- bottom: 1.2em;
252
- right: 1em;
253
- }
254
- }
255
-
256
- /*** Styles for corner-popup ***/
257
- .tb-icon-close {
258
- fill: #000;
259
- }
260
-
261
- tb-notification-widget-corner-popup {
262
- text-align: center;
263
- position: fixed;
264
- font-size: 12px;
265
- bottom: 1.7em;
266
- right: 1.7em;
267
- left: 1.4em;
268
- z-index: 999999;
269
- }
270
-
271
- tb-widget-corner-popup-button {
272
- display: block;
273
- position: absolute;
274
- right: 0;
275
- bottom: 0;
276
- border-radius: 50%;
277
- width: 4.6em;
278
- height: 4.6em;
279
- cursor: pointer;
280
- box-shadow: 0 0 10px 0 rgba(0, 0, 0, .3);
281
- cursor: pointer;
282
-
283
- svg {
284
- position: absolute;
285
- top: 8%;
286
- bottom: 0;
287
- right: 0;
288
- left: 0;
289
- margin: auto;
290
- transition: all 0.2s linear;
291
- }
292
-
293
- .tb-icon-close {
294
- width: 30%;
295
- @include hidden;
296
- transform: scale(.1);
297
- }
298
-
299
- .tb-icon-whatsapp-hollow {
300
- width: 80%;
301
- }
302
- }
303
-
304
- tb-widget-corner-popup-window {
305
- display: block;
306
- position: fixed;
307
- top: 0;
308
- left: 0;
309
- box-sizing: border-box;
310
- width: 100%;
311
- height: 100%;
312
- padding: 100px 35px 40px;
313
- @include hidden;
314
- background: #fff;
315
- overflow: hidden;
316
- }
317
-
318
- tb-widget-corner-popup-tooltip-container {
319
- $color-tooltip-bg: rgba(0, 0, 0, 0.685);
320
-
321
- display: none;
322
- position: absolute;
323
- min-height: 4.6em;
324
- bottom: 0px;
325
- right: 5em;
326
- align-items: center;
327
-
328
- tb-widget-corner-popup-tooltip {
329
- display: inline-block;
330
- white-space: pre-line;;
331
- line-height: 1.5;
332
- font-family: Montserrat, 'Open Sans', 'Droid Sans', Arial, sans-serif;
333
- border-radius: 5px;
334
- background: $color-tooltip-bg;
335
- color: white;
336
- padding: 0.8em;
337
- }
338
-
339
- tb-widget-corner-popup-tooltip-arrow {
340
- $border-width: 0.77em;
341
- display: block;
342
- border-top: $border-width solid transparent;
343
- border-bottom: $border-width solid transparent;
344
- border-left: $border-width solid $color-tooltip-bg;
345
- align-self: flex-end;
346
- margin-bottom: 1.538em;
347
- }
348
- }
349
-
350
- .tb-widget-corner-popup-tooltip-container_show-on-mobile {
351
- display: flex;
352
- }
353
-
354
- tb-widget-corner-popup-window,
355
- tb-widget-corner-popup-tooltip-container,
356
- tb-widget-corner-popup-button {
357
- transition: visibility 0.2s linear, opacity 0.2s linear;
358
- }
359
-
360
- .tb-fullscreen-close-rectangle {
361
- position: fixed;
362
- display: flex;
363
- justify-content: flex-end;
364
- top: 0;
365
- left: 0;
366
- width: 100%;
367
- background: #000000;
368
- height: 50px;
369
-
370
- .tb-icon-close {
371
- box-sizing: border-box;
372
- height: 100%;
373
- padding: 17px 15px;
374
- fill: #fff;
375
- }
376
- }
377
-
378
- tb-notification-widget-corner-popup.tb-opened-corner-popup {
379
- tb-widget-corner-popup-window {
380
- @include visible;
381
- }
382
-
383
- tb-widget-corner-popup-button {
384
- @include hidden;
385
- }
386
-
387
- tb-widget-corner-popup-tooltip-container {
388
- @include hidden;
389
- }
390
- }
391
-
392
-
393
- /**** Small devices (portrait tablets and large phones, 600px and up) ****/
394
- @media only screen and (min-width: 600px) {
395
- .tb-popup-with-image {
396
- font-size: 15px;
397
- }
398
-
399
- .tb-notification-widget-popup-body {
400
-
401
- &_image-align_left,
402
- &_image-align_right {
403
- padding: 2.5em 2em 4em;
404
- align-items: center;
405
-
406
- tb-notification-widget-popup-main {
407
- padding: 0;
408
- }
409
-
410
- tb-notification-widget-image {
411
- background: none !important;
412
- max-width: 280px;
413
- width: 100%;
414
- display: flex;
415
- flex-shrink: 1;
416
- padding: 0;
417
-
418
- img {
419
- width: 100%;
420
- display: block;
421
- }
422
- }
423
- }
424
-
425
- &_image-align_left {
426
- flex-direction: row;
427
-
428
- tb-notification-widget-image {
429
- margin-right: 2em;
430
- }
431
- }
432
-
433
- &_image-align_right {
434
- flex-direction: row-reverse;
435
-
436
- tb-notification-widget-image {
437
- margin-left: 3em;
438
- }
439
- }
440
- }
441
- }
442
-
443
-
444
-
445
- /**** styles for non-mobile ****/
446
- @media only screen and (min-device-width: 736px) {
447
- tb-notification-widget-popup {
448
- width: 525px;
449
- padding: 42px 80px 72px 80px;
450
-
451
- &.wahunter-popup {
452
- width: 95%;
453
- padding: 0;
454
- }
455
- }
456
-
457
- .tb-popup-with-image {
458
- font-size: 16px;
459
- }
460
-
461
- tb-widget-header-container {
462
- font-size: 28px;
463
- margin-bottom: 24px;
464
- }
465
-
466
- tb-notification-widget-icon_body img {
467
- width: 48px;
468
- margin-bottom: 30px;
469
- }
470
-
471
- tb-widget-description-container {
472
- font-size: 22px;
473
- margin-bottom: 40px;
474
- }
475
-
476
- tb-notification-widget-popup {
477
- #tb-notification-brand-badge {
478
- font-size: 12px;
479
- }
480
- }
481
-
482
- tb-widget-corner-popup-window {
483
- position: absolute;
484
- right: 0px;
485
- bottom: 6em;
486
- top: initial;
487
- left: initial;
488
- width: 360px;
489
- width: 360px;
490
- height: auto;
491
- box-shadow: 0 0 20px 0 rgba(0,0,0,0.4);
492
- padding: 30px 35px 50px;
493
- border-radius: 5px;
494
- }
495
-
496
- .tb-fullscreen-close-rectangle {
497
- display: none;
498
- }
499
-
500
- tb-notification-widget-corner-popup {
501
- font-size: 13px;
502
- }
503
-
504
- tb-notification-widget-corner-popup.tb-opened-corner-popup {
505
- tb-widget-corner-popup-window {
506
- @include visible;
507
- }
508
-
509
- tb-widget-corner-popup-button {
510
- background: #fff !important;
511
- @include visible;
512
-
513
- .tb-icon-close {
514
- @include visible;
515
- transform: rotate(0deg) scale(1);
516
- }
517
-
518
- .tb-icon-whatsapp-hollow {
519
- @include hidden;
520
- transform: scale(.1);
521
- }
522
- }
523
- }
524
-
525
- tb-widget-corner-popup-tooltip-container {
526
- display: flex;
527
- }
528
- }
529
- }
530
- }
531
-
532
-
533
- .vk-app-link {
534
- align-items: center;
535
- display: grid;
536
- grid-column-gap: 0.25em;
537
- grid-template-columns: 3em 184px;
538
- }
539
-
540
- .vk-app-link>tb-notification-button__text {
541
- border-radius: 0.15em;
542
- padding: 0.25em;
543
- }
1
+ tb-notification-widget {
2
+ &.tb-no-api-call {
3
+ display: block;
4
+ }
5
+
6
+ all: initial;
7
+ display: inline-block;
8
+ font-family: 'Open Sans', 'Droid Sans', Arial, sans-serif;
9
+ line-height: 1.42857;
10
+ position: relative;
11
+
12
+ #tb-notification-widget-inner.tb-notification-widget-inner {
13
+ .hidden {
14
+ display: none;
15
+ }
16
+
17
+
18
+ @keyframes spin {
19
+ from {
20
+ transform: rotate(0deg);
21
+ }
22
+
23
+ to {
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+
28
+ tb-notification-widget-overlay {
29
+ display: block;
30
+ text-align: center;
31
+ position: fixed;
32
+ z-index: 11000;
33
+ left: 0;
34
+ top: 0;
35
+ width: 100%;
36
+ height: 100%;
37
+ overflow-x: hidden;
38
+ overflow-y: auto;
39
+ background-color: rgba(0, 0, 0, 0.4);
40
+ &.hidden {
41
+ display: none;
42
+ }
43
+
44
+ &:before {
45
+ display: inline-block;
46
+ vertical-align: middle;
47
+ content: " ";
48
+ height: 100%;
49
+ }
50
+ }
51
+
52
+ tb-notification-widget-popup {
53
+ box-sizing: content-box;
54
+ display: inline-block;
55
+ position: relative;
56
+ background-color: #fefefe;
57
+ margin: 0px auto;
58
+ width: 240px;
59
+ padding: 20px 35px 22px 35px;
60
+ border: 1px solid #888;
61
+ border-radius: 5px;
62
+ vertical-align: middle;
63
+ &.pallet-dark {
64
+ background-color: #282828;
65
+ }
66
+ span.tb-notification-widget-close-icon {
67
+ line-height: 1;
68
+ opacity: 1;
69
+ text-shadow: none;
70
+ position: absolute;
71
+ top: 2px;
72
+ right: 5px;
73
+ color: #aaa;
74
+ float: right;
75
+ font-size: 16px;
76
+ font-weight: bold;
77
+ }
78
+ #tb-notification-brand-badge {
79
+ position: absolute;
80
+ bottom: 10px;
81
+ right: 10px;
82
+ width: 80px;
83
+ }
84
+ span.tb-notification-widget-close-icon {
85
+ &:hover, &:active {
86
+ opacity: 1;
87
+ color: black;
88
+ text-decoration: none;
89
+ cursor: pointer;
90
+ }
91
+ }
92
+ }
93
+
94
+ tb-notification-widget-icon_body img {
95
+ width: 24px;
96
+ margin-bottom: 14px;
97
+ }
98
+
99
+ tb-widget-header-container {
100
+ display: block;
101
+ font-size: 14px;
102
+ font-weight: 600;
103
+ margin-bottom: 11px;
104
+ }
105
+
106
+ tb-widget-header-line {
107
+ display: block;
108
+ margin: 0;
109
+ padding: 0;
110
+ }
111
+
112
+ tb-notification-widget-popup.pallet-dark tb-widget-header-line {
113
+ color: white !important;
114
+ }
115
+
116
+ tb-widget-description-container {
117
+ display: block;
118
+ font-size: 11px;
119
+ margin-bottom: 23px;
120
+ }
121
+
122
+ tb-widget-description-line {
123
+ display: block;
124
+ margin: 5px 0;
125
+ padding: 0;
126
+ }
127
+
128
+ tb-notification-widget-popup.pallet-dark tb-widget-description-line {
129
+ color: white !important;
130
+ }
131
+
132
+ /*styles for non mobile*/
133
+ //small
134
+ @media only screen and (min-device-width: 736px) {
135
+ tb-notification-widget-popup {
136
+ width: 525px;
137
+ padding: 42px 80px 72px 80px;
138
+ }
139
+ tb-widget-header-container {
140
+ font-size: 28px;
141
+ margin-bottom: 24px;
142
+ }
143
+ tb-notification-widget-icon_body img {
144
+ width: 48px;
145
+ margin-bottom: 30px;
146
+ }
147
+ tb-widget-description-container {
148
+ font-size: 22px;
149
+ margin-bottom: 40px;
150
+ }
151
+ tb-notification-widget-popup {
152
+ #tb-notification-brand-badge {
153
+ bottom: 20px;
154
+ right: 20px;
155
+ width: 160px;
156
+ }
157
+ span.tb-notification-widget-close-icon {
158
+ font-size: 28px;
159
+ right: 10px;
160
+ top: 5px;
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ .vk-app-link {
168
+ align-items: center;
169
+ display: grid;
170
+ grid-column-gap: 0.25em;
171
+ grid-template-columns: 3em 184px;
172
+ justify-content: center;
173
+ }
174
+
175
+ .vk-app-link > tb-notification-button__text {
176
+ background: #5181b8;
177
+ border-radius: 0.15em;
178
+ color: white;
179
+ padding: 0.25em;
180
+ }