Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

emotion

Package Overview
Dependencies
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emotion - npm Package Compare versions

Comparing version 7.0.5 to 7.0.6

2

dist/DO-NOT-USE.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.emotion=e.emotion||{})}(this,function(e){function t(e){var t=void 0,n=[];for(t in e)n.push(t);return n}function n(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}function r(e,t){if(null==e)return[];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=t(e[n],n,e);return i}function i(e,t,n){if(null==e)return[];var r=0,i=e.length,o=n;for(void 0===o&&(o=e[0],r=1);r<i;r++)o=t(o,e[r],r,e);return o}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return e[e.length-1]}function u(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function c(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-emotion",""),e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function a(){for(var e="",t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0;i<n.length;i++)e+=JSON.stringify(n[i]);return f(e)}function f(e){return l(e,e.length).toString(36)}function l(e,t){for(var n=1540483477,r=t^e.length,i=e.length,o=0;i>=4;){var s=d(e,o);s=h(s,n),s=h(s^=s>>>24,n),r=h(r,n),r^=s,o+=4,i-=4}switch(i){case 3:r^=p(e,o),r=h(r^=e.charCodeAt(o+2)<<16,n);break;case 2:r=h(r^=p(e,o),n);break;case 1:r=h(r^=e.charCodeAt(o),n)}return r^=r>>>13,r=h(r,n),(r^=r>>>15)>>>0}function d(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function p(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function h(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function y(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}function g(e,t){return null==t||"boolean"==typeof t||""===t?"":isNaN(t)||0===t||1===Q[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}function m(e){var t="";for(var n in e){var r=0===n.indexOf("--");if(e.hasOwnProperty(n)){var i=e[n];null!=i&&(r?t+=n+":"+i+";":(t+=Y(n)+":",t+=g(n,i)+";"))}}return t||null}function v(e){return null===e||void 0===e||!1===e||"object"===(void 0===e?"undefined":ee(e))&&0===t(e).length}function b(e){if(v(e))return null;if("object"!==(void 0===e?"undefined":ee(e)))return e;var r={},i=!1;return n(t(e),function(e){var t=w(e);null!==t&&t===e||(i=!0),null!==t&&(r[e]=t)}),0===t(r).length?null:i?r:e}function x(e){var t=!1,r=[];return n(e,function(e){var n=w(e);null!==n&&n===e||(t=!0),null!==n&&r.push(n)}),0==r.length?null:t?r:e}function w(e){return"string"==typeof e?e.trim():Array.isArray(e)?x(e):b(e)}function S(e){ne[e.id]||(ne[e.id]=e)}function O(e){if(E(e)){var t=ne[N(e)];if(null==t)throw new Error("[emotion] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79");return t}return e}function A(e){var t="",r=[];return n(e,function(e){if("string"==typeof e){var n=ie.exec(e);null!==n&&void 0!==se[n[1]]?r.push(se[n[1]]):(t&&(t+=" "),t+=e)}else r.push(e)}),{computedClassName:t,objectStyles:r}}function C(t){var n={id:f(t),css:t,type:"raw"};S(n),e.inserted[n.id]||(te.insert(n.css),e.inserted[n.id]=!0)}function j(i){if(!e.inserted[i.id]){var o=r(t(i.keyframes),function(e){return e+" {"+m(i.keyframes[e])+"}"}).join("");n(["-webkit-",""],function(e){return te.insert("@"+e+"keyframes "+i.name+"_"+i.id+"{"+o+"}")}),e.inserted[i.id]=!0}}function k(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(t=w(t))?re(t):ue}function R(e){var t={};return D(t,{src:e}),I({id:a(t),style:t,type:"css"})}function E(e){var n=t(e);return 1===n.length&&!!ie.exec(n[0])}function N(e){var n=t(e);if(1!==n.length)throw new Error("not a rule");var r=ie.exec(n[0]);if(!r)throw new Error("not a rule");return r[1]}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?t?r(t.split(","),function(t){return t.indexOf("&")>=0?t.replace(oe,".css-"+e):".css-"+e+t}).join(","):".css-"+e:t.replace(oe,"")}function W(e){var r=void 0,i=void 0,o=void 0,s=void 0;return n(t(e),function(t){t.indexOf("&")>=0?(i=i||{})[t]=e[t]:0===t.indexOf("@media")?(o=o||{})[t]=W(e[t]):0===t.indexOf("@supports")?(s=s||{})[t]=W(e[t]):(r=r||{})[t]=e[t]}),{plain:r,selects:i,medias:o,supports:s}}function T(e,r){var i=r.plain,o=r.selects,s=r.medias,u=r.supports,c=[];return i&&c.push(M(e)+"{"+m(i)+"}"),o&&n(t(o),function(t){return c.push(M(e,t)+"{"+m(o[t])+"}")}),s&&n(t(s),function(t){return c.push(t+"{"+T(e,s[t]).join("")+"}")}),u&&n(t(u),function(t){return c.push(t+"{"+T(e,u[t]).join("")+"}")}),c}function P(t){if(!e.inserted[t.id]){e.inserted[t.id]=!0;var n=W(t.style);r(T(t.id,n),function(e){return te.insert(e)})}}function I(e){var t;if(S(e),P(e),se[e.id])return se[e.id];var n=(t={},t["css-"+e.id]="",t);return Object.defineProperty(n,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),se[e.id]=n,n}function L(e){for(var t=[":",".","[",">"," "],n=!1,r=e.charAt(0),i=0;i<t.length;i++)if(r===t[i]){n=!0;break}return n||e.indexOf("&")>=0}function _(e,t){var n=r(e.split(","),function(e){return e.indexOf("&")>=0?e:"&"+e});return i(r(t.split(","),function(e){return e.indexOf("&")>=0?e:"&"+e}),function(e,t){return e.concat(r(n,function(e){return t.replace(oe,e)}))},[]).join(",")}function q(e,t){return e?"@media "+e.substring(6)+" and "+t.substring(6):t}function z(e){return 0===e.indexOf("@media")}function F(e){return 0===e.indexOf("@supports")}function G(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function B(e){var t=[];return n(e,function(e){t=Array.isArray(e)?t.concat(B(e)):t.concat(e)}),t}function D(e,r){var i=r.selector,o=void 0===i?"":i,s=r.mq,u=void 0===s?"":s,c=r.supp,a=void 0===c?"":c,f=r.src,l=void 0===f?{}:f;Array.isArray(l)||(l=[l]),n(l=B(l),function(r){if(E(r)){var i=O(r);if("css"!==i.type)throw new Error("cannot merge this rule");r=i.style}(r=w(r))&&r.composes&&D(e,{selector:o,mq:u,supp:a,src:r.composes}),n(t(r||{}),function(t){if(L(t))D(e,{selector:_(o,t),mq:u,supp:a,src:r[t]});else if(z(t))D(e,{selector:o,mq:q(u,t),supp:a,src:r[t]});else if(F(t))D(e,{selector:o,mq:u,supp:G(a,t),src:r[t]});else if("composes"===t);else{var n=e;a&&(n[a]=n[a]||{},n=n[a]),u&&(n[u]=n[u]||{},n=n[u]),o&&(n[o]=n[o]||{},n=n[o]),n[t]=r[t]}})})}var H=Object.assign||function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Z="undefined"!=typeof window,J=!1,U=!1,$=function(){if(Z){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 10]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}}(),K=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.speedy,r=void 0===n?!J&&!U:n,i=t.maxLength,s=void 0===i?Z&&$?4e3:65e3:i;o(this,e),this.isSpeedy=r,this.sheet=void 0,this.tags=[],this.maxLength=s,this.ctr=0}return e.prototype.getSheet=function(){return u(s(this.tags))},e.prototype.inject=function(){var e=this;if(this.injected)throw new Error("already injected!");Z?this.tags[0]=c():this.sheet={cssRules:[],insertRule:function(t){e.sheet.cssRules.push({cssText:t})}},this.injected=!0},e.prototype.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},e.prototype._insert=function(e){try{var t=this.getSheet();t.insertRule(e,-1!==e.indexOf("@import")?0:t.cssRules.length)}catch(t){J&&console.warn("illegal rule",e)}},e.prototype.insert=function(e){if(Z)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(e);else if(-1!==e.indexOf("@import")){var t=s(this.tags);t.insertBefore(document.createTextNode(e),t.firstChild)}else s(this.tags).appendChild(document.createTextNode(e));else this.sheet.insertRule(e,-1!==e.indexOf("@import")?0:this.sheet.cssRules.length);return this.ctr++,Z&&this.ctr%this.maxLength==0&&this.tags.push(c()),this.ctr-1},e.prototype.delete=function(e){return this.replace(e,"")},e.prototype.flush=function(){Z?(n(this.tags,function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},e.prototype.rules=function(){if(!Z)return this.sheet.cssRules;var e=[];return n(this.tags,function(t){return e.splice.apply(e,[e.length,0].concat(Array.from(u(t).cssRules)))}),e},e}(),Q={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},V=["Webkit","ms","Moz","O"];n(t(Q),function(e){n(V,function(t){Q[y(t,e)]=1})});var X=/[A-Z]|^ms/g,Y=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}(function(e){return e.replace(X,"-$&").toLowerCase()}),ee="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},te=new K;te.inject(),e.inserted={};var ne=te.registered={},re="undefined"!=typeof WeakMap?function(e){return function(t){if(ce[t.length]){for(var n=ce[t.length],r=0;r<t.length-1;)n.has(t[r])||n.set(t[r],new WeakMap),n=n.get(t[r]),r++;if(n.has(t[t.length-1])){var i=n.get(t[r]);if(ne[i.toString().substring(4)])return i}}var o=e(t);if(ce[t.length]){for(var s=0,u=ce[t.length];s<t.length-1;)u=u.get(t[s]),s++;try{u.set(t[s],o)}catch(e){}}return o}}(R):R,ie=/css-([a-zA-Z0-9]+)/,oe=/&/gm,se={},ue={};Object.defineProperty(ue,"toString",{enumerable:!1,value:function(){return"css-nil"}});var ce="undefined"!=typeof WeakMap?[ue,new WeakMap,new WeakMap,new WeakMap]:[ue];e.sheet=te,e.flush=function(){te.flush(),e.inserted={},te.inject()},e.css=function(e,t,n){Array.isArray(e)||(e=[e]);var r=A(n?e.concat(n.apply(null,t)):e),i=r.computedClassName,o=void 0===i?"":i,s=r.objectStyles,u=void 0===s?[]:s;return u.length&&(o+=" "+k.apply(null,u).toString()),o.trim()},e.injectGlobal=function(e,r,i){n(i?e.concat(i.apply(null,r)):e,function(e){n(t(e),function(t){C(t+" {"+m(e[t])+"}")})})},e.fontFace=function(e,t,n){C("@font-face{"+m(i(n?e.concat(n.apply(null,t)):e,function(e,t,n){return H(e,t)},{}))+"}")},e.keyframes=function(e,t,n){var r=n.apply(null,t)[0],i={id:a(r),type:"keyframes",name:"animation",keyframes:r};return S(i),j(i),"animation_"+i.id},e.hydrate=function(t){n(t,function(t){return e.inserted[t]=!0})},e.objStyle=k,e.isLikeRule=E,e.idFor=N,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.emotion=e.emotion||{})}(this,function(e){function t(e){var t=void 0,n=[];for(t in e)n.push(t);return n}function n(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)}function r(e,t){if(null==e)return[];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=t(e[n],n,e);return i}function i(e,t,n){if(null==e)return[];var r=0,i=e.length,o=n;for(void 0===o&&(o=e[0],r=1);r<i;r++)o=t(o,e[r],r,e);return o}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return e[e.length-1]}function u(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function c(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-emotion",""),e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function a(){for(var e="",t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0;i<n.length;i++)e+=JSON.stringify(n[i]);return f(e)}function f(e){return l(e,e.length).toString(36)}function l(e,t){for(var n=1540483477,r=t^e.length,i=e.length,o=0;i>=4;){var s=d(e,o);s=h(s,n),s=h(s^=s>>>24,n),r=h(r,n),r^=s,o+=4,i-=4}switch(i){case 3:r^=p(e,o),r=h(r^=e.charCodeAt(o+2)<<16,n);break;case 2:r=h(r^=p(e,o),n);break;case 1:r=h(r^=e.charCodeAt(o),n)}return r^=r>>>13,r=h(r,n),(r^=r>>>15)>>>0}function d(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function p(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function h(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function y(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}function g(e,t){return null==t||"boolean"==typeof t||""===t?"":isNaN(t)||0===t||1===Q[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}function m(e){var t="";for(var n in e){var r=0===n.indexOf("--");if(e.hasOwnProperty(n)){var i=e[n];null!=i&&(r?t+=n+":"+i+";":(t+=Y(n)+":",t+=g(n,i)+";"))}}return t||null}function v(e){return null===e||void 0===e||!1===e||"object"===(void 0===e?"undefined":ee(e))&&0===t(e).length}function b(e){if(v(e))return null;if("object"!==(void 0===e?"undefined":ee(e)))return e;var r={},i=!1;return n(t(e),function(e){var t=w(e);null!==t&&t===e||(i=!0),null!==t&&(r[e]=t)}),0===t(r).length?null:i?r:e}function x(e){var t=!1,r=[];return n(e,function(e){var n=w(e);null!==n&&n===e||(t=!0),null!==n&&r.push(n)}),0==r.length?null:t?r:e}function w(e){return"string"==typeof e?e.trim():Array.isArray(e)?x(e):b(e)}function O(e){ne[e.id]||(ne[e.id]=e)}function S(e){if(E(e)){var t=ne[N(e)];if(null==t)throw new Error("[emotion] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79");return t}return e}function A(e){var t="",r=[];return n(e,function(e){if("string"==typeof e){var n=ie.exec(e);null!==n&&void 0!==se[n[1]]?r.push(se[n[1]]):(t&&(t+=" "),t+=e)}else r.push(e)}),{computedClassName:t,objectStyles:r}}function C(t){var n={id:f(t),css:t,type:"raw"};O(n),e.inserted[n.id]||(te.insert(n.css),e.inserted[n.id]=!0)}function j(i){if(!e.inserted[i.id]){var o=r(t(i.keyframes),function(e){return e+" {"+m(i.keyframes[e])+"}"}).join("");n(["-webkit-",""],function(e){return te.insert("@"+e+"keyframes "+i.name+"_"+i.id+"{"+o+"}")}),e.inserted[i.id]=!0}}function k(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(t=w(t))?re(t):ue}function R(e){var t={};return D(t,{src:e}),I({id:a(t),style:t,type:"css"})}function E(e){var n=t(e);return 1===n.length&&!!ie.exec(n[0])}function N(e){var n=t(e);if(1!==n.length)throw new Error("not a rule");var r=ie.exec(n[0]);if(!r)throw new Error("not a rule");return r[1]}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e?t?r(t.split(","),function(t){return t.indexOf("&")>=0?t.replace(oe,".css-"+e):".css-"+e+t}).join(","):".css-"+e:t.replace(oe,"")}function W(e){var r=void 0,i=void 0,o=void 0,s=void 0;return n(t(e),function(t){if(t.indexOf("&")>=0)(i=i||{})[t]=W(e[t]).plain;else if(0===t.indexOf("@media"))(o=o||{})[t]=W(e[t]);else if(0===t.indexOf("@supports"))(s=s||{})[t]=W(e[t]);else if(0===t.indexOf("css-")){r=r||{};var n=ne[t.split("css-")[1]].style;H(r,n)}else(r=r||{})[t]=e[t]}),{plain:r,selects:i,medias:o,supports:s}}function T(e,r){var i=r.plain,o=r.selects,s=r.medias,u=r.supports,c=[];return i&&c.push(M(e)+"{"+m(i)+"}"),o&&n(t(o),function(t){return c.push(M(e,t)+"{"+m(o[t])+"}")}),s&&n(t(s),function(t){return c.push(t+"{"+T(e,s[t]).join("")+"}")}),u&&n(t(u),function(t){return c.push(t+"{"+T(e,u[t]).join("")+"}")}),c}function P(t){if(!e.inserted[t.id]){e.inserted[t.id]=!0;var n=W(t.style);r(T(t.id,n),function(e){return te.insert(e)})}}function I(e){var t;if(O(e),P(e),se[e.id])return se[e.id];var n=(t={},t["css-"+e.id]="",t);return Object.defineProperty(n,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),se[e.id]=n,n}function L(e){for(var t=[":",".","[",">"," "],n=!1,r=e.charAt(0),i=0;i<t.length;i++)if(r===t[i]){n=!0;break}return n||e.indexOf("&")>=0}function _(e,t){var n=r(e.split(","),function(e){return e.indexOf("&")>=0?e:"&"+e});return i(r(t.split(","),function(e){return e.indexOf("&")>=0?e:"&"+e}),function(e,t){return e.concat(r(n,function(e){return t.replace(oe,e)}))},[]).join(",")}function q(e,t){return e?"@media "+e.substring(6)+" and "+t.substring(6):t}function z(e){return 0===e.indexOf("@media")}function F(e){return 0===e.indexOf("@supports")}function G(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function B(e){var t=[];return n(e,function(e){t=Array.isArray(e)?t.concat(B(e)):t.concat(e)}),t}function D(e,r){var i=r.selector,o=void 0===i?"":i,s=r.mq,u=void 0===s?"":s,c=r.supp,a=void 0===c?"":c,f=r.src,l=void 0===f?[{}]:f;Array.isArray(l)||(l=[l]),n(l=B(l),function(r){if(E(r)){var i=S(r);if("css"!==i.type)throw new Error("cannot merge this rule");r=i.style}(r=w(r))&&r.composes&&D(e,{selector:o,mq:u,supp:a,src:r.composes}),n(t(r||{}),function(t){if("undefined"!==t)if(L(t))D(e,{selector:_(o,t),mq:u,supp:a,src:r[t]});else if(z(t))D(e,{selector:o,mq:q(u,t),supp:a,src:r[t]});else if(F(t))D(e,{selector:o,mq:u,supp:G(a,t),src:r[t]});else if("composes"===t);else{var n=e;a&&(n[a]=n[a]||{},n=n[a]),u&&(n[u]=n[u]||{},n=n[u]),o&&(n[o]=n[o]||{},n=n[o]),n[t]=r[t]}})})}var H=Object.assign||function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Z="undefined"!=typeof window,J=!1,U=!1,$=function(){if(Z){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 10]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}}(),K=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.speedy,r=void 0===n?!J&&!U:n,i=t.maxLength,s=void 0===i?Z&&$?4e3:65e3:i;o(this,e),this.isSpeedy=r,this.sheet=void 0,this.tags=[],this.maxLength=s,this.ctr=0}return e.prototype.getSheet=function(){return u(s(this.tags))},e.prototype.inject=function(){var e=this;if(this.injected)throw new Error("already injected!");Z?this.tags[0]=c():this.sheet={cssRules:[],insertRule:function(t){e.sheet.cssRules.push({cssText:t})}},this.injected=!0},e.prototype.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},e.prototype._insert=function(e){try{var t=this.getSheet();t.insertRule(e,-1!==e.indexOf("@import")?0:t.cssRules.length)}catch(t){J&&console.warn("illegal rule",e)}},e.prototype.insert=function(e){if(Z)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(e);else if(-1!==e.indexOf("@import")){var t=s(this.tags);t.insertBefore(document.createTextNode(e),t.firstChild)}else s(this.tags).appendChild(document.createTextNode(e));else this.sheet.insertRule(e,-1!==e.indexOf("@import")?0:this.sheet.cssRules.length);return this.ctr++,Z&&this.ctr%this.maxLength==0&&this.tags.push(c()),this.ctr-1},e.prototype.delete=function(e){return this.replace(e,"")},e.prototype.flush=function(){Z?(n(this.tags,function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},e.prototype.rules=function(){if(!Z)return this.sheet.cssRules;var e=[];return n(this.tags,function(t){return e.splice.apply(e,[e.length,0].concat(Array.from(u(t).cssRules)))}),e},e}(),Q={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},V=["Webkit","ms","Moz","O"];n(t(Q),function(e){n(V,function(t){Q[y(t,e)]=1})});var X=/[A-Z]|^ms/g,Y=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}(function(e){return e.replace(X,"-$&").toLowerCase()}),ee="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},te=new K;te.inject(),e.inserted={};var ne=te.registered={},re="undefined"!=typeof WeakMap?function(e){return function(t){if(ce[t.length]){for(var n=ce[t.length],r=0;r<t.length-1;)n.has(t[r])||n.set(t[r],new WeakMap),n=n.get(t[r]),r++;if(n.has(t[t.length-1])){var i=n.get(t[r]);if(ne[i.toString().substring(4)])return i}}var o=e(t);if(ce[t.length]){for(var s=0,u=ce[t.length];s<t.length-1;)u=u.get(t[s]),s++;try{u.set(t[s],o)}catch(e){}}return o}}(R):R,ie=/css-([a-zA-Z0-9]+)/,oe=/&/gm,se={},ue={};Object.defineProperty(ue,"toString",{enumerable:!1,value:function(){return"css-nil"}});var ce="undefined"!=typeof WeakMap?[ue,new WeakMap,new WeakMap,new WeakMap]:[ue];e.sheet=te,e.flush=function(){te.flush(),e.inserted={},te.inject()},e.css=function(e,t,n){Array.isArray(e)||(e=[e]);var r=A(n?e.concat(n.apply(null,t)):e),i=r.computedClassName,o=void 0===i?"":i,s=r.objectStyles,u=void 0===s?[]:s;return u.length&&(o+=" "+k.apply(null,u).toString()),o.trim()},e.injectGlobal=function(e,r,i){n(i?e.concat(i.apply(null,r)):e,function(e){n(t(e),function(t){C(t+" {"+m(e[t])+"}")})})},e.fontFace=function(e,t,n){C("@font-face{"+m(i(n?e.concat(n.apply(null,t)):e,function(e,t,n){return H(e,t)},{}))+"}")},e.keyframes=function(e,t,n){var r=n.apply(null,t)[0],i={id:a(r),type:"keyframes",name:"animation",keyframes:r};return O(i),j(i),"animation_"+i.id},e.hydrate=function(t){n(t,function(t){return e.inserted[t]=!0})},e.objStyle=k,e.isLikeRule=E,e.idFor=N,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=DO-NOT-USE.min.js.map

@@ -246,6 +246,7 @@ 'use strict';

var supports = void 0;
(0, _utils.forEach)((0, _utils.keys)(style), function (key) {
if (key.indexOf('&') >= 0) {
selects = selects || {};
selects[key] = style[key];
selects[key] = deconstruct(style[key]).plain;
} else if (key.indexOf('@media') === 0) {

@@ -257,4 +258,10 @@ medias = medias || {};

supports[key] = deconstruct(style[key]);
} else if (key.indexOf('css-') === 0) {
// replace fragments
plain = plain || {};
var registeredStyles = registered[key.split('css-')[1]].style;
(0, _utils.assign)(plain, registeredStyles);
} else {
plain = plain || {};
plain[key] = style[key];

@@ -392,3 +399,3 @@ }

_ref$src = _ref.src,
src = _ref$src === undefined ? {} : _ref$src;
src = _ref$src === undefined ? [{}] : _ref$src;

@@ -399,3 +406,2 @@ if (!Array.isArray(src)) {

src = flatten(src);
(0, _utils.forEach)(src, function (_src) {

@@ -413,3 +419,8 @@ if (isLikeRule(_src)) {

}
(0, _utils.forEach)((0, _utils.keys)(_src || {}), function (key) {
if (key === 'undefined') {
// drop undefined fragment results
return;
}
if (isSelector(key)) {

@@ -416,0 +427,0 @@ build(dest, {

'use strict';
exports.__esModule = true;
exports.prefixer = undefined;
exports.EmotionSafeParser = exports.prefixer = undefined;

@@ -10,7 +10,16 @@ var _typeof = 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; };

exports.expandCSSFallbacks = expandCSSFallbacks;
exports.safeParse = safeParse;
var _postcssSafeParser = require('postcss-safe-parser');
var _input = require('postcss/lib/input');
var _postcssSafeParser2 = _interopRequireDefault(_postcssSafeParser);
var _input2 = _interopRequireDefault(_input);
var _declaration = require('postcss/lib/declaration');
var _declaration2 = _interopRequireDefault(_declaration);
var _safeParser = require('postcss-safe-parser/lib/safe-parser');
var _safeParser2 = _interopRequireDefault(_safeParser);
var _postcssNested = require('postcss-nested');

@@ -36,2 +45,8 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var prefixer = exports.prefixer = _postcssJs2.default.sync([_autoprefixer2.default, _postcssNested2.default]);

@@ -45,3 +60,3 @@

} else {
root = (0, _postcssSafeParser2.default)(css, { from: filename });
root = safeParse(css, { from: filename });
}

@@ -96,2 +111,36 @@ var vars = 0;

return flattened;
}
}
// Parser
function safeParse(css, opts) {
var input = new _input2.default(css, opts);
var parser = new EmotionSafeParser(input);
parser.parse();
return parser.root;
}
var EmotionSafeParser = exports.EmotionSafeParser = function (_SafeParser) {
_inherits(EmotionSafeParser, _SafeParser);
function EmotionSafeParser() {
_classCallCheck(this, EmotionSafeParser);
return _possibleConstructorReturn(this, _SafeParser.apply(this, arguments));
}
EmotionSafeParser.prototype.unknownWord = function unknownWord(tokens) {
if (tokens[0][0] === 'word') {
if (/xxx(\d+)xxx/gm.exec(tokens[0][1])) {
this.init(new _declaration2.default({ prop: tokens[0][1], value: 'fragment' }, tokens[0][2], tokens[0][3]));
return;
}
}
this.spaces += tokens.map(function (i) {
return i[1];
}).join('');
};
return EmotionSafeParser;
}(_safeParser2.default);
{
"name": "emotion",
"version": "7.0.5",
"version": "7.0.6",
"description": "high performance css-in-js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -237,6 +237,7 @@ // @flow

let supports
forEach(keys(style), key => {
if (key.indexOf('&') >= 0) {
selects = selects || {}
selects[key] = style[key]
selects[key] = deconstruct(style[key]).plain
} else if (key.indexOf('@media') === 0) {

@@ -248,4 +249,10 @@ medias = medias || {}

supports[key] = deconstruct(style[key])
} else if (key.indexOf('css-') === 0) {
// replace fragments
plain = plain || {}
const registeredStyles = registered[key.split('css-')[1]].style
assign(plain, registeredStyles)
} else {
plain = plain || {}
plain[key] = style[key]

@@ -366,3 +373,16 @@ }

// mutable! modifies dest.
function build (dest, { selector = '', mq = '', supp = '', src = {} }) {
function build (
dest,
{
selector = '',
mq = '',
supp = '',
src = [{}]
}: {
selector?: string,
mq?: string,
supp?: string,
src: Array<{ [string]: any }>
}
) {
if (!Array.isArray(src)) {

@@ -372,3 +392,2 @@ src = [src]

src = flatten(src)
forEach(src, _src => {

@@ -386,3 +405,8 @@ if (isLikeRule(_src)) {

}
forEach(keys(_src || {}), key => {
if (key === 'undefined') {
// drop undefined fragment results
return
}
if (isSelector(key)) {

@@ -432,3 +456,3 @@ build(dest, {

let nullrule: EmotionClassName = {
let nullrule: EmotionRule = {
// 'data-css-nil': ''

@@ -435,0 +459,0 @@ }

// @flow
import parse from 'postcss-safe-parser'
import Input from 'postcss/lib/input'
import Declaration from 'postcss/lib/declaration'
import SafeParser from 'postcss-safe-parser/lib/safe-parser'
import postcssNested from 'postcss-nested'

@@ -11,8 +13,2 @@ import postcssJs from 'postcss-js'

type Rule = {
parent: { selector: string, nodes: Array<mixed> },
selector: string,
remove: () => {}
}
type Decl = {

@@ -39,3 +35,3 @@ parent: { selector: string, nodes: Array<mixed> },

} else {
root = parse(css, { from: filename })
root = safeParse(css, { from: filename })
}

@@ -94,1 +90,29 @@ let vars = 0

}
// Parser
export function safeParse (css, opts) {
let input = new Input(css, opts)
let parser = new EmotionSafeParser(input)
parser.parse()
return parser.root
}
export class EmotionSafeParser extends SafeParser {
unknownWord (tokens: Array<Array<any>>) {
if (tokens[0][0] === 'word') {
if (/xxx(\d+)xxx/gm.exec(tokens[0][1])) {
this.init(
new Declaration(
{ prop: tokens[0][1], value: 'fragment' },
tokens[0][2],
tokens[0][3]
)
)
return
}
}
this.spaces += tokens.map(i => i[1]).join('')
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc