summaryrefslogtreecommitdiff
path: root/node_modules/postcss-selector-not
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/postcss-selector-not')
-rw-r--r--node_modules/postcss-selector-not/CHANGELOG.md73
-rw-r--r--node_modules/postcss-selector-not/LICENSE20
-rw-r--r--node_modules/postcss-selector-not/README.md59
-rw-r--r--node_modules/postcss-selector-not/dist/index.cjs1
-rw-r--r--node_modules/postcss-selector-not/dist/index.d.ts5
-rw-r--r--node_modules/postcss-selector-not/dist/index.mjs1
-rw-r--r--node_modules/postcss-selector-not/package.json85
7 files changed, 244 insertions, 0 deletions
diff --git a/node_modules/postcss-selector-not/CHANGELOG.md b/node_modules/postcss-selector-not/CHANGELOG.md
new file mode 100644
index 00000000..29d4f0ab
--- /dev/null
+++ b/node_modules/postcss-selector-not/CHANGELOG.md
@@ -0,0 +1,73 @@
+# Changes to PostCSS Selector Not
+
+### 7.0.1 (January 28, 2023)
+
+- Improve `types` declaration in `package.json`
+
+### 7.0.0 (January 24, 2023)
+
+- Updated: Support for Node v14+ (major).
+- Fix: Do not throw when a selector is invalid, show a warning instead.
+
+### 6.0.1 (July 8, 2022)
+
+- Fixed: Case insensitive `:not` matching.
+
+### 6.0.0 (June 3, 2022)
+
+- Fixed: default export ([#409](https://github.com/csstools/postcss-plugins/issues/409))
+- Fixed: doesn't consider attribute selectors (https://github.com/postcss/postcss-selector-not/issues/23)
+- Fixed: unexpected results when `:not` is not a pseudo class function (https://github.com/postcss/postcss-selector-not/issues/28)
+
+### 5.0.0 (January 31, 2021)
+
+- Added: Support for PostCSS v8.
+
+### 4.0.1 (December 18, 2020)
+
+- Fixed: error when attribute selector containing :not (https://github.com/postcss/postcss-selector-not/pull/17)
+
+### 4.0.0 (September 17, 2017)
+
+- Added: compatibility with postcss v7.x
+- Added: compatibility with node v6.x
+
+### 3.0.1 (May 11, 2015)
+
+- Fixed: incorrect export (https://github.com/postcss/postcss-selector-not/issues/8)
+
+### 3.0.0 (May 11, 2017)
+
+- Added: compatibility with postcss v6.x
+
+### 2.0.0 (August 25, 2015)
+
+- Removed: compatibility with postcss v4.x
+- Added: compatibility with postcss v5.x
+
+### 1.2.1 (June 16, 2015)
+
+- Fixed: selector was updated as an array, which is wrong.
+
+### 1.2.0 (June 16, 2015)
+
+- Fixed: spec has been previously misinterpreted and now transform correctly
+`:not()` level 4 to collapsed level 3
+(https://github.com/postcss/postcss-selector-not/issues/1)
+- Removed: `lineBreak` option (useless now)
+
+### 1.1.0 (June 13, 2015)
+
+- Added: `lineBreak` option
+
+### 1.0.2 (June 13, 2015)
+
+- Fixed: support of pseudo classes that use parenthesis
+
+### 1.0.1 (April 30, 2015)
+
+- Fixed: the module now works in non babel environments
+
+### 1.0.0 (April 30, 2015)
+
+✨ First release
diff --git a/node_modules/postcss-selector-not/LICENSE b/node_modules/postcss-selector-not/LICENSE
new file mode 100644
index 00000000..b75f6e61
--- /dev/null
+++ b/node_modules/postcss-selector-not/LICENSE
@@ -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.
diff --git a/node_modules/postcss-selector-not/README.md b/node_modules/postcss-selector-not/README.md
new file mode 100644
index 00000000..415903f2
--- /dev/null
+++ b/node_modules/postcss-selector-not/README.md
@@ -0,0 +1,59 @@
+# PostCSS Selector Not [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]
+
+[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-selector-not.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/not-pseudo-class.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
+
+[PostCSS Selector Not] transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the [Selectors 4 Specification].
+
+```pcss
+p:not(:first-child, .special) {
+ color: red;
+}
+
+/* becomes */
+
+p:not(:first-child):not(.special) {
+ color: red;
+}
+```
+
+⚠️ Only lists of simple selectors (`:not(.a, .b)`) will work as expected.
+Complex selectors (`:not(.a > .b, .c ~ .d)`) can not be downgraded.
+
+## Usage
+
+Add [PostCSS Selector Not] to your project:
+
+```bash
+npm install postcss postcss-selector-not --save-dev
+```
+
+Use it as a [PostCSS] plugin:
+
+```js
+const postcss = require('postcss');
+const postcssSelectorNot = require('postcss-selector-not');
+
+postcss([
+ postcssSelectorNot(/* pluginOptions */)
+]).process(YOUR_CSS /*, processOptions */);
+```
+
+[PostCSS Selector Not] runs in all Node environments, with special
+instructions for:
+
+- [Node](INSTALL.md#node)
+- [PostCSS CLI](INSTALL.md#postcss-cli)
+- [PostCSS Load Config](INSTALL.md#postcss-load-config)
+- [Webpack](INSTALL.md#webpack)
+- [Next.js](INSTALL.md#nextjs)
+- [Gulp](INSTALL.md#gulp)
+- [Grunt](INSTALL.md#grunt)
+
+[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
+[css-url]: https://cssdb.org/#not-pseudo-class
+[discord]: https://discord.gg/bUadyRwkJS
+[npm-url]: https://www.npmjs.com/package/postcss-selector-not
+
+[PostCSS]: https://github.com/postcss/postcss
+[PostCSS Selector Not]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not
+[Selectors 4 Specification]: https://www.w3.org/TR/selectors-4/#negation-pseudo
diff --git a/node_modules/postcss-selector-not/dist/index.cjs b/node_modules/postcss-selector-not/dist/index.cjs
new file mode 100644
index 00000000..c252cd99
--- /dev/null
+++ b/node_modules/postcss-selector-not/dist/index.cjs
@@ -0,0 +1 @@
+"use strict";var e=require("postcss-selector-parser");function cleanupWhitespace(e){e.spaces&&(e.spaces.after="",e.spaces.before=""),e.nodes&&e.nodes.length>0&&(e.nodes[0]&&e.nodes[0].spaces&&(e.nodes[0].spaces.before=""),e.nodes[e.nodes.length-1]&&e.nodes[e.nodes.length-1].spaces&&(e.nodes[e.nodes.length-1].spaces.after=""))}const creator=()=>({postcssPlugin:"postcss-selector-not",Rule:(s,{result:o})=>{if(s.selector&&s.selector.toLowerCase().includes(":not("))try{const o=e().astSync(s.selector);o.walkPseudos((s=>{if(":not"!==s.value.toLowerCase())return;if(!s.nodes||s.nodes.length<2)return;const o=[];s.nodes.forEach((s=>{cleanupWhitespace(s);const t=e.pseudo({value:":not",nodes:[s]});o.push(t)})),s.replaceWith(...o)}));const t=o.toString();t!==s.selector&&s.replaceWith(s.clone({selector:t}))}catch(e){s.warn(o,`Failed to parse selector : "${s.selector}" with message: "${e.message}"`)}}});creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/postcss-selector-not/dist/index.d.ts b/node_modules/postcss-selector-not/dist/index.d.ts
new file mode 100644
index 00000000..af28b15e
--- /dev/null
+++ b/node_modules/postcss-selector-not/dist/index.d.ts
@@ -0,0 +1,5 @@
+import type { PluginCreator } from 'postcss';
+/** postcss-selector-not plugin options */
+export type pluginOptions = Record<string, never>;
+declare const creator: PluginCreator<pluginOptions>;
+export default creator;
diff --git a/node_modules/postcss-selector-not/dist/index.mjs b/node_modules/postcss-selector-not/dist/index.mjs
new file mode 100644
index 00000000..5c2ec9cb
--- /dev/null
+++ b/node_modules/postcss-selector-not/dist/index.mjs
@@ -0,0 +1 @@
+import e from"postcss-selector-parser";function cleanupWhitespace(e){e.spaces&&(e.spaces.after="",e.spaces.before=""),e.nodes&&e.nodes.length>0&&(e.nodes[0]&&e.nodes[0].spaces&&(e.nodes[0].spaces.before=""),e.nodes[e.nodes.length-1]&&e.nodes[e.nodes.length-1].spaces&&(e.nodes[e.nodes.length-1].spaces.after=""))}const creator=()=>({postcssPlugin:"postcss-selector-not",Rule:(s,{result:o})=>{if(s.selector&&s.selector.toLowerCase().includes(":not("))try{const o=e().astSync(s.selector);o.walkPseudos((s=>{if(":not"!==s.value.toLowerCase())return;if(!s.nodes||s.nodes.length<2)return;const o=[];s.nodes.forEach((s=>{cleanupWhitespace(s);const t=e.pseudo({value:":not",nodes:[s]});o.push(t)})),s.replaceWith(...o)}));const t=o.toString();t!==s.selector&&s.replaceWith(s.clone({selector:t}))}catch(e){s.warn(o,`Failed to parse selector : "${s.selector}" with message: "${e.message}"`)}}});creator.postcss=!0;export{creator as default};
diff --git a/node_modules/postcss-selector-not/package.json b/node_modules/postcss-selector-not/package.json
new file mode 100644
index 00000000..d86d73ad
--- /dev/null
+++ b/node_modules/postcss-selector-not/package.json
@@ -0,0 +1,85 @@
+{
+ "name": "postcss-selector-not",
+ "description": "PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to :not() CSS level 3 selectors",
+ "version": "7.0.1",
+ "contributors": [
+ {
+ "name": "Antonio Laguna",
+ "email": "antonio@laguna.es",
+ "url": "https://antonio.laguna.es"
+ },
+ {
+ "name": "Romain Menke",
+ "email": "romainmenke@gmail.com"
+ },
+ {
+ "name": "Maxime Thirouin"
+ }
+ ],
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ },
+ "engines": {
+ "node": "^14 || ^16 || >=18"
+ },
+ "main": "dist/index.cjs",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.mjs",
+ "require": "./dist/index.cjs",
+ "default": "./dist/index.mjs"
+ }
+ },
+ "files": [
+ "CHANGELOG.md",
+ "LICENSE",
+ "README.md",
+ "dist"
+ ],
+ "dependencies": {
+ "postcss-selector-parser": "^6.0.10"
+ },
+ "peerDependencies": {
+ "postcss": "^8.4"
+ },
+ "scripts": {
+ "prebuild": "npm run clean",
+ "build": "rollup -c ../../rollup/default.mjs",
+ "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true }); fs.mkdirSync('./dist');\"",
+ "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
+ "lint": "npm run lint:eslint && npm run lint:package-json",
+ "lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
+ "lint:package-json": "node ../../.github/bin/format-package-json.mjs",
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
+ "test": "node .tape.mjs && npm run test:exports",
+ "test:exports": "node ./test/_import.mjs && node ./test/_require.cjs",
+ "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
+ },
+ "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not#readme",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/csstools/postcss-plugins.git",
+ "directory": "plugins/postcss-selector-not"
+ },
+ "bugs": "https://github.com/csstools/postcss-plugins/issues",
+ "keywords": [
+ "Not",
+ "postcss",
+ "postcss-plugin",
+ "selector"
+ ],
+ "csstools": {
+ "cssdbId": "not-pseudo-class",
+ "exportName": "postcssSelectorNot",
+ "humanReadableName": "PostCSS Selector Not",
+ "specUrl": "https://www.w3.org/TR/selectors-4/#negation-pseudo"
+ },
+ "volta": {
+ "extends": "../../package.json"
+ }
+}