@textback/notification-widget 2.0.3 → 2.0.4-110501

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 (126) hide show
  1. package/build/index.js +12 -0
  2. package/{release/builds/textback/notificationwidget/build → build}/sdk.js +2 -2
  3. package/package.json +2 -2
  4. package/src/widget/components/tb-notification-widget/index.js +22 -6
  5. package/src/widget/components/tb-nw-wahunter/index.js +4 -2
  6. package/src/widget/icons/tb-logo-dark-en.svg +17 -0
  7. package/src/widget/icons/tb-logo-dark-ru.svg +17 -0
  8. package/src/widget/icons/tb-logo-dark.svg +16 -0
  9. package/src/widget/icons/tb-logo-light-en.svg +17 -0
  10. package/src/widget/icons/tb-logo-light-ru.svg +17 -0
  11. package/src/widget/icons/tb-logo-white.svg +16 -0
  12. package/src/widget/icons/tb-logo.svg +15 -20
  13. package/release/builds/textback/notificationwidget/.eslintrc.js +0 -291
  14. package/release/builds/textback/notificationwidget/.gitlab-ci.yml +0 -34
  15. package/release/builds/textback/notificationwidget/build/index.js +0 -12
  16. package/release/builds/textback/notificationwidget/package-lock.json +0 -9985
  17. package/release/builds/textback/notificationwidget/package.json +0 -70
  18. package/release/builds/textback/notificationwidget/promote_tag.sh +0 -2
  19. package/release/builds/textback/notificationwidget/readme.md +0 -569
  20. package/release/builds/textback/notificationwidget/server.js +0 -224
  21. package/release/builds/textback/notificationwidget/src/libraries/ai.1.0.11.js +0 -4089
  22. package/release/builds/textback/notificationwidget/src/libraries/localization/getLocale.js +0 -17
  23. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/.tern-port +0 -1
  24. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/cs.js +0 -23
  25. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/en.js +0 -23
  26. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/index.js +0 -9
  27. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/pl.js +0 -23
  28. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ro.js +0 -23
  29. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ru.js +0 -22
  30. package/release/builds/textback/notificationwidget/src/libraries/localization/locales/uk.js +0 -23
  31. package/release/builds/textback/notificationwidget/src/libraries/localization/text.js +0 -9
  32. package/release/builds/textback/notificationwidget/src/libraries/t.js +0 -82
  33. package/release/builds/textback/notificationwidget/src/sdk/channels/channel.js +0 -31
  34. package/release/builds/textback/notificationwidget/src/sdk/channels/facebook.js +0 -13
  35. package/release/builds/textback/notificationwidget/src/sdk/channels/factory.js +0 -34
  36. package/release/builds/textback/notificationwidget/src/sdk/channels/skype.js +0 -13
  37. package/release/builds/textback/notificationwidget/src/sdk/channels/telegram.js +0 -18
  38. package/release/builds/textback/notificationwidget/src/sdk/channels/viber.js +0 -13
  39. package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.html +0 -17
  40. package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.js +0 -25
  41. package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.scss +0 -116
  42. package/release/builds/textback/notificationwidget/src/sdk/channels/vk.js +0 -195
  43. package/release/builds/textback/notificationwidget/src/sdk/channels/whatsapp.js +0 -27
  44. package/release/builds/textback/notificationwidget/src/sdk/channels/whatsappb.js +0 -27
  45. package/release/builds/textback/notificationwidget/src/sdk/events/observer.js +0 -46
  46. package/release/builds/textback/notificationwidget/src/sdk/index.js +0 -6
  47. package/release/builds/textback/notificationwidget/src/sdk/sdk.entry.js +0 -1
  48. package/release/builds/textback/notificationwidget/src/sdk/sdk.js +0 -67
  49. package/release/builds/textback/notificationwidget/src/sdk/utils/apiErrorHandler.js +0 -12
  50. package/release/builds/textback/notificationwidget/src/sdk/utils/appInsights.js +0 -88
  51. package/release/builds/textback/notificationwidget/src/sdk/utils/browserInfo.js +0 -9
  52. package/release/builds/textback/notificationwidget/src/sdk/utils/constants.js +0 -18
  53. package/release/builds/textback/notificationwidget/src/sdk/utils/cookies.js +0 -67
  54. package/release/builds/textback/notificationwidget/src/sdk/utils/find.js +0 -8
  55. package/release/builds/textback/notificationwidget/src/sdk/utils/loadConfig.js +0 -21
  56. package/release/builds/textback/notificationwidget/src/sdk/utils/loadDeepLink.js +0 -48
  57. package/release/builds/textback/notificationwidget/src/sdk/utils/loadScript.js +0 -26
  58. package/release/builds/textback/notificationwidget/src/sdk/utils/loadSubscriptions.js +0 -6
  59. package/release/builds/textback/notificationwidget/src/sdk/utils/parseQueryString.js +0 -34
  60. package/release/builds/textback/notificationwidget/src/sdk/utils/windowHelper.js +0 -25
  61. package/release/builds/textback/notificationwidget/src/sdk/widget/widget.js +0 -192
  62. package/release/builds/textback/notificationwidget/src/widget/components/index.js +0 -52
  63. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/facebook.js +0 -55
  64. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/index.js +0 -35
  65. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/styles.scss +0 -657
  66. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/telegram.js +0 -55
  67. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/viber.js +0 -57
  68. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/vk.js +0 -92
  69. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsapp.js +0 -58
  70. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsappb.js +0 -58
  71. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/index.js +0 -678
  72. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/normalize.scss +0 -395
  73. package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/styles.scss +0 -543
  74. package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/index.js +0 -259
  75. package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/styles.scss +0 -471
  76. package/release/builds/textback/notificationwidget/src/widget/config.js +0 -5
  77. package/release/builds/textback/notificationwidget/src/widget/icons/bell-icon.png +0 -0
  78. package/release/builds/textback/notificationwidget/src/widget/icons/broadcast-icon.png +0 -0
  79. package/release/builds/textback/notificationwidget/src/widget/icons/icon_chat_window.svg +0 -1
  80. package/release/builds/textback/notificationwidget/src/widget/icons/icon_close.svg +0 -1
  81. package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook.svg +0 -7
  82. package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook_circle.svg +0 -7
  83. package/release/builds/textback/notificationwidget/src/widget/icons/icon_instagram_circle.svg +0 -96
  84. package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype.svg +0 -44
  85. package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_circle.svg +0 -46
  86. package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_new.svg +0 -114
  87. package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg.svg +0 -25
  88. package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg_circle.svg +0 -17
  89. package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber.svg +0 -75
  90. package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_circle.svg +0 -67
  91. package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_new.svg +0 -102
  92. package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk.svg +0 -14
  93. package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk_circle.svg +0 -16
  94. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp.svg +0 -147
  95. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_circle.svg +0 -4
  96. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_hollow.svg +0 -128
  97. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_new.svg +0 -127
  98. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb.svg +0 -147
  99. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_circle.svg +0 -4
  100. package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_new.svg +0 -127
  101. package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-arrow.svg +0 -3
  102. package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-icon.png +0 -0
  103. package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo.svg +0 -21
  104. package/release/builds/textback/notificationwidget/src/widget/index.js +0 -29
  105. package/release/builds/textback/notificationwidget/src/widget/locales/cs.js +0 -42
  106. package/release/builds/textback/notificationwidget/src/widget/locales/en.js +0 -42
  107. package/release/builds/textback/notificationwidget/src/widget/locales/index.js +0 -9
  108. package/release/builds/textback/notificationwidget/src/widget/locales/pl.js +0 -42
  109. package/release/builds/textback/notificationwidget/src/widget/locales/ro.js +0 -41
  110. package/release/builds/textback/notificationwidget/src/widget/locales/ru.js +0 -41
  111. package/release/builds/textback/notificationwidget/src/widget/locales/uk.js +0 -41
  112. package/release/builds/textback/notificationwidget/src/widget/utils/cookiesEx.js +0 -41
  113. package/release/builds/textback/notificationwidget/src/widget/utils/getLocale.js +0 -17
  114. package/release/builds/textback/notificationwidget/src/widget/utils/stringifyAttributes.js +0 -19
  115. package/release/builds/textback/notificationwidget/src/widget/utils/text.js +0 -10
  116. package/release/builds/textback/notificationwidget/src/widget/utils/widgetsStorage.js +0 -28
  117. package/release/builds/textback/notificationwidget/src/widget/widget.entry.js +0 -3
  118. package/release/builds/textback/notificationwidget/tests/gf.html +0 -35
  119. package/release/builds/textback/notificationwidget/tests/gf.js +0 -22
  120. package/release/builds/textback/notificationwidget/tests/index.js +0 -62
  121. package/release/builds/textback/notificationwidget/views/examples.ejs +0 -51
  122. package/release/builds/textback/notificationwidget/views/sdk.html +0 -274
  123. package/release/builds/textback/notificationwidget/webpack.common.js +0 -72
  124. package/release/builds/textback/notificationwidget/webpack.dev.js +0 -15
  125. package/release/builds/textback/notificationwidget/webpack.prod.js +0 -10
  126. package/widget.tar.gz +0 -0
