From 0aecd792110c50ca6d816da267f59e9bddd9f8b5 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 27 Aug 2019 08:55:56 +0200 Subject: [PATCH] return if ie11 --- dist/tracks.esm.js | 2 +- dist/tracks.iife.js | 2 +- package-lock.json | 2 +- src/tracks.js | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/tracks.esm.js b/dist/tracks.esm.js index 26fb439..16271aa 100644 --- a/dist/tracks.esm.js +++ b/dist/tracks.esm.js @@ -1 +1 @@ -function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}window.Tracks=window.tracks=function(){var I=[],a=[],n={attributes:!1,childList:!0,subtree:!0},k=Object.assign({display:null,visibility:null,opacity:null,delay:null,margin:null,padding:null,background:null,color:null,border:null,height:null,width:null,maxHeight:null,maxWidth:null,overflow:null,"font-size":null,"border-radius":null,"background-color":null,"border-width":null,"border-color":null,"pointer-events":null},{x:function(e){return t("translateX",e,"px")},y:function(e){return t("translateY",e,"px")},skewX:function(e){return t("skewX",e)},skewY:function(e){return t("skewY",e)},scaleX:function(e){return t("scaleX",e)},scaleY:function(e){return t("scaleY",e)},rotation:function(e){return t("rotate",e,"deg")},scale:function(e){return t("scale",e)}});function t(e,n,t){return e+"("+n+(t=t||"")+")"}var z=["width","height","margin","padding"],N={easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1)",easeInQuart:"cubic-bezier(0.645, 0.045, 0.355, 1)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.77, 0, 0.175, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.86, 0, 0.07, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(1, 0, 0, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},S=["webkitTransform","MozTransform","msTransform","OTransform","transform"],e=["-webkit-transition","-moz-transition","-o-transition","transition"],_={UNDEFINED:"undefined",STRING:"string",NUMBER:"number",OBJECT:"object",DELAY:"delay",EASE:"ease",FUNCTION:"function",DEFAULT_EASE:"linear",DEFAULT_TWEEN_PROP:"all",DEFAULT_TIME_UNIT:"ms",CHILDLIST:"childList"},C=window.TracksConfig,x=_.DEFAULT_EASE;function L(n,t,o){e.forEach(function(e){n.style[e]=_.DEFAULT_TWEEN_PROP+" "+t+_.DEFAULT_TIME_UNIT+" "+o})}function A(n,t){n.style[t.key]=t.value,t.handler?S.forEach(function(e){n.style[e]=t.handler(t.value)}):n.style[t.key]=t.value}function s(o,e){return Array.from(e).find(function(e){return-1<(n=e,t="",n.classList&&(t+=JSON.stringify(n.classList)),n.id&&(t+=n.id),t).indexOf(o);var n,t})}function c(e){e.remove=Element.prototype.remove}function l(e){a.splice(e,1)}function f(i,r,u){i&&(i.onclick=null,i.remove=function(){var e,n,t,o;n=u,t=r(e=i),o=a.indexOf(function(e){return e.identifier===n}),_typeof(t)===_.OBJECT&&(t.then&&_typeof(t.then)===_.FUNCTION?t.then(function(){U()&&console.log("Tracks - internal - on complete done"),c(e),l(o),e.remove()}):t.animation&&t.animation.then(function(){c(e),l(o),e.remove(),t.onComplete&&t.onComplete()}))})}function P(e){return window.TracksConfig&&window.TracksConfig[e]}function U(){return!0===P("logs")}function o(v,T,h,w,g){return new Promise(function(e,n){if(w=w||1,g=g||!1,v&&_typeof(T)===_.OBJECT&&_typeof(h)===_.OBJECT||n("incorrect args"),("undefined"==typeof window?"undefined":_typeof(window))===_.UNDEFINED&&n("no window"),0===Object.values(T).length&&n("incorrect fromProps args"),0===Object.values(h).length&&n("incorrect toProps args"),_typeof(w)===_.NUMBER&&w||n("incorrect duration arg"),(C=window.TracksConfig)&&void 0!==P("ease")){var t=C.ease;x=N[t]?N[t]:_.DEFAULT_EASE}var o={element:v,fromState:T,toState:h,duration:w};U()&&console.table(o),-1===v.style.cssText.indexOf("width")&&(v.style.width="0px"),-1===v.style.cssText.indexOf("height")&&(v.style.height="0px");var i,r,u,a,c=(i=T,r=h,u=Object.prototype.hasOwnProperty,(a=[{p:i,equation:x},{p:r,equation:x}]).forEach(function(e){u.call(e.p,_.EASE)&&u.call(N,e.p.ease)&&(e.equation=N[e.p.ease])}),{easingEquationFrom:a[0].equation,easingEquationTo:a[1].equation}),s=c.easingEquationFrom,l=c.easingEquationTo,f=0,d=Object.prototype.hasOwnProperty,b=[],p=[];Object.entries(T).forEach(function(e){var n=e[0],t=e[1];n===_.EASE&&_typeof(t)===_.STRING||(d.call(k,n)?b.push({key:n,value:t,handler:k[n]}):console.error("Tracks - invalid from key:",n))}),Object.entries(h).forEach(function(e){var n=e[0],t=e[1];_typeof(t)!==_.STRING&&-1===t.toString().indexOf("px")&&(z.some(function(e){return-1