web-push-notifications 3.44.7 → 3.44.8

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 (224) hide show
  1. package/core/Pushwoosh.d.ts +199 -0
  2. package/core/Pushwoosh.types.d.ts +213 -0
  3. package/core/Safari.types.d.ts +17 -0
  4. package/core/constants.d.ts +41 -0
  5. package/core/events.types.d.ts +55 -0
  6. package/core/functions.d.ts +5 -0
  7. package/core/legacyEventsMap.d.ts +5 -0
  8. package/core/logger.d.ts +14 -0
  9. package/core/modules/EventBus/EventBus.d.ts +10 -0
  10. package/core/storage.d.ts +27 -0
  11. package/helpers/logger.d.ts +11 -0
  12. package/helpers/pwlogger/Logger.constants.d.ts +21 -0
  13. package/helpers/pwlogger/Logger.d.ts +37 -0
  14. package/helpers/pwlogger/Logger.types.d.ts +44 -0
  15. package/helpers/pwlogger/handlers/handler-console/handler-console.d.ts +2 -0
  16. package/{src/helpers/unescape.ts → helpers/unescape.d.ts} +1 -18
  17. package/models/InboxMessages.d.ts +82 -0
  18. package/models/InboxMessages.types.d.ts +83 -0
  19. package/models/NotificationPayload.d.ts +39 -0
  20. package/models/NotificationPayload.types.d.ts +63 -0
  21. package/modules/Api/Api.d.ts +45 -0
  22. package/modules/Api/Api.types.d.ts +7 -0
  23. package/modules/ApiClient/ApiClient.d.ts +29 -0
  24. package/modules/ApiClient/ApiClient.types.d.ts +188 -0
  25. package/modules/Data/Data.d.ts +76 -0
  26. package/modules/DateModule.d.ts +27 -0
  27. package/modules/InboxMessagesPublic.d.ts +64 -0
  28. package/modules/PlatformChecker/PlatformChecker.d.ts +45 -0
  29. package/modules/PlatformChecker/PlatformChecker.types.d.ts +5 -0
  30. package/modules/storage/Storage.d.ts +63 -0
  31. package/{src/modules/storage/Storage.types.ts → modules/storage/Storage.types.d.ts} +7 -25
  32. package/modules/storage/Store.d.ts +22 -0
  33. package/modules/storage/migrations/26-11-2018.d.ts +2 -0
  34. package/modules/storage/migrations/MigrationExecutor.d.ts +9 -0
  35. package/modules/storage/migrations/Migrations.d.ts +15 -0
  36. package/modules/storage/migrations/constants.d.ts +6 -0
  37. package/modules/storage/migrations/helpers.d.ts +7 -0
  38. package/modules/storage/migrations/initial.d.ts +2 -0
  39. package/modules/storage/version.d.ts +2 -0
  40. package/npm.js +2 -0
  41. package/npm.js.map +1 -0
  42. package/package.json +1 -1
  43. package/service-worker.d.ts +1 -0
  44. package/service-worker.js +2 -0
  45. package/service-worker.js.map +1 -0
  46. package/services/PushService/PushService.types.d.ts +64 -0
  47. package/services/PushService/drivers/PushServiceDefault/PushServiceDefault.d.ts +29 -0
  48. package/{src/services/PushService/drivers/PushServiceDefault/PushServiceDefault.types.ts → services/PushService/drivers/PushServiceDefault/PushServiceDefault.types.d.ts} +1 -1
  49. package/services/PushService/drivers/PushServiceSafari/PushServiceSafari.d.ts +21 -0
  50. package/services/PushService/drivers/PushServiceSafari/PushServiceSafari.types.d.ts +4 -0
  51. package/widget-inbox.js +2 -0
  52. package/widget-inbox.js.map +1 -0
  53. package/widget-subscribe-popup.js +2 -0
  54. package/widget-subscribe-popup.js.map +1 -0
  55. package/widget-subscription-button.js +2 -0
  56. package/widget-subscription-button.js.map +1 -0
  57. package/widget-subscription-prompt.d.ts +2 -0
  58. package/widget-subscription-prompt.js +2 -0
  59. package/widget-subscription-prompt.js.map +1 -0
  60. package/widgets/Inbox/InboxWidget.d.ts +49 -0
  61. package/widgets/Inbox/constants.d.ts +7 -0
  62. package/widgets/Inbox/helpers.d.ts +4 -0
  63. package/widgets/Inbox/inbox_widget.types.d.ts +34 -0
  64. package/widgets/Inbox/widgetTemplates.d.ts +4 -0
  65. package/widgets/SubscribePopup/SubscribePopup.d.ts +20 -0
  66. package/widgets/SubscribePopup/constants.d.ts +6 -0
  67. package/widgets/SubscribePopup/helpers.d.ts +1 -0
  68. package/widgets/SubscribePopup/popupTemplates.d.ts +9 -0
  69. package/widgets/SubscribePopup/types/subscribe-popup.d.ts +43 -0
  70. package/widgets/SubscriptionButton/bell.d.ts +2 -0
  71. package/widgets/SubscriptionButton/constants.d.ts +7 -0
  72. package/widgets/SubscriptionButton/index.d.ts +90 -0
  73. package/widgets/SubscriptionButton/positioning.d.ts +11 -0
  74. package/widgets/SubscriptionButton/subscribe_widget.types.d.ts +35 -0
  75. package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.constants.d.ts +1 -0
  76. package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.d.ts +14 -0
  77. package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.helpers.d.ts +3 -0
  78. package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.types.d.ts +19 -0
  79. package/widgets/SubscriptionPrompt/constants.d.ts +21 -0
  80. package/widgets/SubscriptionPrompt/helpers.d.ts +5 -0
  81. package/worker/global.d.ts +16 -0
  82. package/worker/notification.d.ts +9 -0
  83. package/worker/worker.types.d.ts +4 -0
  84. package/.editorconfig +0 -11
  85. package/.gitlab-ci.yml +0 -193
  86. package/babel.config.js +0 -7
  87. package/ci/cdn/Dockerfile +0 -12
  88. package/ci/dev/Dockerfile +0 -30
  89. package/ci/dev/rootfs/entrypoint.sh +0 -18
  90. package/ci/dev/rootfs/entrypoint.sh.d/nginx.sh +0 -6
  91. package/ci/dev/rootfs/entrypoint.sh.d/supervisor.sh +0 -5
  92. package/ci/dev/rootfs/etc/nginx/_real_ip.conf +0 -2
  93. package/ci/dev/rootfs/etc/nginx/conf.d/default.conf +0 -20
  94. package/ci/dev/rootfs/etc/supervisor.d/nginx.ini +0 -11
  95. package/ci/github/Dockerfile +0 -59
  96. package/ci/github/release-zip.js +0 -61
  97. package/ci/npm/Dockerfile +0 -22
  98. package/config/config.js +0 -24
  99. package/config/configBuilder.js +0 -126
  100. package/config/helpers.js +0 -9
  101. package/config/index.js +0 -1
  102. package/develop/README.md +0 -42
  103. package/develop/favicon.png +0 -0
  104. package/develop/index.html +0 -511
  105. package/eslint.config.mjs +0 -114
  106. package/public/index.d.ts +0 -337
  107. package/scripts/zip.js +0 -26
  108. package/src/core/Pushwoosh.ts +0 -768
  109. package/src/core/Pushwoosh.types.ts +0 -254
  110. package/src/core/Safari.types.ts +0 -26
  111. package/src/core/constants.ts +0 -58
  112. package/src/core/events.types.ts +0 -46
  113. package/src/core/functions.ts +0 -33
  114. package/src/core/legacyEventsMap.ts +0 -64
  115. package/src/core/logger.ts +0 -64
  116. package/src/core/modules/EventBus/EventBus.ts +0 -66
  117. package/src/core/storage.ts +0 -254
  118. package/src/helpers/logger.ts +0 -81
  119. package/src/helpers/pwlogger/Logger.constants.ts +0 -31
  120. package/src/helpers/pwlogger/Logger.ts +0 -218
  121. package/src/helpers/pwlogger/Logger.types.ts +0 -66
  122. package/src/helpers/pwlogger/handlers/handler-console/handler-console.ts +0 -40
  123. package/src/models/InboxMessages.ts +0 -202
  124. package/src/models/InboxMessages.types.ts +0 -111
  125. package/src/models/NotificationPayload.ts +0 -216
  126. package/src/models/NotificationPayload.types.ts +0 -65
  127. package/src/modules/Api/Api.ts +0 -386
  128. package/src/modules/Api/Api.types.ts +0 -7
  129. package/src/modules/ApiClient/ApiClient.ts +0 -153
  130. package/src/modules/ApiClient/ApiClient.types.ts +0 -222
  131. package/src/modules/Data/Data.ts +0 -345
  132. package/src/modules/DateModule.ts +0 -53
  133. package/src/modules/InboxMessagesPublic.ts +0 -222
  134. package/src/modules/PlatformChecker/PlatformChecker.ts +0 -170
  135. package/src/modules/PlatformChecker/PlatformChecker.types.ts +0 -5
  136. package/src/modules/storage/Storage.ts +0 -164
  137. package/src/modules/storage/Store.ts +0 -104
  138. package/src/modules/storage/migrations/26-11-2018.ts +0 -25
  139. package/src/modules/storage/migrations/MigrationExecutor.ts +0 -31
  140. package/src/modules/storage/migrations/Migrations.ts +0 -41
  141. package/src/modules/storage/migrations/constants.ts +0 -8
  142. package/src/modules/storage/migrations/helpers.ts +0 -16
  143. package/src/modules/storage/migrations/initial.ts +0 -47
  144. package/src/modules/storage/version.ts +0 -2
  145. package/src/pushwoosh-web-notifications.ts +0 -47
  146. package/src/pushwoosh-widget-inbox.ts +0 -8
  147. package/src/pushwoosh-widget-subscribe-popup.ts +0 -9
  148. package/src/pushwoosh-widget-subscription-button.ts +0 -8
  149. package/src/pushwoosh-widget-subscription-prompt.ts +0 -6
  150. package/src/service-worker.ts +0 -455
  151. package/src/services/PushService/PushService.types.ts +0 -74
  152. package/src/services/PushService/drivers/PushServiceDefault/PushServiceDefault.ts +0 -235
  153. package/src/services/PushService/drivers/PushServiceSafari/PushServiceSafari.ts +0 -125
  154. package/src/services/PushService/drivers/PushServiceSafari/PushServiceSafari.types.ts +0 -4
  155. package/src/widget-subscription-prompt.ts +0 -33
  156. package/src/widgets/Inbox/InboxWidget.ts +0 -564
  157. package/src/widgets/Inbox/constants.ts +0 -49
  158. package/src/widgets/Inbox/css/inboxWidgetStyle.css +0 -274
  159. package/src/widgets/Inbox/helpers.ts +0 -63
  160. package/src/widgets/Inbox/inbox.d.ts +0 -9
  161. package/src/widgets/Inbox/inbox_widget.types.ts +0 -41
  162. package/src/widgets/Inbox/widgetTemplates.ts +0 -55
  163. package/src/widgets/SubscribePopup/SubscribePopup.ts +0 -241
  164. package/src/widgets/SubscribePopup/constants.ts +0 -66
  165. package/src/widgets/SubscribePopup/helpers.ts +0 -11
  166. package/src/widgets/SubscribePopup/popupTemplates.ts +0 -24
  167. package/src/widgets/SubscribePopup/styles/popup.css +0 -226
  168. package/src/widgets/SubscribePopup/types/subscribe-popup.ts +0 -68
  169. package/src/widgets/SubscriptionButton/assets/css/main.css +0 -205
  170. package/src/widgets/SubscriptionButton/bell.ts +0 -67
  171. package/src/widgets/SubscriptionButton/constants.ts +0 -28
  172. package/src/widgets/SubscriptionButton/index.ts +0 -377
  173. package/src/widgets/SubscriptionButton/positioning.ts +0 -165
  174. package/src/widgets/SubscriptionButton/subscribe_widget.types.ts +0 -53
  175. package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.constants.ts +0 -1
  176. package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.helpers.ts +0 -110
  177. package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.ts +0 -102
  178. package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.types.ts +0 -23
  179. package/src/widgets/SubscriptionPrompt/constants.ts +0 -22
  180. package/src/widgets/SubscriptionPrompt/helpers.ts +0 -42
  181. package/src/widgets/widgets.d.ts +0 -4
  182. package/src/worker/global.ts +0 -36
  183. package/src/worker/notification.ts +0 -34
  184. package/src/worker/worker.types.ts +0 -4
  185. package/test/__helpers__/apiHelpers.ts +0 -22
  186. package/test/__helpers__/keyValueHelpers.ts +0 -15
  187. package/test/__helpers__/platformHelpers.ts +0 -54
  188. package/test/__helpers__/sinonHelpers.ts +0 -7
  189. package/test/__helpers__/storageHelpers.ts +0 -56
  190. package/test/__mocks__/apiRequests.ts +0 -26
  191. package/test/__mocks__/idbMock.ts +0 -12
  192. package/test/__mocks__/idbObjectStoreMock.ts +0 -38
  193. package/test/__mocks__/inboxMessages.ts +0 -292
  194. package/test/__mocks__/models/inboxModel.ts +0 -71
  195. package/test/__mocks__/modules/apiClientModule.ts +0 -18
  196. package/test/__mocks__/modules/dateModule.ts +0 -34
  197. package/test/__mocks__/modules/inboxParamsModule.ts +0 -21
  198. package/test/__mocks__/modules/paramsBuilder.ts +0 -12
  199. package/test/__mocks__/modules/paramsModule.ts +0 -35
  200. package/test/__mocks__/modules/payloadBuilderModule.ts +0 -15
  201. package/test/__mocks__/modules/storageModule.ts +0 -58
  202. package/test/__mocks__/navigator.ts +0 -38
  203. package/test/__mocks__/notification.ts +0 -84
  204. package/test/__mocks__/pushwoosh.ts +0 -12
  205. package/test/__mocks__/userAgents +0 -8
  206. package/test/functions.test.ts +0 -22
  207. package/test/ignore-html.js +0 -6
  208. package/test/mocha.opts +0 -6
  209. package/test/modules/DateModule/unit.test.ts +0 -80
  210. package/test/modules/storage/Storage/unit.test.ts +0 -180
  211. package/test/modules/storage/Store/unit.test.ts +0 -192
  212. package/testRegister.js +0 -24
  213. package/tsconfig.json +0 -31
  214. package/webpack.config.js +0 -163
  215. /package/{src/core/modules/EventBus/index.ts → core/modules/EventBus/index.d.ts} +0 -0
  216. /package/{src/helpers/pwlogger/index.ts → helpers/pwlogger/index.d.ts} +0 -0
  217. /package/{src/modules/PlatformChecker/index.ts → modules/PlatformChecker/index.d.ts} +0 -0
  218. /package/{src/npm.ts → npm.d.ts} +0 -0
  219. /package/{src/services/PushService/PushService.ts → services/PushService/PushService.d.ts} +0 -0
  220. /package/{src/widget-inbox.ts → widget-inbox.d.ts} +0 -0
  221. /package/{src/widget-subscribe-popup.ts → widget-subscribe-popup.d.ts} +0 -0
  222. /package/{src/widget-subscription-button.ts → widget-subscription-button.d.ts} +0 -0
  223. /package/{src/widgets/Inbox/index.ts → widgets/Inbox/index.d.ts} +0 -0
  224. /package/{src/widgets/SubscribePopup/index.ts → widgets/SubscribePopup/index.d.ts} +0 -0
