Comparing version 0.16.0 to 0.16.1
# Radium Changelog | ||
## 0.16.1 (January 5, 2016) | ||
### Bug Fixes | ||
- `<StyleRoot>` no longer throws an error on unmount | ||
## 0.16.0 (January 5, 2016) | ||
@@ -4,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Radium=t(require("react")):e.Radium=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,a["default"])(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=n(i),s=r(6),u=n(s),l=r(44),f=n(l),c=r(45),d=n(c),p=r(37),m=n(p),y=r(9),g=n(y),h=r(4);o.Plugins=u["default"],o.Style=f["default"],o.StyleRoot=d["default"],o.getState=m["default"],o.keyframes=g["default"],o.__clearStateForTests=h.__clearStateForTests,t["default"]=o,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function u(e,t){Object.getOwnPropertyNames(e).forEach(function(r){if(g.indexOf(r)<0&&!t.hasOwnProperty(r)){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n)}})}function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if("function"!=typeof e){var r=function(){var r=f({},t,e);return{v:function(e){return l(e,r)}}}();if("object"===("undefined"==typeof r?"undefined":s(r)))return r.v}var n=e,d=n;d.render||d.prototype.render||(d=function(e){function t(){return o(this,t),i(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return n(this.props,this.context)},t}(c.Component),d.displayName=n.displayName||n.name);var m=function(e){function r(){o(this,r);var t=i(this,e.apply(this,arguments));return t.state=t.state||{},t.state._radiumStyleState={},t._radiumIsMounted=!0,t}return a(r,e),r.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount&&e.prototype.componentWillUnmount.call(this),this._radiumIsMounted=!1,this._radiumMouseUpListener&&this._radiumMouseUpListener.remove(),this._radiumMediaQueryListenersByQuery&&Object.keys(this._radiumMediaQueryListenersByQuery).forEach(function(e){this._radiumMediaQueryListenersByQuery[e].remove()},this)},r.prototype.getChildContext=function(){var t=e.prototype.getChildContext?e.prototype.getChildContext.call(this):{};if(!this.props.radiumConfig)return t;var r=f({},t);return this.props.radiumConfig&&(r._radiumConfig=this.props.radiumConfig),r},r.prototype.render=function(){var r=e.prototype.render.call(this),n=this.props.radiumConfig||this.context._radiumConfig||t;return t&&n!==t&&(n=f({},t,n)),(0,y["default"])(this,r,n)},r}(d);return u(n,m),m.propTypes&&m.propTypes.style&&(m.propTypes=f({},m.propTypes,{style:c.PropTypes.oneOfType([c.PropTypes.array,c.PropTypes.object])})),m.displayName=n.displayName||n.name||"Component",m.contextTypes=f({},m.contextTypes,{_radiumConfig:c.PropTypes.object,_radiumStyleKeeper:c.PropTypes.instanceOf(p["default"])}),m.childContextTypes=f({},m.childContextTypes,{_radiumConfig:c.PropTypes.object,_radiumStyleKeeper:c.PropTypes.instanceOf(p["default"])}),m}var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=l;var c=r(2),d=r(3),p=n(d),m=r(4),y=n(m),g=["arguments","callee","caller","length","name","prototype","type"];e.exports=t["default"]},function(t,r){t.exports=e},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(t){r(this,e),this._userAgent=t,this._listeners=[],this._cssSet={}}return e.prototype.subscribe=function(e){return-1===this._listeners.indexOf(e)&&this._listeners.push(e),{remove:function(){var t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)}}},e.prototype.addCSS=function(e){return this._cssSet[e]||(this._cssSet[e]=!0,this._emitChange()),{remove:function(){delete this._cssSet[e],this._emitChange()}}},e.prototype.getCSS=function(){return Object.keys(this._cssSet).join("\n")},e.prototype._emitChange=function(){this._listeners.forEach(function(e){return e()})},e}();t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var a=(r(5),r(10)),s=n(a),u=r(37),l=n(u),f=r(38),c=n(f),d=r(39),p=r(6),m=n(p),y=r(42),g=n(y),h=r(2),b=n(h),v={plugins:[m["default"].mergeStyleArray,m["default"].checkProps,m["default"].resolveMediaQueries,m["default"].resolveInteractionStyles,m["default"].keyframes,m["default"].prefix,m["default"].checkProps]},x={},S=null,k=function(e){var t=e.children,r=e.component,n=e.config,i=e.existingKeyMap;if(!t)return t;var a="undefined"==typeof t?"undefined":o(t);if("string"===a||"number"===a)return t;if("function"===a)return function(){var e=t.apply(this,arguments);return b["default"].isValidElement(e)?S(r,e,n,i):e};if(1===b["default"].Children.count(t)&&t.type){var s=b["default"].Children.only(t);return S(r,s,n,i)}return b["default"].Children.map(t,function(e){return b["default"].isValidElement(e)?S(r,e,n,i):e})},_=function(e){var t=e.component,r=e.config,n=e.existingKeyMap,o=e.props,a=o;return Object.keys(o).forEach(function(e){if("children"!==e){var s=o[e];b["default"].isValidElement(s)&&(a=i({},a),a[e]=S(t,s,r,n))}}),a},O=function(e){var t=e.componentName,r=e.existingKeyMap,n=e.renderedElement,o="string"==typeof n.ref?n.ref:n.key,i=(0,c["default"])(o),a=!1,s=function(){if(a)return i;if(a=!0,r[i]){var e=void 0;throw"string"==typeof n.type?e=n.type:n.type.constructor&&(e=n.type.constructor.displayName||n.type.constructor.name),new Error("Radium requires each element with interactive styles to have a unique key, set using either the ref or key prop. "+(o?'Key "'+o+'" is a duplicate.':"Multiple elements have no key specified.")+' Component: "'+t+'". '+(e?'Element: "'+e+'".':""))}return r[i]=!0,i};return s},w=function(e,t,r,n){if(e._radiumIsMounted){var o=e._lastRadiumState||e.state&&e.state._radiumStyleState||{},a={_radiumStyleState:i({},o)};a._radiumStyleState[t]=i({},a._radiumStyleState[t]),a._radiumStyleState[t][r]=n,e._lastRadiumState=a._radiumStyleState,e.setState(a)}},C=function(e){var t=e.component,r=e.config,n=e.existingKeyMap,o=e.props,a=e.renderedElement;if(!b["default"].isValidElement(a)||"string"!=typeof a.type||!o.style)return o;var u=o,f=r.plugins||v.plugins,c=t.constructor.displayName||t.constructor.name,p=O({renderedElement:a,existingKeyMap:n,componentName:c}),m=function(e){return t[e]},y=function(e){return x[e]},h=function(e,r){return(0,l["default"])(t.state,r||p(),e)},S=function(e,r,n){return w(t,n||p(),e,r)},k=function(e){var r=t._radiumStyleKeeper||t.context._radiumStyleKeeper;if(!r)throw new Error("To use plugins requiring `addCSS` (e.g. keyframes, media queries), please wrap your application in the StyleRoot component. Component name: `"+c+"`.");return r.addCSS(e)},_=o.style;return f.forEach(function(e){var n=e({ExecutionEnvironment:g["default"],addCSS:k,componentName:c,config:r,cssRuleSetToString:s["default"],getComponentField:m,getGlobalState:y,getState:h,mergeStyles:d.mergeStyles,props:u,setState:S,isNestedStyle:d.isNestedStyle,style:_})||{};_=n.style||_,u=n.props&&Object.keys(n.props).length?i({},u,n.props):u;var o=n.componentFields||{};Object.keys(o).forEach(function(e){t[e]=o[e]});var a=n.globalState||{};Object.keys(a).forEach(function(e){x[e]=a[e]})}),_!==o.style&&(u=i({},u,{style:_})),u},j=function(e,t,r){return"string"==typeof e.type&&(t=i({},t,{_radiumDidResolveStyles:!0})),b["default"].cloneElement(e,t,r)};S=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?v:arguments[2],n=arguments[3];if(n=n||{},!t||t.props&&t.props._radiumDidResolveStyles)return t;var o=k({children:t.props.children,component:e,config:r,existingKeyMap:n}),i=_({component:e,config:r,existingKeyMap:n,props:t.props});return i=C({component:e,config:r,existingKeyMap:n,props:i,renderedElement:t}),o===t.props.children&&i===t.props?t:j(t,i!==t.props?i:{},o)},S.__clearStateForTests=function(){x={}},t["default"]=S,e.exports=t["default"]},function(e,t,r){"use strict";r(6)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=(r(5),r(7)),i=n(o),a=r(8),s=n(a),u=r(31),l=n(u),f=r(32),c=n(f),d=r(33),p=n(d),m=r(35),y=n(m);t["default"]={checkProps:i["default"],keyframes:s["default"],mergeStyleArray:l["default"],prefix:c["default"],resolveInteractionStyles:p["default"],resolveMediaQueries:y["default"]},e.exports=t["default"]},function(e,t,r){"use strict";Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var n=(r(6),function(){});t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){var t=e.addCSS,r=e.config,n=e.style,o=Object.keys(n).reduce(function(e,o){var i=n[o];if("animationName"===o&&i&&i.__radiumKeyframes){var a=i,s=a.__process(r.userAgent),u=s.animationName,l=s.css;t(l),i=u}return e[o]=i,e},{});return{style:o}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;r(6),r(9);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return{__radiumKeyframes:!0,__process:function(r){var n="-webkit-keyframes",o=Object.keys(e).map(function(t){return(0,a["default"])(t,e[t],r)}).join("\n"),i=(t?t+"-":"")+"radium-animation-"+(0,u["default"])(o),s="@"+n+" "+i+" {\n"+o+"\n}\n";return{css:s,animationName:i}}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var i=r(10),a=n(i),s=r(30),u=n(s);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Object.keys(e).map(function(t){return t+": "+e[t]+";"}).join("\n")}function i(e,t,r){if(!t)return"";var n=(0,d.getPrefixedStyle)(t,r),i=(0,c["default"])(n,function(e,t){return(0,s["default"])(t,e)}),a=(0,l["default"])(i),u=o(a);return e+"{"+u+"}"}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i;var a=r(11),s=n(a),u=r(12),l=n(u),f=r(13),c=n(f),d=r(14);e.exports=t["default"]},function(e,t){"use strict";function r(e,t){var r=!n[e]&&"number"==typeof t&&0!==t;return r?t+"px":t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r;var n={animationIterationCount:!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,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/([a-z])?([A-Z])/g,n=function(e,t,r){return(t||"")+"-"+r.toLowerCase()},o=function(e){return e.replace(r,n)},i=function(e){return Object.keys(e).reduce(function(t,r){var n=o(r);return/^ms-/.test(n)&&(n="-"+n),t[n]=e[r],t},{})};t["default"]=i,e.exports=t["default"]},function(e,t){"use strict";function r(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=t(e[n],n),r},{})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r,e.exports=t["default"]},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return Array.isArray(n)&&(n=n.join(";"+r+":")),t[r]=n,t},{})}function i(t,r){var n=r||e&&e.navigator&&e.navigator.userAgent;l&&n===u||(l=new s["default"]({userAgent:n}),u=n);var i=l.prefix(t),a=o(i);return a}Object.defineProperty(t,"__esModule",{value:!0}),t.getPrefixedStyle=i;var a=r(15),s=n(a),u=void 0,l=void 0}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(16),s=n(a),u=r(18),l=n(u),f=r(19),c=n(f),d=r(20),p=n(d),m=r(21),y=n(m),g=r(22),h=n(g),b=r(23),v=n(b),x=["phantom"],S="undefined"!=typeof navigator?navigator.userAgent:void 0,k={userAgent:S,keepUnprefixed:!1},_=function(){function e(){var t=this,r=arguments.length<=0||void 0===arguments[0]?k:arguments[0];if(o(this,e),this._userAgent=r.userAgent,this._keepUnprefixed=r.keepUnprefixed,this._browserInfo=(0,s["default"])(this._userAgent),!this._browserInfo||!this._browserInfo.prefix)return this._hasPropsRequiringPrefix=!1,(0,y["default"])("Either the global navigator was undefined or an invalid userAgent was provided.","Using a valid userAgent? Please let us know and create an issue at https://github.com/rofrischmann/inline-style-prefixer/issues"),!1;this.cssPrefix=this._browserInfo.prefix.CSS,this.jsPrefix=this._browserInfo.prefix.inline,this.prefixedKeyframes=(0,l["default"])(this._browserInfo);var n=this._browserInfo.browser&&h["default"][this._browserInfo.browser];return n?(this._requiresPrefix=Object.keys(n).filter(function(e){return n[e]>=t._browserInfo.version}).reduce(function(e,t){return e[t]=!0,e},{}),void(this._hasPropsRequiringPrefix=Object.keys(this._requiresPrefix).length>0)):(x.forEach(function(e){t._browserInfo[e]&&(t._isWhitelisted=!0)}),this._hasPropsRequiringPrefix=!1,this._isWhitelisted?!0:((0,y["default"])("Your userAgent seems to be not supported by inline-style-prefixer. Feel free to open an issue."),!1))}return i(e,[{key:"prefix",value:function(e){var t=this;return this._hasPropsRequiringPrefix?(e=(0,p["default"])({},e),Object.keys(e).forEach(function(r){var n=e[r];n instanceof Object?e[r]=t.prefix(n):(t._requiresPrefix[r]&&(e[t.jsPrefix+(0,c["default"])(r)]=n,t._keepUnprefixed||delete e[r]),v["default"].forEach(function(o){(0,p["default"])(e,o(r,n,t._browserInfo,e,t._keepUnprefixed,!1))}))}),e):e}}],[{key:"prefixAll",value:function(t){var r={},n=(0,s["default"])("*");return n.browsers.forEach(function(e){var t=h["default"][e];t&&(0,p["default"])(r,t)}),!Object.keys(r).length>0?t:(t=(0,p["default"])({},t),Object.keys(t).forEach(function(o){var i=t[o];if(i instanceof Object)t[o]=e.prefixAll(i);else{var a=Object.keys(n.prefixes);a.forEach(function(e){var a=n.prefixes[e];r[o]&&(t[a.inline+(0,c["default"])(o)]=i),v["default"].forEach(function(r){var n={name:e,prefix:a,version:0};(0,p["default"])(t,r(o,i,n,t,!0,!0))})})}}),t)}}]),e}();t["default"]=_,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),i=n(o),a={Webkit:["chrome","safari","ios","android","phantom","opera","webos","blackberry","bada","tizen"],Moz:["firefox","seamonkey","sailfish"],ms:["msie","msedge"]},s={chrome:[["chrome"]],safari:[["safari"]],firefox:[["firefox"]],ie:[["msie"]],edge:[["msedge"]],opera:[["opera"]],ios_saf:[["ios","mobile"],["ios","tablet"]],ie_mob:[["windowsphone","mobile","msie"],["windowsphone","tablet","msie"],["windowsphone","mobile","msedge"],["windowsphone","tablet","msedge"]],op_mini:[["opera","mobile"],["opera","tablet"]],and_chr:[["android","chrome","mobile"],["android","chrome","tablet"]],and_uc:[["android","mobile"],["android","tablet"]],android:[["android","mobile"],["android","tablet"]]},u=function(e){var t=void 0,r=void 0,n=void 0,o=void 0,i=void 0,u=void 0;t=Object.keys(a);var l=!0,f=!1,c=void 0;try{for(var d,p=t[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){r=d.value,n=a[r],o=s[e];var m=!0,y=!1,g=void 0;try{for(var h,b=n[Symbol.iterator]();!(m=(h=b.next()).done);m=!0){i=h.value;var v=!0,x=!1,S=void 0;try{for(var k,_=o[Symbol.iterator]();!(v=(k=_.next()).done);v=!0)if(u=k.value,-1!==u.indexOf(i))return{inline:r,CSS:"-"+r.toLowerCase()+"-"}}catch(O){x=!0,S=O}finally{try{!v&&_["return"]&&_["return"]()}finally{if(x)throw S}}}}catch(O){y=!0,g=O}finally{try{!m&&b["return"]&&b["return"]()}finally{if(y)throw g}}}}catch(O){f=!0,c=O}finally{try{!l&&p["return"]&&p["return"]()}finally{if(f)throw c}}return{inline:"",CSS:""}};t["default"]=function(e){if(!e)return!1;var t={};if("*"===e)return t.browsers=Object.keys(s),t.prefixes={},t.browsers.forEach(function(e){t.prefixes[e]=u(e)}),t;t=i["default"]._detect(e),Object.keys(a).forEach(function(e){a[e].forEach(function(r){t[r]&&(t.prefix={inline:e,CSS:"-"+e.toLowerCase()+"-"})})});var r="";return Object.keys(s).forEach(function(e){s[e].forEach(function(n){var o=0;n.forEach(function(e){t[e]&&(o+=1)}),n.length===o&&(r=e)})}),t.browser=r,t.version=parseFloat(t.version),t.osversion=parseFloat(t.osversion),"android"===r&&t.osversion<5&&(t.version=t.osversion),t},e.exports=t["default"]},function(e,t,r){var n,o;/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Radium=t(require("react")):e.Radium=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,a["default"])(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=n(i),s=r(6),u=n(s),l=r(44),f=n(l),c=r(45),d=n(c),p=r(37),m=n(p),y=r(9),g=n(y),h=r(4);o.Plugins=u["default"],o.Style=f["default"],o.StyleRoot=d["default"],o.getState=m["default"],o.keyframes=g["default"],o.__clearStateForTests=h.__clearStateForTests,t["default"]=o,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function u(e,t){Object.getOwnPropertyNames(e).forEach(function(r){if(g.indexOf(r)<0&&!t.hasOwnProperty(r)){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n)}})}function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if("function"!=typeof e){var r=function(){var r=f({},t,e);return{v:function(e){return l(e,r)}}}();if("object"===("undefined"==typeof r?"undefined":s(r)))return r.v}var n=e,d=n;d.render||d.prototype.render||(d=function(e){function t(){return o(this,t),i(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return n(this.props,this.context)},t}(c.Component),d.displayName=n.displayName||n.name);var m=function(e){function r(){o(this,r);var t=i(this,e.apply(this,arguments));return t.state=t.state||{},t.state._radiumStyleState={},t._radiumIsMounted=!0,t}return a(r,e),r.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount&&e.prototype.componentWillUnmount.call(this),this._radiumIsMounted=!1,this._radiumMouseUpListener&&this._radiumMouseUpListener.remove(),this._radiumMediaQueryListenersByQuery&&Object.keys(this._radiumMediaQueryListenersByQuery).forEach(function(e){this._radiumMediaQueryListenersByQuery[e].remove()},this)},r.prototype.getChildContext=function(){var t=e.prototype.getChildContext?e.prototype.getChildContext.call(this):{};if(!this.props.radiumConfig)return t;var r=f({},t);return this.props.radiumConfig&&(r._radiumConfig=this.props.radiumConfig),r},r.prototype.render=function(){var r=e.prototype.render.call(this),n=this.props.radiumConfig||this.context._radiumConfig||t;return t&&n!==t&&(n=f({},t,n)),(0,y["default"])(this,r,n)},r}(d);return u(n,m),m.propTypes&&m.propTypes.style&&(m.propTypes=f({},m.propTypes,{style:c.PropTypes.oneOfType([c.PropTypes.array,c.PropTypes.object])})),m.displayName=n.displayName||n.name||"Component",m.contextTypes=f({},m.contextTypes,{_radiumConfig:c.PropTypes.object,_radiumStyleKeeper:c.PropTypes.instanceOf(p["default"])}),m.childContextTypes=f({},m.childContextTypes,{_radiumConfig:c.PropTypes.object,_radiumStyleKeeper:c.PropTypes.instanceOf(p["default"])}),m}var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=l;var c=r(2),d=r(3),p=n(d),m=r(4),y=n(m),g=["arguments","callee","caller","length","name","prototype","type"];e.exports=t["default"]},function(t,r){t.exports=e},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(t){r(this,e),this._userAgent=t,this._listeners=[],this._cssSet={}}return e.prototype.subscribe=function(e){var t=this;return-1===this._listeners.indexOf(e)&&this._listeners.push(e),{remove:function(){var r=t._listeners.indexOf(e);r>-1&&t._listeners.splice(r,1)}}},e.prototype.addCSS=function(e){var t=this;return this._cssSet[e]||(this._cssSet[e]=!0,this._emitChange()),{remove:function(){delete t._cssSet[e],t._emitChange()}}},e.prototype.getCSS=function(){return Object.keys(this._cssSet).join("\n")},e.prototype._emitChange=function(){this._listeners.forEach(function(e){return e()})},e}();t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var a=(r(5),r(10)),s=n(a),u=r(37),l=n(u),f=r(38),c=n(f),d=r(39),p=r(6),m=n(p),y=r(42),g=n(y),h=r(2),b=n(h),v={plugins:[m["default"].mergeStyleArray,m["default"].checkProps,m["default"].resolveMediaQueries,m["default"].resolveInteractionStyles,m["default"].keyframes,m["default"].prefix,m["default"].checkProps]},x={},S=null,k=function(e){var t=e.children,r=e.component,n=e.config,i=e.existingKeyMap;if(!t)return t;var a="undefined"==typeof t?"undefined":o(t);if("string"===a||"number"===a)return t;if("function"===a)return function(){var e=t.apply(this,arguments);return b["default"].isValidElement(e)?S(r,e,n,i):e};if(1===b["default"].Children.count(t)&&t.type){var s=b["default"].Children.only(t);return S(r,s,n,i)}return b["default"].Children.map(t,function(e){return b["default"].isValidElement(e)?S(r,e,n,i):e})},_=function(e){var t=e.component,r=e.config,n=e.existingKeyMap,o=e.props,a=o;return Object.keys(o).forEach(function(e){if("children"!==e){var s=o[e];b["default"].isValidElement(s)&&(a=i({},a),a[e]=S(t,s,r,n))}}),a},O=function(e){var t=e.componentName,r=e.existingKeyMap,n=e.renderedElement,o="string"==typeof n.ref?n.ref:n.key,i=(0,c["default"])(o),a=!1,s=function(){if(a)return i;if(a=!0,r[i]){var e=void 0;throw"string"==typeof n.type?e=n.type:n.type.constructor&&(e=n.type.constructor.displayName||n.type.constructor.name),new Error("Radium requires each element with interactive styles to have a unique key, set using either the ref or key prop. "+(o?'Key "'+o+'" is a duplicate.':"Multiple elements have no key specified.")+' Component: "'+t+'". '+(e?'Element: "'+e+'".':""))}return r[i]=!0,i};return s},w=function(e,t,r,n){if(e._radiumIsMounted){var o=e._lastRadiumState||e.state&&e.state._radiumStyleState||{},a={_radiumStyleState:i({},o)};a._radiumStyleState[t]=i({},a._radiumStyleState[t]),a._radiumStyleState[t][r]=n,e._lastRadiumState=a._radiumStyleState,e.setState(a)}},C=function(e){var t=e.component,r=e.config,n=e.existingKeyMap,o=e.props,a=e.renderedElement;if(!b["default"].isValidElement(a)||"string"!=typeof a.type||!o.style)return o;var u=o,f=r.plugins||v.plugins,c=t.constructor.displayName||t.constructor.name,p=O({renderedElement:a,existingKeyMap:n,componentName:c}),m=function(e){return t[e]},y=function(e){return x[e]},h=function(e,r){return(0,l["default"])(t.state,r||p(),e)},S=function(e,r,n){return w(t,n||p(),e,r)},k=function(e){var r=t._radiumStyleKeeper||t.context._radiumStyleKeeper;if(!r)throw new Error("To use plugins requiring `addCSS` (e.g. keyframes, media queries), please wrap your application in the StyleRoot component. Component name: `"+c+"`.");return r.addCSS(e)},_=o.style;return f.forEach(function(e){var n=e({ExecutionEnvironment:g["default"],addCSS:k,componentName:c,config:r,cssRuleSetToString:s["default"],getComponentField:m,getGlobalState:y,getState:h,mergeStyles:d.mergeStyles,props:u,setState:S,isNestedStyle:d.isNestedStyle,style:_})||{};_=n.style||_,u=n.props&&Object.keys(n.props).length?i({},u,n.props):u;var o=n.componentFields||{};Object.keys(o).forEach(function(e){t[e]=o[e]});var a=n.globalState||{};Object.keys(a).forEach(function(e){x[e]=a[e]})}),_!==o.style&&(u=i({},u,{style:_})),u},j=function(e,t,r){return"string"==typeof e.type&&(t=i({},t,{_radiumDidResolveStyles:!0})),b["default"].cloneElement(e,t,r)};S=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?v:arguments[2],n=arguments[3];if(n=n||{},!t||t.props&&t.props._radiumDidResolveStyles)return t;var o=k({children:t.props.children,component:e,config:r,existingKeyMap:n}),i=_({component:e,config:r,existingKeyMap:n,props:t.props});return i=C({component:e,config:r,existingKeyMap:n,props:i,renderedElement:t}),o===t.props.children&&i===t.props?t:j(t,i!==t.props?i:{},o)},S.__clearStateForTests=function(){x={}},t["default"]=S,e.exports=t["default"]},function(e,t,r){"use strict";r(6)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=(r(5),r(7)),i=n(o),a=r(8),s=n(a),u=r(31),l=n(u),f=r(32),c=n(f),d=r(33),p=n(d),m=r(35),y=n(m);t["default"]={checkProps:i["default"],keyframes:s["default"],mergeStyleArray:l["default"],prefix:c["default"],resolveInteractionStyles:p["default"],resolveMediaQueries:y["default"]},e.exports=t["default"]},function(e,t,r){"use strict";Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var n=(r(6),function(){});t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){var t=e.addCSS,r=e.config,n=e.style,o=Object.keys(n).reduce(function(e,o){var i=n[o];if("animationName"===o&&i&&i.__radiumKeyframes){var a=i,s=a.__process(r.userAgent),u=s.animationName,l=s.css;t(l),i=u}return e[o]=i,e},{});return{style:o}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;r(6),r(9);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return{__radiumKeyframes:!0,__process:function(r){var n="-webkit-keyframes",o=Object.keys(e).map(function(t){return(0,a["default"])(t,e[t],r)}).join("\n"),i=(t?t+"-":"")+"radium-animation-"+(0,u["default"])(o),s="@"+n+" "+i+" {\n"+o+"\n}\n";return{css:s,animationName:i}}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var i=r(10),a=n(i),s=r(30),u=n(s);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Object.keys(e).map(function(t){return t+": "+e[t]+";"}).join("\n")}function i(e,t,r){if(!t)return"";var n=(0,d.getPrefixedStyle)(t,r),i=(0,c["default"])(n,function(e,t){return(0,s["default"])(t,e)}),a=(0,l["default"])(i),u=o(a);return e+"{"+u+"}"}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i;var a=r(11),s=n(a),u=r(12),l=n(u),f=r(13),c=n(f),d=r(14);e.exports=t["default"]},function(e,t){"use strict";function r(e,t){var r=!n[e]&&"number"==typeof t&&0!==t;return r?t+"px":t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r;var n={animationIterationCount:!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,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/([a-z])?([A-Z])/g,n=function(e,t,r){return(t||"")+"-"+r.toLowerCase()},o=function(e){return e.replace(r,n)},i=function(e){return Object.keys(e).reduce(function(t,r){var n=o(r);return/^ms-/.test(n)&&(n="-"+n),t[n]=e[r],t},{})};t["default"]=i,e.exports=t["default"]},function(e,t){"use strict";function r(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=t(e[n],n),r},{})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r,e.exports=t["default"]},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return Array.isArray(n)&&(n=n.join(";"+r+":")),t[r]=n,t},{})}function i(t,r){var n=r||e&&e.navigator&&e.navigator.userAgent;l&&n===u||(l=new s["default"]({userAgent:n}),u=n);var i=l.prefix(t),a=o(i);return a}Object.defineProperty(t,"__esModule",{value:!0}),t.getPrefixedStyle=i;var a=r(15),s=n(a),u=void 0,l=void 0}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(16),s=n(a),u=r(18),l=n(u),f=r(19),c=n(f),d=r(20),p=n(d),m=r(21),y=n(m),g=r(22),h=n(g),b=r(23),v=n(b),x=["phantom"],S="undefined"!=typeof navigator?navigator.userAgent:void 0,k={userAgent:S,keepUnprefixed:!1},_=function(){function e(){var t=this,r=arguments.length<=0||void 0===arguments[0]?k:arguments[0];if(o(this,e),this._userAgent=r.userAgent,this._keepUnprefixed=r.keepUnprefixed,this._browserInfo=(0,s["default"])(this._userAgent),!this._browserInfo||!this._browserInfo.prefix)return this._hasPropsRequiringPrefix=!1,(0,y["default"])("Either the global navigator was undefined or an invalid userAgent was provided.","Using a valid userAgent? Please let us know and create an issue at https://github.com/rofrischmann/inline-style-prefixer/issues"),!1;this.cssPrefix=this._browserInfo.prefix.CSS,this.jsPrefix=this._browserInfo.prefix.inline,this.prefixedKeyframes=(0,l["default"])(this._browserInfo);var n=this._browserInfo.browser&&h["default"][this._browserInfo.browser];return n?(this._requiresPrefix=Object.keys(n).filter(function(e){return n[e]>=t._browserInfo.version}).reduce(function(e,t){return e[t]=!0,e},{}),void(this._hasPropsRequiringPrefix=Object.keys(this._requiresPrefix).length>0)):(x.forEach(function(e){t._browserInfo[e]&&(t._isWhitelisted=!0)}),this._hasPropsRequiringPrefix=!1,this._isWhitelisted?!0:((0,y["default"])("Your userAgent seems to be not supported by inline-style-prefixer. Feel free to open an issue."),!1))}return i(e,[{key:"prefix",value:function(e){var t=this;return this._hasPropsRequiringPrefix?(e=(0,p["default"])({},e),Object.keys(e).forEach(function(r){var n=e[r];n instanceof Object?e[r]=t.prefix(n):(t._requiresPrefix[r]&&(e[t.jsPrefix+(0,c["default"])(r)]=n,t._keepUnprefixed||delete e[r]),v["default"].forEach(function(o){(0,p["default"])(e,o(r,n,t._browserInfo,e,t._keepUnprefixed,!1))}))}),e):e}}],[{key:"prefixAll",value:function(t){var r={},n=(0,s["default"])("*");return n.browsers.forEach(function(e){var t=h["default"][e];t&&(0,p["default"])(r,t)}),!Object.keys(r).length>0?t:(t=(0,p["default"])({},t),Object.keys(t).forEach(function(o){var i=t[o];if(i instanceof Object)t[o]=e.prefixAll(i);else{var a=Object.keys(n.prefixes);a.forEach(function(e){var a=n.prefixes[e];r[o]&&(t[a.inline+(0,c["default"])(o)]=i),v["default"].forEach(function(r){var n={name:e,prefix:a,version:0};(0,p["default"])(t,r(o,i,n,t,!0,!0))})})}}),t)}}]),e}();t["default"]=_,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),i=n(o),a={Webkit:["chrome","safari","ios","android","phantom","opera","webos","blackberry","bada","tizen"],Moz:["firefox","seamonkey","sailfish"],ms:["msie","msedge"]},s={chrome:[["chrome"]],safari:[["safari"]],firefox:[["firefox"]],ie:[["msie"]],edge:[["msedge"]],opera:[["opera"]],ios_saf:[["ios","mobile"],["ios","tablet"]],ie_mob:[["windowsphone","mobile","msie"],["windowsphone","tablet","msie"],["windowsphone","mobile","msedge"],["windowsphone","tablet","msedge"]],op_mini:[["opera","mobile"],["opera","tablet"]],and_chr:[["android","chrome","mobile"],["android","chrome","tablet"]],and_uc:[["android","mobile"],["android","tablet"]],android:[["android","mobile"],["android","tablet"]]},u=function(e){var t=void 0,r=void 0,n=void 0,o=void 0,i=void 0,u=void 0;t=Object.keys(a);var l=!0,f=!1,c=void 0;try{for(var d,p=t[Symbol.iterator]();!(l=(d=p.next()).done);l=!0){r=d.value,n=a[r],o=s[e];var m=!0,y=!1,g=void 0;try{for(var h,b=n[Symbol.iterator]();!(m=(h=b.next()).done);m=!0){i=h.value;var v=!0,x=!1,S=void 0;try{for(var k,_=o[Symbol.iterator]();!(v=(k=_.next()).done);v=!0)if(u=k.value,-1!==u.indexOf(i))return{inline:r,CSS:"-"+r.toLowerCase()+"-"}}catch(O){x=!0,S=O}finally{try{!v&&_["return"]&&_["return"]()}finally{if(x)throw S}}}}catch(O){y=!0,g=O}finally{try{!m&&b["return"]&&b["return"]()}finally{if(y)throw g}}}}catch(O){f=!0,c=O}finally{try{!l&&p["return"]&&p["return"]()}finally{if(f)throw c}}return{inline:"",CSS:""}};t["default"]=function(e){if(!e)return!1;var t={};if("*"===e)return t.browsers=Object.keys(s),t.prefixes={},t.browsers.forEach(function(e){t.prefixes[e]=u(e)}),t;t=i["default"]._detect(e),Object.keys(a).forEach(function(e){a[e].forEach(function(r){t[r]&&(t.prefix={inline:e,CSS:"-"+e.toLowerCase()+"-"})})});var r="";return Object.keys(s).forEach(function(e){s[e].forEach(function(n){var o=0;n.forEach(function(e){t[e]&&(o+=1)}),n.length===o&&(r=e)})}),t.browser=r,t.version=parseFloat(t.version),t.osversion=parseFloat(t.osversion),"android"===r&&t.osversion<5&&(t.version=t.osversion),t},e.exports=t["default"]},function(e,t,r){var n,o;/*! | ||
* Bowser - a browser detector | ||
@@ -3,0 +3,0 @@ * https://github.com/ded/bowser |
@@ -19,2 +19,4 @@ 'use strict'; | ||
StyleKeeper.prototype.subscribe = function subscribe(listener) { | ||
var _this = this; | ||
if (this._listeners.indexOf(listener) === -1) { | ||
@@ -25,6 +27,7 @@ this._listeners.push(listener); | ||
return { | ||
// Must be fat arrow to capture `this` | ||
remove: function remove() { | ||
var listenerIndex = this._listeners.indexOf(listener); | ||
var listenerIndex = _this._listeners.indexOf(listener); | ||
if (listenerIndex > -1) { | ||
this._listeners.splice(listenerIndex, 1); | ||
_this._listeners.splice(listenerIndex, 1); | ||
} | ||
@@ -36,2 +39,4 @@ } | ||
StyleKeeper.prototype.addCSS = function addCSS(css) { | ||
var _this2 = this; | ||
if (!this._cssSet[css]) { | ||
@@ -43,5 +48,6 @@ this._cssSet[css] = true; | ||
return { | ||
// Must be fat arrow to capture `this` | ||
remove: function remove() { | ||
delete this._cssSet[css]; | ||
this._emitChange(); | ||
delete _this2._cssSet[css]; | ||
_this2._emitChange(); | ||
} | ||
@@ -48,0 +54,0 @@ }; |
{ | ||
"name": "radium", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "A set of tools to manage inline styles on React elements", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
243609
4146
0