emotion-theming
Advanced tools
Comparing version 9.2.0 to 9.2.1
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],t):t(e["emotion-theming"]={},e.React,e.PropTypes)}(this,function(e,o,t){"use strict";function i(){return(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}).apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}t=t&&t.hasOwnProperty("default")?t.default:t;var r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};"object"==typeof Reflect&&Reflect.construct;var n,c=function(e){var n={},r=0,o=e;return{publish:function(e){for(var t in o=e,n){var r=n[t];void 0!==r&&r(o)}},subscribe:function(e){var t=r;return n[t]=e,r+=1,e(o),t},unsubscribe:function(e){n[e]=void 0}}},u="__EMOTION_THEMING__",p=((n={})[u]=t.object,n),a=function(e){return"[object Object]"===Object.prototype.toString.call(e)};function h(){var t=this;void 0!==this.context[u]&&(this.unsubscribeToOuterId=this.context[u].subscribe(function(e){t.outerTheme=e,void 0!==t.broadcast&&t.publish(t.props.theme)})),this.broadcast=c(this.getTheme(this.props.theme))}function f(){var e;return(e={})[u]={subscribe:this.broadcast.subscribe,unsubscribe:this.broadcast.unsubscribe},e}function l(e){this.props.theme!==e.theme&&this.publish(e.theme)}function b(){var e=this.context[u];void 0!==e&&e.unsubscribe(this.unsubscribeToOuterId)}function d(e){if("function"==typeof e){var t=e(this.outerTheme);if(!a(t))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return t}if(!a(e))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return void 0===this.outerTheme?e:i({},this.outerTheme,e)}function m(e){this.broadcast.publish(this.getTheme(e))}function y(){return this.props.children?o.Children.only(this.props.children):null}var v=function(t){function e(){var e;return(e=t.call(this)||this).getTheme=e.getTheme.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)),e}s(e,t);var r=e.prototype;return r.componentWillMount=h,r.getChildContext=f,r.componentWillReceiveProps=l,r.componentWillUnmount=b,r.getTheme=d,r.publish=m,r.render=y,e}(o.Component);v.childContextTypes=p,v.contextTypes=p;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function T(){var p={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},h=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,b=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,m=d&&d(Object);return function e(t,r,n){if("string"!=typeof r){if(m){var o=d(r);o&&o!==m&&e(t,o,n)}var i=f(r);l&&(i=i.concat(l(r)));for(var s=0;s<i.length;++s){var c=i[s];if(!(p[c]||a[c]||n&&n[c])){var u=b(r,c);try{h(t,c,u)}catch(e){}}}return t}return t}}var O,g=(function(e,t){var r;r=T,e.exports=r()}(O={exports:{}},O.exports),O.exports);function P(){var t=this,e=this.context[u];void 0!==e?this.unsubscribeId=e.subscribe(function(e){t.setState({theme:e})}):console.error("[withTheme] Please use ThemeProvider to be able to use withTheme")}function x(){-1!==this.unsubscribeId&&this.context[u].unsubscribe(this.unsubscribeId)}e.ThemeProvider=v,e.withTheme=function(e){var t=e.displayName||e.name||"Component";function n(){return o.createElement(e,i({theme:this.state.theme},this.props))}var r=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var r=t.prototype;return r.componentWillMount=P,r.componentWillUnmount=x,r.render=n,t}(o.Component);return r.displayName="WithTheme("+t+")",r.contextTypes=p,g(r,e)},e.channel=u,e.contextTypes=p,e.createBroadcast=c,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["exports","prop-types","react"],t):t(e["emotion-theming"]={},e.PropTypes,e.React)}(this,function(e,t,o){"use strict";function i(){return(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}).apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}t=t&&t.hasOwnProperty("default")?t.default:t;var r,n=function(e){var n={},r=0,o=e;return{publish:function(e){for(var t in o=e,n){var r=n[t];void 0!==r&&r(o)}},subscribe:function(e){var t=r;return n[t]=e,r+=1,e(o),t},unsubscribe:function(e){n[e]=void 0}}},u="__EMOTION_THEMING__",c=((r={})[u]=t.object,r),p=function(e){return"[object Object]"===Object.prototype.toString.call(e)};function a(){var t=this;void 0!==this.context[u]&&(this.unsubscribeToOuterId=this.context[u].subscribe(function(e){t.outerTheme=e,void 0!==t.broadcast&&t.publish(t.props.theme)})),this.broadcast=n(this.getTheme(this.props.theme))}function h(){var e;return(e={})[u]={subscribe:this.broadcast.subscribe,unsubscribe:this.broadcast.unsubscribe},e}function f(e){this.props.theme!==e.theme&&this.publish(e.theme)}function l(){var e=this.context[u];void 0!==e&&e.unsubscribe(this.unsubscribeToOuterId)}function b(e){if("function"==typeof e){var t=e(this.outerTheme);if(!p(t))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return t}if(!p(e))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return void 0===this.outerTheme?e:i({},this.outerTheme,e)}function d(e){this.broadcast.publish(this.getTheme(e))}function m(){return this.props.children?o.Children.only(this.props.children):null}var y=function(t){function e(){var e;return(e=t.call(this)||this).getTheme=e.getTheme.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)),e}s(e,t);var r=e.prototype;return r.componentWillMount=a,r.getChildContext=h,r.componentWillReceiveProps=f,r.componentWillUnmount=l,r.getTheme=b,r.publish=d,r.render=m,e}(o.Component);y.childContextTypes=c,y.contextTypes=c;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function v(){var p={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},h=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,b=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,m=d&&d(Object);return function e(t,r,n){if("string"!=typeof r){if(m){var o=d(r);o&&o!==m&&e(t,o,n)}var i=f(r);l&&(i=i.concat(l(r)));for(var s=0;s<i.length;++s){var u=i[s];if(!(p[u]||a[u]||n&&n[u])){var c=b(r,u);try{h(t,u,c)}catch(e){}}}return t}return t}}var T,g=(function(e,t){var r;r=v,e.exports=r()}(T={exports:{}},T.exports),T.exports);function O(){var t=this,e=this.context[u];void 0!==e?this.unsubscribeId=e.subscribe(function(e){t.setState({theme:e})}):console.error("[withTheme] Please use ThemeProvider to be able to use withTheme")}function x(){-1!==this.unsubscribeId&&this.context[u].unsubscribe(this.unsubscribeId)}e.ThemeProvider=y,e.withTheme=function(e){var t=e.displayName||e.name||"Component";function n(){return o.createElement(e,i({theme:this.state.theme},this.props))}var r=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var r=t.prototype;return r.componentWillMount=O,r.componentWillUnmount=x,r.render=n,t}(o.Component);return r.displayName="WithTheme("+t+")",r.contextTypes=c,g(r,e)},e.channel=u,e.contextTypes=c,e.createBroadcast=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=emotion.umd.min.js.map |
@@ -7,4 +7,4 @@ 'use strict'; | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var React = require('react'); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var hoistNonReactStatics = _interopDefault(require('hoist-non-react-statics')); | ||
@@ -36,15 +36,2 @@ | ||
var _sPO = Object.setPrototypeOf || function _sPO(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
var _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { | ||
var Constructor, | ||
a = [null]; | ||
a.push.apply(a, args); | ||
Constructor = Parent.bind.apply(Parent, a); | ||
return _sPO(new Constructor(), Class.prototype); | ||
}; | ||
function _assertThisInitialized(self) { | ||
@@ -101,7 +88,4 @@ if (self === void 0) { | ||
var _contextTypes; | ||
var contextTypes = (_contextTypes = {}, _contextTypes[channel] = PropTypes.object, _contextTypes); | ||
// adapted from styled-components' ThemeProvider | ||
// https://github.com/styled-components/styled-components/blob/4503cab5b86aa9ef8314c5baa360a2fbb4812485/src/models/ThemeProvider.js | ||
var isPlainObject = function isPlainObject(test) { | ||
@@ -240,7 +224,7 @@ return Object.prototype.toString.call(test) === '[object Object]'; | ||
var withTheme = function withTheme(Component$$1) { | ||
var componentName = Component$$1.displayName || Component$$1.name || 'Component'; | ||
var withTheme = function withTheme(Component) { | ||
var componentName = Component.displayName || Component.name || 'Component'; | ||
function _render() { | ||
return React.createElement(Component$$1, _extends({ | ||
return React.createElement(Component, _extends({ | ||
theme: this.state.theme | ||
@@ -268,3 +252,3 @@ }, this.props)); | ||
WithTheme.contextTypes = contextTypes; | ||
return hoistNonReactStatics(WithTheme, Component$$1); | ||
return hoistNonReactStatics(WithTheme, Component); | ||
}; | ||
@@ -271,0 +255,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { Children, Component, createElement } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Component, Children, createElement } from 'react'; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
@@ -29,15 +29,2 @@ | ||
var _sPO = Object.setPrototypeOf || function _sPO(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
var _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { | ||
var Constructor, | ||
a = [null]; | ||
a.push.apply(a, args); | ||
Constructor = Parent.bind.apply(Parent, a); | ||
return _sPO(new Constructor(), Class.prototype); | ||
}; | ||
function _assertThisInitialized(self) { | ||
@@ -94,7 +81,4 @@ if (self === void 0) { | ||
var _contextTypes; | ||
var contextTypes = (_contextTypes = {}, _contextTypes[channel] = PropTypes.object, _contextTypes); | ||
// adapted from styled-components' ThemeProvider | ||
// https://github.com/styled-components/styled-components/blob/4503cab5b86aa9ef8314c5baa360a2fbb4812485/src/models/ThemeProvider.js | ||
var isPlainObject = function isPlainObject(test) { | ||
@@ -101,0 +85,0 @@ return Object.prototype.toString.call(test) === '[object Object]'; |
{ | ||
"name": "emotion-theming", | ||
"version": "9.2.0", | ||
"version": "9.2.1", | ||
"description": "A CSS-in-JS theming solution, inspired by styled-components", | ||
@@ -44,3 +44,3 @@ "main": "dist/index.cjs.js", | ||
"rimraf": "^2.6.1", | ||
"rollup": "^0.51.3" | ||
"rollup": "^0.60.1" | ||
}, | ||
@@ -47,0 +47,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
61356
647