Socket
Socket
Sign inDemoInstall

jss

Package Overview
Dependencies
4
Maintainers
1
Versions
186
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.0.0-alpha.10 to 10.0.0-alpha.11

232

dist/jss.bundle.js

@@ -342,3 +342,3 @@ function _extends() {

return this;
};
}
/**

@@ -349,4 +349,4 @@ * Returns JSON representation of the rule.

*/
;
_proto2.toJSON = function toJSON() {

@@ -361,8 +361,8 @@ var json = {};

return json;
};
}
/**
* Generates a CSS string.
*/
;
_proto2.toString = function toString(options) {

@@ -453,16 +453,16 @@ var sheet = this.options.sheet;

return this.rules.get(name);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Create and register rule, run plugins.
*/
;
_proto.addRule = function addRule(name, style, options) {

@@ -473,8 +473,8 @@ var rule = this.rules.add(name, style, options);

return rule;
};
}
/**
* Generates a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -856,16 +856,16 @@ if (options === void 0) {

return rule;
};
}
/**
* Get a rule.
*/
;
_proto.get = function get(name) {
return this.map[name];
};
}
/**
* Delete a rule.
*/
;
_proto.remove = function remove(rule) {

@@ -875,16 +875,16 @@ this.unregister(rule);

this.index.splice(this.indexOf(rule), 1);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.index.indexOf(rule);
};
}
/**
* Run `onProcessRule()` plugins on every rule.
*/
;
_proto.process = function process() {

@@ -895,8 +895,8 @@ var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop

this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1);
};
}
/**
* Register a rule in `.map` and `.classes` maps.
*/
;
_proto.register = function register(rule) {

@@ -911,8 +911,8 @@ this.map[rule.key] = rule;

}
};
}
/**
* Unregister a rule.
*/
;
_proto.unregister = function unregister(rule) {

@@ -927,8 +927,8 @@ delete this.map[rule.key];

}
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -959,8 +959,8 @@ var name;

}
};
}
/**
* Execute plugins, update rule props.
*/
;
_proto.onUpdate = function onUpdate(data, rule, options) {

@@ -1000,8 +1000,8 @@ if (options === void 0) {

}
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1072,8 +1072,8 @@ var str = '';

return this;
};
}
/**
* Remove renderable from render tree.
*/
;
_proto.detach = function detach() {

@@ -1084,3 +1084,3 @@ if (!this.attached) return this;

return this;
};
}
/**

@@ -1090,4 +1090,4 @@ * Add a rule to the current stylesheet.

*/
;
_proto.addRule = function addRule(name, decl, options) {

@@ -1122,11 +1122,11 @@ var queue = this.queue; // Plugins can create rules.

return rule;
};
}
/**
* Insert rule into the StyleSheet
*/
;
_proto.insertRule = function insertRule(rule) {
this.renderer.insertRule(rule);
};
}
/**

@@ -1136,4 +1136,4 @@ * Create and add rules.

*/
;
_proto.addRules = function addRules(styles, options) {

@@ -1148,11 +1148,11 @@ var added = [];

return added;
};
}
/**
* Get a rule by name.
*/
;
_proto.getRule = function getRule(name) {
return this.rules.get(name);
};
}
/**

@@ -1162,4 +1162,4 @@ * Delete a rule by name.

*/
;
_proto.deleteRule = function deleteRule(name) {

@@ -1175,16 +1175,16 @@ var rule = this.rules.get(name);

return true;
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Deploy pure CSS string to a renderable.
*/
;
_proto.deploy = function deploy() {

@@ -1194,8 +1194,8 @@ this.renderer.deploy();

return this;
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -1207,8 +1207,8 @@ var _this$rules;

return this;
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1244,8 +1244,8 @@ return this.rules.toString(options);

return null;
};
}
/**
* Call `onProcessRule` hooks.
*/
;
_proto.onProcessRule = function onProcessRule(rule) {

@@ -1262,8 +1262,8 @@ if (rule.isProcessed) return;

rule.isProcessed = true;
};
}
/**
* Call `onProcessStyle` hooks.
*/
;
_proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {

@@ -1274,8 +1274,8 @@ for (var i = 0; i < this.registry.onProcessStyle.length; i++) {

}
};
}
/**
* Call `onProcessSheet` hooks.
*/
;
_proto.onProcessSheet = function onProcessSheet(sheet) {

@@ -1285,8 +1285,8 @@ for (var i = 0; i < this.registry.onProcessSheet.length; i++) {

}
};
}
/**
* Call `onUpdate` hooks.
*/
;
_proto.onUpdate = function onUpdate(data, rule, sheet, options) {

@@ -1296,8 +1296,8 @@ for (var i = 0; i < this.registry.onUpdate.length; i++) {

}
};
}
/**
* Call `onChangeValue` hooks.
*/
;
_proto.onChangeValue = function onChangeValue(value, prop, rule) {

@@ -1311,8 +1311,8 @@ var processedValue = value;

return processedValue;
};
}
/**
* Register a plugin.
*/
;
_proto.use = function use(newPlugin, options) {

@@ -1332,3 +1332,3 @@ if (options === void 0) {

plugins.push(newPlugin);
this.registry = this.plugins.external.concat(this.plugins.internal).reduce(function (registry, plugin) {
this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {
for (var name in plugin) {

@@ -1388,25 +1388,25 @@ if (name in registry) {

}
};
}
/**
* Reset the registry.
*/
;
_proto.reset = function reset() {
this.registry = [];
};
}
/**
* Remove a Style Sheet.
*/
;
_proto.remove = function remove(sheet) {
var index = this.registry.indexOf(sheet);
this.registry.splice(index, 1);
};
}
/**
* Convert all attached sheets to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1795,16 +1795,16 @@ return this.registry.filter(function (sheet) {

}
};
}
/**
* Remove style element from render tree.
*/
;
_proto.detach = function detach() {
this.element.parentNode.removeChild(this.element);
};
}
/**
* Inject CSS string into element.
*/
;
_proto.deploy = function deploy() {

@@ -1815,3 +1815,3 @@ var sheet = this.sheet;

if (sheet.options.link) {
sheet.rules.index.forEach(this.insertRule, this);
this.insertRules(sheet.rules);
return;

@@ -1821,28 +1821,40 @@ }

this.element.textContent = "\n" + sheet.toString() + "\n";
};
}
/**
* Insert RuleList into an element.
*/
;
_proto.insertRules = function insertRules(rules, nativeParent) {
for (var i = 0; i < rules.index.length; i++) {
this.insertRule(rules.index[i], i, nativeParent);
}
}
/**
* Insert a rule into element.
*/
;
_proto.insertRule = function insertRule(rule, index, nativeParent) {
if (nativeParent === void 0) {
nativeParent = this.element.sheet;
}
_proto.insertRule = function insertRule(rule, index) {
var sheet = this.element.sheet;
if (rule.rules) {
var parent = rule;
var latestNativeParent = nativeParent;
if (rule.type === 'conditional' || rule.type === 'keyframes') {
var containerRule = rule; // We need to render the container without children first.
if (rule.type === 'conditional' || rule.type === 'keyframes') {
// We need to render the container without children first.
latestNativeParent = _insertRule(nativeParent, parent.toString({
children: false
}), index);
var _cssRule = _insertRule(sheet, containerRule.toString({
children: false
}), index);
if (_cssRule === false) {
return false;
if (latestNativeParent === false) {
return false;
}
}
containerRule.rules.index.forEach(function (childRule, childIndex) {
var cssChildRule = _insertRule(_cssRule, childRule.toString(), childIndex);
if (cssChildRule !== false) childRule.renderable = cssChildRule;
});
return _cssRule;
this.insertRules(parent.rules, latestNativeParent);
return latestNativeParent;
}

@@ -1853,5 +1865,5 @@

var cssRule = _insertRule(sheet, ruleStr, index);
var nativeRule = _insertRule(nativeParent, ruleStr, index);
if (cssRule === false) {
if (nativeRule === false) {
return false;

@@ -1861,10 +1873,10 @@ }

this.hasInsertedRules = true;
rule.renderable = cssRule;
return cssRule;
};
rule.renderable = nativeRule;
return nativeRule;
}
/**
* Delete a rule.
*/
;
_proto.deleteRule = function deleteRule(cssRule) {

@@ -1876,8 +1888,8 @@ var sheet = this.element.sheet;

return true;
};
}
/**
* Get index of a CSS Rule.
*/
;
_proto.indexOf = function indexOf(cssRule) {

@@ -1891,3 +1903,3 @@ var cssRules = this.element.sheet.cssRules;

return -1;
};
}
/**

@@ -1898,4 +1910,4 @@ * Generate a new CSS rule and replace the existing one.

*/
;
_proto.replaceRule = function replaceRule(cssRule, rule) {

@@ -1906,8 +1918,8 @@ var index = this.indexOf(cssRule);

return this.insertRule(rule, index);
};
}
/**
* Get all rules elements.
*/
;
_proto.getRules = function getRules() {

@@ -1980,3 +1992,3 @@ return this.element.sheet.cssRules;

this.id = instanceCounter++;
this.version = "10.0.0-alpha.10";
this.version = "10.0.0-alpha.11";
this.plugins = new PluginsRegistry();

@@ -2027,8 +2039,8 @@ this.options = {

return this;
};
}
/**
* Create a Style Sheet.
*/
;
_proto.createStyleSheet = function createStyleSheet(styles, options) {

@@ -2055,8 +2067,8 @@ if (options === void 0) {

return sheet;
};
}
/**
* Detach the Style Sheet and remove it from the registry.
*/
;
_proto.removeStyleSheet = function removeStyleSheet(sheet) {

@@ -2066,8 +2078,8 @@ sheet.detach();

return this;
};
}
/**
* Create a rule without a Style Sheet.
*/
;
_proto.createRule = function createRule$$1(name, style, options) {

@@ -2100,8 +2112,8 @@ if (style === void 0) {

return rule;
};
}
/**
* Register plugin. Passed function will be invoked with a rule instance.
*/
;
_proto.use = function use() {

@@ -2108,0 +2120,0 @@ var _this = this;

@@ -7,8 +7,8 @@ 'use strict';

var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
var isInBrowser = _interopDefault(require('is-in-browser'));
var warning = _interopDefault(require('tiny-warning'));
var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
var _createClass = _interopDefault(require('@babel/runtime/helpers/createClass'));
var _inheritsLoose = _interopDefault(require('@babel/runtime/helpers/inheritsLoose'));
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));
var isInBrowser = _interopDefault(require('is-in-browser'));

@@ -289,3 +289,3 @@ var plainObjectConstrurctor = {}.constructor;

return this;
};
}
/**

@@ -296,4 +296,4 @@ * Returns JSON representation of the rule.

*/
;
_proto2.toJSON = function toJSON() {

@@ -308,8 +308,8 @@ var json = {};

return json;
};
}
/**
* Generates a CSS string.
*/
;
_proto2.toString = function toString(options) {

@@ -400,16 +400,16 @@ var sheet = this.options.sheet;

return this.rules.get(name);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Create and register rule, run plugins.
*/
;
_proto.addRule = function addRule(name, style, options) {

@@ -420,8 +420,8 @@ var rule = this.rules.add(name, style, options);

return rule;
};
}
/**
* Generates a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -803,16 +803,16 @@ if (options === void 0) {

return rule;
};
}
/**
* Get a rule.
*/
;
_proto.get = function get(name) {
return this.map[name];
};
}
/**
* Delete a rule.
*/
;
_proto.remove = function remove(rule) {

@@ -822,16 +822,16 @@ this.unregister(rule);

this.index.splice(this.indexOf(rule), 1);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.index.indexOf(rule);
};
}
/**
* Run `onProcessRule()` plugins on every rule.
*/
;
_proto.process = function process() {

@@ -842,8 +842,8 @@ var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop

this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1);
};
}
/**
* Register a rule in `.map` and `.classes` maps.
*/
;
_proto.register = function register(rule) {

@@ -858,8 +858,8 @@ this.map[rule.key] = rule;

}
};
}
/**
* Unregister a rule.
*/
;
_proto.unregister = function unregister(rule) {

@@ -874,8 +874,8 @@ delete this.map[rule.key];

}
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -906,8 +906,8 @@ var name;

}
};
}
/**
* Execute plugins, update rule props.
*/
;
_proto.onUpdate = function onUpdate(data, rule, options) {

@@ -947,8 +947,8 @@ if (options === void 0) {

}
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1019,8 +1019,8 @@ var str = '';

return this;
};
}
/**
* Remove renderable from render tree.
*/
;
_proto.detach = function detach() {

@@ -1031,3 +1031,3 @@ if (!this.attached) return this;

return this;
};
}
/**

@@ -1037,4 +1037,4 @@ * Add a rule to the current stylesheet.

*/
;
_proto.addRule = function addRule(name, decl, options) {

@@ -1069,11 +1069,11 @@ var queue = this.queue; // Plugins can create rules.

return rule;
};
}
/**
* Insert rule into the StyleSheet
*/
;
_proto.insertRule = function insertRule(rule) {
this.renderer.insertRule(rule);
};
}
/**

@@ -1083,4 +1083,4 @@ * Create and add rules.

*/
;
_proto.addRules = function addRules(styles, options) {

@@ -1095,11 +1095,11 @@ var added = [];

return added;
};
}
/**
* Get a rule by name.
*/
;
_proto.getRule = function getRule(name) {
return this.rules.get(name);
};
}
/**

@@ -1109,4 +1109,4 @@ * Delete a rule by name.

*/
;
_proto.deleteRule = function deleteRule(name) {

@@ -1122,16 +1122,16 @@ var rule = this.rules.get(name);

return true;
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Deploy pure CSS string to a renderable.
*/
;
_proto.deploy = function deploy() {

@@ -1141,8 +1141,8 @@ this.renderer.deploy();

return this;
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -1154,8 +1154,8 @@ var _this$rules;

return this;
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1191,8 +1191,8 @@ return this.rules.toString(options);

return null;
};
}
/**
* Call `onProcessRule` hooks.
*/
;
_proto.onProcessRule = function onProcessRule(rule) {

@@ -1209,8 +1209,8 @@ if (rule.isProcessed) return;

rule.isProcessed = true;
};
}
/**
* Call `onProcessStyle` hooks.
*/
;
_proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {

@@ -1221,8 +1221,8 @@ for (var i = 0; i < this.registry.onProcessStyle.length; i++) {

}
};
}
/**
* Call `onProcessSheet` hooks.
*/
;
_proto.onProcessSheet = function onProcessSheet(sheet) {

@@ -1232,8 +1232,8 @@ for (var i = 0; i < this.registry.onProcessSheet.length; i++) {

}
};
}
/**
* Call `onUpdate` hooks.
*/
;
_proto.onUpdate = function onUpdate(data, rule, sheet, options) {

@@ -1243,8 +1243,8 @@ for (var i = 0; i < this.registry.onUpdate.length; i++) {

}
};
}
/**
* Call `onChangeValue` hooks.
*/
;
_proto.onChangeValue = function onChangeValue(value, prop, rule) {

@@ -1258,8 +1258,8 @@ var processedValue = value;

return processedValue;
};
}
/**
* Register a plugin.
*/
;
_proto.use = function use(newPlugin, options) {

@@ -1279,3 +1279,3 @@ if (options === void 0) {

plugins.push(newPlugin);
this.registry = this.plugins.external.concat(this.plugins.internal).reduce(function (registry, plugin) {
this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {
for (var name in plugin) {

@@ -1335,25 +1335,25 @@ if (name in registry) {

}
};
}
/**
* Reset the registry.
*/
;
_proto.reset = function reset() {
this.registry = [];
};
}
/**
* Remove a Style Sheet.
*/
;
_proto.remove = function remove(sheet) {
var index = this.registry.indexOf(sheet);
this.registry.splice(index, 1);
};
}
/**
* Convert all attached sheets to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1747,16 +1747,16 @@ return this.registry.filter(function (sheet) {

}
};
}
/**
* Remove style element from render tree.
*/
;
_proto.detach = function detach() {
this.element.parentNode.removeChild(this.element);
};
}
/**
* Inject CSS string into element.
*/
;
_proto.deploy = function deploy() {

@@ -1767,3 +1767,3 @@ var sheet = this.sheet;

if (sheet.options.link) {
sheet.rules.index.forEach(this.insertRule, this);
this.insertRules(sheet.rules);
return;

@@ -1773,28 +1773,40 @@ }

this.element.textContent = "\n" + sheet.toString() + "\n";
};
}
/**
* Insert RuleList into an element.
*/
;
_proto.insertRules = function insertRules(rules, nativeParent) {
for (var i = 0; i < rules.index.length; i++) {
this.insertRule(rules.index[i], i, nativeParent);
}
}
/**
* Insert a rule into element.
*/
;
_proto.insertRule = function insertRule(rule, index, nativeParent) {
if (nativeParent === void 0) {
nativeParent = this.element.sheet;
}
_proto.insertRule = function insertRule(rule, index) {
var sheet = this.element.sheet;
if (rule.rules) {
var parent = rule;
var latestNativeParent = nativeParent;
if (rule.type === 'conditional' || rule.type === 'keyframes') {
var containerRule = rule; // We need to render the container without children first.
if (rule.type === 'conditional' || rule.type === 'keyframes') {
// We need to render the container without children first.
latestNativeParent = _insertRule(nativeParent, parent.toString({
children: false
}), index);
var _cssRule = _insertRule(sheet, containerRule.toString({
children: false
}), index);
if (_cssRule === false) {
return false;
if (latestNativeParent === false) {
return false;
}
}
containerRule.rules.index.forEach(function (childRule, childIndex) {
var cssChildRule = _insertRule(_cssRule, childRule.toString(), childIndex);
if (cssChildRule !== false) childRule.renderable = cssChildRule;
});
return _cssRule;
this.insertRules(parent.rules, latestNativeParent);
return latestNativeParent;
}

@@ -1805,5 +1817,5 @@

var cssRule = _insertRule(sheet, ruleStr, index);
var nativeRule = _insertRule(nativeParent, ruleStr, index);
if (cssRule === false) {
if (nativeRule === false) {
return false;

@@ -1813,10 +1825,10 @@ }

this.hasInsertedRules = true;
rule.renderable = cssRule;
return cssRule;
};
rule.renderable = nativeRule;
return nativeRule;
}
/**
* Delete a rule.
*/
;
_proto.deleteRule = function deleteRule(cssRule) {

@@ -1828,8 +1840,8 @@ var sheet = this.element.sheet;

return true;
};
}
/**
* Get index of a CSS Rule.
*/
;
_proto.indexOf = function indexOf(cssRule) {

@@ -1843,3 +1855,3 @@ var cssRules = this.element.sheet.cssRules;

return -1;
};
}
/**

@@ -1850,4 +1862,4 @@ * Generate a new CSS rule and replace the existing one.

*/
;
_proto.replaceRule = function replaceRule(cssRule, rule) {

@@ -1858,8 +1870,8 @@ var index = this.indexOf(cssRule);

return this.insertRule(rule, index);
};
}
/**
* Get all rules elements.
*/
;
_proto.getRules = function getRules() {

@@ -1932,3 +1944,3 @@ return this.element.sheet.cssRules;

this.id = instanceCounter++;
this.version = "10.0.0-alpha.10";
this.version = "10.0.0-alpha.11";
this.plugins = new PluginsRegistry();

@@ -1979,8 +1991,8 @@ this.options = {

return this;
};
}
/**
* Create a Style Sheet.
*/
;
_proto.createStyleSheet = function createStyleSheet(styles, options) {

@@ -2007,8 +2019,8 @@ if (options === void 0) {

return sheet;
};
}
/**
* Detach the Style Sheet and remove it from the registry.
*/
;
_proto.removeStyleSheet = function removeStyleSheet(sheet) {

@@ -2018,8 +2030,8 @@ sheet.detach();

return this;
};
}
/**
* Create a rule without a Style Sheet.
*/
;
_proto.createRule = function createRule$$1(name, style, options) {

@@ -2052,8 +2064,8 @@ if (style === void 0) {

return rule;
};
}
/**
* Register plugin. Passed function will be invoked with a rule instance.
*/
;
_proto.use = function use() {

@@ -2060,0 +2072,0 @@ var _this = this;

@@ -0,7 +1,7 @@

import _extends from '@babel/runtime/helpers/esm/extends';
import isInBrowser from 'is-in-browser';
import warning from 'tiny-warning';
import _extends from '@babel/runtime/helpers/esm/extends';
import _createClass from '@babel/runtime/helpers/esm/createClass';
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
import isInBrowser from 'is-in-browser';

@@ -282,3 +282,3 @@ var plainObjectConstrurctor = {}.constructor;

return this;
};
}
/**

@@ -289,4 +289,4 @@ * Returns JSON representation of the rule.

*/
;
_proto2.toJSON = function toJSON() {

@@ -301,8 +301,8 @@ var json = {};

return json;
};
}
/**
* Generates a CSS string.
*/
;
_proto2.toString = function toString(options) {

@@ -393,16 +393,16 @@ var sheet = this.options.sheet;

return this.rules.get(name);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Create and register rule, run plugins.
*/
;
_proto.addRule = function addRule(name, style, options) {

@@ -413,8 +413,8 @@ var rule = this.rules.add(name, style, options);

return rule;
};
}
/**
* Generates a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -796,16 +796,16 @@ if (options === void 0) {

return rule;
};
}
/**
* Get a rule.
*/
;
_proto.get = function get(name) {
return this.map[name];
};
}
/**
* Delete a rule.
*/
;
_proto.remove = function remove(rule) {

@@ -815,16 +815,16 @@ this.unregister(rule);

this.index.splice(this.indexOf(rule), 1);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.index.indexOf(rule);
};
}
/**
* Run `onProcessRule()` plugins on every rule.
*/
;
_proto.process = function process() {

@@ -835,8 +835,8 @@ var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop

this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1);
};
}
/**
* Register a rule in `.map` and `.classes` maps.
*/
;
_proto.register = function register(rule) {

@@ -851,8 +851,8 @@ this.map[rule.key] = rule;

}
};
}
/**
* Unregister a rule.
*/
;
_proto.unregister = function unregister(rule) {

@@ -867,8 +867,8 @@ delete this.map[rule.key];

}
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -899,8 +899,8 @@ var name;

}
};
}
/**
* Execute plugins, update rule props.
*/
;
_proto.onUpdate = function onUpdate(data, rule, options) {

@@ -940,8 +940,8 @@ if (options === void 0) {

}
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1012,8 +1012,8 @@ var str = '';

return this;
};
}
/**
* Remove renderable from render tree.
*/
;
_proto.detach = function detach() {

@@ -1024,3 +1024,3 @@ if (!this.attached) return this;

return this;
};
}
/**

@@ -1030,4 +1030,4 @@ * Add a rule to the current stylesheet.

*/
;
_proto.addRule = function addRule(name, decl, options) {

@@ -1062,11 +1062,11 @@ var queue = this.queue; // Plugins can create rules.

return rule;
};
}
/**
* Insert rule into the StyleSheet
*/
;
_proto.insertRule = function insertRule(rule) {
this.renderer.insertRule(rule);
};
}
/**

@@ -1076,4 +1076,4 @@ * Create and add rules.

*/
;
_proto.addRules = function addRules(styles, options) {

@@ -1088,11 +1088,11 @@ var added = [];

return added;
};
}
/**
* Get a rule by name.
*/
;
_proto.getRule = function getRule(name) {
return this.rules.get(name);
};
}
/**

@@ -1102,4 +1102,4 @@ * Delete a rule by name.

*/
;
_proto.deleteRule = function deleteRule(name) {

@@ -1115,16 +1115,16 @@ var rule = this.rules.get(name);

return true;
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Deploy pure CSS string to a renderable.
*/
;
_proto.deploy = function deploy() {

@@ -1134,8 +1134,8 @@ this.renderer.deploy();

return this;
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -1147,8 +1147,8 @@ var _this$rules;

return this;
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1184,8 +1184,8 @@ return this.rules.toString(options);

return null;
};
}
/**
* Call `onProcessRule` hooks.
*/
;
_proto.onProcessRule = function onProcessRule(rule) {

@@ -1202,8 +1202,8 @@ if (rule.isProcessed) return;

rule.isProcessed = true;
};
}
/**
* Call `onProcessStyle` hooks.
*/
;
_proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {

@@ -1214,8 +1214,8 @@ for (var i = 0; i < this.registry.onProcessStyle.length; i++) {

}
};
}
/**
* Call `onProcessSheet` hooks.
*/
;
_proto.onProcessSheet = function onProcessSheet(sheet) {

@@ -1225,8 +1225,8 @@ for (var i = 0; i < this.registry.onProcessSheet.length; i++) {

}
};
}
/**
* Call `onUpdate` hooks.
*/
;
_proto.onUpdate = function onUpdate(data, rule, sheet, options) {

@@ -1236,8 +1236,8 @@ for (var i = 0; i < this.registry.onUpdate.length; i++) {

}
};
}
/**
* Call `onChangeValue` hooks.
*/
;
_proto.onChangeValue = function onChangeValue(value, prop, rule) {

@@ -1251,8 +1251,8 @@ var processedValue = value;

return processedValue;
};
}
/**
* Register a plugin.
*/
;
_proto.use = function use(newPlugin, options) {

@@ -1272,3 +1272,3 @@ if (options === void 0) {

plugins.push(newPlugin);
this.registry = this.plugins.external.concat(this.plugins.internal).reduce(function (registry, plugin) {
this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {
for (var name in plugin) {

@@ -1328,25 +1328,25 @@ if (name in registry) {

}
};
}
/**
* Reset the registry.
*/
;
_proto.reset = function reset() {
this.registry = [];
};
}
/**
* Remove a Style Sheet.
*/
;
_proto.remove = function remove(sheet) {
var index = this.registry.indexOf(sheet);
this.registry.splice(index, 1);
};
}
/**
* Convert all attached sheets to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1740,16 +1740,16 @@ return this.registry.filter(function (sheet) {

}
};
}
/**
* Remove style element from render tree.
*/
;
_proto.detach = function detach() {
this.element.parentNode.removeChild(this.element);
};
}
/**
* Inject CSS string into element.
*/
;
_proto.deploy = function deploy() {

@@ -1760,3 +1760,3 @@ var sheet = this.sheet;

if (sheet.options.link) {
sheet.rules.index.forEach(this.insertRule, this);
this.insertRules(sheet.rules);
return;

@@ -1766,28 +1766,40 @@ }

this.element.textContent = "\n" + sheet.toString() + "\n";
};
}
/**
* Insert RuleList into an element.
*/
;
_proto.insertRules = function insertRules(rules, nativeParent) {
for (var i = 0; i < rules.index.length; i++) {
this.insertRule(rules.index[i], i, nativeParent);
}
}
/**
* Insert a rule into element.
*/
;
_proto.insertRule = function insertRule(rule, index, nativeParent) {
if (nativeParent === void 0) {
nativeParent = this.element.sheet;
}
_proto.insertRule = function insertRule(rule, index) {
var sheet = this.element.sheet;
if (rule.rules) {
var parent = rule;
var latestNativeParent = nativeParent;
if (rule.type === 'conditional' || rule.type === 'keyframes') {
var containerRule = rule; // We need to render the container without children first.
if (rule.type === 'conditional' || rule.type === 'keyframes') {
// We need to render the container without children first.
latestNativeParent = _insertRule(nativeParent, parent.toString({
children: false
}), index);
var _cssRule = _insertRule(sheet, containerRule.toString({
children: false
}), index);
if (_cssRule === false) {
return false;
if (latestNativeParent === false) {
return false;
}
}
containerRule.rules.index.forEach(function (childRule, childIndex) {
var cssChildRule = _insertRule(_cssRule, childRule.toString(), childIndex);
if (cssChildRule !== false) childRule.renderable = cssChildRule;
});
return _cssRule;
this.insertRules(parent.rules, latestNativeParent);
return latestNativeParent;
}

@@ -1798,5 +1810,5 @@

var cssRule = _insertRule(sheet, ruleStr, index);
var nativeRule = _insertRule(nativeParent, ruleStr, index);
if (cssRule === false) {
if (nativeRule === false) {
return false;

@@ -1806,10 +1818,10 @@ }

this.hasInsertedRules = true;
rule.renderable = cssRule;
return cssRule;
};
rule.renderable = nativeRule;
return nativeRule;
}
/**
* Delete a rule.
*/
;
_proto.deleteRule = function deleteRule(cssRule) {

@@ -1821,8 +1833,8 @@ var sheet = this.element.sheet;

return true;
};
}
/**
* Get index of a CSS Rule.
*/
;
_proto.indexOf = function indexOf(cssRule) {

@@ -1836,3 +1848,3 @@ var cssRules = this.element.sheet.cssRules;

return -1;
};
}
/**

@@ -1843,4 +1855,4 @@ * Generate a new CSS rule and replace the existing one.

*/
;
_proto.replaceRule = function replaceRule(cssRule, rule) {

@@ -1851,8 +1863,8 @@ var index = this.indexOf(cssRule);

return this.insertRule(rule, index);
};
}
/**
* Get all rules elements.
*/
;
_proto.getRules = function getRules() {

@@ -1925,3 +1937,3 @@ return this.element.sheet.cssRules;

this.id = instanceCounter++;
this.version = "10.0.0-alpha.10";
this.version = "10.0.0-alpha.11";
this.plugins = new PluginsRegistry();

@@ -1972,8 +1984,8 @@ this.options = {

return this;
};
}
/**
* Create a Style Sheet.
*/
;
_proto.createStyleSheet = function createStyleSheet(styles, options) {

@@ -2000,8 +2012,8 @@ if (options === void 0) {

return sheet;
};
}
/**
* Detach the Style Sheet and remove it from the registry.
*/
;
_proto.removeStyleSheet = function removeStyleSheet(sheet) {

@@ -2011,8 +2023,8 @@ sheet.detach();

return this;
};
}
/**
* Create a rule without a Style Sheet.
*/
;
_proto.createRule = function createRule$$1(name, style, options) {

@@ -2045,8 +2057,8 @@ if (style === void 0) {

return rule;
};
}
/**
* Register plugin. Passed function will be invoked with a rule instance.
*/
;
_proto.use = function use() {

@@ -2053,0 +2065,0 @@ var _this = this;

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.jss = {})));
}(this, (function (exports) { 'use strict';
(global = global || self, factory(global.jss = {}));
}(this, function (exports) { 'use strict';

@@ -348,3 +348,3 @@ function _extends() {

return this;
};
}
/**

@@ -355,4 +355,4 @@ * Returns JSON representation of the rule.

*/
;
_proto2.toJSON = function toJSON() {

@@ -367,8 +367,8 @@ var json = {};

return json;
};
}
/**
* Generates a CSS string.
*/
;
_proto2.toString = function toString(options) {

@@ -459,16 +459,16 @@ var sheet = this.options.sheet;

return this.rules.get(name);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Create and register rule, run plugins.
*/
;
_proto.addRule = function addRule(name, style, options) {

@@ -479,8 +479,8 @@ var rule = this.rules.add(name, style, options);

return rule;
};
}
/**
* Generates a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -862,16 +862,16 @@ if (options === void 0) {

return rule;
};
}
/**
* Get a rule.
*/
;
_proto.get = function get(name) {
return this.map[name];
};
}
/**
* Delete a rule.
*/
;
_proto.remove = function remove(rule) {

@@ -881,16 +881,16 @@ this.unregister(rule);

this.index.splice(this.indexOf(rule), 1);
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.index.indexOf(rule);
};
}
/**
* Run `onProcessRule()` plugins on every rule.
*/
;
_proto.process = function process() {

@@ -901,8 +901,8 @@ var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop

this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1);
};
}
/**
* Register a rule in `.map` and `.classes` maps.
*/
;
_proto.register = function register(rule) {

@@ -917,8 +917,8 @@ this.map[rule.key] = rule;

}
};
}
/**
* Unregister a rule.
*/
;
_proto.unregister = function unregister(rule) {

@@ -933,8 +933,8 @@ delete this.map[rule.key];

}
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -965,8 +965,8 @@ var name;

}
};
}
/**
* Execute plugins, update rule props.
*/
;
_proto.onUpdate = function onUpdate(data, rule, options) {

@@ -1006,8 +1006,8 @@ if (options === void 0) {

}
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1078,8 +1078,8 @@ var str = '';

return this;
};
}
/**
* Remove renderable from render tree.
*/
;
_proto.detach = function detach() {

@@ -1090,3 +1090,3 @@ if (!this.attached) return this;

return this;
};
}
/**

@@ -1096,4 +1096,4 @@ * Add a rule to the current stylesheet.

*/
;
_proto.addRule = function addRule(name, decl, options) {

@@ -1128,11 +1128,11 @@ var queue = this.queue; // Plugins can create rules.

return rule;
};
}
/**
* Insert rule into the StyleSheet
*/
;
_proto.insertRule = function insertRule(rule) {
this.renderer.insertRule(rule);
};
}
/**

@@ -1142,4 +1142,4 @@ * Create and add rules.

*/
;
_proto.addRules = function addRules(styles, options) {

@@ -1154,11 +1154,11 @@ var added = [];

return added;
};
}
/**
* Get a rule by name.
*/
;
_proto.getRule = function getRule(name) {
return this.rules.get(name);
};
}
/**

@@ -1168,4 +1168,4 @@ * Delete a rule by name.

*/
;
_proto.deleteRule = function deleteRule(name) {

@@ -1181,16 +1181,16 @@ var rule = this.rules.get(name);

return true;
};
}
/**
* Get index of a rule.
*/
;
_proto.indexOf = function indexOf(rule) {
return this.rules.indexOf(rule);
};
}
/**
* Deploy pure CSS string to a renderable.
*/
;
_proto.deploy = function deploy() {

@@ -1200,8 +1200,8 @@ this.renderer.deploy();

return this;
};
}
/**
* Update the function values with a new data.
*/
;
_proto.update = function update() {

@@ -1213,8 +1213,8 @@ var _this$rules;

return this;
};
}
/**
* Convert rules to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1250,8 +1250,8 @@ return this.rules.toString(options);

return null;
};
}
/**
* Call `onProcessRule` hooks.
*/
;
_proto.onProcessRule = function onProcessRule(rule) {

@@ -1268,8 +1268,8 @@ if (rule.isProcessed) return;

rule.isProcessed = true;
};
}
/**
* Call `onProcessStyle` hooks.
*/
;
_proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {

@@ -1280,8 +1280,8 @@ for (var i = 0; i < this.registry.onProcessStyle.length; i++) {

}
};
}
/**
* Call `onProcessSheet` hooks.
*/
;
_proto.onProcessSheet = function onProcessSheet(sheet) {

@@ -1291,8 +1291,8 @@ for (var i = 0; i < this.registry.onProcessSheet.length; i++) {

}
};
}
/**
* Call `onUpdate` hooks.
*/
;
_proto.onUpdate = function onUpdate(data, rule, sheet, options) {

@@ -1302,8 +1302,8 @@ for (var i = 0; i < this.registry.onUpdate.length; i++) {

}
};
}
/**
* Call `onChangeValue` hooks.
*/
;
_proto.onChangeValue = function onChangeValue(value, prop, rule) {

@@ -1317,8 +1317,8 @@ var processedValue = value;

return processedValue;
};
}
/**
* Register a plugin.
*/
;
_proto.use = function use(newPlugin, options) {

@@ -1338,3 +1338,3 @@ if (options === void 0) {

plugins.push(newPlugin);
this.registry = this.plugins.external.concat(this.plugins.internal).reduce(function (registry, plugin) {
this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {
for (var name in plugin) {

@@ -1394,25 +1394,25 @@ if (name in registry) {

}
};
}
/**
* Reset the registry.
*/
;
_proto.reset = function reset() {
this.registry = [];
};
}
/**
* Remove a Style Sheet.
*/
;
_proto.remove = function remove(sheet) {
var index = this.registry.indexOf(sheet);
this.registry.splice(index, 1);
};
}
/**
* Convert all attached sheets to a CSS string.
*/
;
_proto.toString = function toString(options) {

@@ -1801,16 +1801,16 @@ return this.registry.filter(function (sheet) {

}
};
}
/**
* Remove style element from render tree.
*/
;
_proto.detach = function detach() {
this.element.parentNode.removeChild(this.element);
};
}
/**
* Inject CSS string into element.
*/
;
_proto.deploy = function deploy() {

@@ -1821,3 +1821,3 @@ var sheet = this.sheet;

if (sheet.options.link) {
sheet.rules.index.forEach(this.insertRule, this);
this.insertRules(sheet.rules);
return;

@@ -1827,28 +1827,40 @@ }

this.element.textContent = "\n" + sheet.toString() + "\n";
};
}
/**
* Insert RuleList into an element.
*/
;
_proto.insertRules = function insertRules(rules, nativeParent) {
for (var i = 0; i < rules.index.length; i++) {
this.insertRule(rules.index[i], i, nativeParent);
}
}
/**
* Insert a rule into element.
*/
;
_proto.insertRule = function insertRule(rule, index, nativeParent) {
if (nativeParent === void 0) {
nativeParent = this.element.sheet;
}
_proto.insertRule = function insertRule(rule, index) {
var sheet = this.element.sheet;
if (rule.rules) {
var parent = rule;
var latestNativeParent = nativeParent;
if (rule.type === 'conditional' || rule.type === 'keyframes') {
var containerRule = rule; // We need to render the container without children first.
if (rule.type === 'conditional' || rule.type === 'keyframes') {
// We need to render the container without children first.
latestNativeParent = _insertRule(nativeParent, parent.toString({
children: false
}), index);
var _cssRule = _insertRule(sheet, containerRule.toString({
children: false
}), index);
if (_cssRule === false) {
return false;
if (latestNativeParent === false) {
return false;
}
}
containerRule.rules.index.forEach(function (childRule, childIndex) {
var cssChildRule = _insertRule(_cssRule, childRule.toString(), childIndex);
if (cssChildRule !== false) childRule.renderable = cssChildRule;
});
return _cssRule;
this.insertRules(parent.rules, latestNativeParent);
return latestNativeParent;
}

@@ -1859,5 +1871,5 @@

var cssRule = _insertRule(sheet, ruleStr, index);
var nativeRule = _insertRule(nativeParent, ruleStr, index);
if (cssRule === false) {
if (nativeRule === false) {
return false;

@@ -1867,10 +1879,10 @@ }

this.hasInsertedRules = true;
rule.renderable = cssRule;
return cssRule;
};
rule.renderable = nativeRule;
return nativeRule;
}
/**
* Delete a rule.
*/
;
_proto.deleteRule = function deleteRule(cssRule) {

@@ -1882,8 +1894,8 @@ var sheet = this.element.sheet;

return true;
};
}
/**
* Get index of a CSS Rule.
*/
;
_proto.indexOf = function indexOf(cssRule) {

@@ -1897,3 +1909,3 @@ var cssRules = this.element.sheet.cssRules;

return -1;
};
}
/**

@@ -1904,4 +1916,4 @@ * Generate a new CSS rule and replace the existing one.

*/
;
_proto.replaceRule = function replaceRule(cssRule, rule) {

@@ -1912,8 +1924,8 @@ var index = this.indexOf(cssRule);

return this.insertRule(rule, index);
};
}
/**
* Get all rules elements.
*/
;
_proto.getRules = function getRules() {

@@ -1986,3 +1998,3 @@ return this.element.sheet.cssRules;

this.id = instanceCounter++;
this.version = "10.0.0-alpha.10";
this.version = "10.0.0-alpha.11";
this.plugins = new PluginsRegistry();

@@ -2033,8 +2045,8 @@ this.options = {

return this;
};
}
/**
* Create a Style Sheet.
*/
;
_proto.createStyleSheet = function createStyleSheet(styles, options) {

@@ -2061,8 +2073,8 @@ if (options === void 0) {

return sheet;
};
}
/**
* Detach the Style Sheet and remove it from the registry.
*/
;
_proto.removeStyleSheet = function removeStyleSheet(sheet) {

@@ -2072,8 +2084,8 @@ sheet.detach();

return this;
};
}
/**
* Create a rule without a Style Sheet.
*/
;
_proto.createRule = function createRule$$1(name, style, options) {

@@ -2106,8 +2118,8 @@ if (style === void 0) {

return rule;
};
}
/**
* Register plugin. Passed function will be invoked with a rule instance.
*/
;
_proto.use = function use() {

@@ -2262,3 +2274,3 @@ var _this = this;

})));
}));
//# sourceMappingURL=jss.js.map

