Security upgrades
This commit is contained in:
8
node_modules/jss-plugin-camel-case/LICENSE
generated
vendored
Normal file
8
node_modules/jss-plugin-camel-case/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.
|
||||
80
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.bundle.js
generated
vendored
Normal file
80
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.bundle.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
/* eslint-disable no-var, prefer-template */
|
||||
var uppercasePattern = /[A-Z]/g;
|
||||
var msPattern = /^ms-/;
|
||||
var cache = {};
|
||||
|
||||
function toHyphenLower(match) {
|
||||
return '-' + match.toLowerCase()
|
||||
}
|
||||
|
||||
function hyphenateStyleName(name) {
|
||||
if (cache.hasOwnProperty(name)) {
|
||||
return cache[name]
|
||||
}
|
||||
|
||||
var hName = name.replace(uppercasePattern, toHyphenLower);
|
||||
return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert camel cased property names to dash separated.
|
||||
*
|
||||
* @param {Object} style
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function convertCase(style) {
|
||||
var converted = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var key = prop.indexOf('--') === 0 ? prop : hyphenateStyleName(prop);
|
||||
converted[key] = style[prop];
|
||||
}
|
||||
|
||||
if (style.fallbacks) {
|
||||
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
|
||||
}
|
||||
|
||||
return converted;
|
||||
}
|
||||
/**
|
||||
* Allow camel cased property names by converting them back to dasherized.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
*/
|
||||
|
||||
|
||||
function camelCase() {
|
||||
function onProcessStyle(style) {
|
||||
if (Array.isArray(style)) {
|
||||
// Handle rules like @font-face, which can have multiple styles in an array
|
||||
for (var index = 0; index < style.length; index++) {
|
||||
style[index] = convertCase(style[index]);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
return convertCase(style);
|
||||
}
|
||||
|
||||
function onChangeValue(value, prop, rule) {
|
||||
if (prop.indexOf('--') === 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var hyphenatedProp = hyphenateStyleName(prop); // There was no camel case in place
|
||||
|
||||
if (prop === hyphenatedProp) return value;
|
||||
rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
onProcessStyle: onProcessStyle,
|
||||
onChangeValue: onChangeValue
|
||||
};
|
||||
}
|
||||
|
||||
export default camelCase;
|
||||
70
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js
generated
vendored
Normal file
70
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var hyphenate = _interopDefault(require('hyphenate-style-name'));
|
||||
|
||||
/**
|
||||
* Convert camel cased property names to dash separated.
|
||||
*
|
||||
* @param {Object} style
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function convertCase(style) {
|
||||
var converted = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);
|
||||
converted[key] = style[prop];
|
||||
}
|
||||
|
||||
if (style.fallbacks) {
|
||||
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
|
||||
}
|
||||
|
||||
return converted;
|
||||
}
|
||||
/**
|
||||
* Allow camel cased property names by converting them back to dasherized.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
*/
|
||||
|
||||
|
||||
function camelCase() {
|
||||
function onProcessStyle(style) {
|
||||
if (Array.isArray(style)) {
|
||||
// Handle rules like @font-face, which can have multiple styles in an array
|
||||
for (var index = 0; index < style.length; index++) {
|
||||
style[index] = convertCase(style[index]);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
return convertCase(style);
|
||||
}
|
||||
|
||||
function onChangeValue(value, prop, rule) {
|
||||
if (prop.indexOf('--') === 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var hyphenatedProp = hyphenate(prop); // There was no camel case in place
|
||||
|
||||
if (prop === hyphenatedProp) return value;
|
||||
rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
onProcessStyle: onProcessStyle,
|
||||
onChangeValue: onChangeValue
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = camelCase;
|
||||
3
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js.flow
generated
vendored
Normal file
3
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js.flow
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../src';
|
||||
64
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js
generated
vendored
Normal file
64
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import hyphenate from 'hyphenate-style-name';
|
||||
|
||||
/**
|
||||
* Convert camel cased property names to dash separated.
|
||||
*
|
||||
* @param {Object} style
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function convertCase(style) {
|
||||
var converted = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);
|
||||
converted[key] = style[prop];
|
||||
}
|
||||
|
||||
if (style.fallbacks) {
|
||||
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
|
||||
}
|
||||
|
||||
return converted;
|
||||
}
|
||||
/**
|
||||
* Allow camel cased property names by converting them back to dasherized.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
*/
|
||||
|
||||
|
||||
function camelCase() {
|
||||
function onProcessStyle(style) {
|
||||
if (Array.isArray(style)) {
|
||||
// Handle rules like @font-face, which can have multiple styles in an array
|
||||
for (var index = 0; index < style.length; index++) {
|
||||
style[index] = convertCase(style[index]);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
return convertCase(style);
|
||||
}
|
||||
|
||||
function onChangeValue(value, prop, rule) {
|
||||
if (prop.indexOf('--') === 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var hyphenatedProp = hyphenate(prop); // There was no camel case in place
|
||||
|
||||
if (prop === hyphenatedProp) return value;
|
||||
rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
onProcessStyle: onProcessStyle,
|
||||
onChangeValue: onChangeValue
|
||||
};
|
||||
}
|
||||
|
||||
export default camelCase;
|
||||
91
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js
generated
vendored
Normal file
91
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.jssPluginCamelCase = {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/* eslint-disable no-var, prefer-template */
|
||||
var uppercasePattern = /[A-Z]/g;
|
||||
var msPattern = /^ms-/;
|
||||
var cache = {};
|
||||
|
||||
function toHyphenLower(match) {
|
||||
return '-' + match.toLowerCase()
|
||||
}
|
||||
|
||||
function hyphenateStyleName(name) {
|
||||
if (cache.hasOwnProperty(name)) {
|
||||
return cache[name]
|
||||
}
|
||||
|
||||
var hName = name.replace(uppercasePattern, toHyphenLower);
|
||||
return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert camel cased property names to dash separated.
|
||||
*
|
||||
* @param {Object} style
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function convertCase(style) {
|
||||
var converted = {};
|
||||
|
||||
for (var prop in style) {
|
||||
var key = prop.indexOf('--') === 0 ? prop : hyphenateStyleName(prop);
|
||||
converted[key] = style[prop];
|
||||
}
|
||||
|
||||
if (style.fallbacks) {
|
||||
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
|
||||
}
|
||||
|
||||
return converted;
|
||||
}
|
||||
/**
|
||||
* Allow camel cased property names by converting them back to dasherized.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
*/
|
||||
|
||||
|
||||
function camelCase() {
|
||||
function onProcessStyle(style) {
|
||||
if (Array.isArray(style)) {
|
||||
// Handle rules like @font-face, which can have multiple styles in an array
|
||||
for (var index = 0; index < style.length; index++) {
|
||||
style[index] = convertCase(style[index]);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
return convertCase(style);
|
||||
}
|
||||
|
||||
function onChangeValue(value, prop, rule) {
|
||||
if (prop.indexOf('--') === 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var hyphenatedProp = hyphenateStyleName(prop); // There was no camel case in place
|
||||
|
||||
if (prop === hyphenatedProp) return value;
|
||||
rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
onProcessStyle: onProcessStyle,
|
||||
onChangeValue: onChangeValue
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = camelCase;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=jss-plugin-camel-case.js.map
|
||||
1
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js.map
generated
vendored
Normal file
1
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"jss-plugin-camel-case.js","sources":["../../../node_modules/hyphenate-style-name/index.js","../src/index.js"],"sourcesContent":["/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","// @flow\nimport type {Plugin} from 'jss'\nimport hyphenate from 'hyphenate-style-name'\n\n/**\n * Convert camel cased property names to dash separated.\n *\n * @param {Object} style\n * @return {Object}\n */\nfunction convertCase(style) {\n const converted = {}\n\n for (const prop in style) {\n const key = prop.indexOf('--') === 0 ? prop : hyphenate(prop)\n\n converted[key] = style[prop]\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase)\n else converted.fallbacks = convertCase(style.fallbacks)\n }\n\n return converted\n}\n\n/**\n * Allow camel cased property names by converting them back to dasherized.\n *\n * @param {Rule} rule\n */\nexport default function camelCase(): Plugin {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (let index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index])\n }\n return style\n }\n\n return convertCase(style)\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value\n }\n\n const hyphenatedProp = hyphenate(prop)\n\n // There was no camel case in place\n if (prop === hyphenatedProp) return value\n\n rule.prop(hyphenatedProp, value)\n\n // Core will ignore that property value we set the proper one above.\n return null\n }\n\n return {onProcessStyle, onChangeValue}\n}\n"],"names":["convertCase","style","converted","prop","key","indexOf","hyphenate","fallbacks","Array","isArray","map","camelCase","onProcessStyle","index","length","onChangeValue","value","rule","hyphenatedProp"],"mappings":";;;;;;EAAA;EACA,IAAI,gBAAgB,GAAG,SAAQ;EAC/B,IAAI,SAAS,GAAG,OAAM;EACtB,IAAI,KAAK,GAAG,GAAE;AACd;EACA,SAAS,aAAa,CAAC,KAAK,EAAE;EAC9B,EAAE,OAAO,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE;EAClC,CAAC;AACD;EACA,SAAS,kBAAkB,CAAC,IAAI,EAAE;EAClC,EAAE,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;EAClC,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC;EACtB,GAAG;AACH;EACA,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,aAAa,EAAC;EAC3D,EAAE,QAAQ,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,KAAK,CAAC;EACpE;;ECZA;;;;;;;EAMA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;EAC1B,MAAMC,SAAS,GAAG,EAAlB;;EAEA,OAAK,IAAMC,IAAX,IAAmBF,KAAnB,EAA0B;EACxB,QAAMG,GAAG,GAAGD,IAAI,CAACE,OAAL,CAAa,IAAb,MAAuB,CAAvB,GAA2BF,IAA3B,GAAkCG,kBAAS,CAACH,IAAD,CAAvD;EAEAD,IAAAA,SAAS,CAACE,GAAD,CAAT,GAAiBH,KAAK,CAACE,IAAD,CAAtB;EACD;;EAED,MAAIF,KAAK,CAACM,SAAV,EAAqB;EACnB,QAAIC,KAAK,CAACC,OAAN,CAAcR,KAAK,CAACM,SAApB,CAAJ,EAAoCL,SAAS,CAACK,SAAV,GAAsBN,KAAK,CAACM,SAAN,CAAgBG,GAAhB,CAAoBV,WAApB,CAAtB,CAApC,KACKE,SAAS,CAACK,SAAV,GAAsBP,WAAW,CAACC,KAAK,CAACM,SAAP,CAAjC;EACN;;EAED,SAAOL,SAAP;EACD;EAED;;;;;;;AAKA,EAAe,SAASS,SAAT,GAA6B;EAC1C,WAASC,cAAT,CAAwBX,KAAxB,EAA+B;EAC7B,QAAIO,KAAK,CAACC,OAAN,CAAcR,KAAd,CAAJ,EAA0B;EACxB;EACA,WAAK,IAAIY,KAAK,GAAG,CAAjB,EAAoBA,KAAK,GAAGZ,KAAK,CAACa,MAAlC,EAA0CD,KAAK,EAA/C,EAAmD;EACjDZ,QAAAA,KAAK,CAACY,KAAD,CAAL,GAAeb,WAAW,CAACC,KAAK,CAACY,KAAD,CAAN,CAA1B;EACD;;EACD,aAAOZ,KAAP;EACD;;EAED,WAAOD,WAAW,CAACC,KAAD,CAAlB;EACD;;EAED,WAASc,aAAT,CAAuBC,KAAvB,EAA8Bb,IAA9B,EAAoCc,IAApC,EAA0C;EACxC,QAAId,IAAI,CAACE,OAAL,CAAa,IAAb,MAAuB,CAA3B,EAA8B;EAC5B,aAAOW,KAAP;EACD;;EAED,QAAME,cAAc,GAAGZ,kBAAS,CAACH,IAAD,CAAhC,CALwC;;EAQxC,QAAIA,IAAI,KAAKe,cAAb,EAA6B,OAAOF,KAAP;EAE7BC,IAAAA,IAAI,CAACd,IAAL,CAAUe,cAAV,EAA0BF,KAA1B,EAVwC;;EAaxC,WAAO,IAAP;EACD;;EAED,SAAO;EAACJ,IAAAA,cAAc,EAAdA,cAAD;EAAiBG,IAAAA,aAAa,EAAbA;EAAjB,GAAP;EACD;;;;;;;;;;;;"}
|
||||
1
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.min.js
generated
vendored
Normal file
1
node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).jssPluginCamelCase={})}(this,function(e){"use strict";var r=/[A-Z]/g,n=/^ms-/,t={};function a(e){return"-"+e.toLowerCase()}function f(e){if(t.hasOwnProperty(e))return t[e];var f=e.replace(r,a);return t[e]=n.test(f)?"-"+f:f}function o(e){var r={};for(var n in e){r[0===n.indexOf("--")?n:f(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(o):r.fallbacks=o(e.fallbacks)),r}e.default=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]=o(e[r]);return e}return o(e)},onChangeValue:function(e,r,n){if(0===r.indexOf("--"))return e;var t=f(r);return r===t?e:(n.prop(t,e),null)}}},Object.defineProperty(e,"__esModule",{value:!0})});
|
||||
72
node_modules/jss-plugin-camel-case/package.json
generated
vendored
Normal file
72
node_modules/jss-plugin-camel-case/package.json
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_from": "jss-plugin-camel-case@^10.0.3",
|
||||
"_id": "jss-plugin-camel-case@10.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-tadWRi/SLWqLK3EUZEdDNJL71F3ST93Zrl9JYMjV0QDqKPAl0Liue81q7m/nFUpnSTXczbKDy4wq8rI8o7WFqA==",
|
||||
"_location": "/jss-plugin-camel-case",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "jss-plugin-camel-case@^10.0.3",
|
||||
"name": "jss-plugin-camel-case",
|
||||
"escapedName": "jss-plugin-camel-case",
|
||||
"rawSpec": "^10.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^10.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@material-ui/styles"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.3.0.tgz",
|
||||
"_shasum": "ae4da53b39a6e3ea94b70a20fc41c11f0b87386a",
|
||||
"_spec": "jss-plugin-camel-case@^10.0.3",
|
||||
"_where": "D:\\WORK\\Menui\\menui_backend\\node_modules\\@material-ui\\styles",
|
||||
"author": {
|
||||
"name": "JSS Team"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssinjs/jss/issues/new?title=[jss-plugin-camel-case]"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"hyphenate-style-name": "^1.0.3",
|
||||
"jss": "^10.3.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "JSS plugin that allows to write camel cased rule properties",
|
||||
"devDependencies": {
|
||||
"jss-plugin-rule-value-function": "^10.3.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"LICENSE"
|
||||
],
|
||||
"gitHead": "4094410d82dfdae772e1c09f0cd187cb48fa1cdc",
|
||||
"homepage": "https://cssinjs.org/jss-camel-case",
|
||||
"keywords": [
|
||||
"cssinjs",
|
||||
"css-in-js",
|
||||
"css in js",
|
||||
"jss",
|
||||
"plugin",
|
||||
"camel case"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist/jss-plugin-camel-case.cjs.js",
|
||||
"module": "dist/jss-plugin-camel-case.esm.js",
|
||||
"name": "jss-plugin-camel-case",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cssinjs/jss.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node ../../scripts/build.js",
|
||||
"check-snapshot": "node ../../scripts/match-snapshot.js"
|
||||
},
|
||||
"typings": "./src/index.d.ts",
|
||||
"unpkg": "dist/jss-plugin-camel-case.bundle.js",
|
||||
"version": "10.3.0"
|
||||
}
|
||||
26
node_modules/jss-plugin-camel-case/readme.md
generated
vendored
Normal file
26
node_modules/jss-plugin-camel-case/readme.md
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# jss-plugin-camel-case
|
||||
|
||||
[](https://npmjs.org/package/jss-plugin-camel-case)
|
||||
[](https://github.com/cssinjs/jss/blob/master/LICENSE)
|
||||
[](https://npmjs.org/package/jss-plugin-camel-case)
|
||||
[](https://npmjs.org/package/jss-plugin-camel-case)
|
||||
[](https://npmjs.org/package/jss-plugin-camel-case)
|
||||
[](https://gitter.im/cssinjs/lobby)
|
||||
|
||||
> JSS plugin that allows to write camel cased rule properties
|
||||
|
||||
See our website [jss-plugin-camel-case](https://cssinjs.org/jss-plugin-camel-case?v=v10.3.0) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install jss-plugin-camel-case
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add jss-plugin-camel-case
|
||||
```
|
||||
3
node_modules/jss-plugin-camel-case/src/index.d.ts
generated
vendored
Normal file
3
node_modules/jss-plugin-camel-case/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import {Plugin} from 'jss'
|
||||
|
||||
export default function jssPluginSyntaxCamelCase(): Plugin
|
||||
63
node_modules/jss-plugin-camel-case/src/index.js
generated
vendored
Normal file
63
node_modules/jss-plugin-camel-case/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
// @flow
|
||||
import type {Plugin} from 'jss'
|
||||
import hyphenate from 'hyphenate-style-name'
|
||||
|
||||
/**
|
||||
* Convert camel cased property names to dash separated.
|
||||
*
|
||||
* @param {Object} style
|
||||
* @return {Object}
|
||||
*/
|
||||
function convertCase(style) {
|
||||
const converted = {}
|
||||
|
||||
for (const prop in style) {
|
||||
const key = prop.indexOf('--') === 0 ? prop : hyphenate(prop)
|
||||
|
||||
converted[key] = style[prop]
|
||||
}
|
||||
|
||||
if (style.fallbacks) {
|
||||
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase)
|
||||
else converted.fallbacks = convertCase(style.fallbacks)
|
||||
}
|
||||
|
||||
return converted
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow camel cased property names by converting them back to dasherized.
|
||||
*
|
||||
* @param {Rule} rule
|
||||
*/
|
||||
export default function camelCase(): Plugin {
|
||||
function onProcessStyle(style) {
|
||||
if (Array.isArray(style)) {
|
||||
// Handle rules like @font-face, which can have multiple styles in an array
|
||||
for (let index = 0; index < style.length; index++) {
|
||||
style[index] = convertCase(style[index])
|
||||
}
|
||||
return style
|
||||
}
|
||||
|
||||
return convertCase(style)
|
||||
}
|
||||
|
||||
function onChangeValue(value, prop, rule) {
|
||||
if (prop.indexOf('--') === 0) {
|
||||
return value
|
||||
}
|
||||
|
||||
const hyphenatedProp = hyphenate(prop)
|
||||
|
||||
// There was no camel case in place
|
||||
if (prop === hyphenatedProp) return value
|
||||
|
||||
rule.prop(hyphenatedProp, value)
|
||||
|
||||
// Core will ignore that property value we set the proper one above.
|
||||
return null
|
||||
}
|
||||
|
||||
return {onProcessStyle, onChangeValue}
|
||||
}
|
||||
208
node_modules/jss-plugin-camel-case/src/index.test.js
generated
vendored
Normal file
208
node_modules/jss-plugin-camel-case/src/index.test.js
generated
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
import expect from 'expect.js'
|
||||
import {stripIndent} from 'common-tags'
|
||||
import {create} from 'jss'
|
||||
import functionPlugin from 'jss-plugin-rule-value-function'
|
||||
|
||||
import camelCase from './index'
|
||||
|
||||
const settings = {
|
||||
createGenerateId: () => rule => `${rule.key}-id`
|
||||
}
|
||||
|
||||
describe('jss-plugin-camel-case', () => {
|
||||
let jss
|
||||
|
||||
beforeEach(() => {
|
||||
jss = create(settings).use(camelCase())
|
||||
})
|
||||
|
||||
describe('regular rule', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
sheet = jss.createStyleSheet({
|
||||
a: {
|
||||
fontSize: '20px',
|
||||
zIndex: 1,
|
||||
lineHeight: 1.2
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
expect(sheet.toString()).to.be(
|
||||
'.a-id {\n font-size: 20px;\n z-index: 1;\n line-height: 1.2;\n}'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('@font-face with array of styles', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
sheet = jss.createStyleSheet({
|
||||
'@font-face': [
|
||||
{
|
||||
fontFamily: 'Lato-Light',
|
||||
src: 'url("/fonts/Lato-Light.ttf") format("truetype")'
|
||||
},
|
||||
{
|
||||
fontFamily: 'Lato-Bold',
|
||||
src: 'url("/fonts/Lato-Bold.ttf") format("truetype")'
|
||||
}
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
expect(sheet.toString()).to.be(
|
||||
'@font-face {\n' +
|
||||
' font-family: Lato-Light;\n' +
|
||||
' src: url("/fonts/Lato-Light.ttf") format("truetype");\n' +
|
||||
'}\n' +
|
||||
'@font-face {\n' +
|
||||
' font-family: Lato-Bold;\n' +
|
||||
' src: url("/fonts/Lato-Bold.ttf") format("truetype");\n' +
|
||||
'}'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('fallbacks object', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
sheet = jss.createStyleSheet({
|
||||
'@font-face': {
|
||||
fontFamily: 'MyWebFont',
|
||||
fallbacks: {
|
||||
fontFamily: 'MyWebFontFallback'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
expect(sheet.toString()).to.be(
|
||||
'@font-face {\n' +
|
||||
' font-family: MyWebFontFallback;\n' +
|
||||
' font-family: MyWebFont;\n' +
|
||||
'}'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('fallbacks array', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
sheet = jss.createStyleSheet({
|
||||
'@font-face': {
|
||||
fontFamily: 'MyWebFont',
|
||||
fallbacks: [{fontFamily: 'MyWebFontFallback'}]
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
expect(sheet.toString()).to.be(
|
||||
'@font-face {\n' +
|
||||
' font-family: MyWebFontFallback;\n' +
|
||||
' font-family: MyWebFont;\n' +
|
||||
'}'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('font faces with fallbacks', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
sheet = jss.createStyleSheet({
|
||||
'@font-face': [
|
||||
{
|
||||
fontFamily: 'MyWebFont',
|
||||
fallbacks: {
|
||||
fontFamily: 'MyWebFontFallback'
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
expect(sheet.toString()).to.be(
|
||||
'@font-face {\n' +
|
||||
' font-family: MyWebFontFallback;\n' +
|
||||
' font-family: MyWebFont;\n' +
|
||||
'}'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('function values', () => {
|
||||
let sheet
|
||||
|
||||
beforeEach(() => {
|
||||
const localJss = create(settings).use(functionPlugin(), camelCase())
|
||||
sheet = localJss.createStyleSheet({
|
||||
a: {
|
||||
fontSize: () => 12
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('should generate correct CSS', () => {
|
||||
sheet.update()
|
||||
expect(sheet.toString()).to.be(stripIndent`
|
||||
.a-id {
|
||||
font-size: 12;
|
||||
}
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('css variables', () => {
|
||||
let localJss
|
||||
beforeEach(() => {
|
||||
localJss = create(settings).use(functionPlugin(), camelCase())
|
||||
})
|
||||
|
||||
it('with static css variable', () => {
|
||||
const sheet = localJss.createStyleSheet({
|
||||
a: {
|
||||
'--fontSize': 12
|
||||
}
|
||||
})
|
||||
expect(sheet.toString()).to.be(stripIndent`
|
||||
.a-id {
|
||||
--fontSize: 12;
|
||||
}
|
||||
`)
|
||||
})
|
||||
|
||||
it('with dynamic css variable', () => {
|
||||
const sheet = localJss.createStyleSheet({
|
||||
a: {
|
||||
'--fontSize': size => size
|
||||
}
|
||||
})
|
||||
|
||||
sheet.update(12)
|
||||
|
||||
expect(sheet.toString()).to.be(stripIndent`
|
||||
.a-id {
|
||||
--fontSize: 12;
|
||||
}
|
||||
`)
|
||||
|
||||
sheet.update(16)
|
||||
|
||||
expect(sheet.toString()).to.be(stripIndent`
|
||||
.a-id {
|
||||
--fontSize: 16;
|
||||
}
|
||||
`)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user