@@ -176,13 +176,35 @@ export function slidingExitTransition(notification) {
176176 ) ;
177177}
178178
179+ export function touchSwipeTransition ( notification ) {
180+ const { swipe } = notification . touchSlidingExit ;
181+
182+ return getCubicBezierTransition (
183+ swipe . duration ,
184+ swipe . cubicBezier ,
185+ swipe . delay ,
186+ "left"
187+ ) ;
188+ }
189+
190+ export function touchFadeTransition ( notification ) {
191+ const { fade } = notification . touchSlidingExit ;
192+
193+ return getCubicBezierTransition (
194+ fade . duration ,
195+ fade . cubicBezier ,
196+ fade . delay ,
197+ "opacity"
198+ ) ;
199+ }
200+
179201export function getInitialSlidingState ( { notification, isFirstNotification } ) {
180202 // no sliding needed for first notification in container
181203 const hasSliding = shouldNotificationHaveSliding ( notification ) && ! isFirstNotification ;
182204 const state = { } ;
183205
184206 // set default classes for animated element
185- state . animatedElementClasses = exports . getHtmlClassesForType ( notification ) ;
207+ state . animatedElementClasses = getHtmlClassesForType ( notification ) ;
186208 state . rootElementStyle = {
187209 height : "0" ,
188210 marginBottom : 0 ,
@@ -204,8 +226,8 @@ export function getInitialSlidingState({ notification, isFirstNotification }) {
204226
205227export function getChildStyleForTouchTransitionExit ( notification , startX , currentX ) {
206228 const width = window . innerWidth * 2 ;
207- const touchSwipe = exports . touchSwipeTransition ( notification ) ;
208- const touchFade = exports . touchFadeTransition ( notification ) ;
229+ const touchSwipe = touchSwipeTransition ( notification ) ;
230+ const touchFade = touchFadeTransition ( notification ) ;
209231
210232 return {
211233 opacity : 0 ,
@@ -221,11 +243,11 @@ export function getChildStyleForTouchTransitionExit(notification, startX, curren
221243
222244export function handleTouchSlidingAnimationExit ( notification , currentX , startX ) {
223245 // set current html classes
224- const animatedElementClasses = exports . getHtmlClassesForType ( notification ) ;
246+ const animatedElementClasses = getHtmlClassesForType ( notification ) ;
225247 // set opacity and left to pull-out notification
226248 const childElementStyle = getChildStyleForTouchTransitionExit ( notification , startX , currentX ) ;
227249 // sliding out transition
228- const slidingTransition = exports . slidingExitTransition ( notification ) ;
250+ const slidingTransition = slidingExitTransition ( notification ) ;
229251
230252 return {
231253 childElementStyle,
@@ -242,7 +264,7 @@ export function handleTouchSlidingAnimationExit(notification, currentX, startX)
242264
243265export function handleSlidingAnimationExit ( notification ) {
244266 const { animationOut } = notification ;
245- const animatedElementClasses = exports . getHtmlClassesForType ( notification ) ;
267+ const animatedElementClasses = getHtmlClassesForType ( notification ) ;
246268
247269 if ( animationOut ) {
248270 // add CSS classes if any defined
@@ -283,7 +305,7 @@ export function handleStageTransition(notification, state) {
283305 if ( notification . resized ) {
284306 // window got resized, do not apply animations
285307 rootElementStyle = stateRootStyle ;
286- animatedElementClasses = exports . getHtmlClassesForType ( notification ) ;
308+ animatedElementClasses = getHtmlClassesForType ( notification ) ;
287309 } else {
288310 // use values from state
289311 rootElementStyle = stateRootStyle ;
@@ -315,28 +337,6 @@ export function getRootHeightStyle(notification, scrollHeight) {
315337 } ;
316338}
317339
318- export function touchSwipeTransition ( notification ) {
319- const { swipe } = notification . touchSlidingExit ;
320-
321- return getCubicBezierTransition (
322- swipe . duration ,
323- swipe . cubicBezier ,
324- swipe . delay ,
325- "left"
326- ) ;
327- }
328-
329- export function touchFadeTransition ( notification ) {
330- const { fade } = notification . touchSlidingExit ;
331-
332- return getCubicBezierTransition (
333- fade . duration ,
334- fade . cubicBezier ,
335- fade . delay ,
336- "opacity"
337- ) ;
338- }
339-
340340export function getIconHtmlContent ( notification , onClickHandler ) {
341341 // use icon defined by user
342342 if ( notification . dismissIcon ) {
@@ -383,7 +383,7 @@ export function getNotificationOptions(options, userDefinedTypes) {
383383 } = notification ;
384384
385385 // for now we'll use Math.random for id
386- notification . id = exports . getRandomId ( ) ;
386+ notification . id = getRandomId ( ) ;
387387
388388 // validate notification's title
389389 validateTitle ( notification ) ;
0 commit comments