@@ -1,57 +0,0 @@
1
- import Button from './index.js';
2
- import icon from '../../icons/icon_viber.svg';
3
- import iconNew from '../../icons/icon_viber_new.svg';
4
- import iconCircle from '../../icons/icon_viber_circle.svg';
5
- import constants from '../../../sdk/utils/constants.js';
6
-
7
- class ViberButton extends Button {
8
- render() {
9
- super.render();
10
-
11
- const link = this.element.querySelector('a');
12
- link.addEventListener('click', (event) => {
13
- event.preventDefault();
14
- this.channelAPI.subscribe();
15
- });
16
- }
17
-
18
- get template() {
19
- if (this.config.type === constants.WIDGET_TYPE_API_CALL) {
20
- return `
21
- <a target="_blank" href="viber://pa?chatURI=${this.config.id}&context=${this.deepLink}">
22
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
23
- <tb-notification-button__text>${this.text('viber')}</tb-notification-button__text>
24
- </a>
25
- <p class="tb-notification-button__tip">
26
- ${this.text('viberTip')}
27
- </p>
28
- `;
29
- } else if(this.config.markUp.style === 'gradient') {
30
- return `
31
- <a target="_blank" href="viber://pa?chatURI=${this.config.id}&context=${this.deepLink}">
32
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
33
- <tb-notification-button__text>${this.text('viber')}</tb-notification-button__text>
34
- </a>
35
- `;
36
- } else if (this.config.markUp.style !== 'square') {
37
- return `
38
- <a target="_blank" href="viber://pa?chatURI=${this.config.id}&context=${this.deepLink}">
39
- <tb-notification-button__icon>${( this.config.markUp.style === 'rounded' ? icon : iconCircle )}</tb-notification-button__icon>
40
- <tb-notification-button__text>${this.text('viber')}</tb-notification-button__text>
41
- </a>
42
- `;
43
- } else {
44
- return `
45
- <div class="tb-notification-button__inner">
46
- <tb-notification-button__icon>${iconNew}</tb-notification-button__icon>
47
- <a target="_blank" href="viber://pa?chatURI=${this.config.id}&context=${this.deepLink}">
48
- <tb-notification-button__text>${this.text('viberExtended')}</tb-notification-button__text>
49
- </a>
50
- </div>
51
- `;
52
- }
53
-
54
- }
55
- };
56
-
57
- module.exports = ViberButton;
@@ -1,92 +0,0 @@
1
- /* eslint no-console: "off" */
2
-
3
- import Button from './index.js';
4
- import UUID from 'uuid-js';
5
- import icon from '../../icons/icon_vk.svg';
6
- import iconCircle from '../../icons/icon_vk_circle.svg';
7
- import constants from '../../../sdk/utils/constants.js';
8
-
9
- class VKButton extends Button {
10
- constructor() {
11
- super(...arguments);
12
-
13
- this.useVkApp = this.widget.config.useVkApp;
14
- this.landingUrl = this.config.additionalProperties ? this.config.additionalProperties.landingUrl : undefined;
15
- this.element.setAttribute('type', this.config.type || 'widget');
16
-
17
- this.buttonContainerId = UUID.create(4).hex;
18
-
19
- if (this.config.type === constants.WIDGET_TYPE_API_CALL) {
20
- this.element.setAttribute('authorized', this.channelAPI.authorized);
21
- this.element.addEventListener('click', event => {
22
- event.preventDefault();
23
- this.channelAPI.subscribeViaApi();
24
- });
25
-
26
- this.set({
27
- ready: true
28
- });
29
- } else if (this.useVkApp || this.config.markUp.style !== 'square'|| this.config.markUp.style === 'gradient' || this.landingUrl) {
30
- this.element.addEventListener('click', event => {
31
- event.preventDefault();
32
- this.channelAPI.subscribe();
33
- });
34
-
35
- this.set({
36
- ready: true
37
- });
38
- } else {
39
- this.set({
40
- ready: true
41
- });
42
-
43
- this.channelAPI.renderVKSubscriptionButton(30, this.buttonContainerId);
44
- }
45
- }
46
-
47
-
48
- get template() {
49
- if (this.ready) {
50
- if (this.config.type === constants.WIDGET_TYPE_API_CALL) {
51
- return `
52
- <a href="javascript:void(0)">
53
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
54
- <tb-notification-button__text for="login">${this.text('vkontakteLogin')}</tb-notification-button__text>
55
- <tb-notification-button__text for="subscribe">${this.text('vkontakte')}</tb-notification-button__text>
56
- </a>
57
- <p class="tb-notification-button__tip">
58
- ${this.text('vkontakteTip')}
59
- </p>
60
- `;
61
- } else if(this.config.markUp.style === 'gradient') {
62
- return `
63
- <a class="vk-app-link" href="#">
64
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
65
- <tb-notification-button__text>${this.text('vkontakte')}</tb-notification-button__text>
66
- </a>
67
- `;
68
- } else if (this.config.markUp.style !== 'square') {
69
- return `
70
- <a href="#">
71
- <tb-notification-button__icon>${(this.config.markUp.style === 'rounded' ? icon : iconCircle)}</tb-notification-button__icon>
72
- <tb-notification-button__text>${this.text('vkontakte')}</tb-notification-button__text>
73
- </a>
74
- `;
75
- } else {
76
- return `
77
- <div class="tb-notification-button__inner">
78
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
79
- <a id="${this.buttonContainerId}">
80
- ${
81
- this.useVkApp || this.landingUrl ? this.text('vkontakteExtended') : ''
82
- }
83
- </a>
84
- </div>
85
- `
86
- }
87
- }
88
- return '';
89
- }
90
- }
91
-
92
- module.exports = VKButton;
@@ -1,58 +0,0 @@
1
- import Button from './index.js';
2
- import icon from '../../icons/icon_whatsapp.svg';
3
- import iconNew from '../../icons/icon_whatsapp_new.svg';
4
- import iconCircle from '../../icons/icon_whatsapp_circle.svg';
5
- import constants from '../../../sdk/utils/constants.js';
6
-
7
- const prefixText = encodeURIComponent('Отправьте не изменяя это сообщение ');
8
-
9
- class WhatsappButton extends Button {
10
- render() {
11
- super.render();
12
-
13
- const link = this.element.querySelector('a');
14
- link.addEventListener('click', (event) => {
15
- event.preventDefault();
16
- this.channelAPI.subscribe();
17
- });
18
- }
19
-
20
- get template() {
21
- if (this.config.type === constants.WIDGET_TYPE_API_CALL) {
22
- return `
23
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
24
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
25
- <tb-notification-button__text>${this.text('whatsapp')}</tb-notification-button__text>
26
- </a>
27
- <p class="tb-notification-button__tip">
28
- ${this.text('whatsappTip')}
29
- </p>
30
- `;
31
- } else if(this.config.markUp.style === 'gradient' || this.config.markUp.style === 'icons') {
32
- return `
33
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
34
- <tb-notification-button__icon>${iconCircle}</tb-notification-button__icon>
35
- <tb-notification-button__text>${this.text('whatsapp')}</tb-notification-button__text>
36
- </a>
37
- `;
38
- } else if (this.config.markUp.style !== 'square') {
39
- return `
40
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
41
- <tb-notification-button__icon>${( this.config.markUp.style === 'rounded' ? iconCircle : icon )}</tb-notification-button__icon>
42
- <tb-notification-button__text>${this.text('whatsapp')}</tb-notification-button__text>
43
- </a>
44
- `;
45
- } else {
46
- return `
47
- <div class="tb-notification-button__inner">
48
- <tb-notification-button__icon>${iconNew}</tb-notification-button__icon>
49
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
50
- <tb-notification-button__text>${this.text('whatsappExtended')}</tb-notification-button__text>
51
- </a>
52
- </div>
53
- `;
54
- }
55
- }
56
- };
57
-
58
- module.exports = WhatsappButton;
@@ -1,58 +0,0 @@
1
- import Button from './index.js';
2
- import icon from '../../icons/icon_whatsappb.svg';
3
- import iconNew from '../../icons/icon_whatsappb_new.svg';
4
- import iconCircle from '../../icons/icon_whatsappb_circle.svg';
5
- import constants from '../../../sdk/utils/constants.js';
6
-
7
- const prefixText = encodeURIComponent('Отправьте не изменяя это сообщение ');
8
-
9
- class WhatsappbButton extends Button {
10
- render() {
11
- super.render();
12
-
13
- const link = this.element.querySelector('a');
14
- link.addEventListener('click', (event) => {
15
- event.preventDefault();
16
- this.channelAPI.subscribe();
17
- });
18
- }
19
-
20
- get template() {
21
- if (this.config.type === constants.WIDGET_TYPE_API_CALL) {
22
- return `
23
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
24
- <tb-notification-button__icon>${icon}</tb-notification-button__icon>
25
- <tb-notification-button__text>${this.text('whatsappb')}</tb-notification-button__text>
26
- </a>
27
- <p class="tb-notification-button__tip">
28
- ${this.text('whatsappTip')}
29
- </p>
30
- `;
31
- } else if(this.config.markUp.style === 'gradient' || this.config.markUp.style === 'icons') {
32
- return `
33
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
34
- <tb-notification-button__icon>${iconCircle}</tb-notification-button__icon>
35
- <tb-notification-button__text>${this.text('whatsappb')}</tb-notification-button__text>
36
- </a>
37
- `;
38
- } else if (this.config.markUp.style !== 'square') {
39
- return `
40
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
41
- <tb-notification-button__icon>${( this.config.markUp.style === 'rounded' ? iconCircle : icon )}</tb-notification-button__icon>
42
- <tb-notification-button__text>${this.text('whatsappb')}</tb-notification-button__text>
43
- </a>
44
- `;
45
- } else {
46
- return `
47
- <div class="tb-notification-button__inner">
48
- <tb-notification-button__icon>${iconNew}</tb-notification-button__icon>
49
- <a target="_blank" href="https://api.whatsapp.com/send/?phone=+${this.config.id}&text=${prefixText + this.deepLink}">
50
- <tb-notification-button__text>${this.text('whatsappbExtended')}</tb-notification-button__text>
51
- </a>
52
- </div>
53
- `;
54
- }
55
- }
56
- };
57
-
58
- module.exports = WhatsappbButton;