applying transfer to react app

This commit is contained in:
Tyler Koenig
2021-09-20 16:54:47 -04:00
parent 8819f31dd0
commit c612b7d702
37373 changed files with 3775588 additions and 2871 deletions
+83
View File
@@ -0,0 +1,83 @@
# 4.0.0 - 2018-09-17
- Added: compatibility with postcss v7.x
- Added: compatibility with node v6.x
# 3.0.1 - 2017-05-15
- Fixed: incorrect export
# 3.0.0 - 2017-05-11
- Added: compatibility with postcss v6.x
# 2.0.5 - 2016-09-13
- Fixed: another regression of 2.0.2
(don't mangle selector parts that don't contain `:matches`)
([#13](https://github.com/postcss/postcss-selector-matches/pull/13) - @rgrove)
# 2.0.4 - 2016-09-06
- Fixed: another regression of 2.0.2
([#10](https://github.com/postcss/postcss-selector-matches/pull/10) - @MoOx)
# 2.0.3 - 2016-09-06
- Fixed: regression of 2.0.2 due to a transpilation upgrade
(@MoOx)
# 2.0.2 - 2016-09-06
- Fixed: .class:matches(element) now produce element.class
([#8](https://github.com/postcss/postcss-selector-matches/pull/8) - @yordis)
# 2.0.1 - 2015-10-26
- Fixed: pseudo selectors with multiple matches in a selector
# 2.0.0 - 2015-08-25
- Removed: compatibility with postcss v4.x
- Added: compatibility with postcss v5.x
# 1.2.1 - 2015-07-14
- Fixed: plugin is correctly exposed for normal commonjs environments (!babel)
([#5](https://github.com/postcss/postcss-selector-matches/issues/5))
# 1.2.0 - 2015-07-14
- Fixed: indentation adjustment doesn't contain useless new lines
- Fixed: transformation doesn't add some useless whitespace
- Added: plugin now expose `replaceRuleSelector` to make it easy to reuse in
some others plugins (like `postcss-custom-selectors`).
# 1.1.2 - 2015-06-29
- Fixed: support pseudo-element that might be collapsed to :matches()
([#4](https://github.com/postcss/postcss-selector-matches/issues/4))
- Fixed: doesn't drop selectors parts that do not have :matches() in them
# 1.1.1 - 2015-06-17
- Fixed: no more duplicates in generated selector
([#3](https://github.com/postcss/postcss-selector-matches/issues/3))
# 1.1.0 - 2015-06-13
- Added: `lineBreak` option
([#1](https://github.com/postcss/postcss-selector-matches/issues/1))
# 1.0.2 - 2015-06-13
- Fixed: support of pseudo classes that use parenthesis
([#2](https://github.com/postcss/postcss-selector-matches/issues/2))
# 1.0.1 - 2015-04-30
- Fixed: the module now works in non babel environments
# 1.0.0 - 2015-04-30
✨ First release
+20
View File
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 Maxime Thirouin
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.
+55
View File
@@ -0,0 +1,55 @@
# postcss-selector-matches [![CSS Standard Status](https://cssdb.org/badge/matches-pseudo-class.svg)](https://cssdb.org/#matches-pseudo-class) [![Build Status](https://travis-ci.org/postcss/postcss-selector-matches.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-matches)
> PostCSS plugin to transform `:matches()` W3C CSS pseudo class to more compatible CSS selectors
http://dev.w3.org/csswg/selectors-4/#matches
## Installation
```console
$ npm install postcss-selector-matches
```
## Usage
```js
var postcss = require("postcss")
var output = postcss()
.use(require("postcss-selector-matches"))
.process(require("fs").readFileSync("input.css", "utf8"))
.css
```
Using this `input.css`:
```css
p:matches(:first-child, .special) {
color: red;
}
```
you will get:
```css
p:first-child, p.special {
color: red;
}
```
**Note that if you are doing crazy selector like `p:matches(a) {}` you are likely to get crazy results (like `pa {}`)**.
## Options
### `lineBreak`
(default: `false`)
Allows you to introduce a line break between generated selectors.
---
## [Changelog](CHANGELOG.md)
## [License](LICENSE)
+30
View File
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _postcss = require("postcss");
var _postcss2 = _interopRequireDefault(_postcss);
var _replaceRuleSelector = require("./replaceRuleSelector");
var _replaceRuleSelector2 = _interopRequireDefault(_replaceRuleSelector);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function explodeSelectors() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return function (css) {
css.walkRules(function (rule) {
if (rule.selector && rule.selector.indexOf(":matches") > -1) {
rule.selector = (0, _replaceRuleSelector2.default)(rule, options);
}
});
};
}
exports.default = _postcss2.default.plugin("postcss-selector-matches", explodeSelectors);
module.exports = exports.default;
+88
View File
@@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = replaceRuleSelector;
var _list = require("postcss/lib/list");
var _list2 = _interopRequireDefault(_list);
var _balancedMatch = require("balanced-match");
var _balancedMatch2 = _interopRequireDefault(_balancedMatch);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var pseudoClass = ":matches";
var selectorElementRE = /^[a-zA-Z]/;
function isElementSelector(selector) {
var matches = selectorElementRE.exec(selector);
// console.log({selector, matches})
return matches;
}
function normalizeSelector(selector, preWhitespace, pre) {
if (isElementSelector(selector) && !isElementSelector(pre)) {
return `${preWhitespace}${selector}${pre}`;
}
return `${preWhitespace}${pre}${selector}`;
}
function explodeSelector(selector, options) {
if (selector && selector.indexOf(pseudoClass) > -1) {
var newSelectors = [];
var preWhitespaceMatches = selector.match(/^\s+/);
var preWhitespace = preWhitespaceMatches ? preWhitespaceMatches[0] : "";
var selectorPart = _list2.default.comma(selector);
selectorPart.forEach(function (part) {
var position = part.indexOf(pseudoClass);
var pre = part.slice(0, position);
var body = part.slice(position);
var matches = (0, _balancedMatch2.default)("(", ")", body);
var bodySelectors = matches && matches.body ? _list2.default.comma(matches.body).reduce(function (acc, s) {
return [].concat(_toConsumableArray(acc), _toConsumableArray(explodeSelector(s, options)));
}, []) : [body];
var postSelectors = matches && matches.post ? explodeSelector(matches.post, options) : [];
var newParts = void 0;
if (postSelectors.length === 0) {
// the test below is a poor way to try we are facing a piece of a
// selector...
if (position === -1 || pre.indexOf(" ") > -1) {
newParts = bodySelectors.map(function (s) {
return preWhitespace + pre + s;
});
} else {
newParts = bodySelectors.map(function (s) {
return normalizeSelector(s, preWhitespace, pre);
});
}
} else {
newParts = [];
postSelectors.forEach(function (postS) {
bodySelectors.forEach(function (s) {
newParts.push(preWhitespace + pre + s + postS);
});
});
}
newSelectors = [].concat(_toConsumableArray(newSelectors), _toConsumableArray(newParts));
});
return newSelectors;
}
return [selector];
}
function replaceRuleSelector(rule, options) {
var indentation = rule.raws && rule.raws.before ? rule.raws.before.split("\n").pop() : "";
return explodeSelector(rule.selector, options).join("," + (options.lineBreak ? "\n" + indentation : " "));
}
module.exports = exports.default;
+76
View File
@@ -0,0 +1,76 @@
{
"_from": "postcss-selector-matches@^4.0.0",
"_id": "postcss-selector-matches@4.0.0",
"_inBundle": false,
"_integrity": "sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww==",
"_location": "/postcss-selector-matches",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-selector-matches@^4.0.0",
"name": "postcss-selector-matches",
"escapedName": "postcss-selector-matches",
"rawSpec": "^4.0.0",
"saveSpec": null,
"fetchSpec": "^4.0.0"
},
"_requiredBy": [
"/postcss-preset-env"
],
"_resolved": "https://registry.npmjs.org/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz",
"_shasum": "71c8248f917ba2cc93037c9637ee09c64436fcff",
"_spec": "postcss-selector-matches@^4.0.0",
"_where": "/Users/tylerkoenig/Code/personal/react-scss2/node_modules/postcss-preset-env",
"author": {
"name": "Maxime Thirouin"
},
"bugs": {
"url": "https://github.com/postcss/postcss-selector-matches/issues"
},
"bundleDependencies": false,
"dependencies": {
"balanced-match": "^1.0.0",
"postcss": "^7.0.2"
},
"deprecated": false,
"description": "PostCSS plugin to transform :matches() W3C CSS pseudo class to more compatible CSS selectors",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-add-module-exports": "^1.0.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"eslint": "^5.6.0",
"npmpub": "^4.1.0",
"tape": "^4.9.1"
},
"files": [
"dist"
],
"homepage": "https://github.com/postcss/postcss-selector-matches#readme",
"keywords": [
"postcss",
"postcss-plugin",
"selectors",
"selector",
"matches"
],
"license": "MIT",
"main": "dist/index.js",
"name": "postcss-selector-matches",
"repository": {
"type": "git",
"url": "git+https://github.com/postcss/postcss-selector-matches.git"
},
"scripts": {
"babelify": "babel src --out-dir dist",
"lint": "eslint ./src/*.js ./test/*.js",
"prepublish": "npm run babelify",
"release": "npmpub",
"tape": "tape -r babel-register test/*.js",
"test": "npm run lint && npm run babelify && npm run tape"
},
"version": "4.0.0"
}