Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -1,7 +0,0 @@
{
"presets": ["es2015", "stage-0"],
"plugins": [
"transform-es3-member-expression-literals",
"transform-es3-property-literals"
]
}

View File

@@ -1,4 +0,0 @@
{
"parser": "babel-eslint",
"extends": "eslint-config-jss"
}

View File

@@ -1,4 +0,0 @@
src
bench
coverage
tmp

View File

@@ -1,3 +1,12 @@
## 6.1.0 / 2018-02-08
- Use a caching hyphenation.
- Hyphenate property names for function values in onChangeValue hook.
## 6.0.0 / 2017-09-30
- Support jss 9
## 5.0.0 / 2017-06-20
- Support jss 8

View File

@@ -52,24 +52,20 @@ return /******/ (function(modules) { // webpackBootstrap
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = camelCase;
var regExp = /([A-Z])/g;
exports['default'] = camelCase;
/**
* Replace a string passed from String#replace.
* @param {String} str
* @return {String}
*/
function replace(str) {
return "-" + str.toLowerCase();
}
var _hyphenateStyleName = __webpack_require__(1);
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Convert camel cased property names to dash separated.
@@ -81,7 +77,7 @@ return /******/ (function(modules) { // webpackBootstrap
var converted = {};
for (var prop in style) {
converted[prop.replace(regExp, replace)] = style[prop];
converted[(0, _hyphenateStyleName2['default'])(prop)] = style[prop];
}
if (style.fallbacks) {
@@ -109,9 +105,43 @@ return /******/ (function(modules) { // webpackBootstrap
return convertCase(style);
}
return { onProcessStyle: onProcessStyle };
function onChangeValue(value, prop, rule) {
var hyphenatedProp = (0, _hyphenateStyleName2['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 };
}
/***/ }),
/* 1 */
/***/ (function(module, exports) {
'use strict';
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
var cache = {};
function hyphenateStyleName(string) {
return string in cache
? cache[string]
: cache[string] = string
.replace(uppercasePattern, '-$&')
.toLowerCase()
.replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
/***/ })
/******/ ])
});

View File

@@ -1 +1 @@
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.jssCamelCase=r():e.jssCamelCase=r()}(this,function(){return function(e){function r(o){if(t[o])return t[o].exports;var n=t[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r){"use strict";function t(e){return"-"+e.toLowerCase()}function o(e){var r={};for(var n in e)r[n.replace(a,t)]=e[n];return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(o):r.fallbacks=o(e.fallbacks)),r}function n(){function e(e){if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]=o(e[r]);return e}return o(e)}return{onProcessStyle:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var a=/([A-Z])/g}])});
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.jssCamelCase=r():e.jssCamelCase=r()}(this,function(){return function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var r={};for(var t in e)r[(0,s.default)(t)]=e[t];return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(o):r.fallbacks=o(e.fallbacks)),r}function a(){function e(e){if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]=o(e[r]);return e}return o(e)}function r(e,r,t){var n=(0,s.default)(r);return r===n?e:(t.prop(n,e),null)}return{onProcessStyle:e,onChangeValue:r}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=a;var u=t(1),s=n(u)},function(e,r){"use strict";function t(e){return e in a?a[e]:a[e]=e.replace(n,"-$&").toLowerCase().replace(o,"-ms-")}var n=/[A-Z]/g,o=/^ms-/,a={};e.exports=t}])});

View File

@@ -1,24 +0,0 @@
const webpackConfig = require('./webpack.config')
module.exports = (config) => {
config.set({
browsers: ['Chrome'],
frameworks: ['mocha'],
files: ['tests.webpack.js'],
preprocessors: {
'tests.webpack.js': ['webpack', 'sourcemap']
},
webpack: Object.assign(webpackConfig, {
devtool: 'inline-source-map'
}),
webpackServer: {
noInfo: true
},
reporters: ['mocha', 'coverage'],
coverageReporter: {
dir: 'coverage',
file: 'coverage.json',
type: 'json'
}
})
}

View File

@@ -1,19 +1,15 @@
"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = camelCase;
var regExp = /([A-Z])/g;
exports['default'] = camelCase;
/**
* Replace a string passed from String#replace.
* @param {String} str
* @return {String}
*/
function replace(str) {
return "-" + str.toLowerCase();
}
var _hyphenateStyleName = require('hyphenate-style-name');
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Convert camel cased property names to dash separated.
@@ -25,7 +21,7 @@ function convertCase(style) {
var converted = {};
for (var prop in style) {
converted[prop.replace(regExp, replace)] = style[prop];
converted[(0, _hyphenateStyleName2['default'])(prop)] = style[prop];
}
if (style.fallbacks) {
@@ -53,5 +49,17 @@ function camelCase() {
return convertCase(style);
}
return { onProcessStyle: onProcessStyle };
function onChangeValue(value, prop, rule) {
var hyphenatedProp = (0, _hyphenateStyleName2['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 };
}

View File

@@ -1,6 +1,6 @@
'use strict';
var _templateObject = _taggedTemplateLiteral(['\n .a-id {\n font-size: 12;\n }\n '], ['\n .a-id {\n font-size: 12;\n }\n ']);
var _templateObject = _taggedTemplateLiteral(['\n .a-id {\n font-size: 12;\n }\n '], ['\n .a-id {\n font-size: 12;\n }\n ']);
var _expect = require('expect.js');

View File

@@ -1,43 +1,44 @@
{
"name": "jss-camel-case",
"description": "JSS plugin that allows to write camel cased rule properties",
"version": "5.0.0",
"_args": [
[
"jss-camel-case@6.1.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI"
]
],
"_from": "jss-camel-case@6.1.0",
"_id": "jss-camel-case@6.1.0",
"_inBundle": false,
"_integrity": "sha512-HPF2Q7wmNW1t79mCqSeU2vdd/vFFGpkazwvfHMOhPlMgXrJDzdj9viA2SaHk9ZbD5pfL63a8ylp4++irYbbzMQ==",
"_location": "/material-ui/jss-camel-case",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "jss-camel-case@6.1.0",
"name": "jss-camel-case",
"escapedName": "jss-camel-case",
"rawSpec": "6.1.0",
"saveSpec": null,
"fetchSpec": "6.1.0"
},
"_requiredBy": [
"/material-ui",
"/material-ui/jss-preset-default"
],
"_resolved": "https://registry.npmjs.org/jss-camel-case/-/jss-camel-case-6.1.0.tgz",
"_spec": "6.1.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI",
"author": {
"name": "Oleg Slobodskoi",
"email": "oleg008@gmail.com"
},
"repository": {
"type": "git",
"url": "git@github.com:cssinjs/jss-camel-case.git"
"bugs": {
"url": "https://github.com/cssinjs/jss-camel-case/issues"
},
"keywords": [
"cssinjs",
"css-in-js",
"css in js",
"jss",
"plugin",
"camel case"
],
"engines": {},
"scripts": {
"all": "npm run lint && npm run test && npm run build",
"build": "npm run clean && npm run build:lib && npm run build:tests && npm run build:dist",
"build:lib": "babel src --out-dir lib",
"build:tests": "npm run build:tests:lib && npm run build:tests:local",
"build:tests:lib": "cross-env NODE_ENV=test babel src --out-dir tests",
"build:tests:local": "cross-env NODE_ENV=test webpack src/index.test.js tmp/tests.js",
"build:dist": "npm run build:dist:max && npm run build:dist:min",
"build:dist:max": "cross-env NODE_ENV=development webpack src/index.js dist/jss-camel-case.js",
"build:dist:min": "cross-env NODE_ENV=production webpack src/index.js dist/jss-camel-case.min.js",
"clean": "rimraf {lib,dist,tests,tmp}/*",
"lint": "eslint ./src",
"lint:staged": "lint-staged",
"test": "cross-env NODE_ENV=test karma start --single-run ",
"test:watch": "cross-env NODE_ENV=test karma start",
"prepublish": "npm run all"
"dependencies": {
"hyphenate-style-name": "^1.0.2"
},
"license": "MIT",
"main": "lib/index.js",
"description": "JSS plugin that allows to write camel cased rule properties",
"devDependencies": {
"babel-cli": "^6.5.1",
"babel-core": "^6.5.1",
@@ -57,7 +58,7 @@
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.5.0",
"expect.js": "^0.3.1",
"jss": "^8.0.0",
"jss": "^9.7.0",
"karma": "^1.1.1",
"karma-benchmark": "^0.6.0",
"karma-benchmark-reporter": "^0.1.1",
@@ -74,14 +75,54 @@
"rimraf": "^2.5.4",
"webpack": "^1.13.1"
},
"peerDependencies": {
"jss": "^8.0.0"
},
"engines": {},
"files": [
"lib",
"dist",
"tests"
],
"homepage": "https://github.com/cssinjs/jss-camel-case#readme",
"keywords": [
"cssinjs",
"css-in-js",
"css in js",
"jss",
"plugin",
"camel case"
],
"license": "MIT",
"lint-staged": {
"./src/*.js": [
"eslint",
"git add"
]
},
"pre-commit": "lint:staged"
"main": "lib/index.js",
"name": "jss-camel-case",
"peerDependencies": {
"jss": "^9.7.0"
},
"pre-commit": "lint:staged",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/cssinjs/jss-camel-case.git"
},
"scripts": {
"all": "npm run lint && npm run test && npm run build",
"build": "npm run clean && npm run build:lib && npm run build:tests && npm run build:dist",
"build:dist": "npm run build:dist:max && npm run build:dist:min",
"build:dist:max": "cross-env NODE_ENV=development webpack src/index.js dist/jss-camel-case.js",
"build:dist:min": "cross-env NODE_ENV=production webpack src/index.js dist/jss-camel-case.min.js",
"build:lib": "babel src --out-dir lib",
"build:tests": "npm run build:tests:lib && npm run build:tests:local",
"build:tests:lib": "cross-env NODE_ENV=test babel src --out-dir tests",
"build:tests:local": "cross-env NODE_ENV=test webpack src/index.test.js tmp/tests.js",
"clean": "rimraf {lib,dist,tests,tmp}/*",
"lint": "eslint ./src",
"lint:staged": "lint-staged",
"prepublishOnly": "npm run all",
"test": "cross-env NODE_ENV=test karma start --single-run ",
"test:watch": "cross-env NODE_ENV=test karma start"
},
"version": "6.1.0"
}

View File

@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>JSS Tests</title>
<link href="./node_modules/mocha/mocha.css" rel="stylesheet" />
</head>
<body>
<div id="mocha"></div>
<script src="./node_modules/es5-shim/es5-shim.js"></script>
<script src="./node_modules/mocha/mocha.js"></script>
<script>mocha.setup('bdd')</script>
<script src="tmp/tests.js"></script>
<script>
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

View File

@@ -1,2 +0,0 @@
var context = require.context('./src', true, /\.test\.js$/)
context.keys().forEach(context)

View File

@@ -1,19 +1,15 @@
"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = camelCase;
var regExp = /([A-Z])/g;
exports['default'] = camelCase;
/**
* Replace a string passed from String#replace.
* @param {String} str
* @return {String}
*/
function replace(str) {
return "-" + str.toLowerCase();
}
var _hyphenateStyleName = require('hyphenate-style-name');
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Convert camel cased property names to dash separated.
@@ -25,7 +21,7 @@ function convertCase(style) {
var converted = {};
for (var prop in style) {
converted[prop.replace(regExp, replace)] = style[prop];
converted[(0, _hyphenateStyleName2['default'])(prop)] = style[prop];
}
if (style.fallbacks) {
@@ -53,5 +49,17 @@ function camelCase() {
return convertCase(style);
}
return { onProcessStyle: onProcessStyle };
function onChangeValue(value, prop, rule) {
var hyphenatedProp = (0, _hyphenateStyleName2['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 };
}

View File

@@ -1,6 +1,6 @@
'use strict';
var _templateObject = _taggedTemplateLiteral(['\n .a-id {\n font-size: 12;\n }\n '], ['\n .a-id {\n font-size: 12;\n }\n ']);
var _templateObject = _taggedTemplateLiteral(['\n .a-id {\n font-size: 12;\n }\n '], ['\n .a-id {\n font-size: 12;\n }\n ']);
var _expect = require('expect.js');

View File

@@ -1,32 +0,0 @@
'use strict'
var webpack = require('webpack')
var plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
__DEV__: process.env.NODE_ENV === 'development',
__TEST__: process.env.NODE_ENV === 'test'
})
]
if (process.env.NODE_ENV === 'production') {
plugins.push(new webpack.optimize.UglifyJsPlugin())
}
module.exports = {
output: {
library: 'jssCamelCase',
libraryTarget: 'umd'
},
plugins: plugins,
module: {
loaders: [
{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
}
]
}
}