mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
8
web/node_modules/jss-plugin-global/LICENSE
generated
vendored
Normal file
8
web/node_modules/jss-plugin-global/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
The MIT License (MIT)
|
||||
Copyright (c) 2014-present Oleg Isonen (Slobodskoi) & contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2418
web/node_modules/jss-plugin-global/dist/jss-plugin-global.bundle.js
generated
vendored
Normal file
2418
web/node_modules/jss-plugin-global/dist/jss-plugin-global.bundle.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
193
web/node_modules/jss-plugin-global/dist/jss-plugin-global.cjs.js
generated
vendored
Normal file
193
web/node_modules/jss-plugin-global/dist/jss-plugin-global.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,193 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var _extends = require('@babel/runtime/helpers/extends');
|
||||
var jss = require('jss');
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
||||
|
||||
var at = '@global';
|
||||
var atPrefix = '@global ';
|
||||
|
||||
var GlobalContainerRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalContainerRule(key, styles, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.rules = void 0;
|
||||
this.options = void 0;
|
||||
this.key = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
this.rules = new jss.RuleList(_extends__default['default']({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
|
||||
for (var selector in styles) {
|
||||
this.rules.add(selector, styles[selector]);
|
||||
}
|
||||
|
||||
this.rules.process();
|
||||
}
|
||||
/**
|
||||
* Get a rule.
|
||||
*/
|
||||
|
||||
|
||||
var _proto = GlobalContainerRule.prototype;
|
||||
|
||||
_proto.getRule = function getRule(name) {
|
||||
return this.rules.get(name);
|
||||
}
|
||||
/**
|
||||
* Create and register rule, run plugins.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.addRule = function addRule(name, style, options) {
|
||||
var rule = this.rules.add(name, style, options);
|
||||
if (rule) this.options.jss.plugins.onProcessRule(rule);
|
||||
return rule;
|
||||
}
|
||||
/**
|
||||
* Get index of a rule.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.indexOf = function indexOf(rule) {
|
||||
return this.rules.indexOf(rule);
|
||||
}
|
||||
/**
|
||||
* Generates a CSS string.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.toString = function toString() {
|
||||
return this.rules.toString();
|
||||
};
|
||||
|
||||
return GlobalContainerRule;
|
||||
}();
|
||||
|
||||
var GlobalPrefixedRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalPrefixedRule(key, style, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.options = void 0;
|
||||
this.rule = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = void 0;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
var selector = key.substr(atPrefix.length);
|
||||
this.rule = options.jss.createRule(selector, style, _extends__default['default']({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
}
|
||||
|
||||
var _proto2 = GlobalPrefixedRule.prototype;
|
||||
|
||||
_proto2.toString = function toString(options) {
|
||||
return this.rule ? this.rule.toString(options) : '';
|
||||
};
|
||||
|
||||
return GlobalPrefixedRule;
|
||||
}();
|
||||
|
||||
var separatorRegExp = /\s*,\s*/g;
|
||||
|
||||
function addScope(selector, scope) {
|
||||
var parts = selector.split(separatorRegExp);
|
||||
var scoped = '';
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
scoped += scope + " " + parts[i].trim();
|
||||
if (parts[i + 1]) scoped += ', ';
|
||||
}
|
||||
|
||||
return scoped;
|
||||
}
|
||||
|
||||
function handleNestedGlobalContainerRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
var rules = style ? style[at] : null;
|
||||
if (!rules) return;
|
||||
|
||||
for (var name in rules) {
|
||||
sheet.addRule(name, rules[name], _extends__default['default']({}, options, {
|
||||
selector: addScope(name, rule.selector)
|
||||
}));
|
||||
}
|
||||
|
||||
delete style[at];
|
||||
}
|
||||
|
||||
function handlePrefixedGlobalRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
|
||||
for (var prop in style) {
|
||||
if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
|
||||
var selector = addScope(prop.substr(at.length), rule.selector);
|
||||
sheet.addRule(selector, style[prop], _extends__default['default']({}, options, {
|
||||
selector: selector
|
||||
}));
|
||||
delete style[prop];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Convert nested rules to separate, remove them from original styles.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
* @api public
|
||||
*/
|
||||
|
||||
|
||||
function jssGlobal() {
|
||||
function onCreateRule(name, styles, options) {
|
||||
if (!name) return null;
|
||||
|
||||
if (name === at) {
|
||||
return new GlobalContainerRule(name, styles, options);
|
||||
}
|
||||
|
||||
if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
|
||||
return new GlobalPrefixedRule(name, styles, options);
|
||||
}
|
||||
|
||||
var parent = options.parent;
|
||||
|
||||
if (parent) {
|
||||
if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {
|
||||
options.scoped = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.scoped === false) {
|
||||
options.selector = name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onProcessRule(rule, sheet) {
|
||||
if (rule.type !== 'style' || !sheet) return;
|
||||
handleNestedGlobalContainerRule(rule, sheet);
|
||||
handlePrefixedGlobalRule(rule, sheet);
|
||||
}
|
||||
|
||||
return {
|
||||
onCreateRule: onCreateRule,
|
||||
onProcessRule: onProcessRule
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = jssGlobal;
|
3
web/node_modules/jss-plugin-global/dist/jss-plugin-global.cjs.js.flow
generated
vendored
Normal file
3
web/node_modules/jss-plugin-global/dist/jss-plugin-global.cjs.js.flow
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
// @flow
|
||||
|
||||
export * from '../src';
|
185
web/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js
generated
vendored
Normal file
185
web/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js
generated
vendored
Normal file
|
@ -0,0 +1,185 @@
|
|||
import _extends from '@babel/runtime/helpers/esm/extends';
|
||||
import { RuleList } from 'jss';
|
||||
|
||||
var at = '@global';
|
||||
var atPrefix = '@global ';
|
||||
|
||||
var GlobalContainerRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalContainerRule(key, styles, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.rules = void 0;
|
||||
this.options = void 0;
|
||||
this.key = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
this.rules = new RuleList(_extends({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
|
||||
for (var selector in styles) {
|
||||
this.rules.add(selector, styles[selector]);
|
||||
}
|
||||
|
||||
this.rules.process();
|
||||
}
|
||||
/**
|
||||
* Get a rule.
|
||||
*/
|
||||
|
||||
|
||||
var _proto = GlobalContainerRule.prototype;
|
||||
|
||||
_proto.getRule = function getRule(name) {
|
||||
return this.rules.get(name);
|
||||
}
|
||||
/**
|
||||
* Create and register rule, run plugins.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.addRule = function addRule(name, style, options) {
|
||||
var rule = this.rules.add(name, style, options);
|
||||
if (rule) this.options.jss.plugins.onProcessRule(rule);
|
||||
return rule;
|
||||
}
|
||||
/**
|
||||
* Get index of a rule.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.indexOf = function indexOf(rule) {
|
||||
return this.rules.indexOf(rule);
|
||||
}
|
||||
/**
|
||||
* Generates a CSS string.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.toString = function toString() {
|
||||
return this.rules.toString();
|
||||
};
|
||||
|
||||
return GlobalContainerRule;
|
||||
}();
|
||||
|
||||
var GlobalPrefixedRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalPrefixedRule(key, style, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.options = void 0;
|
||||
this.rule = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = void 0;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
var selector = key.substr(atPrefix.length);
|
||||
this.rule = options.jss.createRule(selector, style, _extends({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
}
|
||||
|
||||
var _proto2 = GlobalPrefixedRule.prototype;
|
||||
|
||||
_proto2.toString = function toString(options) {
|
||||
return this.rule ? this.rule.toString(options) : '';
|
||||
};
|
||||
|
||||
return GlobalPrefixedRule;
|
||||
}();
|
||||
|
||||
var separatorRegExp = /\s*,\s*/g;
|
||||
|
||||
function addScope(selector, scope) {
|
||||
var parts = selector.split(separatorRegExp);
|
||||
var scoped = '';
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
scoped += scope + " " + parts[i].trim();
|
||||
if (parts[i + 1]) scoped += ', ';
|
||||
}
|
||||
|
||||
return scoped;
|
||||
}
|
||||
|
||||
function handleNestedGlobalContainerRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
var rules = style ? style[at] : null;
|
||||
if (!rules) return;
|
||||
|
||||
for (var name in rules) {
|
||||
sheet.addRule(name, rules[name], _extends({}, options, {
|
||||
selector: addScope(name, rule.selector)
|
||||
}));
|
||||
}
|
||||
|
||||
delete style[at];
|
||||
}
|
||||
|
||||
function handlePrefixedGlobalRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
|
||||
for (var prop in style) {
|
||||
if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
|
||||
var selector = addScope(prop.substr(at.length), rule.selector);
|
||||
sheet.addRule(selector, style[prop], _extends({}, options, {
|
||||
selector: selector
|
||||
}));
|
||||
delete style[prop];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Convert nested rules to separate, remove them from original styles.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
* @api public
|
||||
*/
|
||||
|
||||
|
||||
function jssGlobal() {
|
||||
function onCreateRule(name, styles, options) {
|
||||
if (!name) return null;
|
||||
|
||||
if (name === at) {
|
||||
return new GlobalContainerRule(name, styles, options);
|
||||
}
|
||||
|
||||
if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
|
||||
return new GlobalPrefixedRule(name, styles, options);
|
||||
}
|
||||
|
||||
var parent = options.parent;
|
||||
|
||||
if (parent) {
|
||||
if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {
|
||||
options.scoped = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.scoped === false) {
|
||||
options.selector = name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onProcessRule(rule, sheet) {
|
||||
if (rule.type !== 'style' || !sheet) return;
|
||||
handleNestedGlobalContainerRule(rule, sheet);
|
||||
handlePrefixedGlobalRule(rule, sheet);
|
||||
}
|
||||
|
||||
return {
|
||||
onCreateRule: onCreateRule,
|
||||
onProcessRule: onProcessRule
|
||||
};
|
||||
}
|
||||
|
||||
export default jssGlobal;
|
211
web/node_modules/jss-plugin-global/dist/jss-plugin-global.js
generated
vendored
Normal file
211
web/node_modules/jss-plugin-global/dist/jss-plugin-global.js
generated
vendored
Normal file
|
@ -0,0 +1,211 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jss')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'jss'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jssPluginGlobal = {}, global.jss));
|
||||
}(this, (function (exports, jss) { 'use strict';
|
||||
|
||||
function _extends() {
|
||||
_extends = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
|
||||
var at = '@global';
|
||||
var atPrefix = '@global ';
|
||||
|
||||
var GlobalContainerRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalContainerRule(key, styles, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.rules = void 0;
|
||||
this.options = void 0;
|
||||
this.key = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
this.rules = new jss.RuleList(_extends({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
|
||||
for (var selector in styles) {
|
||||
this.rules.add(selector, styles[selector]);
|
||||
}
|
||||
|
||||
this.rules.process();
|
||||
}
|
||||
/**
|
||||
* Get a rule.
|
||||
*/
|
||||
|
||||
|
||||
var _proto = GlobalContainerRule.prototype;
|
||||
|
||||
_proto.getRule = function getRule(name) {
|
||||
return this.rules.get(name);
|
||||
}
|
||||
/**
|
||||
* Create and register rule, run plugins.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.addRule = function addRule(name, style, options) {
|
||||
var rule = this.rules.add(name, style, options);
|
||||
if (rule) this.options.jss.plugins.onProcessRule(rule);
|
||||
return rule;
|
||||
}
|
||||
/**
|
||||
* Get index of a rule.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.indexOf = function indexOf(rule) {
|
||||
return this.rules.indexOf(rule);
|
||||
}
|
||||
/**
|
||||
* Generates a CSS string.
|
||||
*/
|
||||
;
|
||||
|
||||
_proto.toString = function toString() {
|
||||
return this.rules.toString();
|
||||
};
|
||||
|
||||
return GlobalContainerRule;
|
||||
}();
|
||||
|
||||
var GlobalPrefixedRule =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function GlobalPrefixedRule(key, style, options) {
|
||||
this.type = 'global';
|
||||
this.at = at;
|
||||
this.options = void 0;
|
||||
this.rule = void 0;
|
||||
this.isProcessed = false;
|
||||
this.key = void 0;
|
||||
this.key = key;
|
||||
this.options = options;
|
||||
var selector = key.substr(atPrefix.length);
|
||||
this.rule = options.jss.createRule(selector, style, _extends({}, options, {
|
||||
parent: this
|
||||
}));
|
||||
}
|
||||
|
||||
var _proto2 = GlobalPrefixedRule.prototype;
|
||||
|
||||
_proto2.toString = function toString(options) {
|
||||
return this.rule ? this.rule.toString(options) : '';
|
||||
};
|
||||
|
||||
return GlobalPrefixedRule;
|
||||
}();
|
||||
|
||||
var separatorRegExp = /\s*,\s*/g;
|
||||
|
||||
function addScope(selector, scope) {
|
||||
var parts = selector.split(separatorRegExp);
|
||||
var scoped = '';
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
scoped += scope + " " + parts[i].trim();
|
||||
if (parts[i + 1]) scoped += ', ';
|
||||
}
|
||||
|
||||
return scoped;
|
||||
}
|
||||
|
||||
function handleNestedGlobalContainerRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
var rules = style ? style[at] : null;
|
||||
if (!rules) return;
|
||||
|
||||
for (var name in rules) {
|
||||
sheet.addRule(name, rules[name], _extends({}, options, {
|
||||
selector: addScope(name, rule.selector)
|
||||
}));
|
||||
}
|
||||
|
||||
delete style[at];
|
||||
}
|
||||
|
||||
function handlePrefixedGlobalRule(rule, sheet) {
|
||||
var options = rule.options,
|
||||
style = rule.style;
|
||||
|
||||
for (var prop in style) {
|
||||
if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
|
||||
var selector = addScope(prop.substr(at.length), rule.selector);
|
||||
sheet.addRule(selector, style[prop], _extends({}, options, {
|
||||
selector: selector
|
||||
}));
|
||||
delete style[prop];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Convert nested rules to separate, remove them from original styles.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
* @api public
|
||||
*/
|
||||
|
||||
|
||||
function jssGlobal() {
|
||||
function onCreateRule(name, styles, options) {
|
||||
if (!name) return null;
|
||||
|
||||
if (name === at) {
|
||||
return new GlobalContainerRule(name, styles, options);
|
||||
}
|
||||
|
||||
if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
|
||||
return new GlobalPrefixedRule(name, styles, options);
|
||||
}
|
||||
|
||||
var parent = options.parent;
|
||||
|
||||
if (parent) {
|
||||
if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {
|
||||
options.scoped = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.scoped === false) {
|
||||
options.selector = name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onProcessRule(rule, sheet) {
|
||||
if (rule.type !== 'style' || !sheet) return;
|
||||
handleNestedGlobalContainerRule(rule, sheet);
|
||||
handlePrefixedGlobalRule(rule, sheet);
|
||||
}
|
||||
|
||||
return {
|
||||
onCreateRule: onCreateRule,
|
||||
onProcessRule: onProcessRule
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = jssGlobal;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=jss-plugin-global.js.map
|
1
web/node_modules/jss-plugin-global/dist/jss-plugin-global.js.map
generated
vendored
Normal file
1
web/node_modules/jss-plugin-global/dist/jss-plugin-global.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/node_modules/jss-plugin-global/dist/jss-plugin-global.min.js
generated
vendored
Normal file
1
web/node_modules/jss-plugin-global/dist/jss-plugin-global.min.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jss")):"function"==typeof define&&define.amd?define(["exports","jss"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jssPluginGlobal={},t.jss)}(this,(function(t,e){"use strict";function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t}).apply(this,arguments)}var n="@global",r="@global ",i=function(){function t(t,r,i){for(var o in this.type="global",this.at=n,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=t,this.options=i,this.rules=new e.RuleList(s({},i,{parent:this})),r)this.rules.add(o,r[o]);this.rules.process()}var r=t.prototype;return r.getRule=function(t){return this.rules.get(t)},r.addRule=function(t,e,s){var n=this.rules.add(t,e,s);return n&&this.options.jss.plugins.onProcessRule(n),n},r.indexOf=function(t){return this.rules.indexOf(t)},r.toString=function(){return this.rules.toString()},t}(),o=function(){function t(t,e,i){this.type="global",this.at=n,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=t,this.options=i;var o=t.substr(r.length);this.rule=i.jss.createRule(o,e,s({},i,{parent:this}))}return t.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},t}(),u=/\s*,\s*/g;function l(t,e){for(var s=t.split(u),n="",r=0;r<s.length;r++)n+=e+" "+s[r].trim(),s[r+1]&&(n+=", ");return n}t.default=function(){return{onCreateRule:function(t,e,s){if(!t)return null;if(t===n)return new i(t,e,s);if("@"===t[0]&&t.substr(0,r.length)===r)return new o(t,e,s);var u=s.parent;return u&&("global"===u.type||u.options.parent&&"global"===u.options.parent.type)&&(s.scoped=!1),!1===s.scoped&&(s.selector=t),null},onProcessRule:function(t,e){"style"===t.type&&e&&(function(t,e){var r=t.options,i=t.style,o=i?i[n]:null;if(o){for(var u in o)e.addRule(u,o[u],s({},r,{selector:l(u,t.selector)}));delete i[n]}}(t,e),function(t,e){var r=t.options,i=t.style;for(var o in i)if("@"===o[0]&&o.substr(0,n.length)===n){var u=l(o.substr(n.length),t.selector);e.addRule(u,i[o],s({},r,{selector:u})),delete i[o]}}(t,e))}}},Object.defineProperty(t,"__esModule",{value:!0})}));
|
46
web/node_modules/jss-plugin-global/package.json
generated
vendored
Normal file
46
web/node_modules/jss-plugin-global/package.json
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "jss-plugin-global",
|
||||
"description": "Global styles for JSS",
|
||||
"version": "10.7.1",
|
||||
"license": "MIT",
|
||||
"homepage": "https://cssinjs.org/jss-global",
|
||||
"main": "dist/jss-plugin-global.cjs.js",
|
||||
"module": "dist/jss-plugin-global.esm.js",
|
||||
"unpkg": "dist/jss-plugin-global.bundle.js",
|
||||
"sideEffects": false,
|
||||
"typings": "./src/index.d.ts",
|
||||
"author": "JSS Team",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cssinjs/jss"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssinjs/jss/issues/new?title=[jss-plugin-global]"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"!*.test.*"
|
||||
],
|
||||
"keywords": [
|
||||
"cssinjs",
|
||||
"css-in-js",
|
||||
"css in js",
|
||||
"jss",
|
||||
"plugin",
|
||||
"global",
|
||||
"unscoped"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "node ../../scripts/build.js",
|
||||
"check-snapshot": "node ../../scripts/match-snapshot.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jss-plugin-nested": "10.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"jss": "10.7.1"
|
||||
},
|
||||
"gitHead": "2b54776c03d97a3bccbbcb28b63508f74103ebbc"
|
||||
}
|
25
web/node_modules/jss-plugin-global/readme.md
generated
vendored
Normal file
25
web/node_modules/jss-plugin-global/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
# jss-plugin-global
|
||||
|
||||
[](https://npmjs.org/package/jss-plugin-global)
|
||||
[](https://github.com/cssinjs/jss/blob/master/LICENSE)
|
||||
[](https://npmjs.org/package/jss-plugin-global)
|
||||
[](https://npmjs.org/package/jss-plugin-global)
|
||||
[](https://npmjs.org/package/jss-plugin-global)
|
||||
|
||||
> Global styles for JSS
|
||||
|
||||
See our website [jss-plugin-global](https://cssinjs.org/jss-plugin-global?v=v10.7.1) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install jss-plugin-global
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add jss-plugin-global
|
||||
```
|
3
web/node_modules/jss-plugin-global/src/index.d.ts
generated
vendored
Normal file
3
web/node_modules/jss-plugin-global/src/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import {Plugin} from 'jss'
|
||||
|
||||
export default function jssPluginSyntaxGlobal(): Plugin
|
187
web/node_modules/jss-plugin-global/src/index.js
generated
vendored
Normal file
187
web/node_modules/jss-plugin-global/src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,187 @@
|
|||
// @flow
|
||||
import {
|
||||
RuleList,
|
||||
type Plugin,
|
||||
type RuleOptions,
|
||||
type ContainerRule,
|
||||
type StyleRule,
|
||||
type BaseRule
|
||||
} from 'jss'
|
||||
|
||||
const at = '@global'
|
||||
const atPrefix = '@global '
|
||||
|
||||
class GlobalContainerRule implements ContainerRule {
|
||||
type = 'global'
|
||||
|
||||
at: string = at
|
||||
|
||||
rules: RuleList
|
||||
|
||||
options: RuleOptions
|
||||
|
||||
key: string
|
||||
|
||||
isProcessed: boolean = false
|
||||
|
||||
constructor(key, styles, options: RuleOptions) {
|
||||
this.key = key
|
||||
this.options = options
|
||||
this.rules = new RuleList({
|
||||
...options,
|
||||
parent: this
|
||||
})
|
||||
|
||||
for (const selector in styles) {
|
||||
this.rules.add(selector, styles[selector])
|
||||
}
|
||||
|
||||
this.rules.process()
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a rule.
|
||||
*/
|
||||
getRule(name) {
|
||||
return this.rules.get(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and register rule, run plugins.
|
||||
*/
|
||||
addRule(name, style, options) {
|
||||
const rule = this.rules.add(name, style, options)
|
||||
if (rule) this.options.jss.plugins.onProcessRule(rule)
|
||||
return rule
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index of a rule.
|
||||
*/
|
||||
indexOf(rule) {
|
||||
return this.rules.indexOf(rule)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a CSS string.
|
||||
*/
|
||||
toString() {
|
||||
return this.rules.toString()
|
||||
}
|
||||
}
|
||||
|
||||
class GlobalPrefixedRule implements BaseRule {
|
||||
type = 'global'
|
||||
|
||||
at: string = at
|
||||
|
||||
options: RuleOptions
|
||||
|
||||
rule: BaseRule | null
|
||||
|
||||
isProcessed: boolean = false
|
||||
|
||||
key: string
|
||||
|
||||
constructor(key, style, options) {
|
||||
this.key = key
|
||||
this.options = options
|
||||
const selector = key.substr(atPrefix.length)
|
||||
this.rule = options.jss.createRule(selector, style, {
|
||||
...options,
|
||||
parent: this
|
||||
})
|
||||
}
|
||||
|
||||
toString(options) {
|
||||
return this.rule ? this.rule.toString(options) : ''
|
||||
}
|
||||
}
|
||||
|
||||
const separatorRegExp = /\s*,\s*/g
|
||||
|
||||
function addScope(selector, scope) {
|
||||
const parts = selector.split(separatorRegExp)
|
||||
let scoped = ''
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
scoped += `${scope} ${parts[i].trim()}`
|
||||
if (parts[i + 1]) scoped += ', '
|
||||
}
|
||||
return scoped
|
||||
}
|
||||
|
||||
function handleNestedGlobalContainerRule(rule, sheet) {
|
||||
const {options, style} = rule
|
||||
const rules = style ? style[at] : null
|
||||
|
||||
if (!rules) return
|
||||
|
||||
for (const name in rules) {
|
||||
sheet.addRule(name, rules[name], {
|
||||
...options,
|
||||
selector: addScope(name, rule.selector)
|
||||
})
|
||||
}
|
||||
|
||||
delete style[at]
|
||||
}
|
||||
|
||||
function handlePrefixedGlobalRule(rule, sheet) {
|
||||
const {options, style} = rule
|
||||
for (const prop in style) {
|
||||
if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue
|
||||
|
||||
const selector = addScope(prop.substr(at.length), rule.selector)
|
||||
sheet.addRule(selector, style[prop], {
|
||||
...options,
|
||||
selector
|
||||
})
|
||||
delete style[prop]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert nested rules to separate, remove them from original styles.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
* @api public
|
||||
*/
|
||||
export default function jssGlobal(): Plugin {
|
||||
function onCreateRule(name, styles, options) {
|
||||
if (!name) return null
|
||||
|
||||
if (name === at) {
|
||||
return new GlobalContainerRule(name, styles, options)
|
||||
}
|
||||
|
||||
if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
|
||||
return new GlobalPrefixedRule(name, styles, options)
|
||||
}
|
||||
|
||||
const {parent} = options
|
||||
|
||||
if (parent) {
|
||||
if (
|
||||
parent.type === 'global' ||
|
||||
(parent.options.parent && parent.options.parent.type === 'global')
|
||||
) {
|
||||
options.scoped = false
|
||||
}
|
||||
}
|
||||
|
||||
if (options.scoped === false) {
|
||||
options.selector = name
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function onProcessRule(rule, sheet) {
|
||||
if (rule.type !== 'style' || !sheet) return
|
||||
|
||||
handleNestedGlobalContainerRule(((rule: any): StyleRule), sheet)
|
||||
handlePrefixedGlobalRule(((rule: any): StyleRule), sheet)
|
||||
}
|
||||
|
||||
return {onCreateRule, onProcessRule}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue