Security upgrades
This commit is contained in:
2258
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.bundle.js
generated
vendored
Normal file
2258
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.bundle.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
71
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.cjs.js
generated
vendored
Normal file
71
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.cjs.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var warning = _interopDefault(require('tiny-warning'));
|
||||
var jss = require('jss');
|
||||
|
||||
var now = Date.now();
|
||||
var fnValuesNs = "fnValues" + now;
|
||||
var fnRuleNs = "fnStyle" + ++now;
|
||||
function functionPlugin() {
|
||||
return {
|
||||
onCreateRule: function onCreateRule(name, decl, options) {
|
||||
if (typeof decl !== 'function') return null;
|
||||
var rule = jss.createRule(name, {}, options);
|
||||
rule[fnRuleNs] = decl;
|
||||
return rule;
|
||||
},
|
||||
onProcessStyle: function onProcessStyle(style, rule) {
|
||||
// We need to extract function values from the declaration, so that we can keep core unaware of them.
|
||||
// We need to do that only once.
|
||||
// We don't need to extract functions on each style update, since this can happen only once.
|
||||
// We don't support function values inside of function rules.
|
||||
if (fnValuesNs in rule || fnRuleNs in rule) return style;
|
||||
var fnValues = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var value = style[prop];
|
||||
if (typeof value !== 'function') continue;
|
||||
delete style[prop];
|
||||
fnValues[prop] = value;
|
||||
} // $FlowFixMe
|
||||
|
||||
|
||||
rule[fnValuesNs] = fnValues;
|
||||
return style;
|
||||
},
|
||||
onUpdate: function onUpdate(data, rule, sheet, options) {
|
||||
var styleRule = rule;
|
||||
var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
|
||||
// will be returned from that function.
|
||||
|
||||
if (fnRule) {
|
||||
// Empty object will remove all currently defined props
|
||||
// in case function rule returns a falsy value.
|
||||
styleRule.style = fnRule(data) || {};
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
for (var prop in styleRule.style) {
|
||||
if (typeof styleRule.style[prop] === 'function') {
|
||||
process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
|
||||
|
||||
if (fnValues) {
|
||||
for (var _prop in fnValues) {
|
||||
styleRule.prop(_prop, fnValues[_prop](data), options);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = functionPlugin;
|
||||
3
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.cjs.js.flow
generated
vendored
Normal file
3
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.cjs.js.flow
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../src';
|
||||
65
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js
generated
vendored
Normal file
65
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import warning from 'tiny-warning';
|
||||
import { createRule } from 'jss';
|
||||
|
||||
var now = Date.now();
|
||||
var fnValuesNs = "fnValues" + now;
|
||||
var fnRuleNs = "fnStyle" + ++now;
|
||||
function functionPlugin() {
|
||||
return {
|
||||
onCreateRule: function onCreateRule(name, decl, options) {
|
||||
if (typeof decl !== 'function') return null;
|
||||
var rule = createRule(name, {}, options);
|
||||
rule[fnRuleNs] = decl;
|
||||
return rule;
|
||||
},
|
||||
onProcessStyle: function onProcessStyle(style, rule) {
|
||||
// We need to extract function values from the declaration, so that we can keep core unaware of them.
|
||||
// We need to do that only once.
|
||||
// We don't need to extract functions on each style update, since this can happen only once.
|
||||
// We don't support function values inside of function rules.
|
||||
if (fnValuesNs in rule || fnRuleNs in rule) return style;
|
||||
var fnValues = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var value = style[prop];
|
||||
if (typeof value !== 'function') continue;
|
||||
delete style[prop];
|
||||
fnValues[prop] = value;
|
||||
} // $FlowFixMe
|
||||
|
||||
|
||||
rule[fnValuesNs] = fnValues;
|
||||
return style;
|
||||
},
|
||||
onUpdate: function onUpdate(data, rule, sheet, options) {
|
||||
var styleRule = rule;
|
||||
var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
|
||||
// will be returned from that function.
|
||||
|
||||
if (fnRule) {
|
||||
// Empty object will remove all currently defined props
|
||||
// in case function rule returns a falsy value.
|
||||
styleRule.style = fnRule(data) || {};
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
for (var prop in styleRule.style) {
|
||||
if (typeof styleRule.style[prop] === 'function') {
|
||||
process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
|
||||
|
||||
if (fnValues) {
|
||||
for (var _prop in fnValues) {
|
||||
styleRule.prop(_prop, fnValues[_prop](data), options);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default functionPlugin;
|
||||
91
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.js
generated
vendored
Normal file
91
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jss')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'jss'], factory) :
|
||||
(global = global || self, factory(global.jssPluginRuleValueFunction = {}, global.jss));
|
||||
}(this, (function (exports, jss) { 'use strict';
|
||||
|
||||
function warning(condition, message) {
|
||||
{
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
|
||||
var text = "Warning: " + message;
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(text);
|
||||
}
|
||||
|
||||
try {
|
||||
throw Error(text);
|
||||
} catch (x) {}
|
||||
}
|
||||
}
|
||||
|
||||
var now = Date.now();
|
||||
var fnValuesNs = "fnValues" + now;
|
||||
var fnRuleNs = "fnStyle" + ++now;
|
||||
function functionPlugin() {
|
||||
return {
|
||||
onCreateRule: function onCreateRule(name, decl, options) {
|
||||
if (typeof decl !== 'function') return null;
|
||||
var rule = jss.createRule(name, {}, options);
|
||||
rule[fnRuleNs] = decl;
|
||||
return rule;
|
||||
},
|
||||
onProcessStyle: function onProcessStyle(style, rule) {
|
||||
// We need to extract function values from the declaration, so that we can keep core unaware of them.
|
||||
// We need to do that only once.
|
||||
// We don't need to extract functions on each style update, since this can happen only once.
|
||||
// We don't support function values inside of function rules.
|
||||
if (fnValuesNs in rule || fnRuleNs in rule) return style;
|
||||
var fnValues = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var value = style[prop];
|
||||
if (typeof value !== 'function') continue;
|
||||
delete style[prop];
|
||||
fnValues[prop] = value;
|
||||
} // $FlowFixMe
|
||||
|
||||
|
||||
rule[fnValuesNs] = fnValues;
|
||||
return style;
|
||||
},
|
||||
onUpdate: function onUpdate(data, rule, sheet, options) {
|
||||
var styleRule = rule;
|
||||
var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
|
||||
// will be returned from that function.
|
||||
|
||||
if (fnRule) {
|
||||
// Empty object will remove all currently defined props
|
||||
// in case function rule returns a falsy value.
|
||||
styleRule.style = fnRule(data) || {};
|
||||
|
||||
{
|
||||
for (var prop in styleRule.style) {
|
||||
if (typeof styleRule.style[prop] === 'function') {
|
||||
warning(false, '[JSS] Function values inside function rules are not supported.') ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
|
||||
|
||||
if (fnValues) {
|
||||
for (var _prop in fnValues) {
|
||||
styleRule.prop(_prop, fnValues[_prop](data), options);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = functionPlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=jss-plugin-rule-value-function.js.map
|
||||
1
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.js.map
generated
vendored
Normal file
1
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.min.js
generated
vendored
Normal file
1
node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jss")):"function"==typeof define&&define.amd?define(["exports","jss"],n):n((e=e||self).jssPluginRuleValueFunction={},e.jss)}(this,function(e,n){"use strict";var t=Date.now(),r="fnValues"+t,o="fnStyle"+ ++t;e.default=function(){return{onCreateRule:function(e,t,r){if("function"!=typeof t)return null;var u=n.createRule(e,{},r);return u[o]=t,u},onProcessStyle:function(e,n){if(r in n||o in n)return e;var t={};for(var u in e){var f=e[u];"function"==typeof f&&(delete e[u],t[u]=f)}return n[r]=t,e},onUpdate:function(e,n,t,u){var f=n,i=f[o];i&&(f.style=i(e)||{});var s=f[r];if(s)for(var a in s)f.prop(a,s[a](e),u)}}},Object.defineProperty(e,"__esModule",{value:!0})});
|
||||
Reference in New Issue
Block a user