@@ -1,66 +0,0 @@
1
- import { type ISubscribePopupConfig, type ISubscribePopupConfigStyles } from './types/subscribe-popup';
2
-
3
- export const DEFAULT_CONFIG: ISubscribePopupConfig = {
4
- enable: true,
5
- text: 'Don’t miss out on our news and updates! Enable push notifications',
6
- askLaterButtonText: 'Not now',
7
- confirmSubscriptionButtonText: 'Subscribe',
8
- delay: 5,
9
- retryOffset: 60 * 60 * 24 * 7,
10
- overlay: false,
11
- position: 'top',
12
- mobileViewMargin: '0',
13
-
14
- bgColor: '#fff',
15
- borderColor: 'transparent',
16
- boxShadow: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
17
-
18
- textColor: '#000',
19
- textSize: 'inherit',
20
- textWeight: 'normal',
21
- fontFamily: 'inherit',
22
-
23
- subscribeBtnBgColor: '#4285f4',
24
- subscribeBtnTextColor: '#fff',
25
- subscribeBtnTextWeight: 'normal',
26
- subscribeBtnBorderColor: 'transparent',
27
- subscribeBtnBorderRadius: '2px',
28
-
29
- askLaterBtnBgColor: 'transparent',
30
- askLaterBtnTextColor: '#000',
31
- askLaterBtnTextWeight: 'normal',
32
- askLaterBtnBorderColor: 'transparent',
33
- askLaterBtnBorderRadius: '2px',
34
-
35
- theme: 'material',
36
- viewport: 'html',
37
- };
38
-
39
- export const COLOR_TEST_REGEXP = /^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/i;
40
-
41
- // Permissions
42
- export const PERMISSION_DENIED = 'denied';
43
- export const PERMISSION_GRANTED = 'granted';
44
-
45
- export const CONFIG_STYLES: Array<ISubscribePopupConfigStyles> = [
46
- { name: 'mobileViewMargin', type: 'string' },
47
- { name: 'mobileViewPosition', type: 'string' },
48
- { name: 'mobileViewTransition', type: 'string' },
49
- { name: 'bgColor', type: 'color' },
50
- { name: 'borderColor', type: 'color' },
51
- { name: 'boxShadow', type: 'string' },
52
- { name: 'textColor', type: 'color' },
53
- { name: 'textSize', type: 'string' },
54
- { name: 'textWeight', type: 'string' },
55
- { name: 'fontFamily', type: 'string' },
56
- { name: 'subscribeBtnBgColor', type: 'color' },
57
- { name: 'subscribeBtnTextColor', type: 'color' },
58
- { name: 'subscribeBtnTextWeight', type: 'string' },
59
- { name: 'subscribeBtnBorderColor', type: 'color' },
60
- { name: 'subscribeBtnBorderRadius', type: 'string' },
61
- { name: 'askLaterBtnBgColor', type: 'color' },
62
- { name: 'askLaterBtnTextColor', type: 'color' },
63
- { name: 'askLaterBtnTextWeight', type: 'string' },
64
- { name: 'askLaterBtnBorderColor', type: 'color' },
65
- { name: 'askLaterBtnBorderRadius', type: 'string' },
66
- ];
@@ -1,11 +0,0 @@
1
- import { COLOR_TEST_REGEXP } from './constants';
2
-
3
- export function getValidColor(color: string): string {
4
- if (color === 'transparent') {
5
- return color;
6
- }
7
-
8
- return COLOR_TEST_REGEXP.test(color)
9
- ? color
10
- : '#333';
11
- }
@@ -1,24 +0,0 @@
1
- interface IInnerTemplate {
2
- iconUrl?: string;
3
- iconAlt?: string;
4
- text: string;
5
- askLaterButtonText: string;
6
- confirmSubscriptionButtonText: string;
7
- }
8
-
9
- export const innerTemplate = ({ iconUrl, iconAlt, text, askLaterButtonText, confirmSubscriptionButtonText }: IInnerTemplate): string => {
10
- return `<div class="pw-subscription-popup-inner">
11
- <div class="pw-subscription-popup-content">
12
- ${iconUrl
13
- ? `<div class="pw-subscription-popup-icon"><img src="${iconUrl}" alt="${iconAlt || 'Subscribe'}"></div>`
14
- : ''}
15
- <div class="pw-subscription-popup-text">
16
- ${text}
17
- </div>
18
- </div>
19
- <div class="pw-subscription-popup-controls">
20
- <button name="pwAskLater" class="pw-subscribe-popup-button">${askLaterButtonText}</button>
21
- <button name="pwSubscribe" class="pw-subscribe-popup-button pw-subscribe-popup-button-active">${confirmSubscriptionButtonText}</button>
22
- </div>
23
- </div>`;
24
- };
@@ -1,226 +0,0 @@
1
- .pw-subscribe-popup {
2
- position: fixed;
3
- left: 50%;
4
- transform: translateX(-50%);
5
- justify-content: center;
6
- z-index: 1000000;
7
- display: flex;
8
- transition: all .4s ease-out;
9
- }
10
-
11
- .pw-subscribe-popup.pw-position-top {
12
- top: calc(-100% - 24px);
13
- }
14
- .pw-subscribe-popup.pw-position-top.pw-show {
15
- top: 0;
16
- }
17
-
18
- .pw-subscribe-popup.pw-position-bottom {
19
- bottom: calc(-100% - 24px);
20
- }
21
- .pw-subscribe-popup.pw-position-bottom.pw-show {
22
- bottom: 0;
23
- }
24
-
25
- .pw-subscribe-popup.pw-position-center {
26
- display: flex;
27
-
28
- position: fixed;
29
- top: 0;
30
- left: 0;
31
- width: 100vw;
32
- height: 100vh;
33
- justify-content: center;
34
- align-items: center;
35
-
36
- transform: none;
37
- }
38
-
39
- .pw-subscribe-popup__overlay {
40
- background: rgba(0,0,0,.4);
41
- z-index: 1000000;
42
- }
43
-
44
- .pw-subscribe-popup.pw-position-center:not(.pw-subscribe-popup__overlay) {
45
- pointer-events: none;
46
- }
47
-
48
- .pw-subscribe-popup.pw-position-center:not(.pw-show) {
49
- display: none;
50
- }
51
-
52
-
53
- .pw-subscribe-popup__overlay.pw-position-top {
54
- align-items: flex-start;
55
- }
56
-
57
- .pw-subscribe-popup__overlay.pw-position-bottom {
58
- align-items: flex-end;
59
- }
60
-
61
- .pw-subscribe-popup__overlay.pw-position-center {
62
- align-items: center;
63
- }
64
-
65
- .pw-subscription-popup-inner {
66
- max-width: 400px;
67
- font-size: var(--textSize);
68
- color: var(--textColor);
69
- font-weight: var(--textWeight);
70
- font-family: var(--fontFamily);
71
- border-style: solid;
72
- border-width: 1px;
73
- border-color: var(--borderColor);
74
- background: var(--bgColor);
75
- box-shadow: var(--boxShadow);
76
- pointer-events: auto;
77
- }
78
-
79
- .pw-subscription-popup-content {
80
- padding: 16px 16px 4px;
81
- display: flex;
82
- justify-content: stretch;
83
- }
84
-
85
- .pw-subscription-popup-icon {
86
- flex: 0 0 50px;
87
- margin-right: 12px;
88
- padding-top: 4px;
89
- }
90
-
91
- .pw-subscription-popup-icon img {
92
- max-width: 60px;
93
- max-height: 60px;
94
- }
95
-
96
- .pw-subscription-popup-text {
97
- flex: 1 1 300px;
98
- }
99
-
100
- .pw-subscription-popup-controls {
101
- display: flex;
102
- flex-wrap: nowrap;
103
- justify-content: center;
104
- padding: 8px 16px 16px;
105
- }
106
-
107
- button.pw-subscribe-popup-button {
108
- border: solid 1px var(--askLaterBtnBorderColor);
109
- border-radius: var(--askLaterBtnBorderRadius);
110
- display: inline-block;
111
- height: 36px;
112
- line-height: 36px;
113
- padding: 0 16px;
114
- text-transform: uppercase;
115
- font-weight: var(--askLaterBtnTextWeight);
116
- vertical-align: middle;
117
- -webkit-tap-highlight-color: transparent;
118
- font-size: 14px;
119
- outline: 0;
120
- text-decoration: none;
121
- color: var(--askLaterBtnTextColor);
122
- text-align: center;
123
- letter-spacing: .5px;
124
- cursor: pointer;
125
- background: var(--askLaterBtnBgColor);
126
- margin: 4px 8px;
127
- }
128
- button.pw-subscribe-popup-button:hover {
129
- background: rgba(0,0,0,.04);
130
- }
131
- button.pw-subscribe-popup-button:active {
132
- background: rgba(0,0,0,.12);
133
- }
134
-
135
- button.pw-subscribe-popup-button.pw-subscribe-popup-button-active {
136
- color: var(--subscribeBtnTextColor);
137
- background: var(--subscribeBtnBgColor);
138
- border-radius: var(--subscribeBtnBorderRadius);
139
- border: solid 1px var(--subscribeBtnBorderColor);
140
- box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),
141
- 0 3px 1px -2px rgba(0,0,0,0.12),
142
- 0 1px 5px 0 rgba(0,0,0,0.2);
143
- font-weight: var(--subscribeBtnTextWeight);
144
- }
145
- button.pw-subscribe-popup-button.pw-subscribe-popup-button-active:hover {
146
- box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),
147
- 0 1px 7px 0 rgba(0,0,0,0.12),
148
- 0 3px 1px -1px rgba(0,0,0,0.2);
149
- }
150
- button.pw-subscribe-popup-button.pw-subscribe-popup-button-active:active {
151
- box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),
152
- 0 3px 1px -2px rgba(0,0,0,0.12),
153
- 0 1px 5px 0 rgba(0,0,0,0.2);
154
- }
155
-
156
- @media screen and (min-width: 541px) {
157
-
158
- .pw-subscribe-popup-topbar {
159
- width: 100%;
160
- }
161
-
162
- .pw-subscribe-popup-topbar .pw-subscription-popup-inner {
163
- max-width: 100%;
164
- width: 100%;
165
- display: flex;
166
- flex-direction: row;
167
- padding: 2px 40px;
168
- justify-content: center;
169
- align-items: center;
170
- flex-wrap: nowrap;
171
- }
172
-
173
- .pw-subscribe-popup-topbar .pw-subscription-popup-content {
174
- padding: 0;
175
- justify-content: flex-start;
176
- align-items: center;
177
- }
178
-
179
- .pw-subscribe-popup-topbar .pw-subscription-popup-icon img {
180
- max-width: 28px;
181
- max-height: 28px;
182
- }
183
-
184
- .pw-subscribe-popup-topbar button.pw-subscribe-popup-button {
185
- height: 32px;
186
- line-height: 32px;
187
- }
188
-
189
- .pw-subscribe-popup-topbar .pw-subscription-popup-controls {
190
- padding: 0 0 0 16px;
191
- align-items: center;
192
- }
193
- }
194
- @media screen and (max-width: 540px) {
195
- .pw-subscribe-popup,
196
- .pw-subscribe-popup.pw-position-top,
197
- .pw-subscribe-popup.pw-position-center,
198
- .pw-subscribe-popup.pw-position-bottom {
199
- top: var(--mobileViewPosition);
200
- bottom: -110%;
201
- left: 0;
202
- right: 0;
203
- transform: none;
204
- display: flex;
205
- transition: var(--mobileViewTransition);
206
- align-items: flex-end;
207
- }
208
-
209
- .pw-subscribe-popup.pw-subscribe-popup__overlay {
210
- align-items: flex-end;
211
- }
212
-
213
- .pw-subscribe-popup.pw-show {
214
- bottom: var(--mobileViewMargin);
215
- }
216
-
217
- .pw-subscribe-popup__overlay .pw-subscription-popup-inner {
218
- align-items: flex-end;
219
- justify-content: stretch;
220
- }
221
-
222
- .pw-subscription-popup-inner {
223
- max-width: 100%;
224
- width: 100%;
225
- }
226
- }
@@ -1,68 +0,0 @@
1
- export interface ISubscribePopupConfig {
2
- enable: boolean;
3
- text: string;
4
- askLaterButtonText: string;
5
- confirmSubscriptionButtonText: string;
6
- delay: number;
7
- manualToggle?: boolean;
8
- retryOffset: number;
9
- iconUrl?: string;
10
- iconAlt?: string;
11
- overlay: boolean;
12
- position: string;
13
- mobileViewMargin: string;
14
-
15
- bgColor: string;
16
- borderColor: string;
17
- boxShadow: string;
18
- textColor: string;
19
- textSize: string;
20
- textWeight: string;
21
- fontFamily: string;
22
- subscribeBtnBgColor: string;
23
- subscribeBtnTextColor: string;
24
- subscribeBtnTextWeight: string;
25
- subscribeBtnBorderColor: string;
26
- subscribeBtnBorderRadius: string;
27
- askLaterBtnBgColor: string;
28
- askLaterBtnTextColor: string;
29
- askLaterBtnBorderColor: string;
30
- askLaterBtnBorderRadius: string;
31
- askLaterBtnTextWeight: string;
32
- theme: string;
33
- viewport: string;
34
- }
35
-
36
- export interface ISubscribePopupVariables extends ISubscribePopupConfig {
37
- mobileViewTransition: string;
38
- mobileViewPosition: string;
39
- }
40
-
41
- export interface ISubscribePopupConfigStyles {
42
- name: SPTStylesNames;
43
- type: SPTStylesTypes;
44
- }
45
-
46
- export type SPTStylesNames =
47
- | 'mobileViewMargin'
48
- | 'mobileViewTransition'
49
- | 'mobileViewPosition'
50
- | 'bgColor'
51
- | 'borderColor'
52
- | 'boxShadow'
53
- | 'textColor'
54
- | 'textSize'
55
- | 'textWeight'
56
- | 'fontFamily'
57
- | 'subscribeBtnBgColor'
58
- | 'subscribeBtnTextColor'
59
- | 'subscribeBtnTextWeight'
60
- | 'subscribeBtnBorderColor'
61
- | 'subscribeBtnBorderRadius'
62
- | 'askLaterBtnBgColor'
63
- | 'askLaterBtnTextColor'
64
- | 'askLaterBtnTextWeight'
65
- | 'askLaterBtnBorderColor'
66
- | 'askLaterBtnBorderRadius';
67
-
68
- export type SPTStylesTypes = 'number' | 'color' | 'string' | 'size';
@@ -1,205 +0,0 @@
1
- /* Widget */
2
- .pushwoosh-subscribe-widget {
3
- position: fixed;
4
- display: block;
5
- transform: translate3d(0, 0, 0);
6
- }
7
-
8
- .pushwoosh-subscribe-widget__subscribed {
9
- display: none;
10
- }
11
-
12
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button {
13
- border-radius: 50%;
14
- cursor: pointer;
15
- font-size: 0;
16
- text-align: center;
17
- transform: scale(0.9) translate3d(0, 0, 0);
18
- transition: transform .3s ease-in-out;
19
- position: relative;
20
- }
21
-
22
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button:hover {
23
- transform: scale(1);
24
- }
25
-
26
- /* Tooltip */
27
- .pushwoosh-subscribe-widget__tooltip {
28
- position: absolute;
29
- height: 48px;
30
- max-width: 300px;
31
- min-width: 200px;
32
- padding: 5px 7px;
33
- background-color: #3b444b;
34
- color: #ffffff;
35
- text-align: center;
36
- vertical-align: middle;
37
- box-sizing: border-box;
38
- line-height: 38px;
39
- font-size: 0;
40
- font-weight: normal;
41
- visibility: hidden;
42
- opacity: 0;
43
- transition: visibility 0s ease-in .3s,
44
- opacity .3s ease-in;
45
- top: 50%;
46
- transform: translate(0, -50%);
47
- box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);
48
- }
49
-
50
- .pushwoosh-subscribe-widget__tooltip__right:after,
51
- .pushwoosh-subscribe-widget__tooltip__left:after {
52
- content: "";
53
- top: 50%;
54
- height: 0;
55
- width: 0;
56
- position: absolute;
57
- pointer-events: none;
58
- border-top: 5px solid transparent;
59
- border-bottom: 5px solid transparent;
60
- background: #3b444b;
61
- }
62
-
63
- .pushwoosh-subscribe-widget__tooltip__right:after {
64
- left: calc(100% - 7px);
65
- border-top: 5px solid #3b444b;
66
- border-left: 5px solid #3b444b;
67
- border-right: 5px solid transparent;
68
- box-sizing: border-box;
69
- transform-origin: 0 0;
70
- transform: rotate(-45deg);
71
- box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);
72
- }
73
-
74
- .pushwoosh-subscribe-widget__tooltip__left:after {
75
- left: -7px;
76
- border-top: 5px solid #3b444b;
77
- border-right: 5px solid #3b444b;
78
- border-left: 5px solid transparent;
79
- box-sizing: border-box;
80
- transform-origin: 0 0;
81
- transform: rotate(-45deg);
82
- box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);
83
- }
84
-
85
- .pushwoosh-subscribe-widget__bell-button:hover + .pushwoosh-subscribe-widget__tooltip,
86
- .pushwoosh-subscribe-widget__tooltip.pushwoosh-subscribe-widget__tooltip__visible {
87
- display: block;
88
- visibility: visible;
89
- opacity: 1;
90
- transition-delay: 0s;
91
- }
92
-
93
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__tooltip-content {
94
- display: inline-block;
95
- vertical-align: middle;
96
- font-size: 14px;
97
- line-height: 1.4;
98
- white-space: nowrap;
99
- overflow: hidden;
100
- padding-right: 5px;
101
- text-overflow: ellipsis;
102
- max-width: 100%;
103
- }
104
-
105
- /* Popover */
106
-
107
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover {
108
- position: absolute;
109
- right: auto;
110
- box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);
111
- box-sizing: border-box;
112
- background: #9ca8b1;
113
- visibility: hidden;
114
- opacity: 0;
115
- transition: visibility 0s ease-in .5s,
116
- opacity .5s ease-in;
117
- }
118
-
119
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover__visible {
120
- display: block;
121
- visibility: visible;
122
- opacity: 1;
123
- transition-delay: 0s;
124
- }
125
-
126
- .pushwoosh-subscribe-widget__popover__bottom:after,
127
- .pushwoosh-subscribe-widget__popover__top:after {
128
- content: "";
129
- height: 0;
130
- width: 0;
131
- position: absolute;
132
- pointer-events: none;
133
- border-right: 8px solid transparent;
134
- border-left: 8px solid #9ca8b1;
135
- background: #9ca8b1;
136
- transform-origin: 0 0;
137
- transform: rotate(-45deg);
138
- }
139
-
140
- .pushwoosh-subscribe-widget__popover__bottom:after {
141
- border-bottom: 8px solid #9ca8b1;
142
- border-top: 8px solid transparent;
143
- box-sizing: border-box;
144
- box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);
145
- bottom: -16px;
146
- }
147
-
148
- .pushwoosh-subscribe-widget__popover__top:after {
149
- top: 0;
150
- border-top: 8px solid #9ca8b1;
151
- border-bottom: 8px solid transparent;
152
- box-sizing: border-box;
153
- box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);
154
- }
155
-
156
- .pushwoosh-subscribe-widget__popover-content-wrapper {
157
- overflow: auto;
158
- max-width: 100%;
159
- }
160
-
161
-
162
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {
163
- display: flex;
164
- flex-direction: column;
165
- padding: 14px;
166
- box-sizing: border-box;
167
- float: left;
168
- min-width: 100%;
169
- align-items: center;
170
- }
171
-
172
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {
173
- display: block;
174
- }
175
-
176
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {
177
- margin-bottom: 14px;
178
- }
179
-
180
- @media (max-width: 767px) and (orientation: portrait) {
181
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {
182
- flex-direction: column;
183
- }
184
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {
185
- max-width: 280px;
186
- height: auto;
187
- }
188
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {
189
- margin-right: 0;
190
- margin-bottom: 14px;
191
- }
192
- }
193
- @media (max-width: 767px) and (orientation: landscape) {
194
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {
195
- flex-direction: row;
196
- }
197
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {
198
- max-width: 280px;
199
- height: auto;
200
- }
201
- .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {
202
- margin-right: 14px;
203
- margin-bottom: 0;
204
- }
205
- }
@@ -1,67 +0,0 @@
1
- export default (fillColor: string, strokeColor: string) => {
2
- return '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
3
- + '<svg\n'
4
- + ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n'
5
- + ' xmlns:cc="http://creativecommons.org/ns#"\n'
6
- + ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n'
7
- + ' xmlns:svg="http://www.w3.org/2000/svg"\n'
8
- + ' xmlns="http://www.w3.org/2000/svg"\n'
9
- + ' xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n'
10
- + ' xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n'
11
- + ' version="1.1"\n'
12
- + ' id="Capa_1"\n'
13
- + ' x="0px"\n'
14
- + ' y="0px"\n'
15
- + ' viewBox="0 0 346.013 346.013"\n'
16
- + ' style="enable-background:new 0 0 346.013 346.013;width: 80%; height: auto; vertical-align: middle;"\n'
17
- + ' xml:space="preserve"\n'
18
- + ' inkscape:version="0.91 r13725"\n'
19
- + ' sodipodi:docname="alarm_white.svg"><metadata\n'
20
- + ' id="metadata51"><rdf:RDF><cc:Work\n'
21
- + ' rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type\n'
22
- + ' rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs\n'
23
- + ' id="defs49" /><sodipodi:namedview\n'
24
- + ' borderopacity="1"\n'
25
- + ' objecttolerance="10"\n'
26
- + ' gridtolerance="10"\n'
27
- + ' guidetolerance="10"\n'
28
- + ' inkscape:pageopacity="0"\n'
29
- + ' inkscape:pageshadow="2"\n'
30
- + ' inkscape:window-width="1618"\n'
31
- + ' inkscape:window-height="828"\n'
32
- + ' id="namedview47"\n'
33
- + ' showgrid="false"\n'
34
- + ' inkscape:zoom="0.6820553"\n'
35
- + ' inkscape:cx="173.0065"\n'
36
- + ' inkscape:cy="173.0065"\n'
37
- + ' inkscape:window-x="0"\n'
38
- + ' inkscape:window-y="0"\n'
39
- + ' inkscape:window-maximized="0"\n'
40
- + ' inkscape:current-layer="g3" /><g\n'
41
- + ' id="g3"><path\n'
42
- + ' d="m 256.76227,220.19006 c -1.77513,-2.69766 -3.45154,-5.24564 -3.98966,-7.46382 -0.042,-0.17861 -0.0911,-0.36128 -0.16237,-0.61436 -2.28354,-7.67647 0.69147,-24.43921 2.46886,-34.45124 0.26788,-1.50394 0.52274,-2.94197 0.75286,-4.29035 0.0232,-0.13675 0.044,-0.27211 0.0724,-0.48006 1.95582,-15.28051 2.58811,-37.91956 -5.51044,-58.99147 -5.6032,-14.57978 -14.45978,-25.82612 -26.3559,-33.48393 1.26598,-9.812938 -4.85967,-19.343691 -14.66682,-22.0511 -9.80715,-2.70741 -19.95724,2.33226 -23.90298,11.405413 -14.1382,0.467533 -27.51111,5.577097 -39.80114,15.219267 -17.76129,13.9298 -28.83431,33.68757 -34.99389,47.80757 l -0.0479,0.11335 c -0.0512,0.12175 -0.0998,0.24114 -0.13249,0.32962 -0.49733,1.28292 -1.01552,2.64514 -1.55689,4.07255 -3.61311,9.51043 -9.66004,25.42824 -15.611995,30.89342 -0.106524,0.10027 -0.208228,0.20187 -0.362362,0.35435 -1.636243,1.66563 -4.382941,2.99463 -7.288979,4.40101 -7.145531,3.45301 -22.013613,10.64166 -17.206389,31.67844 0.929154,4.07105 4.008437,7.29057 8.033861,8.40185 l 167.570804,46.2604 c 4.02253,1.11048 8.31521,-0.0729 11.2052,-3.08958 14.91617,-15.58874 5.84693,-29.38668 1.48625,-36.02133 z"\n'
43
- + ' id="path5"\n'
44
- + ' inkscape:connector-curvature="0"\n'
45
- + ' vector-effect="non-scaling-stroke"\n'
46
- + ` style="fill:${fillColor}; stroke: ${strokeColor}; stroke-width: 1; " /><path\n`
47
- + ' vector-effect="non-scaling-stroke"\n'
48
- + ' d="m 174.26737,259.72378 -38.76399,-10.70137 c -1.59243,-0.43962 -3.28183,-0.15596 -4.63548,0.7754 -2.53909,1.7494 -2.84182,4.93159 -3.02304,6.83188 l -0.0151,0.15247 c -1.22819,12.67106 6.79854,24.33046 19.08688,27.72284 12.51583,3.45518 25.8324,-2.91586 30.9681,-14.80385 l 0.0935,-0.19205 c 0.52305,-1.06418 1.74613,-3.55554 0.50882,-6.31116 -0.44302,-0.98439 -1.5794,-2.74529 -4.21964,-3.47416 z"\n'
49
- + ' id="path7"\n'
50
- + ' inkscape:connector-curvature="0"\n'
51
- + ` style="fill:${fillColor}; stroke: ${strokeColor}; stroke-width: 1;" /></g><g\n`
52
- + ' id="g17" /><g\n'
53
- + ' id="g19" /><g\n'
54
- + ' id="g21" /><g\n'
55
- + ' id="g23" /><g\n'
56
- + ' id="g25" /><g\n'
57
- + ' id="g27" /><g\n'
58
- + ' id="g29" /><g\n'
59
- + ' id="g31" /><g\n'
60
- + ' id="g33" /><g\n'
61
- + ' id="g35" /><g\n'
62
- + ' id="g37" /><g\n'
63
- + ' id="g39" /><g\n'
64
- + ' id="g41" /><g\n'
65
- + ' id="g43" /><g\n'
66
- + ' id="g45" /></svg>';
67
- };
@@ -1,28 +0,0 @@
1
- // Bell
2
- import { type TBellConfig } from './subscribe_widget.types';
3
-
4
- export const BELL_POSITION_BOTTOM_RIGHT = 'bottomRight';
5
- export const BELL_POSITION_BOTTOM_LEFT = 'bottomLeft';
6
- export const BELL_POSITION_TOP_RIGHT = 'topRight';
7
- export const BELL_POSITION_TOP_LEFT = 'topLeft';
8
-
9
- // Common
10
- export const WIDGET_CONTAINER_ID = 'pushwooshBellWidget';
11
-
12
- export const SUBSCRIBE_WIDGET_DEFAULT_CONFIG: TBellConfig = {
13
- position: BELL_POSITION_BOTTOM_LEFT,
14
- bgColor: '#12AE7E',
15
- bellColor: 'white',
16
- bellStrokeColor: '#08754f',
17
- bellButtonBorder: '1px solid #379676',
18
- shadow: '0px 0px 6px rgba(0, 0, 0, 0.75)',
19
- size: '48px',
20
- indent: '20px',
21
- zIndex: '999999',
22
- tooltipText: {
23
- successSubscribe: 'You are successfully subscribed!',
24
- needSubscribe: 'Get notifications about important news!',
25
- blockSubscribe: 'Click to see how to get notifications',
26
- alreadySubscribed: 'You are already subscribed',
27
- },
28
- };