diff --git a/dist/withStyles.js b/dist/withStyles.js index ee2724f..063a05b 100644 --- a/dist/withStyles.js +++ b/dist/withStyles.js @@ -99,7 +99,7 @@ function withStyles() { var displayName = ComposedComponent.displayName || ComposedComponent.name || 'Component'; WithStyles.propTypes = { __$$withStylesRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ - current: PropTypes.instanceOf(Element) + current: PropTypes.instanceOf(typeof Element === 'undefined' ? Function : Element) })]) }; WithStyles.defaultProps = { diff --git a/dist/withStyles.js.map b/dist/withStyles.js.map index a6e009c..17368f7 100644 --- a/dist/withStyles.js.map +++ b/dist/withStyles.js.map @@ -1 +1 @@ -{"version":3,"file":"withStyles.js","sources":["src/withStyles.js"],"sourcesContent":["/**\n * Isomorphic CSS style loader for Webpack\n *\n * Copyright © 2015-present Kriasoft, LLC. All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.txt file in the root directory of this source tree.\n */\n\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport hoistStatics from 'hoist-non-react-statics'\n\nimport StyleContext from './StyleContext'\n\nfunction withStyles(...styles) {\n return function wrapWithStyles(ComposedComponent) {\n class WithStyles extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.removeCss = context.insertCss(...styles)\n }\n\n componentWillUnmount() {\n if (typeof this.removeCss === 'function') {\n setTimeout(this.removeCss, 0)\n }\n }\n\n render() {\n const { __$$withStylesRef, ...props } = this.props\n return \n }\n }\n\n const displayName = ComposedComponent.displayName || ComposedComponent.name || 'Component'\n\n WithStyles.propTypes = {\n __$$withStylesRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(Element) }),\n ]),\n }\n\n WithStyles.defaultProps = {\n __$$withStylesRef: undefined,\n }\n\n WithStyles.contextType = StyleContext\n\n const ForwardedWithStyles = React.forwardRef((props, ref) => (\n \n ))\n\n ForwardedWithStyles.ComposedComponent = ComposedComponent\n ForwardedWithStyles.displayName = `WithStyles(${displayName})`\n\n return hoistStatics(ForwardedWithStyles, ComposedComponent)\n }\n}\n\nexport default withStyles\n"],"names":["withStyles","styles","wrapWithStyles","ComposedComponent","WithStyles","props","context","removeCss","insertCss","componentWillUnmount","setTimeout","render","__$$withStylesRef","React","PureComponent","displayName","name","propTypes","PropTypes","oneOfType","func","shape","current","instanceOf","Element","defaultProps","undefined","contextType","StyleContext","ForwardedWithStyles","forwardRef","ref","hoistStatics"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAASA,UAAT,GAA+B;AAAA,oCAARC,MAAQ;AAARA,IAAAA,MAAQ;AAAA;;AAC7B,SAAO,SAASC,cAAT,CAAwBC,iBAAxB,EAA2C;AAAA,QAC1CC,UAD0C;AAAA;;AAE9C,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAC1B,gDAAMD,KAAN,EAAaC,OAAb;AACA,cAAKC,SAAL,GAAiBD,OAAO,CAACE,SAAR,OAAAF,OAAO,EAAcL,MAAd,CAAxB;AAF0B;AAG3B;;AAL6C;;AAAA,aAO9CQ,oBAP8C,GAO9C,gCAAuB;AACrB,YAAI,OAAO,KAAKF,SAAZ,KAA0B,UAA9B,EAA0C;AACxCG,UAAAA,UAAU,CAAC,KAAKH,SAAN,EAAiB,CAAjB,CAAV;AACD;AACF,OAX6C;;AAAA,aAa9CI,MAb8C,GAa9C,kBAAS;AACP,0BAAwC,KAAKN,KAA7C;AAAA,YAAQO,iBAAR,eAAQA,iBAAR;AAAA,YAA8BP,KAA9B;;AACA,eAAO,oBAAC,iBAAD;AAAmB,UAAA,GAAG,EAAEO;AAAxB,WAA+CP,KAA/C,EAAP;AACD,OAhB6C;;AAAA;AAAA,MACvBQ,KAAK,CAACC,aADiB;;AAmBhD,QAAMC,WAAW,GAAGZ,iBAAiB,CAACY,WAAlB,IAAiCZ,iBAAiB,CAACa,IAAnD,IAA2D,WAA/E;AAEAZ,IAAAA,UAAU,CAACa,SAAX,GAAuB;AACrBL,MAAAA,iBAAiB,EAAEM,SAAS,CAACC,SAAV,CAAoB,CACrCD,SAAS,CAACE,IAD2B,EAErCF,SAAS,CAACG,KAAV,CAAgB;AAAEC,QAAAA,OAAO,EAAEJ,SAAS,CAACK,UAAV,CAAqBC,OAArB;AAAX,OAAhB,CAFqC,CAApB;AADE,KAAvB;AAOApB,IAAAA,UAAU,CAACqB,YAAX,GAA0B;AACxBb,MAAAA,iBAAiB,EAAEc;AADK,KAA1B;AAIAtB,IAAAA,UAAU,CAACuB,WAAX,GAAyBC,YAAzB;AAEA,QAAMC,mBAAmB,GAAGhB,KAAK,CAACiB,UAAN,CAAiB,UAACzB,KAAD,EAAQ0B,GAAR;AAAA,aAC3C,oBAAC,UAAD,eAAgB1B,KAAhB;AAAuB,QAAA,iBAAiB,EAAE0B;AAA1C,SAD2C;AAAA,KAAjB,CAA5B;AAIAF,IAAAA,mBAAmB,CAAC1B,iBAApB,GAAwCA,iBAAxC;AACA0B,IAAAA,mBAAmB,CAACd,WAApB,mBAAgDA,WAAhD;AAEA,WAAOiB,YAAY,CAACH,mBAAD,EAAsB1B,iBAAtB,CAAnB;AACD,GA1CD;AA2CD;;;;"} \ No newline at end of file +{"version":3,"file":"withStyles.js","sources":["src/withStyles.js"],"sourcesContent":["/**\n * Isomorphic CSS style loader for Webpack\n *\n * Copyright © 2015-present Kriasoft, LLC. All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.txt file in the root directory of this source tree.\n */\n\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport hoistStatics from 'hoist-non-react-statics'\n\nimport StyleContext from './StyleContext'\n\nfunction withStyles(...styles) {\n return function wrapWithStyles(ComposedComponent) {\n class WithStyles extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.removeCss = context.insertCss(...styles)\n }\n\n componentWillUnmount() {\n if (typeof this.removeCss === 'function') {\n setTimeout(this.removeCss, 0)\n }\n }\n\n render() {\n const { __$$withStylesRef, ...props } = this.props\n return \n }\n }\n\n const displayName = ComposedComponent.displayName || ComposedComponent.name || 'Component'\n\n WithStyles.propTypes = {\n __$$withStylesRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.instanceOf(typeof Element === 'undefined' ? Function : Element),\n }),\n ]),\n }\n\n WithStyles.defaultProps = {\n __$$withStylesRef: undefined,\n }\n\n WithStyles.contextType = StyleContext\n\n const ForwardedWithStyles = React.forwardRef((props, ref) => (\n \n ))\n\n ForwardedWithStyles.ComposedComponent = ComposedComponent\n ForwardedWithStyles.displayName = `WithStyles(${displayName})`\n\n return hoistStatics(ForwardedWithStyles, ComposedComponent)\n }\n}\n\nexport default withStyles\n"],"names":["withStyles","styles","wrapWithStyles","ComposedComponent","WithStyles","props","context","removeCss","insertCss","componentWillUnmount","setTimeout","render","__$$withStylesRef","React","PureComponent","displayName","name","propTypes","PropTypes","oneOfType","func","shape","current","instanceOf","Element","Function","defaultProps","undefined","contextType","StyleContext","ForwardedWithStyles","forwardRef","ref","hoistStatics"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAASA,UAAT,GAA+B;AAAA,oCAARC,MAAQ;AAARA,IAAAA,MAAQ;AAAA;;AAC7B,SAAO,SAASC,cAAT,CAAwBC,iBAAxB,EAA2C;AAAA,QAC1CC,UAD0C;AAAA;;AAE9C,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAC1B,gDAAMD,KAAN,EAAaC,OAAb;AACA,cAAKC,SAAL,GAAiBD,OAAO,CAACE,SAAR,OAAAF,OAAO,EAAcL,MAAd,CAAxB;AAF0B;AAG3B;;AAL6C;;AAAA,aAO9CQ,oBAP8C,GAO9C,gCAAuB;AACrB,YAAI,OAAO,KAAKF,SAAZ,KAA0B,UAA9B,EAA0C;AACxCG,UAAAA,UAAU,CAAC,KAAKH,SAAN,EAAiB,CAAjB,CAAV;A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ad4c7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "isomorphic-style-loader", - "version": "5.3.1", + "version": "5.3.2", "description": "CSS style loader for Webpack optimized for critical path CSS rendering and isomoprhic web apps", "repository": "kriasoft/isomorphic-style-loader", "author": "Kriasoft (https://www.kriasoft.com)",