sass-notification 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sass-notification might be problematic. Click here for more details.

Files changed (36) hide show
  1. package/.eslintignore +1 -0
  2. package/README.md +460 -0
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/samples/js/components/App.d.ts +3 -0
  6. package/dist/samples/js/components/Content.d.ts +3 -0
  7. package/dist/samples/js/components/Header.d.ts +3 -0
  8. package/dist/samples/js/components/examples/AnimationExample.d.ts +2 -0
  9. package/dist/samples/js/components/examples/ContainerExample.d.ts +2 -0
  10. package/dist/samples/js/components/examples/CustomContentExample.d.ts +2 -0
  11. package/dist/samples/js/components/examples/InsertExample.d.ts +2 -0
  12. package/dist/samples/js/components/examples/TypeExample.d.ts +2 -0
  13. package/dist/samples/js/helpers/code.d.ts +2 -0
  14. package/dist/samples/js/helpers/notification.d.ts +46 -0
  15. package/dist/samples/js/helpers/randomize.d.ts +4 -0
  16. package/dist/samples/js/index.d.ts +1 -0
  17. package/dist/scss/_containers.scss +100 -0
  18. package/dist/scss/_types.scss +91 -0
  19. package/dist/scss/_variables.scss +35 -0
  20. package/dist/scss/notification.scss +110 -0
  21. package/dist/src/components/Container.d.ts +31 -0
  22. package/dist/src/components/Notification.d.ts +22 -0
  23. package/dist/src/index.d.ts +4 -0
  24. package/dist/src/store/index.d.ts +16 -0
  25. package/dist/src/typings.d.ts +90 -0
  26. package/dist/src/utils/constants.d.ts +37 -0
  27. package/dist/src/utils/enums.d.ts +29 -0
  28. package/dist/src/utils/helpers.d.ts +27 -0
  29. package/dist/src/utils/timer.d.ts +10 -0
  30. package/dist/src/utils/validators.d.ts +3 -0
  31. package/dist/theme.css +1 -0
  32. package/fastflow.js +32 -0
  33. package/global.d.ts +6 -0
  34. package/package.json +47 -0
  35. package/tohash.json +46 -0
  36. package/tsconfig.json +42 -0
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ /**/*.d.ts
package/README.md ADDED
@@ -0,0 +1,460 @@
1
+ A delightful, easy to use and highly configurable component to help you notify your users out of the box. No messy setup, just beautiful notifications!
2
+
3
+
4
+ ## Demo
5
+
6
+ ## Features
7
+
8
+ * Touch support
9
+ * Responsive notifications
10
+ * Standard notification types
11
+ * Custom notification types
12
+ * Custom notification content
13
+ * Dismissable (touch, click, timeout)
14
+ * Customizable transitions
15
+ * Small library
16
+
17
+
18
+ ### Development
19
+
20
+ First build the library
21
+ ```
22
+ npm run build:library:dev
23
+ ```
24
+ then run the webpack server to see the app running
25
+ ```
26
+ npm run start
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ###
32
+
33
+
34
+
35
+
36
+
37
+ ```jsx
38
+ const App = () => {
39
+ return (
40
+ <div className="app-container">
41
+ <ReactNotifications />
42
+ <Application />
43
+ </div>
44
+ )
45
+ };
46
+ ```
47
+
48
+ ```
49
+
50
+ Then call `addNotification` and watch the magic happens
51
+
52
+ ```jsx
53
+ Store.addNotification({
54
+ title: "Wonderful!",
55
+ message: "example notification",
56
+ type: "success",
57
+ insert: "top",
58
+ container: "top-right",
59
+ animationIn: ["animate__animated", "animate__fadeIn"],
60
+ animationOut: ["animate__animated", "animate__fadeOut"],
61
+ dismiss: {
62
+ duration: 5000,
63
+ onScreen: true
64
+ }
65
+ });
66
+ ```
67
+
68
+ Voila!
69
+
70
+ **Note**: We rely on `animate.css` in this example as `animate__fadeIn` and `animate__fadeOut` are part of `animate.css`. We recommend using it as it's an excellent animation library, but you're not forced to. If you prefer you may also use your custom animations as long as they're valid CSS animations.
71
+
72
+ **Note**: `animate.css` latest version (`v4`) has breaking changes. It introduces `animate__` prefix so that existing classes don't clash. If you still would like to use classes without prefix you can import `animate.css/animate.compat.css`
73
+ ```js
74
+ // preferred way to import (from `v4`). Uses `animate__` prefix.
75
+ import 'animate.css/animate.min.css';
76
+
77
+ // Alternate way to use classes without prefix like `animated fadeIn`
78
+ import 'animate.css/animate.compat.css'
79
+ ```
80
+
81
+ In the examples, we will be using classes with `animate__` prefix, which is the default behaviour of latest `v4` version of `animate.css`.
82
+
83
+ For more info on how to use `animate.css`, please refer to [animate.css docs](https://animate.style/)
84
+
85
+ ## API
86
+
87
+ `Store.addNotification(options)`
88
+
89
+ Render a new notification. Method returns a unique id for the rendered notification. Supplied options are internally validated and an exception will be thrown if validation fails.
90
+
91
+ `Store.removeNotification(id)`
92
+
93
+ Manually remove a notification by id.
94
+
95
+
96
+ ## Examples
97
+
98
+
99
+
100
+ In the following examples for brevity some options will not be mentioned. Strictly focusing on the needed options to present each example. For reference, we will be using Object spread operator on a `notification` object to have non relevant fields included as well.
101
+
102
+ ```js
103
+ notification = {
104
+ title: "Wonderful!",
105
+ message: "Configurable",
106
+ type: "success",
107
+ insert: "top",
108
+ container: "top-right",
109
+ animationIn: ["animate__animated animate__fadeIn"], // `animate.css v4` classes
110
+ animationOut: ["animate__animated animate__fadeOut"] // `animate.css v4` classes
111
+ };
112
+ ```
113
+
114
+ #### Notification container
115
+
116
+ You have in total 6 containers for desktop and 2 for mobile, if component is set to be responsive. List of containers:
117
+
118
+ * `top-left`
119
+ * `top-right`
120
+ * `top-center`
121
+ * `center`
122
+ * `bottom-left`
123
+ * `bottom-right`
124
+ * `bottom-center`
125
+
126
+ ```js
127
+ Store.addNotification({
128
+ ...notification,
129
+ container: 'top-right'
130
+ })
131
+ ```
132
+
133
+ Will position the notification in top right of the screen.
134
+
135
+ #### Notification type
136
+
137
+ List of types:
138
+
139
+ * `success`
140
+ * `danger`
141
+ * `info`
142
+ * `default`
143
+ * `warning`
144
+
145
+
146
+ ```js
147
+ Store.addNotification({
148
+ ...notification,
149
+ type: 'danger'
150
+ })
151
+ ```
152
+
153
+ Will trigger a `danger` notification.
154
+
155
+ #### Animating
156
+
157
+ ```js
158
+ Store.addNotification({
159
+ ...notification,
160
+ animationIn: ['animate__animated animate__fadeIn'], // `animate.css v4` classes
161
+ animationOut: ['animate__animated animate__fadeOut'] // `animate.css v4` classes
162
+ })
163
+ ```
164
+
165
+ `animationIn` and `animationOut` rely on CSS classes that toggle animations. On github pages we rely on `animate.css`, we suggest you to import that package and use their animations as they have plenty.
166
+
167
+
168
+ #### Dismiss notification automatically after timeout expires
169
+
170
+ ```js
171
+ Store.addNotification({
172
+ ...notification,
173
+ dismiss: {
174
+ duration: 2000
175
+ }
176
+ })
177
+ ```
178
+
179
+ #### Dismiss notification automatically with the time left shown on UI
180
+
181
+ ```js
182
+ Store.addNotification({
183
+ ...notification,
184
+ dismiss: {
185
+ duration: 2000,
186
+ onScreen: true
187
+ }
188
+ })
189
+ ```
190
+
191
+ #### Subscribe to notification's removal
192
+
193
+ Easily subscribe to `onRemoval` by supplying callback as option to the notification object. Callback will get called after the removal animation finishes.
194
+
195
+ ```js
196
+ Store.addNotification({
197
+ ...notification,
198
+ onRemoval: (id, removedBy) => {
199
+ ...
200
+ }
201
+ })
202
+ ```
203
+
204
+ #### Pause notification's timeout by hovering
205
+
206
+ ```js
207
+ Store.addNotification({
208
+ ...notification,
209
+ dismiss: {
210
+ duration: 2000,
211
+ pauseOnHover: true
212
+ }
213
+ })
214
+ ```
215
+
216
+ #### Change transition
217
+
218
+ ```js
219
+ Store.addNotification({
220
+ ...notification,
221
+ slidingExit: {
222
+ duration: 800,
223
+ timingFunction: 'ease-out',
224
+ delay: 0
225
+ }
226
+ })
227
+ ```
228
+
229
+ `slidingEnter`, `touchRevert` and `touchSlidingExit` can all be configured in the same way, with the mention that `touchSlidingExit` has 2 transitions nested.
230
+
231
+ ```js
232
+ Store.addNotification({
233
+ ...notification,
234
+ touchSlidingExit: {
235
+ swipe: {
236
+ duration: 400,
237
+ timingFunction: 'ease-out',
238
+ delay: 0,
239
+ },
240
+ fade: {
241
+ duration: 400,
242
+ timingFunction: 'ease-out',
243
+ delay: 0
244
+ }
245
+ }
246
+ })
247
+ ```
248
+
249
+ ## Props
250
+
251
+ <table>
252
+ <tr>
253
+ <th>Name</th>
254
+ <th>Type</th>
255
+ <th>Description</th>
256
+ </tr>
257
+ <tr>
258
+ <td><code>isMobile</code></td>
259
+ <td><code>Boolean</code></td>
260
+ <td>Set whether you want component to be responsive or not. To be used together with <code>breakpoint</codee></td>
261
+ </tr>
262
+ <tr>
263
+ <td><code>breakpoint</code></td>
264
+ <td><code>Number</code></td>
265
+ <td>Breakpoint for responsiveness - defaults to <code>768</code>px</td>
266
+ </tr>
267
+ <tr>
268
+ <td><code>types</code></td>
269
+ <td><code>Array</code></td>
270
+ <td>Custom types</td>
271
+ </tr>
272
+ <tr>
273
+ <td><code>className</code></td>
274
+ <td><code>string</code></td>
275
+ <td>Classes assigned to the container</td>
276
+ </tr>
277
+ <tr>
278
+ <td><code>id</code></td>
279
+ <td><code>string</code></td>
280
+ <td>Id of the container</td>
281
+ </tr>
282
+ </table>
283
+
284
+ ## Options
285
+
286
+ <table>
287
+ <tr>
288
+ <th>Name</th>
289
+ <th>Type</th>
290
+ <th>Description</th>
291
+ </tr>
292
+ <tr>
293
+ <td><code>id</code></td>
294
+ <td><code>String</code></td>
295
+ <td>Id of the notification. Supply option only if you prefer to have custom id, otherwise you should let the component handle generation for you.</td>
296
+ </tr>
297
+ <tr>
298
+ <td><code>onRemoval</code></td>
299
+ <td><code>Function</code></td>
300
+ <td>Gets called on notification removal with <code>id</code> and <code>removedBy</code> arguments</td>
301
+ </tr>
302
+ <tr>
303
+ <td><code>title</code></td>
304
+ <td><code>String</code>, <code>React Node</code> or <code>Functional Component</code></td>
305
+ <td>Title of the notification. Option is ignored if <code>content</code> is set, otherwise it is required.</td>
306
+ </tr>
307
+ <tr>
308
+ <td><code>message</code></td>
309
+ <td><code>String</code>, <code>React Node</code> or <code>Functional Component</code></td>
310
+ <td>Message of the notification. Option is ignored if <code>content</code> is set, otherwise it is required.</td>
311
+ </tr>
312
+ <tr>
313
+ <td><code>content</code></td>
314
+ <td><code>Object</code></td>
315
+ <td>Custom notification content, must be either Class Component, Functional Component or React element. If being supplied as functional or class component, <code>id</code> and <code>notificationConfig</code> will be supplied as prop. <code>notificationConfig</code> will return the parsed notification object as defined in the library.</td>
316
+ </tr>
317
+ <tr>
318
+ <td><code>type</code></td>
319
+ <td><code>String</code></td>
320
+ <td>Type of the notification. Option is ignored if <code>content</code> is set, otherwise it is required.</td>
321
+ </tr>
322
+ <tr>
323
+ <td><code>container</code></td>
324
+ <td><code>String</code></td>
325
+ <td>Container in which the notification will be displayed. Option is required.</td>
326
+ </tr>
327
+ <tr>
328
+ <td><code>insert</code></td>
329
+ <td><code>String</code></td>
330
+ <td>Specify where to append notification into the container - top or bottom. Option defaults to <code>top</code>.</td>
331
+ </tr>
332
+ <tr>
333
+ <td><code>dismiss</code></td>
334
+ <td><code>Dismiss</code></td>
335
+ <td>Specify how a notification should be dismissed.</td>
336
+ </tr>
337
+ <tr>
338
+ <td><code>animationIn</code></td>
339
+ <td><code>Array</code></td>
340
+ <td>Array of CSS classes for animating the notification's entrance.</td>
341
+ </tr>
342
+ <tr>
343
+ <td><code>animationOut</code></td>
344
+ <td><code>Array</code></td>
345
+ <td>Array of CSS classes for animating the notification's exit.</td>
346
+ </tr>
347
+ <tr>
348
+ <td><code>slidingEnter</code></td>
349
+ <td><code>Transition</code></td>
350
+ <td>Transition to be used when sliding to show a notification.</td>
351
+ </tr>
352
+ <tr>
353
+ <td><code>slidingExit</code></td>
354
+ <td><code>Transition</code></td>
355
+ <td>Transition to be used when sliding to remove a notification.</td>
356
+ </tr>
357
+ <tr>
358
+ <td><code>touchRevert</code></td>
359
+ <td><code>Transition</code></td>
360
+ <td>Transition to be used when sliding back after an incomplete swipe.</td>
361
+ </tr>
362
+ <tr>
363
+ <td><code>touchSlidingExit</code></td>
364
+ <td><code>Transition</code></td>
365
+ <td>Transition to be used when sliding on swipe.</td>
366
+ </tr>
367
+ <tr>
368
+ <td><code>width</code></td>
369
+ <td><code>Number</code></td>
370
+ <td>Overwrite notification's <code>width</code> defined by CSS</td>
371
+ </tr>
372
+ </table>
373
+
374
+ #### Transition
375
+
376
+ <code>Transition</code> is used each time you define a transition.
377
+
378
+ <table>
379
+ <tr>
380
+ <th>Name</th>
381
+ <th>Type</th>
382
+ <th>Description</th>
383
+ </tr>
384
+ <tr>
385
+ <td><code>duration</code></td>
386
+ <td><code>Number</code></td>
387
+ <td>Transition duration in ms. Its default value ranges from 300 to 600, depending on transition</td>
388
+ </tr>
389
+ <tr>
390
+ <td><code>timingFunction</code></td>
391
+ <td><code>String</code></td>
392
+ <td>CSS timing function for the transition, defaults to <code>linear</code></td>
393
+ </tr>
394
+ <tr>
395
+ <td><code>delay</code></td>
396
+ <td><code>Number</code></td>
397
+ <td>Delay of the transition in ms, defaults to 0</td>
398
+ </tr>
399
+ </table>
400
+
401
+ #### Dismiss
402
+
403
+ <code>Dismiss</code> is used to describe how a notification should be dismissed.
404
+
405
+ <table>
406
+ <tr>
407
+ <th>Name</th>
408
+ <th>Type</th>
409
+ <th>Description</th>
410
+ </tr>
411
+ <tr>
412
+ <td><code>duration</code></td>
413
+ <td><code>Number</code></td>
414
+ <td>Time in milliseconds after notification gets dismissed. 0 will act as infinite duration. Defaults to <code>0</code></td>
415
+ </tr>
416
+ <tr>
417
+ <td><code>onScreen</code></td>
418
+ <td><code>Boolean</code></td>
419
+ <td>Show time left directly on the notification. Defaults to <code>false</code></td>
420
+ </tr>
421
+ <tr>
422
+ <td><code>pauseOnHover</code></td>
423
+ <td><code>Boolean</code></td>
424
+ <td>Hovering over notification will pause the dismiss timer. Defaults to <code>false</code></td>
425
+ </tr>
426
+ <tr>
427
+ <td><code>waitForAnimation</code></td>
428
+ <td><code>Boolean</code></td>
429
+ <td>When removing a notification by default we trigger the exit animation and the transition to height 0 at the same time. Setting this to <code>true</code> will wait for the exit animation to finish and then start the transition to height 0. Defaults to <code>false</code></td>
430
+ </tr>
431
+ <tr>
432
+ <td><code>click</code></td>
433
+ <td><code>Boolean</code></td>
434
+ <td>Enable dismissal by click, defaults to <code>true</code></td>
435
+ </tr>
436
+ <tr>
437
+ <td><code>touch</code></td>
438
+ <td><code>Boolean</code></td>
439
+ <td>Enable dismiss by touch move, defaults to <code>true</code></td>
440
+ </tr>
441
+ <tr>
442
+ <td><code>showIcon</code></td>
443
+ <td><code>Boolean</code></td>
444
+ <td>Show or hide the close icon, defaults to <code>false</code>. If set to <code>true</code>, it will respond to click interaction and will remove notification</td>
445
+ </tr>
446
+ </table>
447
+
448
+ ## Migration from v1
449
+
450
+ * Ref usage has been deprecated. Import `Store` from library and use it for adding and removing notifications
451
+ * `touchSlidingBack` has been renamed to `touchRevert`
452
+ * Default values for transitions have been slightly changed
453
+ * `dismissIcon` has been removed. Use `showIcon` instead. If you relly on customized close icon, then stick to custom content.
454
+ * `dismiss` supports now more options
455
+ * `cubicBezier` has been renamed to `timingFunction`
456
+ * Validators are now no longer included in the prod build, they are only included in the dev build. If you inspect the npm package you will see that the component has 2 builds - `dev` and `prod` - and relies on ENV variable when importing.
457
+
458
+ ## License
459
+
460
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports["react-notifications-component"]=n(require("react")):t["react-notifications-component"]=n(t.React)}(this,(function(t){return(()=>{"use strict";var n={359:n=>{n.exports=t}},e={};function i(t){var o=e[t];if(void 0!==o)return o.exports;var r=e[t]={exports:{}};return n[t](r,r.exports,i),r.exports}i.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return i.d(n,{a:n}),n},i.d=(t,n)=>{for(var e in n)i.o(n,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{i.r(o),i.d(o,{ReactNotifications:()=>D,Store:()=>k});var t,n,e,r,a=i(359),c=i.n(a),s=!0,u=768,f=325,l="rnc__notification-item";!function(t){t.BOTTOM_LEFT="bottom-left",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_CENTER="bottom-center",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.TOP_CENTER="top-center",t.CENTER="center",t.TOP_FULL="top-full",t.BOTTOM_FULL="bottom-full"}(t||(t={})),function(t){t.TOP="top",t.BOTTOM="bottom"}(n||(n={})),function(t){t.SUCCESS="success",t.DANGER="danger",t.INFO="info",t.DEFAULT="default",t.WARNING="warning"}(e||(e={})),function(t){t.TIMEOUT="timeout",t.CLICK="click",t.TOUCH="touch",t.MANUAL="manual"}(r||(r={}));var d=function(t){return null==t};function m(n){return n===t.BOTTOM_FULL||n===t.BOTTOM_LEFT||n===t.BOTTOM_RIGHT||n===t.BOTTOM_CENTER}function p(n){return n===t.TOP_FULL||n===t.TOP_LEFT||n===t.TOP_RIGHT||n===t.TOP_CENTER}function h(t){var n=t.type,i=t.content,o=t.userDefinedTypes,r=[l];if(i)return r;if(d(o))return function(t){switch(t){case e.DEFAULT:return[l,"rnc__notification-item--default"];case e.SUCCESS:return[l,"rnc__notification-item--success"];case e.DANGER:return[l,"rnc__notification-item--danger"];case e.WARNING:return[l,"rnc__notification-item--warning"];case e.INFO:return[l,"rnc__notification-item--info"];default:return[l]}}(n);var a=o.find((function(t){return t.name===n}));return r.concat(a.htmlClasses)}function y(t,n){var e=t.duration,i=t.timingFunction,o=t.delay;return"".concat(e,"ms ").concat(n," ").concat(i," ").concat(o,"ms")}function v(t){return t?(0|16*Math.random()).toString(16):"100000000000100000000000".replace(/1|0/g,v)}function b(t,n){var e=n.duration,i=n.timingFunction,o=n.delay,r=t||{};return d(r.duration)&&(r.duration=e),d(r.timingFunction)&&(r.timingFunction=i),d(r.delay)&&(r.delay=o),r}function E(t,n,i){var o=t,r=o.id,a=o.type,c=o.insert,s=o.content,u=o.container,f=o.animationIn,l=o.animationOut,m=o.slidingEnter,p=o.slidingExit,h=o.touchRevert,y=o.touchSlidingExit,E=o.dismiss,g=o.width,O=o.onRemoval;o.id=r||v(),o.type=s?null:a.toLowerCase(),n&&!s&&(o.userDefinedTypes=function(t,n){var i=t.content,o=t.type;if(!i&&o!==e.SUCCESS&&o!==e.DANGER&&o!==e.INFO&&o!==e.DEFAULT&&o!==e.WARNING&&n)return n}(o,n)),o.width=d(g)?i:g,o.container=u.toLowerCase(),o.insert=(c||"top").toLowerCase(),o.dismiss=function(t){var n=t,e={duration:0,click:!0,touch:!0,onScreen:!1,pauseOnHover:!1,waitForAnimation:!1,showIcon:!1};return n?(Object.keys(e).forEach((function(t){d(n[t])&&(n[t]=e[t])})),n):e}(E),o.animationIn=f||[],o.animationOut=l||[],o.onRemoval=O||function(){};var T=function(t,n,e){return{duration:t,timingFunction:n,delay:e}};o.slidingEnter=b(m,T(600,"linear",0)),o.slidingExit=b(p,T(600,"linear",0)),o.touchRevert=b(h,T(600,"linear",0));var _=y||{},S=_.swipe||{},N=_.fade||{};return o.touchSlidingExit=_,o.touchSlidingExit.swipe=b(S,T(600,"linear",0)),o.touchSlidingExit.fade=b(N,T(300,"linear",0)),o}function g(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var O=function(){function t(n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.callback=n,this.remaining=e,this.resume()}var n,e,i;return n=t,(e=[{key:"pause",value:function(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.start}},{key:"resume",value:function(){this.start=Date.now(),clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}},{key:"clear",value:function(){clearTimeout(this.timerId)}}])&&g(n.prototype,e),i&&g(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function _(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return S(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return S(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function N(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function w(t,n){return w=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},w(t,n)}function R(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,i=j(t);if(n){var o=j(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return C(this,e)}}function C(t,n){if(n&&("object"===T(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}var M=function(e){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&w(t,n)}(u,e);var i,o,a,s=R(u);function u(t){var n;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,u),(n=s.call(this,t)).onClick=function(){var t=n.props.notification.dismiss;(t.click||t.showIcon)&&n.removeNotification(r.CLICK)},n.onTouchStart=function(t){var e=t.touches[0].pageX;n.setState((function(t){var n=t.parentStyle;return{startX:e,currentX:e,parentStyle:Object.assign(Object.assign({},n),{position:"relative"})}}))},n.onTouchMove=function(t){var e=t.touches[0].pageX,i=n.state.startX,o=n.props,a=o.toggleRemoval,c=o.notification,s=c.id,u=c.onRemoval,f=c.slidingExit,l=c.touchSlidingExit,d=l.swipe,m=l.fade,p=e-i,h=n.rootElementRef.current.offsetWidth,v=window.innerWidth+h,b="".concat(e-i>=0?v:-v,"px");if(function(t,n){return Math.abs(t)>=.4*n}(p,h)){var E=y(d,"left"),g=y(m,"opacity"),O=function(){a(s,(function(){return u(s,r.TOUCH)}))};return n.setState((function(t){var e=t.parentStyle;return{touchEnabled:!1,parentStyle:Object.assign(Object.assign({},e),{left:b,opacity:0,transition:"".concat(E,", ").concat(g)}),onTransitionEnd:function(){n.setState((function(t){var n=t.parentStyle;return{parentStyle:Object.assign(Object.assign({},n),{height:"0px",overflow:"hidden",transition:y(f,"height")}),onTransitionEnd:O}}))}}}))}return n.setState((function(t){var n=t.parentStyle;return{currentX:e,parentStyle:Object.assign(Object.assign({},n),{left:"".concat(0+p,"px")})}}))},n.onTouchEnd=function(){var t=n.props.notification.touchRevert;n.setState((function(n){var e=n.parentStyle;return{parentStyle:Object.assign(Object.assign({},e),{left:0,transition:y(t,"left")})}}))},n.onMouseEnter=function(){n.timer?n.timer.pause():n.setState({animationPlayState:"paused"})},n.onMouseLeave=function(){n.timer?n.timer.resume():n.setState({animationPlayState:"running"})},n.rootElementRef=c().createRef();var e=t.defaultNotificationWidth,i=t.notification,o=t.isMobile,a=i.width;return n.state={parentStyle:{height:"0px",overflow:"hidden",width:"".concat(a||e,"px")},htmlClassList:h(i),animationPlayState:"running",touchEnabled:!0},o&&(n.state.parentStyle.width="100%"),n}return i=u,(o=[{key:"componentWillUnmount",value:function(){this.timer&&this.timer.clear()}},{key:"componentDidMount",value:function(){var e=this,i=this.props,o=i.notification,a=i.notificationsCount,c=o.dismiss,s=c.duration,u=c.onScreen,f=function(e,i){return!(i<=1)&&i>1&&(e.insert===n.TOP&&p(e.container)||e.insert===n.BOTTOM&&m(e.container)||e.container===t.CENTER)}(o,a),l=this.rootElementRef.current.scrollHeight,d=function(){!s||u||e.timer||(e.timer=new O((function(){return e.removeNotification(r.TIMEOUT)}),s))};this.setState((function(t){return{parentStyle:{width:t.parentStyle.width,height:"".concat(l,"px"),transition:f?y(o.slidingEnter,"height"):"10ms height"},onTransitionEnd:d}}),(function(){requestAnimationFrame((function(){e.setState((function(t){return{htmlClassList:[].concat(_(o.animationIn),_(t.htmlClassList))}}))}))}))}},{key:"componentDidUpdate",value:function(t){if(this.props.hasBeenRemoved&&!t.hasBeenRemoved&&this.removeNotification(r.MANUAL),t!==this.props&&!this.props.hasBeenRemoved){var n=this.props.notification.container,e=this.rootElementRef.current.children[0].scrollHeight;this.setState((function(t){var i=t.parentStyle;return{parentStyle:Object.assign(Object.assign({},i),{height:"".concat(e+(n.endsWith("full")?0:15),"px")})}}))}}},{key:"removeNotification",value:function(t){var n=this,e=this.props,i=e.notification,o=e.toggleRemoval,r=i.id,a=i.onRemoval,c=i.dismiss.waitForAnimation,s=[].concat(_(i.animationOut),_(h(i))),u=function(){return o(r,(function(){return a(r,t)}))},f={height:"0px",overflow:"hidden",transition:y(i.slidingExit,"height")};return c?this.setState((function(t){var e=t.parentStyle.width;return{htmlClassList:s,onAnimationEnd:function(){n.setState({parentStyle:Object.assign({width:e},f),onTransitionEnd:u})}}})):this.setState((function(t){var n=t.parentStyle.width;return{parentStyle:Object.assign({width:n},f),onTransitionEnd:u,htmlClassList:s}}))}},{key:"renderTimer",value:function(){var t=this,n=this.props.notification.dismiss,e=n.duration,i=n.onScreen,o=this.state.animationPlayState;if(e&&i){var a={animationName:"timer",animationDuration:"".concat(e,"ms"),animationTimingFunction:"linear",animationFillMode:"forwards",animationDelay:"0",animationPlayState:o};return c().createElement("div",{className:"rnc__notification-timer"},c().createElement("div",{className:"rnc__notification-timer-filler",onAnimationEnd:function(){return t.removeNotification(r.TIMEOUT)},style:a}))}}},{key:"renderCustomContent",value:function(){var t=this.state.htmlClassList,n=this.props.notification,e=n.id,i=n.content,o=n.dismiss,r=o.duration,a=o.pauseOnHover,s=r>0&&a;return c().createElement("div",{className:"".concat(_(t).join(" ")),onMouseEnter:s?this.onMouseEnter:null,onMouseLeave:s?this.onMouseLeave:null},c().isValidElement(i)?i:c().createElement(i,Object.assign({},{id:e,notificationConfig:Object.assign({},this.props.notification)})))}},{key:"renderNotification",value:function(){var t=this.props.notification,n=t.title,e=t.message,i=t.dismiss,o=i.showIcon,r=i.duration,a=i.pauseOnHover,s=this.state.htmlClassList,u=r>0&&a;return c().createElement("div",{className:"".concat(_(s).join(" ")),onMouseEnter:u?this.onMouseEnter:null,onMouseLeave:u?this.onMouseLeave:null},c().createElement("div",{className:"rnc__notification-content"},o&&c().createElement("div",{className:"rnc__notification-close-mark",onClick:this.onClick}),n&&c().createElement("div",{className:"rnc__notification-title"},n),c().createElement("div",{className:"rnc__notification-message"},e),this.renderTimer()))}},{key:"render",value:function(){var t=this.props.notification,n=t.content,e=t.dismiss.click,i=this.state,o=i.parentStyle,r=i.onAnimationEnd,a=i.onTransitionEnd,s=i.touchEnabled;return c().createElement("div",{ref:this.rootElementRef,onClick:e?this.onClick:null,style:o,className:"rnc__notification",onAnimationEnd:r,onTransitionEnd:a,onTouchStart:s?this.onTouchStart:null,onTouchMove:s?this.onTouchMove:null,onTouchEnd:s?this.onTouchEnd:null},n?this.renderCustomContent():this.renderNotification())}}])&&N(i.prototype,o),a&&N(i,a),Object.defineProperty(i,"prototype",{writable:!1}),u}(c().Component);function L(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const k=new(function(){function t(){var n=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.incrementCounter=function(){return n.counter+=1},this.getCounter=function(){return n.counter},this.counter=0,this.add=null}var n,e,i;return n=t,(e=[{key:"addNotification",value:function(t){this.incrementCounter();var n=E(t,this.types,this.defaultNotificationWidth);return this.add(n)}},{key:"register",value:function(t){var n=t.addNotification,e=t.removeNotification,i=t.removeAllNotifications,o=t.types,r=t.defaultNotificationWidth;this.add=n,this.removeNotification=e,this.removeAllNotifications=i,this.defaultNotificationWidth=r,this.types=o}}])&&L(n.prototype,e),i&&L(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}());function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function A(t){return function(t){if(Array.isArray(t))return I(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return I(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return I(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function x(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function F(t,n){return F=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},F(t,n)}function B(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,i=W(t);if(n){var o=W(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return U(this,e)}}function U(t,n){if(n&&("object"===P(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function W(t){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},W(t)}var D=function(n){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&F(t,n)}(a,n);var e,i,o,r=B(a);function a(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,a),(n=r.call(this,t)).handleResize=function(){n.setState({windowWidth:window.innerWidth})},n.add=function(t){return n.setState((function(n){var e=A(n.notifications),i=e.findIndex((function(n){return n.id===t.id}));return i>-1?(e[i]=t,{notifications:e}):{notifications:"top"===t.insert?[t].concat(A(e)):[].concat(A(e),[t])}})),t.id},n.remove=function(t){n.setState((function(n){return{notifications:n.notifications.map((function(n){return n.id===t&&(n.hasBeenRemoved=!0),n}))}}))},n.removeAllNotifications=function(){n.setState({notifications:n.state.notifications.map((function(t){return Object.assign(Object.assign({},t),{hasBeenRemoved:!0})}))})},n.toggleRemoval=function(t,e){n.setState((function(n){return{notifications:n.notifications.filter((function(n){return n.id!==t}))}}),e)},n.state={isMobile:d(t.isMobile)?s:t.isMobile,breakpoint:d(t.breakpoint)?u:t.breakpoint,notifications:[],windowWidth:void 0},n}return e=a,(i=[{key:"componentDidMount",value:function(){var t=this.props,n=t.types,e=t.defaultNotificationWidth;k.register({addNotification:this.add,removeNotification:this.remove,removeAllNotifications:this.removeAllNotifications,defaultNotificationWidth:e||f,types:n}),this.setState({windowWidth:window.innerWidth}),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize)}},{key:"renderNotifications",value:function(t,n){var e=this;return t.map((function(i){return c().createElement(M,{id:i.id,key:i.id,isMobile:n,defaultNotificationWidth:e.props.defaultNotificationWidth,notification:i,toggleRemoval:e.toggleRemoval,notificationsCount:t.length,hasBeenRemoved:i.hasBeenRemoved})}))}},{key:"renderMobileNotifications",value:function(n){var e=n.className,i=n.id,o=function(n){var e=[],i=[];return n.forEach((function(n){var o=n.container,r=t.CENTER;p(o)||o===r?e.push(n):m(o)&&i.push(n)})),{top:e,bottom:i}}(this.state.notifications),r=this.renderNotifications(o.top,!0),a=this.renderNotifications(o.bottom,!0);return c().createElement("div",{id:i,key:"mobile",className:"rnc__base ".concat(e||"")},c().createElement("div",{className:"rnc__notification-container--mobile-top"},r),c().createElement("div",{className:"rnc__notification-container--mobile-bottom"},a))}},{key:"renderScreenNotifications",value:function(n){var e=n.className,i=n.id,o=function(n){var e=[],i=[],o=[],r=[],a=[],c=[],s=[],u=[],f=[];return n.forEach((function(n){var l=n.container;l===t.TOP_FULL?u.push(n):l===t.BOTTOM_FULL?f.push(n):l===t.TOP_LEFT?e.push(n):l===t.TOP_RIGHT?i.push(n):l===t.TOP_CENTER?o.push(n):l===t.BOTTOM_LEFT?r.push(n):l===t.BOTTOM_RIGHT?a.push(n):l===t.BOTTOM_CENTER?c.push(n):l===t.CENTER&&s.push(n)})),{topFull:u,bottomFull:f,topLeft:e,topRight:i,topCenter:o,bottomLeft:r,bottomRight:a,bottomCenter:c,center:s}}(this.state.notifications),r=this.renderNotifications(o.topFull,!1),a=this.renderNotifications(o.bottomFull,!1),s=this.renderNotifications(o.topLeft,!1),u=this.renderNotifications(o.topRight,!1),f=this.renderNotifications(o.topCenter,!1),l=this.renderNotifications(o.bottomLeft,!1),d=this.renderNotifications(o.bottomRight,!1),m=this.renderNotifications(o.bottomCenter,!1),p=this.renderNotifications(o.center,!1);return c().createElement("div",{id:i,key:"screen",className:"rnc__base ".concat(e||"")},c().createElement("div",{className:"rnc__notification-container--top-full"},r),c().createElement("div",{className:"rnc__notification-container--bottom-full"},a),c().createElement("div",{className:"rnc__notification-container--top-left"},s),c().createElement("div",{className:"rnc__notification-container--top-right"},u),c().createElement("div",{className:"rnc__notification-container--bottom-left"},l),c().createElement("div",{className:"rnc__notification-container--bottom-right"},d),c().createElement("div",{className:"rnc__notification-container--top-center"},f),c().createElement("div",{className:"rnc__notification-container--center"},c().createElement("div",{className:"rnc__util--flex-center"},p)),c().createElement("div",{className:"rnc__notification-container--bottom-center"},m))}},{key:"render",value:function(){var t=this.props.isMobile,n=this.state,e=n.windowWidth,i=n.breakpoint;return t&&e<=i?this.renderMobileNotifications(this.props):this.renderScreenNotifications(this.props)}}])&&x(e.prototype,i),o&&x(e,o),Object.defineProperty(e,"prototype",{writable:!1}),a}(c().Component)})(),o})()}));
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAUJ,GACQ,iBAAZC,QACdA,QAAQ,iCAAmCD,EAAQG,QAAQ,UAE3DJ,EAAK,iCAAmCC,EAAQD,EAAY,OAR9D,CASGO,MAAM,SAASC,GAClB,M,kCCVAL,EAAOD,QAAUM,ICCbC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaV,QAGrB,IAAIC,EAASM,EAAyBE,GA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AK4O,oBAAoBC,EAAME,UAAU,GACpDC,EAAYhP,KAAK4O,oBAAoBC,EAAMG,WAAW,GACtDC,EAAajP,KAAK4O,oBAAoBC,EAAMI,YAAY,GACxDC,EAAclP,KAAK4O,oBAAoBC,EAAMK,aAAa,GAC1DC,EAAenP,KAAK4O,oBAAoBC,EAAMM,cAAc,GAC5DC,EAASpP,KAAK4O,oBAAoBC,EAAMO,QAAQ,GACtD,OAAQhF,IAAAA,cAAoB,MAAO,CAAElF,GAAIA,EAAIpE,IAAK,SAAUkL,UAAW,aAAF,OAAeA,GAAa,KAC7F5B,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,yCAA2CqD,GACnFjF,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,4CAA8CsD,GACtFlF,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,yCAA2C8C,GACnF1E,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,0CAA4C+C,GACpF3E,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,4CAA8CiD,GACtF7E,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,6CAA+CkD,GACvF9E,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,2CAA6CgD,GACrF5E,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,uCACpC5B,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,0BAA4BoD,IACxEhF,IAAAA,cAAoB,MAAO,CAAE4B,UAAW,8CAAgDmD,M,oBAEhG,WACI,IAAQ9E,EAAarK,KAAK0H,MAAlB2C,SACR,EAAoCrK,KAAKyI,MAAjC8E,EAAR,EAAQA,YAAaS,EAArB,EAAqBA,WACrB,OAAI3D,GAAYkD,GAAeS,EACpBhO,KAAKwP,0BAA0BxP,KAAK0H,OAExC1H,KAAKyP,0BAA0BzP,KAAK0H,Y,gFA9G7C2F,CAAkBjD,IAAAA,Y","sources":["webpack://react-notifications-component/webpack/universalModuleDefinition","webpack://react-notifications-component/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","webpack://react-notifications-component/webpack/bootstrap","webpack://react-notifications-component/webpack/runtime/compat get default export","webpack://react-notifications-component/webpack/runtime/define property getters","webpack://react-notifications-component/webpack/runtime/hasOwnProperty shorthand","webpack://react-notifications-component/webpack/runtime/make namespace object","webpack://react-notifications-component/./src/utils/enums.ts","webpack://react-notifications-component/./src/utils/constants.ts","webpack://react-notifications-component/./src/utils/helpers.ts","webpack://react-notifications-component/./src/utils/timer.ts","webpack://react-notifications-component/./src/components/Notification.tsx","webpack://react-notifications-component/./src/store/index.ts","webpack://react-notifications-component/./src/components/Container.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"react-notifications-component\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"react-notifications-component\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__359__) {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__359__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { NOTIFICATION_CONTAINER, NOTIFICATION_INSERTION, NOTIFICATION_TYPE, NOTIFICATION_REMOVAL_SOURCE };\r\nvar NOTIFICATION_CONTAINER;\r\n(function (NOTIFICATION_CONTAINER) {\r\n NOTIFICATION_CONTAINER[\"BOTTOM_LEFT\"] = \"bottom-left\";\r\n NOTIFICATION_CONTAINER[\"BOTTOM_RIGHT\"] = \"bottom-right\";\r\n NOTIFICATION_CONTAINER[\"BOTTOM_CENTER\"] = \"bottom-center\";\r\n NOTIFICATION_CONTAINER[\"TOP_LEFT\"] = \"top-left\";\r\n NOTIFICATION_CONTAINER[\"TOP_RIGHT\"] = \"top-right\";\r\n NOTIFICATION_CONTAINER[\"TOP_CENTER\"] = \"top-center\";\r\n NOTIFICATION_CONTAINER[\"CENTER\"] = \"center\";\r\n NOTIFICATION_CONTAINER[\"TOP_FULL\"] = \"top-full\";\r\n NOTIFICATION_CONTAINER[\"BOTTOM_FULL\"] = \"bottom-full\";\r\n})(NOTIFICATION_CONTAINER || (NOTIFICATION_CONTAINER = {}));\r\nvar NOTIFICATION_INSERTION;\r\n(function (NOTIFICATION_INSERTION) {\r\n NOTIFICATION_INSERTION[\"TOP\"] = \"top\";\r\n NOTIFICATION_INSERTION[\"BOTTOM\"] = \"bottom\";\r\n})(NOTIFICATION_INSERTION || (NOTIFICATION_INSERTION = {}));\r\nvar NOTIFICATION_TYPE;\r\n(function (NOTIFICATION_TYPE) {\r\n NOTIFICATION_TYPE[\"SUCCESS\"] = \"success\";\r\n NOTIFICATION_TYPE[\"DANGER\"] = \"danger\";\r\n NOTIFICATION_TYPE[\"INFO\"] = \"info\";\r\n NOTIFICATION_TYPE[\"DEFAULT\"] = \"default\";\r\n NOTIFICATION_TYPE[\"WARNING\"] = \"warning\";\r\n})(NOTIFICATION_TYPE || (NOTIFICATION_TYPE = {}));\r\nvar NOTIFICATION_REMOVAL_SOURCE;\r\n(function (NOTIFICATION_REMOVAL_SOURCE) {\r\n NOTIFICATION_REMOVAL_SOURCE[\"TIMEOUT\"] = \"timeout\";\r\n NOTIFICATION_REMOVAL_SOURCE[\"CLICK\"] = \"click\";\r\n NOTIFICATION_REMOVAL_SOURCE[\"TOUCH\"] = \"touch\";\r\n NOTIFICATION_REMOVAL_SOURCE[\"MANUAL\"] = \"manual\";\r\n})(NOTIFICATION_REMOVAL_SOURCE || (NOTIFICATION_REMOVAL_SOURCE = {}));\r\n","export const DEFAULT_CONTAINER_VALUES = {\r\n isMobile: true,\r\n breakpoint: 768,\r\n defaultNotificationWidth: 325\r\n};\r\nexport const NOTIFICATION_BASE_CLASS = 'rnc__notification-item';\r\nexport const ERROR = {\r\n ANIMATION_IN: 'Validation error. `animationIn` option must be an array',\r\n ANIMATION_OUT: 'Validation error. `animationOut` option must be an array',\r\n DISMISS_REQUIRED: 'Validation error. `duration` property of `dismiss` option is required',\r\n DISMISS_NUMBER: 'Validation error. `duration` property of `dismiss` option must be a Number',\r\n DISMISS_POSITIVE: 'Validation error. `duration` property of `dismiss` option must be a positive Number',\r\n DISMISS_CLICK_BOOL: 'Validation error. `click` property of `dismiss` option must be a Boolean',\r\n DISMISS_TOUCH_BOOL: 'Validation error. `touch` property of `dismiss` option must be a Boolean',\r\n DISMISS_WAIT: 'Validation error. `waitForAnimation` property of `dismiss` option must be a Boolean',\r\n DISMISS_PAUSE_BOOL: 'Validation error. `pauseOnHover` property of `dismiss` option must be a Boolean',\r\n DISMISS_ONSCREEN_BOOL: 'Validation error. `onScreen` property of `dismiss` option must be a Boolean',\r\n DISMISS_ICON: 'Validation error. `showIcon` property of `dismiss` option must be a Boolean',\r\n TITLE_STRING: 'Validation error. `title` option must be a String',\r\n TITLE_ELEMENT: 'Validation error. `title` option must be a valid React element/function',\r\n MESSAGE_REQUIRED: 'Validation error. `message` option is required',\r\n MESSAGE_STRING: 'Validation error. `message` option must be a String',\r\n MESSAGE_ELEMENT: 'Validation error. `message` option must be a valid React element/function',\r\n TYPE_REQUIRED: 'Validation error. `type` option is required',\r\n TYPE_STRING: 'Validation error. `type` option must be a String',\r\n TYPE_NOT_EXISTENT: 'Validation error. `type` option not found',\r\n CONTAINER_REQUIRED: 'Validation error. `container` option is required',\r\n CONTAINER_STRING: 'Validation error. `container` option must be a String',\r\n CONTENT_INVALID: 'Validation error. `content` option must be a valid React component/function/element',\r\n WIDTH_NUMBER: 'Validation error. `width` option must be a Number',\r\n INSERT_STRING: 'Validation error. `insert` option must be a String',\r\n TRANSITION_DURATION_NUMBER: 'Validation error. `duration` property of `transition` option must be a Number',\r\n TRANSITION_TIMING_FUNCTION: 'Validation error. `timingFunction` property of `transition` option must be a String',\r\n TRANSITION_DELAY_NUMBER: 'Validation error. `delay` property of `transition` option must be a Number',\r\n TYPE_NOT_FOUND: 'Validation error. Custom type not found',\r\n REMOVAL_FUNC: 'Validation error. `onRemoval` must be a function'\r\n};\r\n","import { NOTIFICATION_BASE_CLASS } from \"src/utils/constants\";\r\nimport { NOTIFICATION_CONTAINER, NOTIFICATION_INSERTION, NOTIFICATION_TYPE } from \"src/utils/enums\";\r\nexport const isNullOrUndefined = (object) => object === null || object === undefined;\r\nexport function isBottomContainer(container) {\r\n return (container === NOTIFICATION_CONTAINER.BOTTOM_FULL ||\r\n container === NOTIFICATION_CONTAINER.BOTTOM_LEFT ||\r\n container === NOTIFICATION_CONTAINER.BOTTOM_RIGHT ||\r\n container === NOTIFICATION_CONTAINER.BOTTOM_CENTER);\r\n}\r\nexport function isTopContainer(container) {\r\n return (container === NOTIFICATION_CONTAINER.TOP_FULL ||\r\n container === NOTIFICATION_CONTAINER.TOP_LEFT ||\r\n container === NOTIFICATION_CONTAINER.TOP_RIGHT ||\r\n container === NOTIFICATION_CONTAINER.TOP_CENTER);\r\n}\r\nexport function hasFullySwiped(diffX, width) {\r\n const swipeLength = Math.abs(diffX);\r\n const requiredSwipeLength = (40 / 100) * width;\r\n return swipeLength >= requiredSwipeLength;\r\n}\r\nexport function shouldNotificationHaveSliding(notification, count) {\r\n if (count <= 1) {\r\n return false;\r\n }\r\n return (count > 1 &&\r\n ((notification.insert === NOTIFICATION_INSERTION.TOP && isTopContainer(notification.container)) ||\r\n (notification.insert === NOTIFICATION_INSERTION.BOTTOM && isBottomContainer(notification.container)) ||\r\n notification.container === NOTIFICATION_CONTAINER.CENTER));\r\n}\r\nexport function htmlClassesForExistingType(type) {\r\n switch (type) {\r\n case NOTIFICATION_TYPE.DEFAULT:\r\n return [NOTIFICATION_BASE_CLASS, 'rnc__notification-item--default'];\r\n case NOTIFICATION_TYPE.SUCCESS:\r\n return [NOTIFICATION_BASE_CLASS, 'rnc__notification-item--success'];\r\n case NOTIFICATION_TYPE.DANGER:\r\n return [NOTIFICATION_BASE_CLASS, 'rnc__notification-item--danger'];\r\n case NOTIFICATION_TYPE.WARNING:\r\n return [NOTIFICATION_BASE_CLASS, 'rnc__notification-item--warning'];\r\n case NOTIFICATION_TYPE.INFO:\r\n return [NOTIFICATION_BASE_CLASS, 'rnc__notification-item--info'];\r\n default:\r\n return [NOTIFICATION_BASE_CLASS];\r\n }\r\n}\r\nexport function getHtmlClassesForType(notification) {\r\n const { type, content, userDefinedTypes } = notification;\r\n const base = [NOTIFICATION_BASE_CLASS];\r\n if (content) {\r\n return base;\r\n }\r\n if (isNullOrUndefined(userDefinedTypes)) {\r\n return htmlClassesForExistingType(type);\r\n }\r\n const foundType = userDefinedTypes.find((q) => q.name === type);\r\n return base.concat(foundType.htmlClasses);\r\n}\r\nexport function getNotificationsForMobileView(notifications) {\r\n const top = [];\r\n const bottom = [];\r\n notifications.forEach((notification) => {\r\n const { container } = notification;\r\n const { CENTER } = NOTIFICATION_CONTAINER;\r\n if (isTopContainer(container) || container === CENTER) {\r\n top.push(notification);\r\n }\r\n else if (isBottomContainer(container)) {\r\n bottom.push(notification);\r\n }\r\n });\r\n return { top, bottom };\r\n}\r\nexport function getNotificationsForEachContainer(notifications) {\r\n const topLeft = [];\r\n const topRight = [];\r\n const topCenter = [];\r\n const bottomLeft = [];\r\n const bottomRight = [];\r\n const bottomCenter = [];\r\n const center = [];\r\n const topFull = [];\r\n const bottomFull = [];\r\n notifications.forEach((notification) => {\r\n const { container } = notification;\r\n if (container === NOTIFICATION_CONTAINER.TOP_FULL) {\r\n topFull.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.BOTTOM_FULL) {\r\n bottomFull.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.TOP_LEFT) {\r\n topLeft.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.TOP_RIGHT) {\r\n topRight.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.TOP_CENTER) {\r\n topCenter.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.BOTTOM_LEFT) {\r\n bottomLeft.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.BOTTOM_RIGHT) {\r\n bottomRight.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.BOTTOM_CENTER) {\r\n bottomCenter.push(notification);\r\n }\r\n else if (container === NOTIFICATION_CONTAINER.CENTER) {\r\n center.push(notification);\r\n }\r\n });\r\n return {\r\n topFull,\r\n bottomFull,\r\n topLeft,\r\n topRight,\r\n topCenter,\r\n bottomLeft,\r\n bottomRight,\r\n bottomCenter,\r\n center\r\n };\r\n}\r\nexport function getTransition({ duration, timingFunction, delay }, property) {\r\n return `${duration}ms ${property} ${timingFunction} ${delay}ms`;\r\n}\r\nexport function getUid(a) {\r\n return a ? (0 | (Math.random() * 16)).toString(16) : ('' + 1e11 + 1e11).replace(/1|0/g, getUid);\r\n}\r\nfunction defaultTransition(transition, { duration, timingFunction, delay }) {\r\n const transitionOptions = transition || {};\r\n if (isNullOrUndefined(transitionOptions.duration)) {\r\n transitionOptions.duration = duration;\r\n }\r\n if (isNullOrUndefined(transitionOptions.timingFunction)) {\r\n transitionOptions.timingFunction = timingFunction;\r\n }\r\n if (isNullOrUndefined(transitionOptions.delay)) {\r\n transitionOptions.delay = delay;\r\n }\r\n return transitionOptions;\r\n}\r\nfunction defaultDismiss(dismiss) {\r\n const option = dismiss;\r\n const defaults = {\r\n duration: 0,\r\n click: true,\r\n touch: true,\r\n onScreen: false,\r\n pauseOnHover: false,\r\n waitForAnimation: false,\r\n showIcon: false\r\n };\r\n if (!option) {\r\n return defaults;\r\n }\r\n Object.keys(defaults).forEach((prop) => {\r\n if (isNullOrUndefined(option[prop])) {\r\n option[prop] = defaults[prop];\r\n }\r\n });\r\n return option;\r\n}\r\nfunction defaultUserDefinedTypes(notification, definedTypes) {\r\n const { content, type } = notification;\r\n if (content) {\r\n return undefined;\r\n }\r\n if (type === NOTIFICATION_TYPE.SUCCESS ||\r\n type === NOTIFICATION_TYPE.DANGER ||\r\n type === NOTIFICATION_TYPE.INFO ||\r\n type === NOTIFICATION_TYPE.DEFAULT ||\r\n type === NOTIFICATION_TYPE.WARNING ||\r\n !definedTypes) {\r\n return undefined;\r\n }\r\n return definedTypes;\r\n}\r\nexport function parseNotification(options, userDefinedTypes, defaultNotificationWidth) {\r\n const notification = options;\r\n const { id, type, insert, content, container, animationIn, animationOut, slidingEnter, slidingExit, touchRevert, touchSlidingExit, dismiss, width, onRemoval } = notification;\r\n notification.id = id || getUid();\r\n notification.type = content ? null : type.toLowerCase();\r\n if (userDefinedTypes && !content) {\r\n notification.userDefinedTypes = defaultUserDefinedTypes(notification, userDefinedTypes);\r\n }\r\n notification.width = isNullOrUndefined(width) ? defaultNotificationWidth : width;\r\n notification.container = container.toLowerCase();\r\n notification.insert = (insert || 'top').toLowerCase();\r\n notification.dismiss = defaultDismiss(dismiss);\r\n notification.animationIn = animationIn || [];\r\n notification.animationOut = animationOut || [];\r\n // eslint-disable-next-line\r\n notification.onRemoval = onRemoval || (() => { });\r\n const t = (duration, timingFunction, delay) => ({\r\n duration,\r\n timingFunction,\r\n delay\r\n });\r\n notification.slidingEnter = defaultTransition(slidingEnter, t(600, 'linear', 0));\r\n notification.slidingExit = defaultTransition(slidingExit, t(600, 'linear', 0));\r\n notification.touchRevert = defaultTransition(touchRevert, t(600, 'linear', 0));\r\n const touchExit = touchSlidingExit || {};\r\n const swipe = touchExit.swipe || {};\r\n const fade = touchExit.fade || {};\r\n notification.touchSlidingExit = touchExit;\r\n notification.touchSlidingExit.swipe = defaultTransition(swipe, t(600, 'linear', 0));\r\n notification.touchSlidingExit.fade = defaultTransition(fade, t(300, 'linear', 0));\r\n return notification;\r\n}\r\n","export default class Timer {\r\n constructor(callback, delay) {\r\n this.callback = callback;\r\n this.remaining = delay;\r\n this.resume();\r\n }\r\n pause() {\r\n clearTimeout(this.timerId);\r\n this.remaining -= Date.now() - this.start;\r\n }\r\n resume() {\r\n this.start = Date.now();\r\n clearTimeout(this.timerId);\r\n this.timerId = setTimeout(this.callback, this.remaining);\r\n }\r\n clear() {\r\n clearTimeout(this.timerId);\r\n }\r\n}\r\n","import React from 'react';\r\nimport { getHtmlClassesForType, getTransition, hasFullySwiped, shouldNotificationHaveSliding } from 'src/utils/helpers';\r\nimport Timer from 'src/utils/timer';\r\nimport { NOTIFICATION_REMOVAL_SOURCE } from 'src/utils/enums';\r\nexport { Notification };\r\nclass Notification extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.onClick = () => {\r\n const { notification: { dismiss } } = this.props;\r\n if (dismiss.click || dismiss.showIcon) {\r\n this.removeNotification(NOTIFICATION_REMOVAL_SOURCE.CLICK);\r\n }\r\n };\r\n this.onTouchStart = (event) => {\r\n const { pageX } = event.touches[0];\r\n this.setState(({ parentStyle }) => ({\r\n startX: pageX,\r\n currentX: pageX,\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { position: 'relative' })\r\n }));\r\n };\r\n this.onTouchMove = (event) => {\r\n const { pageX } = event.touches[0];\r\n const { startX } = this.state;\r\n const { toggleRemoval, notification: { id, onRemoval, slidingExit, touchSlidingExit: { swipe, fade } } } = this.props;\r\n const distance = pageX - startX;\r\n const { offsetWidth: width } = this.rootElementRef.current;\r\n const swipeTo = window.innerWidth + width;\r\n const left = `${pageX - startX >= 0 ? swipeTo : -swipeTo}px`;\r\n if (hasFullySwiped(distance, width)) {\r\n const t1 = getTransition(swipe, 'left');\r\n const t2 = getTransition(fade, 'opacity');\r\n const onTransitionEnd = () => {\r\n toggleRemoval(id, () => onRemoval(id, NOTIFICATION_REMOVAL_SOURCE.TOUCH));\r\n };\r\n return this.setState(({ parentStyle }) => ({\r\n touchEnabled: false,\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { left, opacity: 0, transition: `${t1}, ${t2}` }),\r\n onTransitionEnd: () => {\r\n this.setState(({ parentStyle }) => ({\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { height: `0px`, overflow: 'hidden', transition: getTransition(slidingExit, 'height') }),\r\n onTransitionEnd\r\n }));\r\n }\r\n }));\r\n }\r\n return this.setState(({ parentStyle }) => ({\r\n currentX: pageX,\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { left: `${0 + distance}px` })\r\n }));\r\n };\r\n this.onTouchEnd = () => {\r\n const { notification: { touchRevert } } = this.props;\r\n this.setState(({ parentStyle }) => ({\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { left: 0, transition: getTransition(touchRevert, 'left') })\r\n }));\r\n };\r\n this.onMouseEnter = () => {\r\n if (this.timer) {\r\n this.timer.pause();\r\n }\r\n else {\r\n this.setState({ animationPlayState: 'paused' });\r\n }\r\n };\r\n this.onMouseLeave = () => {\r\n if (this.timer) {\r\n this.timer.resume();\r\n }\r\n else {\r\n this.setState({ animationPlayState: 'running' });\r\n }\r\n };\r\n this.rootElementRef = React.createRef();\r\n const { defaultNotificationWidth, notification, isMobile } = props;\r\n const { width } = notification;\r\n this.state = {\r\n parentStyle: {\r\n height: `0px`,\r\n overflow: 'hidden',\r\n width: `${width ? width : defaultNotificationWidth}px`\r\n },\r\n htmlClassList: getHtmlClassesForType(notification),\r\n animationPlayState: 'running',\r\n touchEnabled: true\r\n };\r\n if (isMobile) {\r\n this.state.parentStyle.width = '100%';\r\n }\r\n }\r\n componentWillUnmount() {\r\n if (this.timer) {\r\n this.timer.clear();\r\n }\r\n }\r\n componentDidMount() {\r\n const { notification, notificationsCount } = this.props;\r\n const { dismiss: { duration, onScreen } } = notification;\r\n const willSlide = shouldNotificationHaveSliding(notification, notificationsCount);\r\n const { scrollHeight } = this.rootElementRef.current;\r\n const onTransitionEnd = () => {\r\n if (!duration || onScreen || this.timer)\r\n return;\r\n const callback = () => this.removeNotification(NOTIFICATION_REMOVAL_SOURCE.TIMEOUT);\r\n this.timer = new Timer(callback, duration);\r\n };\r\n const callback = () => {\r\n requestAnimationFrame(() => {\r\n this.setState((prevState) => ({\r\n htmlClassList: [...notification.animationIn, ...prevState.htmlClassList]\r\n }));\r\n });\r\n };\r\n this.setState(({ parentStyle: { width } }) => ({\r\n parentStyle: {\r\n width,\r\n height: `${scrollHeight}px`,\r\n transition: willSlide ? getTransition(notification.slidingEnter, 'height') : '10ms height'\r\n },\r\n onTransitionEnd\r\n }), callback);\r\n }\r\n componentDidUpdate(prevProps) {\r\n if (this.props.hasBeenRemoved && !prevProps.hasBeenRemoved) {\r\n this.removeNotification(NOTIFICATION_REMOVAL_SOURCE.MANUAL);\r\n }\r\n if (prevProps !== this.props && !this.props.hasBeenRemoved) {\r\n const { container } = this.props.notification;\r\n const { scrollHeight } = this.rootElementRef.current.children[0];\r\n this.setState(({ parentStyle }) => ({\r\n parentStyle: Object.assign(Object.assign({}, parentStyle), { height: `${scrollHeight + (container.endsWith('full') ? 0 : 15)}px` })\r\n }));\r\n }\r\n }\r\n removeNotification(removalFlag) {\r\n const { notification, toggleRemoval } = this.props;\r\n const { id, onRemoval, dismiss: { waitForAnimation } } = notification;\r\n const htmlClassList = [...notification.animationOut, ...getHtmlClassesForType(notification)];\r\n const onTransitionEnd = () => toggleRemoval(id, () => onRemoval(id, removalFlag));\r\n const parentStyle = {\r\n height: `0px`,\r\n overflow: 'hidden',\r\n transition: getTransition(notification.slidingExit, 'height')\r\n };\r\n if (waitForAnimation) {\r\n return this.setState(({ parentStyle: { width } }) => ({\r\n htmlClassList,\r\n onAnimationEnd: () => {\r\n this.setState({\r\n parentStyle: Object.assign({ width }, parentStyle),\r\n onTransitionEnd\r\n });\r\n }\r\n }));\r\n }\r\n return this.setState(({ parentStyle: { width } }) => ({\r\n parentStyle: Object.assign({ width }, parentStyle),\r\n onTransitionEnd,\r\n htmlClassList\r\n }));\r\n }\r\n renderTimer() {\r\n const { notification: { dismiss } } = this.props;\r\n const { duration, onScreen } = dismiss;\r\n const { animationPlayState } = this.state;\r\n if (!duration || !onScreen) {\r\n return;\r\n }\r\n const style = {\r\n animationName: 'timer',\r\n animationDuration: `${duration}ms`,\r\n animationTimingFunction: 'linear',\r\n animationFillMode: 'forwards',\r\n animationDelay: `0`,\r\n animationPlayState\r\n };\r\n const onAnimationEnd = () => this.removeNotification(NOTIFICATION_REMOVAL_SOURCE.TIMEOUT);\r\n return (React.createElement(\"div\", { className: \"rnc__notification-timer\" },\r\n React.createElement(\"div\", { className: \"rnc__notification-timer-filler\", onAnimationEnd: onAnimationEnd, style: style })));\r\n }\r\n renderCustomContent() {\r\n const { htmlClassList } = this.state;\r\n const { notification: { id, content: CustomContent, dismiss: { duration, pauseOnHover } } } = this.props;\r\n const hasMouseEvents = duration > 0 && pauseOnHover;\r\n return (React.createElement(\"div\", { className: `${[...htmlClassList].join(' ')}`, onMouseEnter: hasMouseEvents ? this.onMouseEnter : null, onMouseLeave: hasMouseEvents ? this.onMouseLeave : null }, React.isValidElement(CustomContent) ? CustomContent : React.createElement(CustomContent, Object.assign({}, { id, notificationConfig: Object.assign({}, this.props.notification) }))));\r\n }\r\n renderNotification() {\r\n const { notification: { title, message, dismiss: { showIcon, duration, pauseOnHover } } } = this.props;\r\n const { htmlClassList } = this.state;\r\n const hasMouseEvents = duration > 0 && pauseOnHover;\r\n return (React.createElement(\"div\", { className: `${[...htmlClassList].join(' ')}`, onMouseEnter: hasMouseEvents ? this.onMouseEnter : null, onMouseLeave: hasMouseEvents ? this.onMouseLeave : null },\r\n React.createElement(\"div\", { className: \"rnc__notification-content\" },\r\n showIcon && React.createElement(\"div\", { className: \"rnc__notification-close-mark\", onClick: this.onClick }),\r\n title && React.createElement(\"div\", { className: \"rnc__notification-title\" }, title),\r\n React.createElement(\"div\", { className: \"rnc__notification-message\" }, message),\r\n this.renderTimer())));\r\n }\r\n render() {\r\n const { notification: { content, dismiss: { click } } } = this.props;\r\n const { parentStyle, onAnimationEnd, onTransitionEnd, touchEnabled } = this.state;\r\n return (React.createElement(\"div\", { ref: this.rootElementRef, onClick: click ? this.onClick : null, style: parentStyle, className: \"rnc__notification\", onAnimationEnd: onAnimationEnd, onTransitionEnd: onTransitionEnd, onTouchStart: touchEnabled ? this.onTouchStart : null, onTouchMove: touchEnabled ? this.onTouchMove : null, onTouchEnd: touchEnabled ? this.onTouchEnd : null }, content ? this.renderCustomContent() : this.renderNotification()));\r\n }\r\n}\r\n","import { parseNotification } from 'src/utils/helpers';\r\nimport { validateTransition, validators } from 'src/utils/validators';\r\nclass Store {\r\n constructor() {\r\n this.incrementCounter = () => (this.counter += 1);\r\n this.getCounter = () => this.counter;\r\n this.counter = 0;\r\n this.add = null;\r\n }\r\n addNotification(notification) {\r\n if (process.env.NODE_ENV === 'development') {\r\n const transitions = ['slidingEnter', 'slidingExit', 'touchRevert', 'touchSlidingExit'];\r\n transitions.forEach((transition) => validateTransition(notification, transition));\r\n validators.forEach((validator) => validator(notification, this.types));\r\n }\r\n this.incrementCounter();\r\n const parsedNotification = parseNotification(notification, this.types, this.defaultNotificationWidth);\r\n return this.add(parsedNotification);\r\n }\r\n register(parameters) {\r\n const { addNotification, removeNotification, removeAllNotifications, types, defaultNotificationWidth } = parameters;\r\n this.add = addNotification;\r\n this.removeNotification = removeNotification;\r\n this.removeAllNotifications = removeAllNotifications;\r\n this.defaultNotificationWidth = defaultNotificationWidth;\r\n this.types = types;\r\n }\r\n}\r\nexport default new Store();\r\n","import React from 'react';\r\nimport { Notification as ReactNotification } from 'src/components/Notification';\r\nimport store from 'src/store';\r\nimport { DEFAULT_CONTAINER_VALUES as DCV } from 'src/utils/constants';\r\nimport { getNotificationsForEachContainer, getNotificationsForMobileView, isNullOrUndefined } from 'src/utils/helpers';\r\nimport \"src/scss/notification.scss\";\r\nexport { Container };\r\nclass Container extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.handleResize = () => {\r\n this.setState({ windowWidth: window.innerWidth });\r\n };\r\n this.add = (notification) => {\r\n this.setState(({ notifications }) => {\r\n const nextNotifications = [...notifications];\r\n const i = nextNotifications.findIndex(({ id }) => id === notification.id);\r\n if (i > -1) {\r\n nextNotifications[i] = notification;\r\n return {\r\n notifications: nextNotifications\r\n };\r\n }\r\n return {\r\n notifications: notification.insert === 'top'\r\n ? [notification, ...nextNotifications]\r\n : [...nextNotifications, notification]\r\n };\r\n });\r\n return notification.id;\r\n };\r\n this.remove = (id) => {\r\n this.setState(({ notifications }) => ({\r\n notifications: notifications.map((notification) => {\r\n if (notification.id === id) {\r\n notification.hasBeenRemoved = true;\r\n }\r\n return notification;\r\n })\r\n }));\r\n };\r\n this.removeAllNotifications = () => {\r\n this.setState({\r\n notifications: this.state.notifications.map((notification) => (Object.assign(Object.assign({}, notification), { hasBeenRemoved: true })))\r\n });\r\n };\r\n this.toggleRemoval = (id, callback) => {\r\n this.setState(({ notifications }) => ({\r\n notifications: notifications.filter(({ id: nId }) => nId !== id)\r\n }), callback);\r\n };\r\n this.state = {\r\n isMobile: isNullOrUndefined(props.isMobile) ? DCV.isMobile : props.isMobile,\r\n breakpoint: isNullOrUndefined(props.breakpoint) ? DCV.breakpoint : props.breakpoint,\r\n notifications: [],\r\n windowWidth: undefined\r\n };\r\n }\r\n componentDidMount() {\r\n const { types, defaultNotificationWidth } = this.props;\r\n store.register({\r\n addNotification: this.add,\r\n removeNotification: this.remove,\r\n removeAllNotifications: this.removeAllNotifications,\r\n defaultNotificationWidth: defaultNotificationWidth || DCV.defaultNotificationWidth,\r\n types\r\n });\r\n this.setState({ windowWidth: window.innerWidth });\r\n window.addEventListener('resize', this.handleResize);\r\n }\r\n componentWillUnmount() {\r\n window.removeEventListener('resize', this.handleResize);\r\n }\r\n renderNotifications(notifications, isMobile) {\r\n return notifications.map((notification) => (React.createElement(ReactNotification, { id: notification.id, key: notification.id, isMobile: isMobile, defaultNotificationWidth: this.props.defaultNotificationWidth, notification: notification, toggleRemoval: this.toggleRemoval, notificationsCount: notifications.length, hasBeenRemoved: notification.hasBeenRemoved })));\r\n }\r\n renderMobileNotifications(props) {\r\n const { className, id } = props;\r\n const { notifications } = this.state;\r\n const mobileNotifications = getNotificationsForMobileView(notifications);\r\n const top = this.renderNotifications(mobileNotifications.top, true);\r\n const bottom = this.renderNotifications(mobileNotifications.bottom, true);\r\n return (React.createElement(\"div\", { id: id, key: \"mobile\", className: `rnc__base ${className || ''}` },\r\n React.createElement(\"div\", { className: \"rnc__notification-container--mobile-top\" }, top),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--mobile-bottom\" }, bottom)));\r\n }\r\n renderScreenNotifications(props) {\r\n const { className, id } = props;\r\n const { notifications } = this.state;\r\n const items = getNotificationsForEachContainer(notifications);\r\n const topFull = this.renderNotifications(items.topFull, false);\r\n const bottomFull = this.renderNotifications(items.bottomFull, false);\r\n const topLeft = this.renderNotifications(items.topLeft, false);\r\n const topRight = this.renderNotifications(items.topRight, false);\r\n const topCenter = this.renderNotifications(items.topCenter, false);\r\n const bottomLeft = this.renderNotifications(items.bottomLeft, false);\r\n const bottomRight = this.renderNotifications(items.bottomRight, false);\r\n const bottomCenter = this.renderNotifications(items.bottomCenter, false);\r\n const center = this.renderNotifications(items.center, false);\r\n return (React.createElement(\"div\", { id: id, key: \"screen\", className: `rnc__base ${className || ''}` },\r\n React.createElement(\"div\", { className: \"rnc__notification-container--top-full\" }, topFull),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--bottom-full\" }, bottomFull),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--top-left\" }, topLeft),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--top-right\" }, topRight),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--bottom-left\" }, bottomLeft),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--bottom-right\" }, bottomRight),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--top-center\" }, topCenter),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--center\" },\r\n React.createElement(\"div\", { className: \"rnc__util--flex-center\" }, center)),\r\n React.createElement(\"div\", { className: \"rnc__notification-container--bottom-center\" }, bottomCenter)));\r\n }\r\n render() {\r\n const { isMobile } = this.props;\r\n const { windowWidth, breakpoint } = this.state;\r\n if (isMobile && windowWidth <= breakpoint) {\r\n return this.renderMobileNotifications(this.props);\r\n }\r\n return this.renderScreenNotifications(this.props);\r\n }\r\n}\r\n"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__359__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","NOTIFICATION_CONTAINER","NOTIFICATION_INSERTION","NOTIFICATION_TYPE","NOTIFICATION_REMOVAL_SOURCE","DEFAULT_CONTAINER_VALUES","NOTIFICATION_BASE_CLASS","isNullOrUndefined","object","isBottomContainer","container","BOTTOM_FULL","BOTTOM_LEFT","BOTTOM_RIGHT","BOTTOM_CENTER","isTopContainer","TOP_FULL","TOP_LEFT","TOP_RIGHT","TOP_CENTER","getHtmlClassesForType","notification","type","content","userDefinedTypes","base","DEFAULT","SUCCESS","DANGER","WARNING","INFO","htmlClassesForExistingType","foundType","find","q","name","concat","htmlClasses","getTransition","property","duration","timingFunction","delay","getUid","Math","random","toString","replace","defaultTransition","transition","transitionOptions","parseNotification","options","defaultNotificationWidth","id","insert","animationIn","animationOut","slidingEnter","slidingExit","touchRevert","touchSlidingExit","dismiss","width","onRemoval","toLowerCase","definedTypes","defaultUserDefinedTypes","option","defaults","click","touch","onScreen","pauseOnHover","waitForAnimation","showIcon","keys","forEach","defaultDismiss","t","touchExit","swipe","fade","Timer","callback","remaining","resume","clearTimeout","timerId","Date","now","start","setTimeout","Notification","props","onClick","removeNotification","CLICK","onTouchStart","event","pageX","touches","setState","parentStyle","startX","currentX","assign","position","onTouchMove","state","toggleRemoval","distance","rootElementRef","current","offsetWidth","swipeTo","window","innerWidth","left","diffX","abs","hasFullySwiped","t1","t2","onTransitionEnd","TOUCH","touchEnabled","opacity","height","overflow","onTouchEnd","onMouseEnter","timer","pause","animationPlayState","onMouseLeave","React","isMobile","htmlClassList","clear","notificationsCount","willSlide","count","TOP","BOTTOM","CENTER","shouldNotificationHaveSliding","scrollHeight","TIMEOUT","requestAnimationFrame","prevState","prevProps","hasBeenRemoved","MANUAL","children","endsWith","removalFlag","onAnimationEnd","style","animationName","animationDuration","animationTimingFunction","animationFillMode","animationDelay","className","CustomContent","hasMouseEvents","join","notificationConfig","title","message","renderTimer","ref","renderCustomContent","renderNotification","Store","incrementCounter","counter","getCounter","add","parsedNotification","types","parameters","addNotification","removeAllNotifications","Container","handleResize","windowWidth","nextNotifications","notifications","i","findIndex","remove","map","filter","DCV","breakpoint","store","register","addEventListener","removeEventListener","ReactNotification","length","mobileNotifications","top","bottom","push","getNotificationsForMobileView","renderNotifications","items","topLeft","topRight","topCenter","bottomLeft","bottomRight","bottomCenter","center","topFull","bottomFull","getNotificationsForEachContainer","renderMobileNotifications","renderScreenNotifications"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import 'src/scss/notification.scss';
3
+ export default function App(): JSX.Element;