@textback/notification-widget 2.0.2 → 2.0.4-110500

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 (92) hide show
  1. package/.eslintrc.js +291 -291
  2. package/.gitlab-ci.yml +34 -0
  3. package/build/index.js +3 -3
  4. package/build/sdk.js +2 -2
  5. package/package.json +70 -70
  6. package/promote_tag.sh +1 -1
  7. package/readme.md +569 -569
  8. package/src/libraries/ai.1.0.11.js +4088 -4088
  9. package/src/libraries/localization/locales/index.js +8 -8
  10. package/src/libraries/localization/text.js +9 -9
  11. package/src/libraries/t.js +82 -82
  12. package/src/sdk/channels/channel.js +30 -30
  13. package/src/sdk/channels/facebook.js +13 -13
  14. package/src/sdk/channels/skype.js +12 -12
  15. package/src/sdk/channels/telegram.js +18 -18
  16. package/src/sdk/channels/viber.js +12 -12
  17. package/src/sdk/channels/vk-modal/vk-modal.html +17 -17
  18. package/src/sdk/channels/vk-modal/vk-modal.js +25 -25
  19. package/src/sdk/channels/vk-modal/vk-modal.scss +116 -116
  20. package/src/sdk/channels/vk.js +195 -195
  21. package/src/sdk/events/observer.js +46 -46
  22. package/src/sdk/index.js +5 -5
  23. package/src/sdk/sdk.js +67 -67
  24. package/src/sdk/utils/apiErrorHandler.js +11 -11
  25. package/src/sdk/utils/appInsights.js +88 -88
  26. package/src/sdk/utils/browserInfo.js +8 -8
  27. package/src/sdk/utils/constants.js +17 -17
  28. package/src/sdk/utils/cookies.js +67 -67
  29. package/src/sdk/utils/find.js +7 -7
  30. package/src/sdk/utils/loadConfig.js +20 -20
  31. package/src/sdk/utils/loadDeepLink.js +48 -48
  32. package/src/sdk/utils/loadScript.js +25 -25
  33. package/src/sdk/utils/loadSubscriptions.js +6 -6
  34. package/src/sdk/utils/parseQueryString.js +33 -33
  35. package/src/sdk/utils/windowHelper.js +25 -25
  36. package/src/sdk/widget/widget.js +192 -192
  37. package/src/widget/components/tb-notification-button/index.js +34 -34
  38. package/src/widget/components/tb-notification-button/styles.scss +657 -657
  39. package/src/widget/components/tb-notification-widget/index.js +24 -8
  40. package/src/widget/components/tb-notification-widget/normalize.scss +395 -395
  41. package/src/widget/components/tb-nw-wahunter/index.js +6 -4
  42. package/src/widget/components/tb-nw-wahunter/styles.scss +471 -471
  43. package/src/widget/config.js +5 -5
  44. package/src/widget/icons/icon_chat_window.svg +1 -1
  45. package/src/widget/icons/icon_close.svg +1 -1
  46. package/src/widget/icons/icon_facebook.svg +7 -7
  47. package/src/widget/icons/icon_facebook_circle.svg +7 -7
  48. package/src/widget/icons/icon_instagram_circle.svg +95 -95
  49. package/src/widget/icons/icon_skype.svg +44 -44
  50. package/src/widget/icons/icon_skype_circle.svg +46 -46
  51. package/src/widget/icons/icon_skype_new.svg +113 -113
  52. package/src/widget/icons/icon_tg.svg +25 -25
  53. package/src/widget/icons/icon_tg_circle.svg +17 -17
  54. package/src/widget/icons/icon_viber.svg +75 -75
  55. package/src/widget/icons/icon_viber_circle.svg +67 -67
  56. package/src/widget/icons/icon_viber_new.svg +102 -102
  57. package/src/widget/icons/icon_vk.svg +14 -14
  58. package/src/widget/icons/icon_vk_circle.svg +16 -16
  59. package/src/widget/icons/icon_whatsapp.svg +147 -147
  60. package/src/widget/icons/icon_whatsapp_circle.svg +3 -3
  61. package/src/widget/icons/icon_whatsapp_new.svg +127 -127
  62. package/src/widget/icons/icon_whatsappb.svg +147 -147
  63. package/src/widget/icons/icon_whatsappb_circle.svg +3 -3
  64. package/src/widget/icons/icon_whatsappb_new.svg +127 -127
  65. package/src/widget/icons/paper-plane-arrow.svg +3 -3
  66. package/src/widget/icons/tb-logo-dark-en.svg +17 -0
  67. package/src/widget/icons/tb-logo-dark-ru.svg +17 -0
  68. package/src/widget/icons/tb-logo-dark.svg +16 -0
  69. package/src/widget/icons/tb-logo-light-en.svg +17 -0
  70. package/src/widget/icons/tb-logo-light-ru.svg +17 -0
  71. package/src/widget/icons/tb-logo-white.svg +16 -0
  72. package/src/widget/icons/tb-logo.svg +16 -21
  73. package/src/widget/index.js +28 -28
  74. package/src/widget/locales/cs.js +42 -42
  75. package/src/widget/locales/en.js +42 -42
  76. package/src/widget/locales/ro.js +41 -41
  77. package/src/widget/utils/cookiesEx.js +41 -41
  78. package/src/widget/utils/stringifyAttributes.js +19 -19
  79. package/src/widget/utils/widgetsStorage.js +28 -28
  80. package/src/widget/widget.entry.js +3 -3
  81. package/tests/gf.html +35 -35
  82. package/tests/gf.js +21 -21
  83. package/tests/index.js +61 -61
  84. package/views/sdk.html +274 -274
  85. package/webpack.common.js +72 -72
  86. package/webpack.dev.js +15 -15
  87. package/webpack.prod.js +10 -10
  88. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  89. package/.idea/misc.xml +0 -6
  90. package/.idea/modules.xml +0 -8
  91. package/.idea/notificationwidget.iml +0 -9
  92. package/.idea/vcs.xml +0 -6
