Comparing version 9.8.6 to 9.8.7
@@ -0,1 +1,5 @@ | ||
## 9.8.7 / 2018-06-24 | ||
* Fix `global` access in the dist version (#736) | ||
## 9.8.6 / 2018-06-19 | ||
@@ -7,3 +11,3 @@ | ||
* Fix version un the dist version (#730) | ||
* Fix version in the dist version (#730) | ||
@@ -10,0 +14,0 @@ ## 9.8.4 / 2018-06-12 |
@@ -19,11 +19,19 @@ (function (global, factory) { | ||
/** | ||
* Copyright 2014-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
var global$1 = (typeof global !== "undefined" ? global : | ||
typeof self !== "undefined" ? self : | ||
typeof window !== "undefined" ? window : {}); | ||
if (typeof global$1.setTimeout === 'function') ; | ||
if (typeof global$1.clearTimeout === 'function') ; | ||
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js | ||
var performance = global$1.performance || {}; | ||
var performanceNow = | ||
performance.now || | ||
performance.mozNow || | ||
performance.msNow || | ||
performance.oNow || | ||
performance.webkitNow || | ||
function(){ return (new Date()).getTime() }; | ||
/** | ||
@@ -372,4 +380,2 @@ * Similar to invariant but only logs a warning if the condition is not met. | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
function unwrapExports (x) { | ||
@@ -428,4 +434,4 @@ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
root = window; | ||
} else if (typeof commonjsGlobal !== 'undefined') { | ||
root = commonjsGlobal; | ||
} else if (typeof global$1 !== 'undefined') { | ||
root = global$1; | ||
} else { | ||
@@ -503,5 +509,5 @@ root = module; | ||
var CSS = global.CSS; | ||
var CSS = global$1.CSS; | ||
var env = "development"; | ||
var env$1 = "development"; | ||
@@ -513,3 +519,3 @@ var escapeRegex = /([[\].#*$><+~=|^:(),"'`])/g; | ||
// input for selectors, we are generating a valid selector. | ||
if (env === 'production') return str; | ||
if (env$1 === 'production') return str; | ||
@@ -1493,3 +1499,3 @@ if (!CSS || !CSS.escape) { | ||
var ns = '2f1acc6c3a606b082e5eef5e54414ffb'; | ||
if (global[ns] == null) global[ns] = 0; | ||
if (global$1[ns] == null) global$1[ns] = 0; | ||
@@ -1500,7 +1506,7 @@ // Bundle may contain multiple JSS versions at the same time. In order to identify | ||
// the module. | ||
var moduleId = global[ns]++; | ||
var moduleId = global$1[ns]++; | ||
var maxRules = 1e10; | ||
var env$1 = "development"; | ||
var env$2 = "development"; | ||
@@ -1514,3 +1520,3 @@ /** | ||
var ruleCounter = 0; | ||
var defaultPrefix = env$1 === 'production' ? 'c' : ''; | ||
var defaultPrefix = env$2 === 'production' ? 'c' : ''; | ||
@@ -1532,3 +1538,3 @@ return function (rule, sheet) { | ||
if (env$1 === 'production') { | ||
if (env$2 === 'production') { | ||
return '' + prefix + moduleId + jssId + ruleCounter; | ||
@@ -2043,3 +2049,3 @@ } | ||
this.id = instanceCounter++; | ||
this.version = "9.8.6"; | ||
this.version = "9.8.7"; | ||
this.plugins = new PluginsRegistry(); | ||
@@ -2046,0 +2052,0 @@ this.options = { |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.jss={})}(this,function(e){"use strict";var t="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},n="object"===("undefined"==typeof window?"undefined":t(window))&&"object"===("undefined"==typeof document?"undefined":t(document))&&9===document.nodeType;function r(e,t){e.renderable=t,e.rules&&t.cssRules&&e.rules.link(t.cssRules)}var s=function(){};var i=s,o=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function u(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=o(e[r]," ");else n=o(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function a(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="";if(!t)return r;var s=n.indent,i=void 0===s?0:s,o=t.fallbacks;if(i++,o)if(Array.isArray(o))for(var l=0;l<o.length;l++){var h=o[l];for(var f in h){var c=h[f];null!=c&&(r+="\n"+a(f+": "+u(c)+";",i))}}else for(var d in o){var y=o[d];null!=y&&(r+="\n"+a(d+": "+u(y)+";",i))}for(var v in t){var p=t[v];null!=p&&"fallbacks"!==v&&(r+="\n"+a(v+": "+u(p)+";",i))}return r||n.allowEmpty?r=a(e+" {"+r+"\n",--i)+a("}",i):r}var h="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},f=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(){function e(t,n,r){f(this,e),this.type="style",this.isProcessed=!1;var s=r.sheet,i=r.Renderer,o=r.selector;this.key=t,this.options=r,this.style=n,o&&(this.selectorText=o),this.renderer=s?s.renderer:new i}return c(e,[{key:"prop",value:function(e,t){if(void 0===t)return this.style[e];if(this.style[e]===t)return this;var n=null==(t=this.options.jss.plugins.onChangeValue(t,e,this))||!1===t,r=e in this.style;if(n&&!r)return this;var s=n&&r;if(s?delete this.style[e]:this.style[e]=t,this.renderable)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,t),this;var o=this.options.sheet;return o&&o.attached&&i(!1,'Rule is not linked. Missing sheet option "link: true".'),this}},{key:"applyTo",value:function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this}},{key:"toJSON",value:function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==(void 0===n?"undefined":h(n))?e[t]=n:Array.isArray(n)&&(e[t]=u(n))}return e}},{key:"toString",value:function(e){var t=this.options.sheet,n=!!t&&t.options.link?d({},e,{allowEmpty:!0}):e;return l(this.selector,this.style,n)}},{key:"selector",set:function(e){if(e!==this.selectorText&&(this.selectorText=e,this.renderable&&!this.renderer.setSelector(this.renderable,e)&&this.renderable)){var t=this.renderer.replaceRule(this.renderable,this);t&&(this.renderable=t)}},get:function(){return this.selectorText}}]),e}(),v="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e,t){return e(t={exports:{}},t.exports),t.exports}var k=g(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}});p(k);var m=g(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n,r,s=(n=k)&&n.__esModule?n:{default:n};r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==v?v:e;var i=(0,s.default)(r);t.default=i});p(m);var b=m,S=function(e){return e&&e[b]&&e===e[b]()},R=Array.isArray;function x(e){if(null==e)return e;var t=void 0===e?"undefined":h(e);if("string"===t||"number"===t||"function"===t)return e;if(R(e))return e.map(x);if(S(e))return e;var n={};for(var r in e){var s=e[r];"object"!==(void 0===s?"undefined":h(s))?n[r]=s:n[r]=x(s)}return n}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unnamed",t=arguments[1],n=arguments[2],r=n.jss,s=x(t),o=r.plugins.onCreateRule(e,s,n);return o||("@"===e[0]&&i(!1,"[JSS] Unknown at-rule %s",e),new y(e,s,n))}global.CSS;var w=function(e){return e},C=function(){function e(t){var n=this;f(this,e),this.map={},this.raw={},this.index=[],this.update=function(e,t){var r=n.options,s=r.jss.plugins,i=r.sheet;if("string"==typeof e)s.onUpdate(t,n.get(e),i);else for(var o=0;o<n.index.length;o++)s.onUpdate(e,n.index[o],i)},this.options=t,this.classes=t.classes}return c(e,[{key:"add",value:function(e,t,n){var r=this.options,s=r.parent,i=r.sheet,o=r.jss,u=r.Renderer,a=r.generateClassName;!(n=d({classes:this.classes,parent:s,sheet:i,jss:o,Renderer:u,generateClassName:a},n)).selector&&this.classes[e]&&(n.selector="."+w(this.classes[e])),this.raw[e]=t;var l=P(e,t,n),h=void 0;!n.selector&&l instanceof y&&(h=a(l,i),l.selector="."+w(h)),this.register(l,h);var f=void 0===n.index?this.index.length:n.index;return this.index.splice(f,0,l),l}},{key:"get",value:function(e){return this.map[e]}},{key:"remove",value:function(e){this.unregister(e),this.index.splice(this.indexOf(e),1)}},{key:"indexOf",value:function(e){return this.index.indexOf(e)}},{key:"process",value:function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)}},{key:"register",value:function(e,t){this.map[e.key]=e,e instanceof y&&(this.map[e.selector]=e,t&&(this.classes[e.key]=t))}},{key:"unregister",value:function(e){delete this.map[e.key],e instanceof y&&(delete this.map[e.selector],delete this.classes[e.key])}},{key:"link",value:function(e){for(var t=this.options.sheet.renderer.getUnescapedKeysMap(this.index),n=0;n<e.length;n++){var s=e[n],i=this.options.sheet.renderer.getKey(s);t[i]&&(i=t[i]);var o=this.map[i];o&&r(o,s)}}},{key:"toString",value:function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,s=0;s<this.index.length;s++){var i=this.index[s].toString(e);(i||r)&&(t&&(t+="\n"),t+=i)}return t}}]),e}(),O=function(){function e(t,n){var r=this;for(var s in f(this,e),this.update=function(e,t){return"string"==typeof e?r.rules.update(e,t):r.rules.update(e),r},this.attached=!1,this.deployed=!1,this.linked=!1,this.classes={},this.options=d({},n,{sheet:this,parent:this,classes:this.classes}),this.renderer=new n.Renderer(this),this.rules=new C(this.options),t)this.rules.add(s,t[s]);this.rules.process()}return c(e,[{key:"attach",value:function(){return this.attached?this:(this.deployed||this.deploy(),this.renderer.attach(),!this.linked&&this.options.link&&this.link(),this.attached=!0,this)}},{key:"detach",value:function(){return this.attached?(this.renderer.detach(),this.attached=!1,this):this}},{key:"addRule",value:function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var s=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(s),this.attached?this.deployed?(r?r.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),s):s:(this.deployed=!1,s)}},{key:"insertRule",value:function(e){var t=this.renderer.insertRule(e);t&&this.options.link&&r(e,t)}},{key:"addRules",value:function(e,t){var n=[];for(var r in e)n.push(this.addRule(r,e[r],t));return n}},{key:"getRule",value:function(e){return this.rules.get(e)}},{key:"deleteRule",value:function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))}},{key:"indexOf",value:function(e){return this.rules.indexOf(e)}},{key:"deploy",value:function(){return this.renderer.deploy(),this.deployed=!0,this}},{key:"link",value:function(){var e=this.renderer.getRules();return e&&this.rules.link(e),this.linked=!0,this}},{key:"toString",value:function(e){return this.rules.toString(e)}}]),e}(),j=function(){function e(){f(this,e),this.hooks={onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}}return c(e,[{key:"onCreateRule",value:function(e,t,n){for(var r=0;r<this.hooks.onCreateRule.length;r++){var s=this.hooks.onCreateRule[r](e,t,n);if(s)return s}return null}},{key:"onProcessRule",value:function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.hooks.onProcessRule.length;n++)this.hooks.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}}},{key:"onProcessStyle",value:function(e,t,n){for(var r=e,s=0;s<this.hooks.onProcessStyle.length;s++)r=this.hooks.onProcessStyle[s](r,t,n),t.style=r}},{key:"onProcessSheet",value:function(e){for(var t=0;t<this.hooks.onProcessSheet.length;t++)this.hooks.onProcessSheet[t](e)}},{key:"onUpdate",value:function(e,t,n){for(var r=0;r<this.hooks.onUpdate.length;r++)this.hooks.onUpdate[r](e,t,n)}},{key:"onChangeValue",value:function(e,t,n){for(var r=e,s=0;s<this.hooks.onChangeValue.length;s++)r=this.hooks.onChangeValue[s](r,t,n);return r}},{key:"use",value:function(e){for(var t in e)this.hooks[t]?this.hooks[t].push(e[t]):i(!1,'[JSS] Unknown hook "%s".',t)}}]),e}(),N=function(){function e(t,n,r){f(this,e),this.type="simple",this.isProcessed=!1,this.key=t,this.value=n,this.options=r}return c(e,[{key:"toString",value:function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"}}]),e}(),A=function(){function e(t,n,r){for(var s in f(this,e),this.type="keyframes",this.isProcessed=!1,this.key=t,this.options=r,this.rules=new C(d({},r,{parent:this})),n)this.rules.add(s,n[s],d({},this.options,{parent:this,selector:s}));this.rules.process()}return c(e,[{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t&&(t+="\n"),this.key+" {\n"+t+"}"}}]),e}(),T=function(){function e(t,n,r){for(var s in f(this,e),this.type="conditional",this.isProcessed=!1,this.key=t,this.options=r,this.rules=new C(d({},r,{parent:this})),n)this.rules.add(s,n[s]);this.rules.process()}return c(e,[{key:"getRule",value:function(e){return this.rules.get(e)}},{key:"indexOf",value:function(e){return this.rules.indexOf(e)}},{key:"addRule",value:function(e,t,n){var r=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(r),r}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""}}]),e}(),E=function(){function e(t,n,r){f(this,e),this.type="font-face",this.isProcessed=!1,this.key=t,this.style=n,this.options=r}return c(e,[{key:"toString",value:function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=l(this.key,this.style[n]),this.style[n+1]&&(t+="\n");return t}return l(this.key,this.style,e)}}]),e}(),M=function(){function e(t,n,r){f(this,e),this.type="viewport",this.isProcessed=!1,this.key=t,this.style=n,this.options=r}return c(e,[{key:"toString",value:function(e){return l(this.key,this.style,e)}}]),e}(),U={"@charset":N,"@import":N,"@namespace":N,"@keyframes":A,"@media":T,"@supports":T,"@font-face":E,"@viewport":M,"@-ms-viewport":M},V=Object.keys(U).map(function(e){var t=new RegExp("^"+e),n=U[e];return{onCreateRule:function(e,r,s){return t.test(e)?new n(e,r,s):null}}}),_={onCreateRule:function(e,t,n){if(!S(t))return null;var r=t,s=P(e,{},n);return r.subscribe(function(e){for(var t in e)s.prop(t,e[t])}),s},onProcessRule:function(e){if(e instanceof y){var t=e,n=t.style,r=function(e){var r=n[e];if(!S(r))return"continue";delete n[e],r.subscribe({next:function(n){t.prop(e,n)}})};for(var s in n)r(s)}}},J=Date.now(),q="fnValues"+J,G="fnStyle"+ ++J,I={onCreateRule:function(e,t,n){if("function"!=typeof t)return null;var r=P(e,{},n);return r[G]=t,r},onProcessStyle:function(e,t){var n={};for(var r in e){var s=e[r];"function"==typeof s&&(delete e[r],n[r]=s)}return(t=t)[q]=n,e},onUpdate:function(e,t){if(t.rules instanceof C)t.rules.update(e);else if(t instanceof y){if((t=t)[q])for(var n in t[q])t.prop(n,t[q][n](e));var r=(t=t)[G];if(r){var s=r(e);for(var i in s)t.prop(i,s[i])}}}},K=function(){function e(){f(this,e),this.registry=[]}return c(e,[{key:"add",value:function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)}},{key:"reset",value:function(){this.registry=[]}},{key:"remove",value:function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)}},{key:"toString",value:function(e){return this.registry.filter(function(e){return e.attached}).map(function(t){return t.toString(e)}).join("\n")}},{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),B=new K,D="2f1acc6c3a606b082e5eef5e54414ffb";null==global[D]&&(global[D]=0);var z=global[D]++,L=function(){var e=0;return function(t,n){(e+=1)>1e10&&i(!1,"[JSS] You might have a memory leak. Rule counter is at %s.",e);var r="c",s="";return n&&(r=n.options.classNamePrefix||"c",null!=n.options.jss.id&&(s+=n.options.jss.id)),""+r+z+s+e}},Y=function(e){var t=void 0;return function(){return t||(t=e()),t}};function F(e,t){try{return e.style.getPropertyValue(t)}catch(e){return""}}function H(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=u(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;e.style.setProperty(t,r)}catch(e){return!1}return!0}function Q(e,t){try{e.style.removeProperty(t)}catch(e){i(!1,'[JSS] DOMException "%s" was thrown. Tried to remove property "%s".',e.message,t)}}var W,X=1,Z=7,$=(W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.substr(t,e.indexOf("{")-1)},function(e){if(e.type===X)return e.selectorText;if(e.type===Z){var t=e.name;if(t)return"@keyframes "+t;var n=e.cssText;return"@"+W(n,n.indexOf("keyframes"))}return W(e.cssText)});function ee(e,t){return e.selectorText=t,e.selectorText===t}var te,ne,re=Y(function(){return document.head||document.getElementsByTagName("head")[0]}),se=(te=void 0,ne=!1,function(e){var t={};te||(te=document.createElement("style"));for(var n=0;n<e.length;n++){var r=e[n];if(r instanceof y){var s=r.selector;if(s&&-1!==s.indexOf("\\")){ne||(re().appendChild(te),ne=!0),te.textContent=s+" {}";var i=te.sheet;if(i){var o=i.cssRules;o&&(t[o[0].selectorText]=r.key)}}}}return ne&&(re().removeChild(te),ne=!1),t});function ie(e){var t=B.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n)return n.renderer.element;if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))return n.renderer.element.nextElementSibling}var r=e.insertionPoint;if(r&&"string"==typeof r){var s=function(e){for(var t=re(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(s)return s.nextSibling;i("jss"===r,'[JSS] Insertion point "%s" not found.',r)}return null}var oe=Y(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),ue=function(){function e(t){f(this,e),this.getPropertyValue=F,this.setProperty=H,this.removeProperty=Q,this.setSelector=ee,this.getKey=$,this.getUnescapedKeysMap=se,this.hasInsertedRules=!1,t&&B.add(t),this.sheet=t;var n=this.sheet?this.sheet.options:{},r=n.media,s=n.meta,i=n.element;this.element=i||document.createElement("style"),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),s&&this.element.setAttribute("data-meta",s);var o=oe();o&&this.element.setAttribute("nonce",o)}return c(e,[{key:"attach",value:function(){!this.element.parentNode&&this.sheet&&(this.hasInsertedRules&&(this.deploy(),this.hasInsertedRules=!1),function(e,t){var n=t.insertionPoint,r=ie(t);if(r){var s=r.parentNode;s&&s.insertBefore(e,r)}else if(n&&"number"==typeof n.nodeType){var o=n,u=o.parentNode;u?u.insertBefore(e,o.nextSibling):i(!1,"[JSS] Insertion point is not in the DOM.")}else re().insertBefore(e,r)}(this.element,this.sheet.options))}},{key:"detach",value:function(){this.element.parentNode.removeChild(this.element)}},{key:"deploy",value:function(){this.sheet&&(this.element.textContent="\n"+this.sheet.toString()+"\n")}},{key:"insertRule",value:function(e,t){var n=this.element.sheet,r=n.cssRules,s=e.toString();if(t||(t=r.length),!s)return!1;try{n.insertRule(s,t)}catch(t){return i(!1,"[JSS] Can not insert an unsupported rule \n\r%s",e),!1}return this.hasInsertedRules=!0,r[t]}},{key:"deleteRule",value:function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)}},{key:"indexOf",value:function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1}},{key:"replaceRule",value:function(e,t){var n=this.indexOf(e),r=this.insertRule(t,n);return this.element.sheet.deleteRule(n),r}},{key:"getRules",value:function(){return this.element.sheet.cssRules}}]),e}(),ae=function(){function e(){f(this,e)}return c(e,[{key:"setProperty",value:function(){return!0}},{key:"getPropertyValue",value:function(){return""}},{key:"removeProperty",value:function(){}},{key:"setSelector",value:function(){return!0}},{key:"getKey",value:function(){return""}},{key:"attach",value:function(){}},{key:"detach",value:function(){}},{key:"deploy",value:function(){}},{key:"insertRule",value:function(){return!1}},{key:"deleteRule",value:function(){return!0}},{key:"replaceRule",value:function(){return!1}},{key:"getRules",value:function(){}},{key:"indexOf",value:function(){return-1}}]),e}(),le=V.concat([_,I]),he=0,fe=function(){function e(t){f(this,e),this.id=he++,this.version="9.8.6",this.plugins=new j,this.options={createGenerateClassName:L,Renderer:n?ue:ae,plugins:[]},this.generateClassName=L(),this.use.apply(this,le),this.setup(t)}return c(e,[{key:"setup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.createGenerateClassName&&(this.options.createGenerateClassName=e.createGenerateClassName,this.generateClassName=e.createGenerateClassName()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?ae:ue)),e.plugins&&this.use.apply(this,e.plugins),this}},{key:"createStyleSheet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.index;"number"!=typeof n&&(n=0===B.index?0:B.index+1);var r=new O(e,d({},t,{jss:this,generateClassName:t.generateClassName||this.generateClassName,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r}},{key:"removeStyleSheet",value:function(e){return e.detach(),B.remove(e),this}},{key:"createRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"===(void 0===e?"undefined":h(e))&&(n=t,t=e,e=void 0);var r=n;r.jss=this,r.Renderer=this.options.Renderer,r.generateClassName||(r.generateClassName=this.generateClassName),r.classes||(r.classes={});var s=P(e,t,r);return!r.selector&&s instanceof y&&(s.selector="."+r.generateClassName(s)),this.plugins.onProcessRule(s),s}},{key:"use",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){-1===e.options.plugins.indexOf(t)&&(e.options.plugins.push(t),e.plugins.use(t))}),this}}]),e}();var ce=function(){function e(){f(this,e),this.sheets=[],this.refs=[],this.keys=[]}return c(e,[{key:"get",value:function(e){var t=this.keys.indexOf(e);return this.sheets[t]}},{key:"add",value:function(e,t){var n=this.sheets,r=this.refs,s=this.keys,i=n.indexOf(t);return-1!==i?i:(n.push(t),r.push(0),s.push(e),n.length-1)}},{key:"manage",value:function(e){var t=this.keys.indexOf(e),n=this.sheets[t];return 0===this.refs[t]&&n.attach(),this.refs[t]++,this.keys[t]||this.keys.splice(t,0,e),n}},{key:"unmanage",value:function(e){var t=this.keys.indexOf(e);-1!==t?this.refs[t]>0&&(this.refs[t]--,0===this.refs[t]&&this.sheets[t].detach()):i(!1,"SheetsManager: can't find sheet to unmanage")}},{key:"size",get:function(){return this.keys.length}}]),e}(),de=function(e){return new fe(e)},ye=de();e.create=de,e.default=ye,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var s=t[r],i=void 0===s?"undefined":h(s);if("function"===i)n||(n={}),n[r]=s;else if("object"===i&&null!==s&&!Array.isArray(s)){var o=e(s);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=u,e.SheetsRegistry=K,e.SheetsManager=ce,e.RuleList=C,e.sheets=B,e.createGenerateClassName=L,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.jss={})}(this,function(e){"use strict";var t="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},n="object"===("undefined"==typeof window?"undefined":t(window))&&"object"===("undefined"==typeof document?"undefined":t(document))&&9===document.nodeType;function r(e,t){e.renderable=t,e.rules&&t.cssRules&&e.rules.link(t.cssRules)}var s="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};s.setTimeout,s.clearTimeout;var i=s.performance||{},o=(i.now||i.mozNow||i.msNow||i.oNow||i.webkitNow,function(){});var u=o,a=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function l(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=a(e[r]," ");else n=a(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function h(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="";if(!t)return r;var s=n.indent,i=void 0===s?0:s,o=t.fallbacks;if(i++,o)if(Array.isArray(o))for(var u=0;u<o.length;u++){var a=o[u];for(var f in a){var c=a[f];null!=c&&(r+="\n"+h(f+": "+l(c)+";",i))}}else for(var d in o){var v=o[d];null!=v&&(r+="\n"+h(d+": "+l(v)+";",i))}for(var y in t){var p=t[y];null!=p&&"fallbacks"!==y&&(r+="\n"+h(y+": "+l(p)+";",i))}return r||n.allowEmpty?r=h(e+" {"+r+"\n",--i)+h("}",i):r}var c="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},d=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p=function(){function e(t,n,r){d(this,e),this.type="style",this.isProcessed=!1;var s=r.sheet,i=r.Renderer,o=r.selector;this.key=t,this.options=r,this.style=n,o&&(this.selectorText=o),this.renderer=s?s.renderer:new i}return v(e,[{key:"prop",value:function(e,t){if(void 0===t)return this.style[e];if(this.style[e]===t)return this;var n=null==(t=this.options.jss.plugins.onChangeValue(t,e,this))||!1===t,r=e in this.style;if(n&&!r)return this;var s=n&&r;if(s?delete this.style[e]:this.style[e]=t,this.renderable)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,t),this;var i=this.options.sheet;return i&&i.attached&&u(!1,'Rule is not linked. Missing sheet option "link: true".'),this}},{key:"applyTo",value:function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this}},{key:"toJSON",value:function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==(void 0===n?"undefined":c(n))?e[t]=n:Array.isArray(n)&&(e[t]=l(n))}return e}},{key:"toString",value:function(e){var t=this.options.sheet,n=!!t&&t.options.link?y({},e,{allowEmpty:!0}):e;return f(this.selector,this.style,n)}},{key:"selector",set:function(e){if(e!==this.selectorText&&(this.selectorText=e,this.renderable&&!this.renderer.setSelector(this.renderable,e)&&this.renderable)){var t=this.renderer.replaceRule(this.renderable,this);t&&(this.renderable=t)}},get:function(){return this.selectorText}}]),e}();function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function k(e,t){return e(t={exports:{}},t.exports),t.exports}var m=k(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}});g(m);var b=k(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n,r,i=(n=m)&&n.__esModule?n:{default:n};r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s?s:e;var o=(0,i.default)(r);t.default=o});g(b);var S=b,R=function(e){return e&&e[S]&&e===e[S]()},x=Array.isArray;function P(e){if(null==e)return e;var t=void 0===e?"undefined":c(e);if("string"===t||"number"===t||"function"===t)return e;if(x(e))return e.map(P);if(R(e))return e;var n={};for(var r in e){var s=e[r];"object"!==(void 0===s?"undefined":c(s))?n[r]=s:n[r]=P(s)}return n}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unnamed",t=arguments[1],n=arguments[2],r=n.jss,s=P(t),i=r.plugins.onCreateRule(e,s,n);return i||("@"===e[0]&&u(!1,"[JSS] Unknown at-rule %s",e),new p(e,s,n))}s.CSS;var C=function(e){return e},O=function(){function e(t){var n=this;d(this,e),this.map={},this.raw={},this.index=[],this.update=function(e,t){var r=n.options,s=r.jss.plugins,i=r.sheet;if("string"==typeof e)s.onUpdate(t,n.get(e),i);else for(var o=0;o<n.index.length;o++)s.onUpdate(e,n.index[o],i)},this.options=t,this.classes=t.classes}return v(e,[{key:"add",value:function(e,t,n){var r=this.options,s=r.parent,i=r.sheet,o=r.jss,u=r.Renderer,a=r.generateClassName;!(n=y({classes:this.classes,parent:s,sheet:i,jss:o,Renderer:u,generateClassName:a},n)).selector&&this.classes[e]&&(n.selector="."+C(this.classes[e])),this.raw[e]=t;var l=w(e,t,n),h=void 0;!n.selector&&l instanceof p&&(h=a(l,i),l.selector="."+C(h)),this.register(l,h);var f=void 0===n.index?this.index.length:n.index;return this.index.splice(f,0,l),l}},{key:"get",value:function(e){return this.map[e]}},{key:"remove",value:function(e){this.unregister(e),this.index.splice(this.indexOf(e),1)}},{key:"indexOf",value:function(e){return this.index.indexOf(e)}},{key:"process",value:function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)}},{key:"register",value:function(e,t){this.map[e.key]=e,e instanceof p&&(this.map[e.selector]=e,t&&(this.classes[e.key]=t))}},{key:"unregister",value:function(e){delete this.map[e.key],e instanceof p&&(delete this.map[e.selector],delete this.classes[e.key])}},{key:"link",value:function(e){for(var t=this.options.sheet.renderer.getUnescapedKeysMap(this.index),n=0;n<e.length;n++){var s=e[n],i=this.options.sheet.renderer.getKey(s);t[i]&&(i=t[i]);var o=this.map[i];o&&r(o,s)}}},{key:"toString",value:function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,s=0;s<this.index.length;s++){var i=this.index[s].toString(e);(i||r)&&(t&&(t+="\n"),t+=i)}return t}}]),e}(),j=function(){function e(t,n){var r=this;for(var s in d(this,e),this.update=function(e,t){return"string"==typeof e?r.rules.update(e,t):r.rules.update(e),r},this.attached=!1,this.deployed=!1,this.linked=!1,this.classes={},this.options=y({},n,{sheet:this,parent:this,classes:this.classes}),this.renderer=new n.Renderer(this),this.rules=new O(this.options),t)this.rules.add(s,t[s]);this.rules.process()}return v(e,[{key:"attach",value:function(){return this.attached?this:(this.deployed||this.deploy(),this.renderer.attach(),!this.linked&&this.options.link&&this.link(),this.attached=!0,this)}},{key:"detach",value:function(){return this.attached?(this.renderer.detach(),this.attached=!1,this):this}},{key:"addRule",value:function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var s=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(s),this.attached?this.deployed?(r?r.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),s):s:(this.deployed=!1,s)}},{key:"insertRule",value:function(e){var t=this.renderer.insertRule(e);t&&this.options.link&&r(e,t)}},{key:"addRules",value:function(e,t){var n=[];for(var r in e)n.push(this.addRule(r,e[r],t));return n}},{key:"getRule",value:function(e){return this.rules.get(e)}},{key:"deleteRule",value:function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))}},{key:"indexOf",value:function(e){return this.rules.indexOf(e)}},{key:"deploy",value:function(){return this.renderer.deploy(),this.deployed=!0,this}},{key:"link",value:function(){var e=this.renderer.getRules();return e&&this.rules.link(e),this.linked=!0,this}},{key:"toString",value:function(e){return this.rules.toString(e)}}]),e}(),N=function(){function e(){d(this,e),this.hooks={onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}}return v(e,[{key:"onCreateRule",value:function(e,t,n){for(var r=0;r<this.hooks.onCreateRule.length;r++){var s=this.hooks.onCreateRule[r](e,t,n);if(s)return s}return null}},{key:"onProcessRule",value:function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.hooks.onProcessRule.length;n++)this.hooks.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}}},{key:"onProcessStyle",value:function(e,t,n){for(var r=e,s=0;s<this.hooks.onProcessStyle.length;s++)r=this.hooks.onProcessStyle[s](r,t,n),t.style=r}},{key:"onProcessSheet",value:function(e){for(var t=0;t<this.hooks.onProcessSheet.length;t++)this.hooks.onProcessSheet[t](e)}},{key:"onUpdate",value:function(e,t,n){for(var r=0;r<this.hooks.onUpdate.length;r++)this.hooks.onUpdate[r](e,t,n)}},{key:"onChangeValue",value:function(e,t,n){for(var r=e,s=0;s<this.hooks.onChangeValue.length;s++)r=this.hooks.onChangeValue[s](r,t,n);return r}},{key:"use",value:function(e){for(var t in e)this.hooks[t]?this.hooks[t].push(e[t]):u(!1,'[JSS] Unknown hook "%s".',t)}}]),e}(),A=function(){function e(t,n,r){d(this,e),this.type="simple",this.isProcessed=!1,this.key=t,this.value=n,this.options=r}return v(e,[{key:"toString",value:function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"}}]),e}(),T=function(){function e(t,n,r){for(var s in d(this,e),this.type="keyframes",this.isProcessed=!1,this.key=t,this.options=r,this.rules=new O(y({},r,{parent:this})),n)this.rules.add(s,n[s],y({},this.options,{parent:this,selector:s}));this.rules.process()}return v(e,[{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t&&(t+="\n"),this.key+" {\n"+t+"}"}}]),e}(),E=function(){function e(t,n,r){for(var s in d(this,e),this.type="conditional",this.isProcessed=!1,this.key=t,this.options=r,this.rules=new O(y({},r,{parent:this})),n)this.rules.add(s,n[s]);this.rules.process()}return v(e,[{key:"getRule",value:function(e){return this.rules.get(e)}},{key:"indexOf",value:function(e){return this.rules.indexOf(e)}},{key:"addRule",value:function(e,t,n){var r=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(r),r}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{indent:1},t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""}}]),e}(),M=function(){function e(t,n,r){d(this,e),this.type="font-face",this.isProcessed=!1,this.key=t,this.style=n,this.options=r}return v(e,[{key:"toString",value:function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=f(this.key,this.style[n]),this.style[n+1]&&(t+="\n");return t}return f(this.key,this.style,e)}}]),e}(),U=function(){function e(t,n,r){d(this,e),this.type="viewport",this.isProcessed=!1,this.key=t,this.style=n,this.options=r}return v(e,[{key:"toString",value:function(e){return f(this.key,this.style,e)}}]),e}(),V={"@charset":A,"@import":A,"@namespace":A,"@keyframes":T,"@media":E,"@supports":E,"@font-face":M,"@viewport":U,"@-ms-viewport":U},_=Object.keys(V).map(function(e){var t=new RegExp("^"+e),n=V[e];return{onCreateRule:function(e,r,s){return t.test(e)?new n(e,r,s):null}}}),J={onCreateRule:function(e,t,n){if(!R(t))return null;var r=t,s=w(e,{},n);return r.subscribe(function(e){for(var t in e)s.prop(t,e[t])}),s},onProcessRule:function(e){if(e instanceof p){var t=e,n=t.style,r=function(e){var r=n[e];if(!R(r))return"continue";delete n[e],r.subscribe({next:function(n){t.prop(e,n)}})};for(var s in n)r(s)}}},q=Date.now(),G="fnValues"+q,I="fnStyle"+ ++q,K={onCreateRule:function(e,t,n){if("function"!=typeof t)return null;var r=w(e,{},n);return r[I]=t,r},onProcessStyle:function(e,t){var n={};for(var r in e){var s=e[r];"function"==typeof s&&(delete e[r],n[r]=s)}return(t=t)[G]=n,e},onUpdate:function(e,t){if(t.rules instanceof O)t.rules.update(e);else if(t instanceof p){if((t=t)[G])for(var n in t[G])t.prop(n,t[G][n](e));var r=(t=t)[I];if(r){var s=r(e);for(var i in s)t.prop(i,s[i])}}}},B=function(){function e(){d(this,e),this.registry=[]}return v(e,[{key:"add",value:function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)}},{key:"reset",value:function(){this.registry=[]}},{key:"remove",value:function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)}},{key:"toString",value:function(e){return this.registry.filter(function(e){return e.attached}).map(function(t){return t.toString(e)}).join("\n")}},{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),D=new B,z="2f1acc6c3a606b082e5eef5e54414ffb";null==s[z]&&(s[z]=0);var L=s[z]++,Y=function(){var e=0;return function(t,n){(e+=1)>1e10&&u(!1,"[JSS] You might have a memory leak. Rule counter is at %s.",e);var r="c",s="";return n&&(r=n.options.classNamePrefix||"c",null!=n.options.jss.id&&(s+=n.options.jss.id)),""+r+L+s+e}},F=function(e){var t=void 0;return function(){return t||(t=e()),t}};function H(e,t){try{return e.style.getPropertyValue(t)}catch(e){return""}}function Q(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=l(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;e.style.setProperty(t,r)}catch(e){return!1}return!0}function W(e,t){try{e.style.removeProperty(t)}catch(e){u(!1,'[JSS] DOMException "%s" was thrown. Tried to remove property "%s".',e.message,t)}}var X,Z=1,$=7,ee=(X=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.substr(t,e.indexOf("{")-1)},function(e){if(e.type===Z)return e.selectorText;if(e.type===$){var t=e.name;if(t)return"@keyframes "+t;var n=e.cssText;return"@"+X(n,n.indexOf("keyframes"))}return X(e.cssText)});function te(e,t){return e.selectorText=t,e.selectorText===t}var ne,re,se=F(function(){return document.head||document.getElementsByTagName("head")[0]}),ie=(ne=void 0,re=!1,function(e){var t={};ne||(ne=document.createElement("style"));for(var n=0;n<e.length;n++){var r=e[n];if(r instanceof p){var s=r.selector;if(s&&-1!==s.indexOf("\\")){re||(se().appendChild(ne),re=!0),ne.textContent=s+" {}";var i=ne.sheet;if(i){var o=i.cssRules;o&&(t[o[0].selectorText]=r.key)}}}}return re&&(se().removeChild(ne),re=!1),t});function oe(e){var t=D.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n)return n.renderer.element;if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))return n.renderer.element.nextElementSibling}var r=e.insertionPoint;if(r&&"string"==typeof r){var s=function(e){for(var t=se(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(s)return s.nextSibling;u("jss"===r,'[JSS] Insertion point "%s" not found.',r)}return null}var ue=F(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),ae=function(){function e(t){d(this,e),this.getPropertyValue=H,this.setProperty=Q,this.removeProperty=W,this.setSelector=te,this.getKey=ee,this.getUnescapedKeysMap=ie,this.hasInsertedRules=!1,t&&D.add(t),this.sheet=t;var n=this.sheet?this.sheet.options:{},r=n.media,s=n.meta,i=n.element;this.element=i||document.createElement("style"),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),s&&this.element.setAttribute("data-meta",s);var o=ue();o&&this.element.setAttribute("nonce",o)}return v(e,[{key:"attach",value:function(){!this.element.parentNode&&this.sheet&&(this.hasInsertedRules&&(this.deploy(),this.hasInsertedRules=!1),function(e,t){var n=t.insertionPoint,r=oe(t);if(r){var s=r.parentNode;s&&s.insertBefore(e,r)}else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o?o.insertBefore(e,i.nextSibling):u(!1,"[JSS] Insertion point is not in the DOM.")}else se().insertBefore(e,r)}(this.element,this.sheet.options))}},{key:"detach",value:function(){this.element.parentNode.removeChild(this.element)}},{key:"deploy",value:function(){this.sheet&&(this.element.textContent="\n"+this.sheet.toString()+"\n")}},{key:"insertRule",value:function(e,t){var n=this.element.sheet,r=n.cssRules,s=e.toString();if(t||(t=r.length),!s)return!1;try{n.insertRule(s,t)}catch(t){return u(!1,"[JSS] Can not insert an unsupported rule \n\r%s",e),!1}return this.hasInsertedRules=!0,r[t]}},{key:"deleteRule",value:function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)}},{key:"indexOf",value:function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1}},{key:"replaceRule",value:function(e,t){var n=this.indexOf(e),r=this.insertRule(t,n);return this.element.sheet.deleteRule(n),r}},{key:"getRules",value:function(){return this.element.sheet.cssRules}}]),e}(),le=function(){function e(){d(this,e)}return v(e,[{key:"setProperty",value:function(){return!0}},{key:"getPropertyValue",value:function(){return""}},{key:"removeProperty",value:function(){}},{key:"setSelector",value:function(){return!0}},{key:"getKey",value:function(){return""}},{key:"attach",value:function(){}},{key:"detach",value:function(){}},{key:"deploy",value:function(){}},{key:"insertRule",value:function(){return!1}},{key:"deleteRule",value:function(){return!0}},{key:"replaceRule",value:function(){return!1}},{key:"getRules",value:function(){}},{key:"indexOf",value:function(){return-1}}]),e}(),he=_.concat([J,K]),fe=0,ce=function(){function e(t){d(this,e),this.id=fe++,this.version="9.8.7",this.plugins=new N,this.options={createGenerateClassName:Y,Renderer:n?ae:le,plugins:[]},this.generateClassName=Y(),this.use.apply(this,he),this.setup(t)}return v(e,[{key:"setup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.createGenerateClassName&&(this.options.createGenerateClassName=e.createGenerateClassName,this.generateClassName=e.createGenerateClassName()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?le:ae)),e.plugins&&this.use.apply(this,e.plugins),this}},{key:"createStyleSheet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.index;"number"!=typeof n&&(n=0===D.index?0:D.index+1);var r=new j(e,y({},t,{jss:this,generateClassName:t.generateClassName||this.generateClassName,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r}},{key:"removeStyleSheet",value:function(e){return e.detach(),D.remove(e),this}},{key:"createRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"===(void 0===e?"undefined":c(e))&&(n=t,t=e,e=void 0);var r=n;r.jss=this,r.Renderer=this.options.Renderer,r.generateClassName||(r.generateClassName=this.generateClassName),r.classes||(r.classes={});var s=w(e,t,r);return!r.selector&&s instanceof p&&(s.selector="."+r.generateClassName(s)),this.plugins.onProcessRule(s),s}},{key:"use",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){-1===e.options.plugins.indexOf(t)&&(e.options.plugins.push(t),e.plugins.use(t))}),this}}]),e}();var de=function(){function e(){d(this,e),this.sheets=[],this.refs=[],this.keys=[]}return v(e,[{key:"get",value:function(e){var t=this.keys.indexOf(e);return this.sheets[t]}},{key:"add",value:function(e,t){var n=this.sheets,r=this.refs,s=this.keys,i=n.indexOf(t);return-1!==i?i:(n.push(t),r.push(0),s.push(e),n.length-1)}},{key:"manage",value:function(e){var t=this.keys.indexOf(e),n=this.sheets[t];return 0===this.refs[t]&&n.attach(),this.refs[t]++,this.keys[t]||this.keys.splice(t,0,e),n}},{key:"unmanage",value:function(e){var t=this.keys.indexOf(e);-1!==t?this.refs[t]>0&&(this.refs[t]--,0===this.refs[t]&&this.sheets[t].detach()):u(!1,"SheetsManager: can't find sheet to unmanage")}},{key:"size",get:function(){return this.keys.length}}]),e}(),ve=function(e){return new ce(e)},ye=ve();e.create=ve,e.default=ye,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var s=t[r],i=void 0===s?"undefined":c(s);if("function"===i)n||(n={}),n[r]=s;else if("object"===i&&null!==s&&!Array.isArray(s)){var o=e(s);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=l,e.SheetsRegistry=B,e.SheetsManager=de,e.RuleList=O,e.sheets=D,e.createGenerateClassName=Y,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -74,3 +74,3 @@ 'use strict'; | ||
this.id = instanceCounter++; | ||
this.version = "9.8.6"; | ||
this.version = "9.8.7"; | ||
this.plugins = new _PluginsRegistry2['default'](); | ||
@@ -77,0 +77,0 @@ this.options = { |
{ | ||
"name": "jss", | ||
"description": "A lib for generating Style Sheets with JavaScript.", | ||
"version": "9.8.6", | ||
"version": "9.8.7", | ||
"author": { | ||
@@ -92,2 +92,3 @@ "name": "Oleg Slobodskoi", | ||
"rollup-plugin-commonjs": "^9.1.3", | ||
"rollup-plugin-node-globals": "^1.2.1", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
@@ -94,0 +95,0 @@ "rollup-plugin-replace": "^2.0.0", |
@@ -5,3 +5,3 @@ /* @flow */ | ||
import StyleRule from './rules/StyleRule' | ||
import type {RuleListOptions, ToCssOptions, Rule, RuleOptions, JssStyle} from './types' | ||
import type {RuleListOptions, ToCssOptions, Rule, RuleOptions, JssStyle, Classes} from './types' | ||
import escape from './utils/escape' | ||
@@ -28,3 +28,3 @@ | ||
classes: Object | ||
classes: Classes | ||
@@ -135,3 +135,6 @@ constructor(options: RuleListOptions) { | ||
update: Update = (name, data) => { | ||
const {jss: {plugins}, sheet} = this.options | ||
const { | ||
jss: {plugins}, | ||
sheet | ||
} = this.options | ||
if (typeof name === 'string') { | ||
@@ -138,0 +141,0 @@ plugins.onUpdate(data, this.get(name), sheet) |
@@ -10,3 +10,4 @@ /* @flow */ | ||
StyleSheetOptions, | ||
JssStyle | ||
JssStyle, | ||
Classes | ||
} from './types' | ||
@@ -30,3 +31,3 @@ | ||
classes: Object | ||
classes: Classes | ||
@@ -33,0 +34,0 @@ queue: ?Array<Rule> |
@@ -12,2 +12,4 @@ /* @flow */ | ||
export type Classes = { [string]: string } | ||
export type ToCssOptions = { | ||
@@ -68,3 +70,3 @@ indent?: number, | ||
index?: number, | ||
classes: Object, | ||
classes: Classes, | ||
jss: Jss, | ||
@@ -76,3 +78,3 @@ generateClassName: generateClassName, | ||
export type RuleListOptions = { | ||
classes: Object, | ||
classes: Classes, | ||
generateClassName: generateClassName, | ||
@@ -157,3 +159,3 @@ Renderer: Class<Renderer>, | ||
parent: ConditionalRule | KeyframesRule | StyleSheet, | ||
classes: Object | ||
classes: Classes | ||
} |
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
384683
5971
69