@@ -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";function f(){return(f=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}).apply(this,arguments)}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,r={}.constructor;function o(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(o);if(e.constructor!==r)return e;var t={};for(var n in e)t[n]=o(e[n]);return t}function p(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=o(t),s=r.plugins.onCreateRule(e,i,n);return s||(e[0],null)}function i(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)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function u(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var 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 y(e,t){if(void 0===t&&(t=!1),!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 v(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function l(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,s=void 0===i?0:i,o=t.fallbacks;if(e&&s++,o)if(Array.isArray(o))for(var u=0;u<o.length;u++){var a=o[u];for(var h in a){var l=a[h];null!=l&&(r&&(r+="\n"),r+=""+v(h+": "+y(l)+";",s))}}else for(var c in o){var d=o[c];null!=d&&(r&&(r+="\n"),r+=""+v(c+": "+y(d)+";",s))}for(var f in t){var p=t[f];null!=p&&"fallbacks"!==f&&(r&&(r+="\n"),r+=""+v(f+": "+y(p)+";",s))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),v(e+" {"+r,--s)+v("}",s)):r}var g=function(e){return e},c=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,this.renderer=r?r.renderer:new i}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];if(!(!!n&&n.force)&&this.style[e]===t)return this;var r=t;n&&!1===n.process||(r=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==r||!1===r,s=e in this.style;if(i&&!s)return this;var o=i&&s;if(o?delete this.style[e]:this.style[e]=r,this.renderable)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,r),this;var u=this.options.sheet;return u&&u.attached,this},e}(),d=function(a){function e(e,t,n){var r;(r=a.call(this,e,t,n)||this).selectorText=void 0,r.id=void 0,r.renderable=void 0;var i=n.selector,s=n.scoped,o=n.sheet,u=n.generateId;return i?r.selectorText=i:!1!==s&&(r.id=u(h(h(r)),o),r.selectorText="."+g(r.id)),r}u(e,a);var t=e.prototype;return t.applyTo=function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this},t.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=y(n))}return e},t.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?f({},e,{allowEmpty:!0}):e;return l(this.selectorText,this.style,n)},s(e,[{key:"selector",set:function(e){e!==this.selectorText&&(this.selectorText=e,this.renderable&&(this.renderer.setSelector(this.renderable,e)||this.renderer.replaceRule(this.renderable,this)))},get:function(){return this.selectorText}}]),e}(c),m={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new d(e,t,n)}},R={indent:1,children:!0},S=/@([\w-]+)/,b=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=(this.key=e).match(S);for(var i in this.at=r?r[1]:"unknown",this.options=n,this.rules=new z(f({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=R),!1===e.children)return this.key+" {}";var t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""},e}(),x=/@media|@supports\s+/,k={onCreateRule:function(e,t,n){return x.test(e)?new b(e,t,n):null}},P={indent:1,children:!0},w=/@keyframes\s+([\w-]+)/,j=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=e.match(w);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name;var i=(this.options=n).scoped,s=n.sheet,o=n.generateId;for(var u in this.id=!1===i?this.name:o(this,s),this.rules=new z(f({},n,{parent:this})),t)this.rules.add(u,t[u],f({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=P),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),C=/@keyframes\s+/,A=/\$([\w-]+)/,O=function(e,t,n){var r=e[t];if("string"==typeof r){var i=A.exec(r);if(!i)return;i[1]in n&&(e[t]=r.replace(i[0],n[i[1]]))}},I={onCreateRule:function(e,t,n){return C.test(e)?new j(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n&&("animation-name"in e&&O(e,"animation-name",n.keyframes),"animation"in e&&O(e,"animation",n.keyframes)),e}},T=function(i){function e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))||this).renderable=void 0,e}return u(e,i),e.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?f({},e,{allowEmpty:!0}):e;return l(this.key,this.style,n)},e}(c),q={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new T(e,t,n):null}},N=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=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}(),E={onCreateRule:function(e,t,n){return"@font-face"===e?new N(e,t,n):null}},M=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return l(this.key,this.style,e)},e}(),V={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new M(e,t,n):null}},U=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=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}(),G={"@charset":!0,"@import":!0,"@namespace":!0},_=[m,k,I,q,E,V,{onCreateRule:function(e,t,n){return e in G?new U(e,t,n):null}}],B={process:!0},J={force:!0,process:!0},z=function(){function l(e){this.map={},this.raw={},this.index=[],this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var e=l.prototype;return e.add=function(e,t,n){var r=this.options,i=r.parent,s=r.sheet,o=r.jss,u=r.Renderer,a=r.generateId,h=r.scoped,l=f({classes:this.classes,parent:i,sheet:s,jss:o,Renderer:u,generateId:a,scoped:h},n);this.raw[e]=t,e in this.classes&&(l.selector="."+g(this.classes[e]));var c=p(e,t,l);if(!c)return null;this.register(c);var d=void 0===l.index?this.index.length:l.index;return this.index.splice(d,0,c),c},e.get=function(e){return this.map[e]},e.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.indexOf(e),1)},e.indexOf=function(e){return this.index.indexOf(e)},e.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},e.register=function(e){(this.map[e.key]=e)instanceof d?(this.map[e.selector]=e).id&&(this.classes[e.key]=e.id):e instanceof j&&this.keyframes&&(this.keyframes[e.name]=e.id)},e.unregister=function(e){delete this.map[e.key],e instanceof d?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof j&&delete this.keyframes[e.name]},e.update=function(){var e,t,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.onUpdate(t,this.get(e),n);else for(var r=0;r<this.index.length;r++)this.onUpdate(t,this.index[r],n)},e.onUpdate=function(e,t,n){void 0===n&&(n=B);var r=this.options,i=r.jss.plugins,s=r.sheet;if(t.rules instanceof l)t.rules.update(e,n);else{var o=t,u=o.style;if(i.onUpdate(e,t,s,n),n.process&&u&&u!==o.style)for(var a in i.onProcessStyle(o.style,o,s),o.style){var h=o.style[a];h!==u[a]&&o.prop(a,h,J)}}},e.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=0;i<this.index.length;i++){var s=this.index[i].toString(e);(s||r)&&(t&&(t+="\n"),t+=s)}return t},l}(),D=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=f({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),this.renderer=new t.Renderer(this),this.rules=new z(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached&&(this.renderer.detach(),this.attached=!1),this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed&&(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))):this.deployed=!1,i):null},t.insertRule=function(e){this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.toString=function(e){return this.rules.toString(e)},e}(),L=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=this.plugins.external.concat(this.plugins.internal).reduce(function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),W=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=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)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(t){return this.registry.filter(function(e){return e.attached}).map(function(e){return e.toString(t)}).join("\n")},s(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),$=new W,F="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},H="2f1acc6c3a606b082e5eef5e54414ffb";null==F[H]&&(F[H]=0);var K=F[H]++,Q=function(){var i=0;return function(e,t){i+=1;var n="c",r="";return t&&(n=t.options.classNamePrefix||"c",null!=t.options.jss.id&&(r+=t.options.jss.id)),""+n+K+r+i}},X=function(e){var t;return function(){return t||(t=e()),t}};function Y(e,t){try{return"attributeStyleMap"in e?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}}function Z(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=y(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;"attributeStyleMap"in e?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(e){return!1}return!0}function ee(e,t){try{"attributeStyleMap"in e?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}}function te(e,t){return e.selectorText=t,e.selectorText===t}var ne=X(function(){return document.querySelector("head")});function re(e){var t=$.registry;if(0<t.length){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{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;0<=n;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ne(),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(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var ie=X(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),se=function(e,t,n){void 0===n&&(n=e.cssRules.length);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},oe=function(){function e(e){this.getPropertyValue=Y,this.setProperty=Z,this.removeProperty=ee,this.setSelector=te,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&$.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,s=n.element;this.element=s||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var o=ie();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){!this.element.parentNode&&this.sheet&&(!function(e,t){var n=t.insertionPoint,r=re(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else ne().appendChild(e)}(this.element,this.sheet.options),this.hasInsertedRules&&(this.hasInsertedRules=!1,this.deploy()))},t.detach=function(){this.element.parentNode.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?e.rules.index.forEach(this.insertRule,this):this.element.textContent="\n"+e.toString()+"\n")},t.insertRule=function(e,t){var n=this.element.sheet;if("conditional"===e.type||"keyframes"===e.type){var r=e,i=se(n,r.toString({children:!1}),t);return!1!==i&&(r.rules.index.forEach(function(e,t){var n=se(i,e.toString(),t);!1!==n&&(e.renderable=n)}),i)}var s=e.toString();if(!s)return!1;var o=se(n,s,t);return!1!==o&&(this.hasInsertedRules=!0,e.renderable=o)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),ue=function(){function e(){}var t=e.prototype;return t.setProperty=function(){return!0},t.getPropertyValue=function(){return""},t.removeProperty=function(){},t.setSelector=function(){return!0},t.attach=function(){},t.detach=function(){},t.deploy=function(){},t.insertRule=function(){return!1},t.deleteRule=function(){return!0},t.replaceRule=function(){return!1},t.getRules=function(){},t.indexOf=function(){return-1},e}(),ae=0,he=function(){function e(e){this.id=ae++,this.version="10.0.0-alpha.10",this.plugins=new L,this.options={createGenerateId:Q,Renderer:n?oe:ue,plugins:[]},this.generateId=Q();for(var t=0;t<_.length;t++)this.plugins.use(_[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId,this.generateId=e.createGenerateId()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?ue:oe)),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!=typeof n&&(n=0===$.index?0:$.index+1);var r=new D(e,f({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),$.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"==typeof e)return this.createRule(void 0,e,t);var r=f({},n,{jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var i=p(e,t,r);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.plugins.use(e)}),this},e}();var le=function(){function e(){this.length=0,this.sheets=new WeakMap}var t=e.prototype;return t.get=function(e){var t=this.sheets.get(e);return t&&t.sheet},t.add=function(e,t){this.sheets.has(e)||(this.length++,this.sheets.set(e,{sheet:t,refs:0}))},t.manage=function(e){var t=this.sheets.get(e);if(t)return 0===t.refs&&t.sheet.attach(),t.refs++,t.sheet},t.unmanage=function(e){var t=this.sheets.get(e);t&&0<t.refs&&(t.refs--,0===t.refs&&t.sheet.detach())},s(e,[{key:"size",get:function(){return this.length}}]),e}(),ce="undefined"!=typeof CSS&&CSS&&"number"in CSS,de=function(e){return new he(e)},fe=de();e.hasCSSTOMSupport=ce,e.create=de,e.default=fe,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var i=t[r],s=typeof i;if("function"===s)n||(n={}),n[r]=i;else if("object"===s&&null!==i&&!Array.isArray(i)){var o=e(i);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=y,e.createRule=p,e.SheetsRegistry=W,e.SheetsManager=le,e.RuleList=z,e.sheets=$,e.createGenerateId=Q,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=e||self).jss={})}(this,function(e){"use strict";function t(){return(t=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}).apply(this,arguments)}var n="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},r="object"===("undefined"==typeof window?"undefined":n(window))&&"object"===("undefined"==typeof document?"undefined":n(document))&&9===document.nodeType,i={}.constructor;function s(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(s);if(e.constructor!==i)return e;var t={};for(var n in e)t[n]=s(e[n]);return t}function o(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=s(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}function u(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)}}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function h(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var c=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function d(e,t){if(void 0===t&&(t=!1),!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+=c(e[r]," ");else n=c(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function f(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function p(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,s=void 0===i?0:i,o=t.fallbacks;if(e&&s++,o)if(Array.isArray(o))for(var u=0;u<o.length;u++){var a=o[u];for(var h in a){var l=a[h];null!=l&&(r&&(r+="\n"),r+=""+f(h+": "+d(l)+";",s))}}else for(var c in o){var p=o[c];null!=p&&(r&&(r+="\n"),r+=""+f(c+": "+d(p)+";",s))}for(var y in t){var v=t[y];null!=v&&"fallbacks"!==y&&(r&&(r+="\n"),r+=""+f(y+": "+d(v)+";",s))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),f(e+" {"+r,--s)+f("}",s)):r}var y=function(e){return e},v=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,this.renderer=r?r.renderer:new i}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];if(!(!!n&&n.force)&&this.style[e]===t)return this;var r=t;n&&!1===n.process||(r=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==r||!1===r,s=e in this.style;if(i&&!s)return this;var o=i&&s;if(o?delete this.style[e]:this.style[e]=r,this.renderable)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,r),this;var u=this.options.sheet;return u&&u.attached,this},e}(),g=function(e){function n(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var s=r.selector,o=r.scoped,u=r.sheet,a=r.generateId;return s?i.selectorText=s:!1!==o&&(i.id=a(l(l(i)),u),i.selectorText="."+y(i.id)),i}h(n,e);var r=n.prototype;return r.applyTo=function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this},r.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=d(n))}return e},r.toString=function(e){var n=this.options.sheet,r=!!n&&n.options.link?t({},e,{allowEmpty:!0}):e;return p(this.selectorText,this.style,r)},a(n,[{key:"selector",set:function(e){e!==this.selectorText&&(this.selectorText=e,this.renderable&&(this.renderer.setSelector(this.renderable,e)||this.renderer.replaceRule(this.renderable,this)))},get:function(){return this.selectorText}}]),n}(v),m={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new g(e,t,n)}},R={indent:1,children:!0},S=/@([\w-]+)/,b=function(){function e(e,n,r){this.type="conditional",this.at=void 0,this.key=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e;var i=e.match(S);for(var s in this.at=i?i[1]:"unknown",this.options=r,this.rules=new z(t({},r,{parent:this})),n)this.rules.add(s,n[s]);this.rules.process()}var n=e.prototype;return n.getRule=function(e){return this.rules.get(e)},n.indexOf=function(e){return this.rules.indexOf(e)},n.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},n.toString=function(e){if(void 0===e&&(e=R),!1===e.children)return this.key+" {}";var t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""},e}(),x=/@media|@supports\s+/,k={onCreateRule:function(e,t,n){return x.test(e)?new b(e,t,n):null}},P={indent:1,children:!0},w=/@keyframes\s+([\w-]+)/,j=function(){function e(e,n,r){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(w);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=r;var s=r.scoped,o=r.sheet,u=r.generateId;for(var a in this.id=!1===s?this.name:u(this,o),this.rules=new z(t({},r,{parent:this})),n)this.rules.add(a,n[a],t({},r,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=P),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),C=/@keyframes\s+/,A=/\$([\w-]+)/,O=function(e,t,n){var r=e[t];if("string"==typeof r){var i=A.exec(r);if(!i)return;i[1]in n&&(e[t]=r.replace(i[0],n[i[1]]))}},I={onCreateRule:function(e,t,n){return C.test(e)?new j(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&O(e,"animation-name",n.keyframes),"animation"in e&&O(e,"animation",n.keyframes),e):e}},T=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).renderable=void 0,t}return h(n,e),n.prototype.toString=function(e){var n=this.options.sheet,r=!!n&&n.options.link?t({},e,{allowEmpty:!0}):e;return p(this.key,this.style,r)},n}(v),q={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new T(e,t,n):null}},N=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=p(this.key,this.style[n]),this.style[n+1]&&(t+="\n");return t}return p(this.key,this.style,e)},e}(),M={onCreateRule:function(e,t,n){return"@font-face"===e?new N(e,t,n):null}},V=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return p(this.key,this.style,e)},e}(),E={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new V(e,t,n):null}},U=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=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}(),G={"@charset":!0,"@import":!0,"@namespace":!0},_=[m,k,I,q,M,E,{onCreateRule:function(e,t,n){return e in G?new U(e,t,n):null}}],B={process:!0},J={force:!0,process:!0},z=function(){function e(e){this.map={},this.raw={},this.index=[],this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var n=e.prototype;return n.add=function(e,n,r){var i=this.options,s=i.parent,u=i.sheet,a=i.jss,h=i.Renderer,l=i.generateId,c=i.scoped,d=t({classes:this.classes,parent:s,sheet:u,jss:a,Renderer:h,generateId:l,scoped:c},r);this.raw[e]=n,e in this.classes&&(d.selector="."+y(this.classes[e]));var f=o(e,n,d);if(!f)return null;this.register(f);var p=void 0===d.index?this.index.length:d.index;return this.index.splice(p,0,f),f},n.get=function(e){return this.map[e]},n.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.indexOf(e),1)},n.indexOf=function(e){return this.index.indexOf(e)},n.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},n.register=function(e){this.map[e.key]=e,e instanceof g?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof j&&this.keyframes&&(this.keyframes[e.name]=e.id)},n.unregister=function(e){delete this.map[e.key],e instanceof g?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof j&&delete this.keyframes[e.name]},n.update=function(){var e,t,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.onUpdate(t,this.get(e),n);else for(var r=0;r<this.index.length;r++)this.onUpdate(t,this.index[r],n)},n.onUpdate=function(t,n,r){void 0===r&&(r=B);var i=this.options,s=i.jss.plugins,o=i.sheet;if(n.rules instanceof e)n.rules.update(t,r);else{var u=n,a=u.style;if(s.onUpdate(t,n,o,r),r.process&&a&&a!==u.style)for(var h in s.onProcessStyle(u.style,u,o),u.style){var l=u.style[h];l!==a[h]&&u.prop(h,l,J)}}},n.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=0;i<this.index.length;i++){var s=this.index[i].toString(e);(s||r)&&(t&&(t+="\n"),t+=s)}return t},e}(),D=function(){function e(e,n){for(var r in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=t({},n,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),this.renderer=new n.Renderer(this),this.rules=new z(this.options),e)this.rules.add(r,e[r]);this.rules.process()}var n=e.prototype;return n.attach=function(){return this.attached?this:(this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},n.detach=function(){return this.attached?(this.renderer.detach(),this.attached=!1,this):this},n.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},n.insertRule=function(e){this.renderer.insertRule(e)},n.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},n.getRule=function(e){return this.rules.get(e)},n.deleteRule=function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))},n.indexOf=function(e){return this.rules.indexOf(e)},n.deploy=function(){return this.renderer.deploy(),this.deployed=!0,this},n.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},n.toString=function(e){return this.rules.toString(e)},e}(),L=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),W=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=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)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){return this.registry.filter(function(e){return e.attached}).map(function(t){return t.toString(e)}).join("\n")},a(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),$=new W,F="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},H="2f1acc6c3a606b082e5eef5e54414ffb";null==F[H]&&(F[H]=0);var K=F[H]++,Q=function(){var e=0;return function(t,n){e+=1;var r="c",i="";return n&&(r=n.options.classNamePrefix||"c",null!=n.options.jss.id&&(i+=n.options.jss.id)),""+r+K+i+e}},X=function(e){var t;return function(){return t||(t=e()),t}};function Y(e,t){try{return"attributeStyleMap"in e?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}}function Z(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=d(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;"attributeStyleMap"in e?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(e){return!1}return!0}function ee(e,t){try{"attributeStyleMap"in e?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}}function te(e,t){return e.selectorText=t,e.selectorText===t}var ne=X(function(){return document.querySelector("head")});function re(e){var t=$.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{parent:n.renderer.element.parentNode,node: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{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ne(),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(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var ie=X(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),se=function(e,t,n){void 0===n&&(n=e.cssRules.length);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},oe=function(){var e=document.createElement("style");return e.textContent="\n",e},ue=function(){function e(e){this.getPropertyValue=Y,this.setProperty=Z,this.removeProperty=ee,this.setSelector=te,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&$.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||oe(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var s=ie();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){!this.element.parentNode&&this.sheet&&(!function(e,t){var n=t.insertionPoint,r=re(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else ne().appendChild(e)}(this.element,this.sheet.options),this.hasInsertedRules&&(this.hasInsertedRules=!1,this.deploy()))},t.detach=function(){this.element.parentNode.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,i=n;return("conditional"!==e.type&&"keyframes"!==e.type||!1!==(i=se(n,r.toString({children:!1}),t)))&&(this.insertRules(r.rules,i),i)}var s=e.toString();if(!s)return!1;var o=se(n,s,t);return!1!==o&&(this.hasInsertedRules=!0,e.renderable=o,o)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),ae=function(){function e(){}var t=e.prototype;return t.setProperty=function(){return!0},t.getPropertyValue=function(){return""},t.removeProperty=function(){},t.setSelector=function(){return!0},t.attach=function(){},t.detach=function(){},t.deploy=function(){},t.insertRule=function(){return!1},t.deleteRule=function(){return!0},t.replaceRule=function(){return!1},t.getRules=function(){},t.indexOf=function(){return-1},e}(),he=0,le=function(){function e(e){this.id=he++,this.version="10.0.0-alpha.11",this.plugins=new L,this.options={createGenerateId:Q,Renderer:r?ue:ae,plugins:[]},this.generateId=Q();for(var t=0;t<_.length;t++)this.plugins.use(_[t],{queue:"internal"});this.setup(e)}var n=e.prototype;return n.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId,this.generateId=e.createGenerateId()),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},n.createStyleSheet=function(e,n){void 0===n&&(n={});var r=n.index;"number"!=typeof r&&(r=0===$.index?0:$.index+1);var i=new D(e,t({},n,{jss:this,generateId:n.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:r}));return this.plugins.onProcessSheet(i),i},n.removeStyleSheet=function(e){return e.detach(),$.remove(e),this},n.createRule=function(e,n,r){if(void 0===n&&(n={}),void 0===r&&(r={}),"object"==typeof e)return this.createRule(void 0,e,n);var i=t({},r,{jss:this,Renderer:this.options.Renderer});i.generateId||(i.generateId=this.generateId),i.classes||(i.classes={}),i.keyframes||(i.keyframes={});var s=o(e,n,i);return s&&this.plugins.onProcessRule(s),s},n.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e.plugins.use(t)}),this},e}();var ce=function(){function e(){this.length=0,this.sheets=new WeakMap}var t=e.prototype;return t.get=function(e){var t=this.sheets.get(e);return t&&t.sheet},t.add=function(e,t){this.sheets.has(e)||(this.length++,this.sheets.set(e,{sheet:t,refs:0}))},t.manage=function(e){var t=this.sheets.get(e);if(t)return 0===t.refs&&t.sheet.attach(),t.refs++,t.sheet},t.unmanage=function(e){var t=this.sheets.get(e);t&&t.refs>0&&(t.refs--,0===t.refs&&t.sheet.detach())},a(e,[{key:"size",get:function(){return this.length}}]),e}(),de="undefined"!=typeof CSS&&CSS&&"number"in CSS,fe=function(e){return new le(e)},pe=fe();e.hasCSSTOMSupport=de,e.create=fe,e.default=pe,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var i=t[r],s=typeof i;if("function"===s)n||(n={}),n[r]=i;else if("object"===s&&null!==i&&!Array.isArray(i)){var o=e(i);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=d,e.createRule=o,e.SheetsRegistry=W,e.SheetsManager=ce,e.RuleList=z,e.sheets=$,e.createGenerateId=Q,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "jss",
"description": "A lib for generating Style Sheets with JavaScript.",
"version": "10.0.0-alpha.10",
"version": "10.0.0-alpha.11",
"license": "MIT",

@@ -43,7 +43,7 @@ "homepage": "https://cssinjs.org/",

"dependencies": {
"@babel/runtime": "^7.0.0",
"@babel/runtime": "^7.3.1",
"is-in-browser": "^1.1.3",
"tiny-warning": "^1.0.2"
},
"gitHead": "953234ad4e69b2f3d00fb9d683fba24865d2c4dd"
"gitHead": "79343bda7df92609218aea1c9907297051cfc6ed"
}

@@ -12,3 +12,3 @@ # jss

See our website [jss](https://cssinjs.org/setup?v=v10.0.0-alpha.10) for more information.
See our website [jss](https://cssinjs.org/setup?v=v10.0.0-alpha.11) for more information.

@@ -15,0 +15,0 @@ ## Install

@@ -1,4 +0,9 @@

type GenerateId = (rule: Rule, sheet?: StyleSheet) => string
type CreateGenerateId = () => GenerateId
type JssValue =
export type Style = {[key: string]: Style | any}
export type Styles<Name extends string = string> = Record<Name, Style>
export type Classes<Name extends string = string> = Record<Name, string>
export type Keyframes<Name extends string = string> = Record<Name, string>
export type GenerateId = (rule: Rule, sheet?: StyleSheet<string>) => string
export type JssValue =
| string

@@ -9,8 +14,8 @@ | number

| false
type JssStyle = {}
type Classes = {[key: string]: string}
type Keyframes = {[key: string]: string}
type Styles = {[key: string]: JssStyle}
type InsertionPoint = string | HTMLElement
type UpdateOptions = {
export type CreateGenerateId = () => GenerateId
export type InsertionPoint = string | HTMLElement
export interface UpdateOptions {
process?: boolean

@@ -20,3 +25,8 @@ force?: boolean

type RuleListOptions = {
export interface ToCssOptions {
indent?: number
allowEmpty?: boolean
}
interface RuleListOptions {
classes: Classes

@@ -30,10 +40,5 @@ generateClassName: GenerateId

type ToCssOptions = {
indent?: number
allowEmpty?: boolean
}
declare class RuleList {
constructor(options: RuleListOptions)
add(name: string, decl: JssStyle, options?: RuleOptions): Rule
add(name: string, decl: Style, options?: RuleOptions): Rule
get(name: string): Rule

@@ -50,3 +55,3 @@ remove(rule: Rule): void

type RuleOptions = {
interface RuleOptions {
selector?: string

@@ -62,3 +67,3 @@ sheet?: StyleSheet

declare class BaseRule {
interface BaseRule {
type: string

@@ -69,3 +74,2 @@ key: string

options: RuleOptions
constructor(key: string, style: JssStyle, options: RuleOptions)
toString(options?: ToCssOptions): string

@@ -78,6 +82,6 @@ }

interface Plugin {
onCreateRule?(name: string, decl: JssStyle, options: RuleOptions): Rule
export interface Plugin {
onCreateRule?(name: string, decl: Style, options: RuleOptions): Rule
onProcessRule?(rule: Rule, sheet?: StyleSheet): void
onProcessStyle?(style: JssStyle, rule: Rule, sheet?: StyleSheet): JssStyle
onProcessStyle?(style: Style, rule: Rule, sheet?: StyleSheet): Style
onProcessSheet?(sheet?: StyleSheet): void

@@ -88,6 +92,5 @@ onChangeValue?(value: string, prop: string, rule: Rule): string | null | false

type Rule = BaseRule | ContainerRule
export type Rule = BaseRule | ContainerRule
declare class Renderer {
constructor(sheet?: StyleSheet)
export interface Renderer {
setProperty(cssRule: HTMLElement | CSSStyleRule, prop: string, value: JssValue): boolean

@@ -107,10 +110,3 @@ getPropertyValue(cssRule: HTMLElement | CSSStyleRule, prop: string): string

type JssOptions = {
createGenerateId?: CreateGenerateId
plugins?: Array<Plugin>
insertionPoint?: InsertionPoint
Renderer?: Renderer
virtual?: boolean
}
type RuleFactoryOptions = {
interface RuleFactoryOptions {
selector?: string

@@ -125,3 +121,3 @@ classes?: object

type StyleSheetFactoryOptions = {
export interface StyleSheetFactoryOptions {
media?: string

@@ -136,7 +132,15 @@ meta?: string

interface StyleSheetOptions extends StyleSheetFactoryOptions {
index: number
generateId: GenerateId
Renderer: Renderer
insertionPoint?: InsertionPoint
jss: Jss
}
declare class SheetsRegistry {
readonly index: number
add(sheet: StyleSheet): void
add(sheet: StyleSheet<any>): void
reset(): void
remove(sheet: StyleSheet): void
remove(sheet: StyleSheet<any>): void
toString(options?: ToCssOptions): string

@@ -153,75 +157,83 @@ }

type StyleSheetOptions = {
media?: string
meta?: string
link?: boolean
element?: HTMLStyleElement
index: number
generateId: GenerateId
classNamePrefix?: string
Renderer: Renderer
insertionPoint?: InsertionPoint
jss: Jss
}
declare class StyleSheet {
classes: Classes
keyframes: Keyframes
constructor(styles: object, options: StyleSheetOptions)
export interface StyleSheet<RuleName extends string = string> {
// Gives auto-completion on the rules declared in `createStyleSheet` without
// causing errors for rules added dynamically after creation.
classes: Classes<RuleName>
keyframes: Keyframes<string>
options: StyleSheetOptions
linked: boolean
attached: boolean
/**
* Attach renderable to the render tree.
*/
attach(): this
/**
* Remove renderable from render tree.
*/
detach(): this
addRule(name: string, decl: JssStyle, options?: RuleOptions): Rule
deploy(): this
/**
* Add a rule to the current stylesheet.
* Will insert a rule also after the stylesheet has been rendered first time.
*/
addRule(style: Style, options?: Partial<RuleOptions>): Rule
addRule(name: RuleName, style: Style, options?: Partial<RuleOptions>): Rule
insertRule(rule: Rule): void
addRules(styles: object, options?: RuleOptions): Array<Rule>
getRule(name: string): Rule
deleteRule(name: string): boolean
/**
* Create and add rules.
* Will render also after Style Sheet was rendered the first time.
*/
addRules(styles: Partial<Styles<RuleName>>, options?: Partial<RuleOptions>): Rule[]
/**
* Get a rule by name.
*/
getRule(name: RuleName): Rule
/**
* Delete a rule by name.
* Returns `true`: if rule has been deleted from the DOM.
*/
deleteRule(name: RuleName): boolean
/**
* Get index of a rule.
*/
indexOf(rule: Rule): number
deploy(): this
/**
* Update the function values with a new data.
*/
update(name: string, data: object, options?: UpdateOptions): this
update(data: object, options?: UpdateOptions): this
/**
* Convert rules to a CSS string.
*/
toString(options?: ToCssOptions): string
}
declare class Jss {
constructor(options?: JssOptions)
createStyleSheet(styles: Styles, options?: StyleSheetFactoryOptions): StyleSheet
export interface JssOptions {
createGenerateId: CreateGenerateId
plugins: ReadonlyArray<Plugin>
virtual: boolean
Renderer?: Renderer
insertionPoint: InsertionPoint
}
export interface Jss {
createStyleSheet<Name extends string>(
styles: Partial<Styles<Name>>,
options?: StyleSheetFactoryOptions
): StyleSheet<Name>
removeStyleSheet(sheet: StyleSheet): this
setup(options?: JssOptions): this
setup(options?: Partial<JssOptions>): this
use(...plugins: Plugin[]): this
createRule(style: JssStyle, options?: RuleFactoryOptions): Rule
createRule(name: string, style: JssStyle, options?: RuleFactoryOptions): Rule
createRule(style: Style, options?: RuleFactoryOptions): Rule
createRule<Name extends string>(name: Name, style: Style, options?: RuleFactoryOptions): Rule
}
/**
* Type exports
* Creates a new instance of JSS.
*/
export {
Jss,
StyleSheet,
BaseRule,
ContainerRule,
JssValue,
JssOptions,
StyleSheetFactoryOptions,
Styles,
JssStyle,
Plugin,
CreateGenerateId,
GenerateId,
RuleListOptions,
Rule,
Renderer,
RuleOptions,
Classes,
UpdateOptions
}
/*
* Actual exports
*/
declare const sheets: SheetsRegistry
export {SheetsRegistry, sheets, RuleList, SheetsManager}
export {sheets, SheetsManager, SheetsRegistry, RuleList}
export function create(options?: Partial<JssOptions>): Jss
export function createGenerateId(): GenerateId
export function createRule(name: string, decl: JssStyle, options: RuleOptions): Rule
export function createRule(name: string, decl: Style, options: RuleOptions): Rule
export function toCssValue(value: JssValue, ignoreImportant: boolean): string

@@ -231,2 +243,5 @@ export function getDynamicStyles(styles: Styles): Styles | null

/**
* A global JSS instance.
*/
export default jss
/* @flow */
import warning from 'tiny-warning'
import sheets from '../sheets'
import type StyleSheet from '../StyleSheet'
import toCssValue from '../utils/toCssValue'
import type {

@@ -11,7 +11,8 @@ CSSStyleRule,

Rule,
RuleList,
ContainerRule,
JssValue,
InsertionPoint
InsertionPoint,
StyleSheet
} from '../types'
import toCssValue from '../utils/toCssValue'

@@ -259,6 +260,6 @@ type PriorityOptions = {

const insertRule = (
container: CSSStyleSheet | CSSKeyframesRule | CSSMediaRule,
container: CSSStyleSheet | CSSMediaRule | CSSKeyframesRule,
rule: string,
index?: number = container.cssRules.length
): false | Object => {
): false | any => {
try {

@@ -353,3 +354,3 @@ if ('insertRule' in container) {

if (sheet.options.link) {
sheet.rules.index.forEach(this.insertRule, this)
this.insertRules(sheet.rules)
return

@@ -361,19 +362,31 @@ }

/**
* Insert RuleList into an element.
*/
insertRules(rules: RuleList, nativeParent?: CSSStyleSheet | CSSMediaRule | CSSKeyframesRule) {
for (let i = 0; i < rules.index.length; i++) {
this.insertRule(rules.index[i], i, nativeParent)
}
}
/**
* Insert a rule into element.
*/
insertRule(rule: Rule, index?: number): false | CSSRule {
const {sheet} = this.element
if (rule.type === 'conditional' || rule.type === 'keyframes') {
const containerRule: ContainerRule = (rule: any)
// We need to render the container without children first.
const cssRule = insertRule(sheet, containerRule.toString({children: false}), index)
if (cssRule === false) {
return false
insertRule(
rule: Rule,
index?: number,
nativeParent?: CSSStyleSheet | CSSMediaRule | CSSKeyframesRule = this.element.sheet
): false | CSSStyleSheet | CSSMediaRule | CSSKeyframesRule | CSSRule {
if (rule.rules) {
const parent: ContainerRule = (rule: any)
let latestNativeParent = nativeParent
if (rule.type === 'conditional' || rule.type === 'keyframes') {
// We need to render the container without children first.
latestNativeParent = insertRule(nativeParent, parent.toString({children: false}), index)
if (latestNativeParent === false) {
return false
}
}
containerRule.rules.index.forEach((childRule, childIndex) => {
const cssChildRule = insertRule(cssRule, childRule.toString(), childIndex)
if (cssChildRule !== false) childRule.renderable = cssChildRule
})
return cssRule
this.insertRules(parent.rules, latestNativeParent)
return latestNativeParent
}

@@ -385,4 +398,4 @@

const cssRule = insertRule(sheet, ruleStr, index)
if (cssRule === false) {
const nativeRule = insertRule(nativeParent, ruleStr, index)
if (nativeRule === false) {
return false

@@ -392,4 +405,4 @@ }

this.hasInsertedRules = true
rule.renderable = cssRule
return cssRule
rule.renderable = nativeRule
return nativeRule
}

@@ -424,3 +437,6 @@

*/
replaceRule(cssRule: CSSRule, rule: Rule): false | CSSRule {
replaceRule(
cssRule: CSSRule,
rule: Rule
): false | CSSStyleSheet | CSSMediaRule | CSSKeyframesRule | CSSRule {
const index = this.indexOf(cssRule)

@@ -427,0 +443,0 @@ if (index === -1) return false

/* @flow */
import Jss from '../Jss'
import StyleSheet from '../StyleSheet'
import {ConditionalRule} from '../plugins/conditionalRule'
import {KeyframesRule} from '../plugins/keyframesRule'
import {StyleRule} from '../plugins/styleRule'
import {ViewportRule} from '../plugins/viewportRule'
import {SimpleRule} from '../plugins/simpleRule'
import {FontFaceRule} from '../plugins/fontFaceRule'
import type {CSSStyleRule} from './cssom'
import type Jss from '../Jss'
import type StyleSheet from '../StyleSheet'
import type {ConditionalRule} from '../plugins/conditionalRule'
import type {KeyframesRule} from '../plugins/keyframesRule'
import type {StyleRule} from '../plugins/styleRule'
import type {ViewportRule} from '../plugins/viewportRule'
import type {SimpleRule} from '../plugins/simpleRule'
import type {FontFaceRule} from '../plugins/fontFaceRule'
import type {CSSStyleRule, CSSMediaRule, CSSKeyframesRule} from './cssom'
import type RuleList from '../RuleList'
export type {RuleList, StyleSheet}
export type Classes = {[string]: string}

@@ -78,5 +80,8 @@

deploy(sheet: StyleSheet): void;
insertRule(rule: Rule): false | CSSRule;
insertRule(rule: Rule): false | CSSStyleSheet | CSSMediaRule | CSSKeyframesRule | CSSRule;
deleteRule(cssRule: CSSRule): boolean;
replaceRule(cssRule: CSSRule, rule: Rule): false | CSSRule;
replaceRule(
cssRule: CSSRule,
rule: Rule
): false | CSSStyleSheet | CSSMediaRule | CSSKeyframesRule | CSSRule;
indexOf(cssRule: CSSRule): number;

@@ -83,0 +88,0 @@ getRules(): CSSRuleList | void;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc