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-camel-case/LICENSE
generated
vendored
Normal file
8
web/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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.bundle.js
generated
vendored
Normal file
80
web/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;
|
72
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js
generated
vendored
Normal file
72
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var hyphenate = require('hyphenate-style-name');
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var hyphenate__default = /*#__PURE__*/_interopDefaultLegacy(hyphenate);
|
||||
|
||||
/**
|
||||
* 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__default['default'](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__default['default'](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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.cjs.js.flow
generated
vendored
Normal file
3
web/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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js
generated
vendored
Normal file
64
web/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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js
generated
vendored
Normal file
91
web/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 = typeof globalThis !== 'undefined' ? globalThis : 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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.js.map
generated
vendored
Normal file
1
web/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;;;;;;;EAKe,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
web/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.min.js
generated
vendored
Normal file
1
web/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="undefined"!=typeof globalThis?globalThis: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})}));
|
46
web/node_modules/jss-plugin-camel-case/package.json
generated
vendored
Normal file
46
web/node_modules/jss-plugin-camel-case/package.json
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "jss-plugin-camel-case",
|
||||
"description": "JSS plugin that allows to write camel cased rule properties",
|
||||
"version": "10.7.1",
|
||||
"license": "MIT",
|
||||
"homepage": "https://cssinjs.org/jss-camel-case",
|
||||
"main": "dist/jss-plugin-camel-case.cjs.js",
|
||||
"module": "dist/jss-plugin-camel-case.esm.js",
|
||||
"unpkg": "dist/jss-plugin-camel-case.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-camel-case]"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"!*.test.*"
|
||||
],
|
||||
"keywords": [
|
||||
"cssinjs",
|
||||
"css-in-js",
|
||||
"css in js",
|
||||
"jss",
|
||||
"plugin",
|
||||
"camel case"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "node ../../scripts/build.js",
|
||||
"check-snapshot": "node ../../scripts/match-snapshot.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jss-plugin-rule-value-function": "10.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"hyphenate-style-name": "^1.0.3",
|
||||
"jss": "10.7.1"
|
||||
},
|
||||
"gitHead": "2b54776c03d97a3bccbbcb28b63508f74103ebbc"
|
||||
}
|
25
web/node_modules/jss-plugin-camel-case/readme.md
generated
vendored
Normal file
25
web/node_modules/jss-plugin-camel-case/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
# 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)
|
||||
|
||||
> 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.7.1) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install jss-plugin-camel-case
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add jss-plugin-camel-case
|
||||
```
|
3
web/node_modules/jss-plugin-camel-case/src/index.d.ts
generated
vendored
Normal file
3
web/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
web/node_modules/jss-plugin-camel-case/src/index.js
generated
vendored
Normal file
63
web/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}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue