@textback/notification-widget 2.0.0 → 2.0.1-102913

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/.eslintrc.js +291 -291
  2. package/build/index.js +12 -0
  3. package/build/sdk.js +9 -0
  4. package/package.json +70 -68
  5. package/promote_tag.sh +1 -1
  6. package/readme.md +569 -490
  7. package/server.js +8 -4
  8. package/src/libraries/ai.1.0.11.js +4088 -4088
  9. package/src/libraries/localization/locales/cs.js +14 -12
  10. package/src/libraries/localization/locales/en.js +14 -12
  11. package/src/libraries/localization/locales/index.js +8 -8
  12. package/src/libraries/localization/locales/pl.js +14 -12
  13. package/src/libraries/localization/locales/ro.js +14 -12
  14. package/src/libraries/localization/locales/ru.js +13 -12
  15. package/src/libraries/localization/locales/uk.js +14 -12
  16. package/src/libraries/localization/text.js +9 -9
  17. package/src/libraries/t.js +82 -82
  18. package/src/sdk/channels/channel.js +30 -30
  19. package/src/sdk/channels/facebook.js +13 -13
  20. package/src/sdk/channels/factory.js +3 -3
  21. package/src/sdk/channels/skype.js +12 -12
  22. package/src/sdk/channels/telegram.js +18 -18
  23. package/src/sdk/channels/viber.js +12 -12
  24. package/src/sdk/channels/vk-modal/vk-modal.html +17 -17
  25. package/src/sdk/channels/vk-modal/vk-modal.js +25 -25
  26. package/src/sdk/channels/vk-modal/vk-modal.scss +116 -116
  27. package/src/sdk/channels/vk.js +195 -184
  28. package/src/sdk/channels/whatsapp.js +16 -10
  29. package/src/sdk/channels/whatsappb.js +27 -0
  30. package/src/sdk/events/observer.js +46 -46
  31. package/src/sdk/index.js +5 -5
  32. package/src/sdk/sdk.js +67 -30
  33. package/src/sdk/utils/apiErrorHandler.js +11 -11
  34. package/src/sdk/utils/appInsights.js +88 -88
  35. package/src/sdk/utils/browserInfo.js +8 -8
  36. package/src/sdk/utils/constants.js +17 -17
  37. package/src/sdk/utils/cookies.js +67 -50
  38. package/src/sdk/utils/find.js +7 -7
  39. package/src/sdk/utils/loadConfig.js +20 -20
  40. package/src/sdk/utils/loadDeepLink.js +48 -21
  41. package/src/sdk/utils/loadScript.js +25 -25
  42. package/src/sdk/utils/loadSubscriptions.js +6 -6
  43. package/src/sdk/utils/parseQueryString.js +33 -33
  44. package/src/sdk/utils/windowHelper.js +25 -25
  45. package/src/sdk/widget/widget.js +192 -140
  46. package/src/widget/components/index.js +6 -2
  47. package/src/widget/components/tb-notification-button/facebook.js +9 -2
  48. package/src/widget/components/tb-notification-button/index.js +34 -34
  49. package/src/widget/components/tb-notification-button/styles.scss +657 -433
  50. package/src/widget/components/tb-notification-button/telegram.js +9 -2
  51. package/src/widget/components/tb-notification-button/viber.js +9 -2
  52. package/src/widget/components/tb-notification-button/vk.js +59 -50
  53. package/src/widget/components/tb-notification-button/whatsapp.js +15 -8
  54. package/src/widget/components/tb-notification-button/whatsappb.js +58 -0
  55. package/src/widget/components/tb-notification-widget/index.js +589 -384
  56. package/src/widget/components/tb-notification-widget/normalize.scss +395 -394
  57. package/src/widget/components/tb-notification-widget/styles.scss +502 -139
  58. package/src/widget/components/tb-nw-wahunter/index.js +259 -0
  59. package/src/widget/components/tb-nw-wahunter/styles.scss +471 -0
  60. package/src/widget/config.js +5 -5
  61. package/src/widget/icons/icon_chat_window.svg +1 -0
  62. package/src/widget/icons/icon_close.svg +1 -0
  63. package/src/widget/icons/icon_facebook.svg +7 -7
  64. package/src/widget/icons/icon_facebook_circle.svg +7 -9
  65. package/src/widget/icons/icon_instagram_circle.svg +95 -95
  66. package/src/widget/icons/icon_skype.svg +44 -44
  67. package/src/widget/icons/icon_skype_circle.svg +46 -46
  68. package/src/widget/icons/icon_skype_new.svg +113 -113
  69. package/src/widget/icons/icon_tg.svg +25 -25
  70. package/src/widget/icons/icon_tg_circle.svg +17 -27
  71. package/src/widget/icons/icon_viber.svg +75 -75
  72. package/src/widget/icons/icon_viber_circle.svg +67 -77
  73. package/src/widget/icons/icon_viber_new.svg +102 -102
  74. package/src/widget/icons/icon_vk.svg +14 -14
  75. package/src/widget/icons/icon_vk_circle.svg +16 -16
  76. package/src/widget/icons/icon_whatsapp.svg +147 -147
  77. package/src/widget/icons/icon_whatsapp_circle.svg +3 -3
  78. package/src/widget/icons/icon_whatsapp_hollow.svg +128 -0
  79. package/src/widget/icons/icon_whatsapp_new.svg +127 -127
  80. package/src/widget/icons/icon_whatsappb.svg +147 -0
  81. package/src/widget/icons/icon_whatsappb_circle.svg +4 -0
  82. package/src/widget/icons/icon_whatsappb_new.svg +127 -0
  83. package/src/widget/icons/paper-plane-arrow.svg +3 -0
  84. package/src/widget/icons/tb-logo.svg +21 -0
  85. package/src/widget/index.js +28 -28
  86. package/src/widget/locales/cs.js +42 -0
  87. package/src/widget/locales/en.js +42 -20
  88. package/src/widget/locales/index.js +2 -2
  89. package/src/widget/locales/pl.js +41 -19
  90. package/src/widget/locales/ro.js +41 -20
  91. package/src/widget/locales/ru.js +40 -19
  92. package/src/widget/locales/uk.js +40 -19
  93. package/src/widget/utils/cookiesEx.js +41 -41
  94. package/src/widget/utils/getLocale.js +4 -2
  95. package/src/widget/utils/stringifyAttributes.js +19 -19
  96. package/src/widget/utils/text.js +2 -1
  97. package/src/widget/utils/widgetsStorage.js +28 -28
  98. package/src/widget/widget.entry.js +3 -4
  99. package/tests/gf.html +35 -35
  100. package/tests/gf.js +21 -21
  101. package/tests/index.js +61 -61
  102. package/views/examples.ejs +7 -3
  103. package/views/sdk.html +274 -256
  104. package/webpack.common.js +72 -72
  105. package/webpack.dev.js +15 -15
  106. package/webpack.prod.js +10 -10
  107. package/src/widget/components/tb-notification-button/skype.js +0 -47
  108. package/src/widget/icons/text-back-badge.png +0 -0
  109. package/src/widget/locales/cz.js +0 -20
