universal-transition
Advanced tools
Comparing version 0.5.0-beta to 0.5.0
@@ -98,3 +98,3 @@ module.exports = function(require, exports, module) { | ||
if (_universalEnv.isWeex) { | ||
var animation = __webpack_require__(3); | ||
var animation = __weex_require__('@weex-module/animation'); | ||
animation.transition(node.ref, { | ||
@@ -171,5 +171,14 @@ styles: styles, | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { | ||
return typeof obj === "undefined" ? "undefined" : _typeof2(obj); | ||
} : function (obj) { | ||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj); | ||
}; | ||
exports.isRem = isRem; | ||
@@ -217,5 +226,8 @@ exports.calcRem = calcRem; | ||
var REM_REG = /[-+]?\d*\.?\d+rem/g; | ||
var GLOBAL_REM_UNIT = '__global_rem_unit__'; | ||
var global = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? window : (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' ? global : {}; | ||
// Default 1 rem to 1 px | ||
var defaultRemUnit = 1; | ||
if (global[GLOBAL_REM_UNIT] == null) { | ||
global[GLOBAL_REM_UNIT] = 1; | ||
} | ||
@@ -238,3 +250,3 @@ /** | ||
function calcRem(str) { | ||
var remUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRemUnit; | ||
var remUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : global[GLOBAL_REM_UNIT]; | ||
@@ -247,7 +259,7 @@ return str.replace(REM_REG, function (rem) { | ||
function getRem() { | ||
return defaultRemUnit; | ||
return global[GLOBAL_REM_UNIT]; | ||
} | ||
function setRem(rem) { | ||
defaultRemUnit = rem; | ||
global[GLOBAL_REM_UNIT] = rem; | ||
} | ||
@@ -260,3 +272,3 @@ | ||
function convertUnit(val, prop) { | ||
var remUnit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultRemUnit; | ||
var remUnit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : global[GLOBAL_REM_UNIT]; | ||
@@ -274,10 +286,4 @@ if (prop && isUnitNumber(val, prop)) { | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@weex-module/animation"); | ||
/***/ }) | ||
/******/ ])}};; | ||
//# sourceMappingURL=transition.factory.map |
@@ -120,3 +120,3 @@ | ||
if (_universalEnv.isWeex) { | ||
var animation = __webpack_require__(3); | ||
var animation = __weex_require__('@weex-module/animation'); | ||
animation.transition(node.ref, { | ||
@@ -193,5 +193,14 @@ styles: styles, | ||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { | ||
return typeof obj === "undefined" ? "undefined" : _typeof2(obj); | ||
} : function (obj) { | ||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj); | ||
}; | ||
exports.isRem = isRem; | ||
@@ -239,5 +248,8 @@ exports.calcRem = calcRem; | ||
var REM_REG = /[-+]?\d*\.?\d+rem/g; | ||
var GLOBAL_REM_UNIT = '__global_rem_unit__'; | ||
var global = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? window : (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' ? global : {}; | ||
// Default 1 rem to 1 px | ||
var defaultRemUnit = 1; | ||
if (global[GLOBAL_REM_UNIT] == null) { | ||
global[GLOBAL_REM_UNIT] = 1; | ||
} | ||
@@ -260,3 +272,3 @@ /** | ||
function calcRem(str) { | ||
var remUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRemUnit; | ||
var remUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : global[GLOBAL_REM_UNIT]; | ||
@@ -269,7 +281,7 @@ return str.replace(REM_REG, function (rem) { | ||
function getRem() { | ||
return defaultRemUnit; | ||
return global[GLOBAL_REM_UNIT]; | ||
} | ||
function setRem(rem) { | ||
defaultRemUnit = rem; | ||
global[GLOBAL_REM_UNIT] = rem; | ||
} | ||
@@ -282,3 +294,3 @@ | ||
function convertUnit(val, prop) { | ||
var remUnit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultRemUnit; | ||
var remUnit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : global[GLOBAL_REM_UNIT]; | ||
@@ -296,10 +308,4 @@ if (prop && isUnitNumber(val, prop)) { | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@weex-module/animation"); | ||
/***/ }) | ||
/******/ ])});; | ||
//# sourceMappingURL=transition.map |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("universal-transition",function(n,t,o){o.exports=e()});else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this,n.UniversalTransition=e()}}(function(){return function(e){function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";function o(e,n,o,u){"function"!=typeof o&&null!=o||(u=o,o={timingFunction:"ease",duration:0,delay:0});for(var f in n)n[f]=(0,r.convertUnit)(n[f],f);if(i.isWeex){t(3).transition(e.ref,{styles:n,timingFunction:o.timingFunction||"linear",delay:o.delay||0,duration:o.duration||0},u||function(){})}else if(i.isWeb){var a=o.duration||0,s=o.timingFunction||"linear",l=o.delay||0,d="all "+a+"ms "+s+" "+l+"ms";if(e.style.transition=d,e.style.webkitTransition=d,u){var c=function n(t){t.stopPropagation(),e.removeEventListener("webkitTransitionEnd",n),e.removeEventListener("transitionend",n),e.style.transition="",e.style.webkitTransition="",u()};e.addEventListener("webkitTransitionEnd",c),e.addEventListener("transitionend",c)}for(var p in n){var y=n[p];e.style[p]=y}}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=o;var i=t(1),r=t(2);e.exports=n.default},function(e,n,t){"use strict";var o="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};Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)};n.isWeb="object"===("undefined"==typeof navigator?"undefined":i(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),n.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),n.isWeex="function"==typeof callNative,n.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig;n.default=e.exports,n.default=e.exports},function(e,n,t){"use strict";function o(e){return"string"==typeof e&&-1!==e.indexOf(l)}function i(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return e.replace(d,function(e){return parseFloat(e)*n+"px"})}function r(){return c}function u(e){c=e}function f(e,n){return"number"==typeof e&&!s[n]}function a(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c;return n&&f(e,n)?e*t+"px":o(e)?i(e,t):e}Object.defineProperty(n,"__esModule",{value:!0}),n.isRem=o,n.calcRem=i,n.getRem=r,n.setRem=u,n.isUnitNumber=f,n.convertUnit=a;var s={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,lines:!0},l="rem",d=/[-+]?\d*\.?\d+rem/g,c=1;n.default=e.exports,n.default=e.exports},function(e,n){e.exports=require("@weex-module/animation")}])}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("universal-transition",function(n,t,o){o.exports=e()});else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this,n.UniversalTransition=e()}}(function(){return function(e){function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";function o(e,n,t,o){"function"!=typeof t&&null!=t||(o=t,t={timingFunction:"ease",duration:0,delay:0});for(var u in n)n[u]=(0,r.convertUnit)(n[u],u);if(i.isWeex){__weex_require__("@weex-module/animation").transition(e.ref,{styles:n,timingFunction:t.timingFunction||"linear",delay:t.delay||0,duration:t.duration||0},o||function(){})}else if(i.isWeb){var f=t.duration||0,l=t.timingFunction||"linear",a=t.delay||0,d="all "+f+"ms "+l+" "+a+"ms";if(e.style.transition=d,e.style.webkitTransition=d,o){var s=function n(t){t.stopPropagation(),e.removeEventListener("webkitTransitionEnd",n),e.removeEventListener("transitionend",n),e.style.transition="",e.style.webkitTransition="",o()};e.addEventListener("webkitTransitionEnd",s),e.addEventListener("transitionend",s)}for(var c in n){var y=n[c];e.style[c]=y}}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=o;var i=t(1),r=t(2);e.exports=n.default},function(e,n,t){"use strict";var o="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};Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)};n.isWeb="object"===("undefined"==typeof navigator?"undefined":i(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),n.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),n.isWeex="function"==typeof callNative,n.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig;n.default=e.exports,n.default=e.exports},function(e,n,t){"use strict";function o(e){return"string"==typeof e&&-1!==e.indexOf(c)}function i(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m[p];return e.replace(y,function(e){return parseFloat(e)*n+"px"})}function r(){return m[p]}function u(e){m[p]=e}function f(e,n){return"number"==typeof e&&!s[n]}function l(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m[p];return n&&f(e,n)?e*t+"px":o(e)?i(e,t):e}var a="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};Object.defineProperty(n,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":a(e)};n.isRem=o,n.calcRem=i,n.getRem=r,n.setRem=u,n.isUnitNumber=f,n.convertUnit=l;var s={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,lines:!0},c="rem",y=/[-+]?\d*\.?\d+rem/g,p="__global_rem_unit__",m="object"===("undefined"==typeof window?"undefined":d(window))?window:"object"===(void 0===m?"undefined":d(m))?m:{};null==m[p]&&(m[p]=1),n.default=e.exports,n.default=e.exports}])}); |
@@ -27,3 +27,3 @@ 'use strict'; | ||
if (_universalEnv.isWeex) { | ||
var animation = require('@weex-module/animation'); | ||
var animation = __weex_require__('@weex-module/animation'); | ||
animation.transition(node.ref, { | ||
@@ -30,0 +30,0 @@ styles: styles, |
{ | ||
"name": "universal-transition", | ||
"version": "0.5.0-beta", | ||
"version": "0.5.0", | ||
"description": "A universal transition API.", | ||
@@ -16,5 +16,5 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"style-unit": "^0.5.0-beta", | ||
"universal-env": "^0.5.0-beta" | ||
"style-unit": "^0.5.0", | ||
"universal-env": "^0.5.0" | ||
} | ||
} |
@@ -19,3 +19,3 @@ import {isWeex, isWeb} from 'universal-env'; | ||
if (isWeex) { | ||
const animation = require('@weex-module/animation'); | ||
const animation = __weex_require__('@weex-module/animation'); | ||
animation.transition(node.ref, { | ||
@@ -22,0 +22,0 @@ styles, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
58982
676
1
Updatedstyle-unit@^0.5.0
Updateduniversal-env@^0.5.0