package/tests/index.js CHANGED
@@ -1,62 +1,62 @@
1
- const {Selector} = require('testcafe');
2
- const querystring = require('querystring');
3
-
4
- const query = querystring.stringify({
5
- widgetPath: '/build/index.js',
6
- apiPath: '/api',
7
- widgetId: 'a'
8
- });
9
-
10
- fixture `Notification widget base tests`
11
- .page `http://localhost:3000/examples?${query}`;
12
-
13
- test('Telegram button', async t => {
14
- const button = Selector('tb-notification-button[channel="tg"]');
15
- const link = button.find('a');
16
- const text = await button.innerText;
17
- const href = await link.getAttribute('href');
18
-
19
- await t.expect(text).contains('Telegram');
20
- await t.expect(href).contains('https://telegram.me/rb_dev_3_bot?start=subscribe_');
21
- });
22
-
23
- test('VK button', async t => {
24
- const button = Selector('tb-notification-button[channel="vk"]');
25
- const text = await button.innerText;
26
-
27
- await t.expect(text).contains('VKontakte');
28
- });
29
-
30
- test('Facebook button', async t => {
31
- const button = Selector('tb-notification-button[channel="facebook"]');
32
- const link = button.find('a');
33
- const text = await button.innerText;
34
- const href = await link.getAttribute('href');
35
-
36
- await t.expect(text).contains('Facebook');
37
- await t.expect(href).contains('https://m.me/323049074708312?ref=subscribe_');
38
- });
39
-
40
- test('Viber button', async t => {
41
- const button = Selector('tb-notification-button[channel="viber"]');
42
- const link = button.find('a');
43
- const text = await button.innerText;
44
- const href = await link.getAttribute('href');
45
-
46
- await t.expect(text).contains('Viber');
47
- await t.expect(href).contains('viber://pa?chatURI=dev_&context=subscribe_');
48
- });
49
-
50
- test('deeplink request', async t => {
51
- const requests = await t.eval(() => window.fetch.calls);
52
-
53
- const deeplinkRequests = requests.filter(call => {
54
- return call.url === '/api/endUserNotifications/deepLinks'
55
- });
56
-
57
- await t.expect(JSON.parse(deeplinkRequests[0].options.body)).eql({
58
- "accountId": "99bffda5-5bd1-49b1-b4f2-658854797c01",
59
- "insecureContext": {"orderId": "insecureOrderID"},
60
- "secureContextToken": null
61
- });
1
+ const {Selector} = require('testcafe');
2
+ const querystring = require('querystring');
3
+
4
+ const query = querystring.stringify({
5
+ widgetPath: '/build/index.js',
6
+ apiPath: '/api',
7
+ widgetId: 'a'
8
+ });
9
+
10
+ fixture `Notification widget base tests`
11
+ .page `http://localhost:3000/examples?${query}`;
12
+
13
+ test('Telegram button', async t => {
14
+ const button = Selector('tb-notification-button[channel="tg"]');
15
+ const link = button.find('a');
16
+ const text = await button.innerText;
17
+ const href = await link.getAttribute('href');
18
+
19
+ await t.expect(text).contains('Telegram');
20
+ await t.expect(href).contains('https://telegram.me/rb_dev_3_bot?start=subscribe_');
21
+ });
22
+
23
+ test('VK button', async t => {
24
+ const button = Selector('tb-notification-button[channel="vk"]');
25
+ const text = await button.innerText;
26
+
27
+ await t.expect(text).contains('VKontakte');
28
+ });
29
+
30
+ test('Facebook button', async t => {
31
+ const button = Selector('tb-notification-button[channel="facebook"]');
32
+ const link = button.find('a');
33
+ const text = await button.innerText;
34
+ const href = await link.getAttribute('href');
35
+
36
+ await t.expect(text).contains('Facebook');
37
+ await t.expect(href).contains('https://m.me/323049074708312?ref=subscribe_');
38
+ });
39
+
40
+ test('Viber button', async t => {
41
+ const button = Selector('tb-notification-button[channel="viber"]');
42
+ const link = button.find('a');
43
+ const text = await button.innerText;
44
+ const href = await link.getAttribute('href');
45
+
46
+ await t.expect(text).contains('Viber');
47
+ await t.expect(href).contains('viber://pa?chatURI=dev_&context=subscribe_');
48
+ });
49
+
50
+ test('deeplink request', async t => {
51
+ const requests = await t.eval(() => window.fetch.calls);
52
+
53
+ const deeplinkRequests = requests.filter(call => {
54
+ return call.url === '/api/endUserNotifications/deepLinks'
55
+ });
56
+
57
+ await t.expect(JSON.parse(deeplinkRequests[0].options.body)).eql({
58
+ "accountId": "99bffda5-5bd1-49b1-b4f2-658854797c01",
59
+ "insecureContext": {"orderId": "insecureOrderID"},
60
+ "secureContextToken": null
61
+ });
62
62
  });