@@ -1,17 +1,17 @@
1
- <div class="tb-modal">
2
- <div class="tb-modal-dialog">
3
- <div class="tb-modal-content">
4
- <button class="tb-close" type="button">&times;</button>
5
- <div class="tb-modal-content_text">
6
- <p>
7
- Разрешите сообществу присылать сообщения. <br>
8
- Вы в любой момент сможете отписаться.
9
- </p>
10
- </div>
11
- <div class="tb-vk-button">
12
- <div class="tb-vk-icon">{{=vkIcon}}</div>
13
- <div id="{{=vkPluginContainerId}}"></div>
14
- </div>
15
- </div>
16
- </div>
17
- </div>
1
+ <div class="tb-modal">
2
+ <div class="tb-modal-dialog">
3
+ <div class="tb-modal-content">
4
+ <button class="tb-close" type="button">&times;</button>
5
+ <div class="tb-modal-content_text">
6
+ <p>
7
+ Разрешите сообществу присылать сообщения. <br>
8
+ Вы в любой момент сможете отписаться.
9
+ </p>
10
+ </div>
11
+ <div class="tb-vk-button">
12
+ <div class="tb-vk-icon">{{=vkIcon}}</div>
13
+ <div id="{{=vkPluginContainerId}}"></div>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
@@ -1,25 +1,25 @@
1
- import t from '../../../libraries/t.js';
2
-
3
- import './vk-modal.scss';
4
- import vkTemplate from './vk-modal.html';
5
- import vkIcon from '../../../widget/icons/icon_vk.svg';
6
-
7
- export default class VKModal {
8
- constructor(vkPluginContainerId) {
9
- const modalContainer = document.createElement('div');
10
-
11
- modalContainer.innerHTML = new t(vkTemplate).render({ vkPluginContainerId, vkIcon });
12
-
13
- this.element = document.body.appendChild(modalContainer.firstChild);
14
- this.element.querySelector('.tb-close').addEventListener('click', event => {
15
- document.body.classList.remove('tb-modal-open');
16
- document.body.removeChild(this.element);
17
-
18
- if (this.onClose) {
19
- this.onClose();
20
- }
21
- });
22
-
23
- document.body.classList.add('tb-modal-open');
24
- }
25
- }
1
+ import t from '../../../libraries/t.js';
2
+
3
+ import './vk-modal.scss';
4
+ import vkTemplate from './vk-modal.html';
5
+ import vkIcon from '../../../widget/icons/icon_vk.svg';
6
+
7
+ export default class VKModal {
8
+ constructor(vkPluginContainerId) {
9
+ const modalContainer = document.createElement('div');
10
+
11
+ modalContainer.innerHTML = new t(vkTemplate).render({ vkPluginContainerId, vkIcon });
12
+
13
+ this.element = document.body.appendChild(modalContainer.firstChild);
14
+ this.element.querySelector('.tb-close').addEventListener('click', event => {
15
+ document.body.classList.remove('tb-modal-open');
16
+ document.body.removeChild(this.element);
17
+
18
+ if (this.onClose) {
19
+ this.onClose();
20
+ }
21
+ });
22
+
23
+ document.body.classList.add('tb-modal-open');
24
+ }
25
+ }
@@ -1,116 +1,116 @@
1
- .tb-modal-open {
2
- overflow: hidden;
3
-
4
- .tb-modal {
5
- overflow-x: hidden;
6
- overflow-y: auto;
7
-
8
- display: block;
9
- }
10
- }
11
-
12
- .tb-modal {
13
- position: fixed;
14
- top: 0;
15
- right: 0;
16
- bottom: 0;
17
- left: 0;
18
- display: none;
19
- background-color: rgba(0, 0, 0, .7);
20
- z-index: 1072;
21
- height: 100%;
22
- width: 100%;
23
- text-align: center;
24
-
25
- * {
26
- box-sizing: border-box;
27
- }
28
-
29
- .tb-modal-dialog {
30
- height: 100%;
31
- width: 100%;
32
-
33
- &:before {
34
- display: inline-block;
35
- vertical-align: middle;
36
- content: " ";
37
- height: 100%;
38
- }
39
-
40
- .tb-modal-content {
41
- display: inline-block;
42
- position: relative;
43
- padding: 25px 25px 35px;
44
- background-color: #fff;
45
-
46
- width: 310px;
47
-
48
- .tb-modal-content_text {
49
- display: flex;
50
- justify-content: center;
51
- }
52
-
53
- .tb-close {
54
- position: absolute;
55
- top: 5px;
56
- right: 12px;
57
-
58
- border: none;
59
- outline: 0;
60
- padding: 0;
61
- background-color: transparent;
62
-
63
- font-size: 24px;
64
- font-weight: bold;
65
- color: #000;
66
- opacity: 0.7;
67
-
68
- &:hover {
69
- opacity: 1;
70
- cursor: pointer;
71
- }
72
- }
73
- }
74
- }
75
- }
76
-
77
- .tb-vk-button {
78
- margin-top: 15px;
79
- display: inline-block;
80
- width: 230px;
81
- position: relative;
82
- padding-left: 40px;
83
-
84
- .tb-vk-icon {
85
- width: 30px;
86
- height: 30px;
87
- position: absolute;
88
- top: 0px;
89
- left: 0px;
90
-
91
- > svg path {
92
- fill: #45668e;
93
- }
94
- }
95
-
96
- .tb-vk-button-container {
97
-
98
- }
99
- }
100
-
101
- @media only screen and (min-device-width: 736px) {
102
- .tb-modal .tb-modal-dialog .tb-modal-content{
103
- width: 500px;
104
- }
105
-
106
- .tb-vk-button {
107
- width: 245px;
108
- padding-left: 55px;
109
-
110
- .tb-vk-icon {
111
- width: 40px;
112
- height: 40px;
113
- top: -5px;
114
- }
115
- }
116
- }
1
+ .tb-modal-open {
2
+ overflow: hidden;
3
+
4
+ .tb-modal {
5
+ overflow-x: hidden;
6
+ overflow-y: auto;
7
+
8
+ display: block;
9
+ }
10
+ }
11
+
12
+ .tb-modal {
13
+ position: fixed;
14
+ top: 0;
15
+ right: 0;
16
+ bottom: 0;
17
+ left: 0;
18
+ display: none;
19
+ background-color: rgba(0, 0, 0, .7);
20
+ z-index: 1072;
21
+ height: 100%;
22
+ width: 100%;
23
+ text-align: center;
24
+
25
+ * {
26
+ box-sizing: border-box;
27
+ }
28
+
29
+ .tb-modal-dialog {
30
+ height: 100%;
31
+ width: 100%;
32
+
33
+ &:before {
34
+ display: inline-block;
35
+ vertical-align: middle;
36
+ content: " ";
37
+ height: 100%;
38
+ }
39
+
40
+ .tb-modal-content {
41
+ display: inline-block;
42
+ position: relative;
43
+ padding: 25px 25px 35px;
44
+ background-color: #fff;
45
+
46
+ width: 310px;
47
+
48
+ .tb-modal-content_text {
49
+ display: flex;
50
+ justify-content: center;
51
+ }
52
+
53
+ .tb-close {
54
+ position: absolute;
55
+ top: 5px;
56
+ right: 12px;
57
+
58
+ border: none;
59
+ outline: 0;
60
+ padding: 0;
61
+ background-color: transparent;
62
+
63
+ font-size: 24px;
64
+ font-weight: bold;
65
+ color: #000;
66
+ opacity: 0.7;
67
+
68
+ &:hover {
69
+ opacity: 1;
70
+ cursor: pointer;
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ .tb-vk-button {
78
+ margin-top: 15px;
79
+ display: inline-block;
80
+ width: 230px;
81
+ position: relative;
82
+ padding-left: 40px;
83
+
84
+ .tb-vk-icon {
85
+ width: 30px;
86
+ height: 30px;
87
+ position: absolute;
88
+ top: 0px;
89
+ left: 0px;
90
+
91
+ > svg path {
92
+ fill: #45668e;
93
+ }
94
+ }
95
+
96
+ .tb-vk-button-container {
97
+
98
+ }
99
+ }
100
+
101
+ @media only screen and (min-device-width: 736px) {
102
+ .tb-modal .tb-modal-dialog .tb-modal-content{
103
+ width: 500px;
104
+ }
105
+
106
+ .tb-vk-button {
107
+ width: 245px;
108
+ padding-left: 55px;
109
+
110
+ .tb-vk-icon {
111
+ width: 40px;
112
+ height: 40px;
113
+ top: -5px;
114
+ }
115
+ }
116
+ }