diff options
Diffstat (limited to 'node_modules/postcss-nesting')
26 files changed, 816 insertions, 0 deletions
diff --git a/node_modules/postcss-nesting/CHANGELOG.md b/node_modules/postcss-nesting/CHANGELOG.md new file mode 100644 index 00000000..c0ce8508 --- /dev/null +++ b/node_modules/postcss-nesting/CHANGELOG.md @@ -0,0 +1,422 @@ +# Changes to PostCSS Nesting + +### 12.0.1 + +_August 5, 2023_ + +- Fix nesting of `@starting-style` rules + +### 12.0.0 + +_July 3, 2023_ + +- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) +- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#300) (major) + +### 11.3.0 + +_June 14, 2023_ + +- Add support for nested selectors that that begin with a letter +- Add warning when using the deprecated `@nest` rule + - you can silence this warning with a new `silenceAtNestWarning` plugin option + - you can migrate your code to the latest syntax with our [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) + +### 11.2.2 + +_March 25, 2023_ + +- Improved: support for mixins + +### 11.2.1 + +_February 16, 2023_ + +- Skip nested rules that have a selector that begins with a letter +- Better warning when nested rules have a selector that begins with a letter + +### 11.2.0 + +_February 13, 2023_ + +- Added: support for `&` at the root +- Improved: support for mixins + +### 11.1.0 + +_January 31, 2023_ + +- Implement latest specification + - relative selector syntax + - `@nest` is obsolete, all selectors can be written without it (sometimes you will need `:is()`) + - allow declarations after nested rules. + +⚠️ We advice everyone to migrate their codebase **now** to nested CSS without `@nest`. +Future versions of this plugin will warn and then error on `@nest`. + +### 11.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 11.0.0 + +_January 24, 2023_ + +- Updated: Support for Node v14+ (major). +- Fix: Do not throw when a selector is invalid, show a warning instead. +- Removed: Support for Deno (breaking) + +### 10.2.0 + +_September 14, 2022_ + +- Added: TypeScript typings + +### 10.1.10 + +_June 30, 2022_ + +- Partially revert the changes to pseudo element selectors from 10.1.9. + +```diff +.anything::before { + @nest .something_else > & { + order: 1; + } +} + +/* becomes */ + +- .something_else > :is(.anything::before) { /* 10.1.9 */ ++ .something_else > .anything::before { /* previous and restored behavior */ + order: 1; +} +``` + +The exact behavior of this pattern is unspecified and might change in the future. +We are reverting to the previous behavior until the specification is clarified. + +### 10.1.9 + +_June 23, 2022_ + +- Fix selector order with any pseudo element. +- Fix semicolons being removed [#497](https://github.com/csstools/postcss-plugins/issues/497). + +### 10.1.8 + +_June 4, 2022_ + +- Update `@csstools/selector-specificity` (major) + +### 10.1.7 + +_May 20, 2022_ + +- Add tentative support for `@layer`. The actual behavior is poorly defined and may change in the future. Use with caution. + +### 10.1.6 + +_May 17, 2022_ + + - Fix selector order with `:before` and other pseudo elements. + +### 10.1.5 + +_May 11, 2022_ + +- Use `@csstools/selector-specificity` for specificity calculations. + +### 10.1.4 + +_April 4, 2022_ + +- Improved : compound selector order with pseudo elements +- Improved : selector specificity calculation. + +### 10.1.3 + +_March 4, 2022_ + +- Avoid creating duplicate selectors containing only comments. + +```diff +.alpha { + /* loose comment */ + & .beta { + order: 1; + } +} + +/* becomes */ + +- .alpha { +- /* loose comment */ +- } ++ /* loose comment */ +.alpha .beta { + order: 1; +} +``` + +### 10.1.2 + +_January 12, 2022_ + +- Improved : selector specificity calculation + +### 10.1.1 + +_January 2, 2022_ + +- Removed Sourcemaps from package tarball. +- Moved CLI to CLI Package. See [announcement](https://github.com/csstools/postcss-plugins/discussions/121). + +### 10.1.0 + +_December 22, 2021_ + +- Added: `noIsPseudoSelector` plugin option. +- Changed: `:is()` pseudo is now avoided as much as possible by default. +- Updated: documentation + +[more info on noIsPseudoSelector](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#noispseudoselector) + +```js +postcssNesting({ + noIsPseudoSelector: true +}) +``` + +### 10.0.3 + +_December 13, 2021_ + +- Updated: documentation + +### 10.0.2 + +_November 18, 2021_ + +- Fixed: Support for Deno. Ensuring we pack `mod.js` so it can be accessible by CDNs. + +### 10.0.1 + +_November 17, 2021_ + +- Removed: Support for `allowDeclarationsAfterNestedRules`. + +We've realised that enforcing this rule from the spec was going to be problematic +in the long run given how plugins work and the whole ecosystem around mixins and +other features. Treating this as a patch given that this was introduced in the +previous version and was starting to break projects that were using other features. + +### 10.0.0 + +_November 16, 2021_ + +- Added: Support for `allowDeclarationsAfterNestedRules` to deviate from spec. +- Added: `.npmrc` file. + +- Updated: Aligning completely with the [spec](https://www.w3.org/TR/css-nesting-1/) updates. +- Updated: `esbuild` to 0.13.12 (minor) + +- Removed: Support for PostCSS 7 + +### 9.0.0 + +_October 27, 2021_ + +- Added: Support for Deno +- Fixed: Issue with PostCSS 8 compatibility using the RuleExit listener + +### 8.0.1 + +_May 1, 2021_ + +- Fixed: Compatibility issue with CommonJS. + +### 8.0.0 + +_April 26, 2021_ + +- Updated: Support for PostCSS 8+. +- Updated: Support for Node v12+. +- Updated: Support for the `@container` at-rule. + +### 7.0.1 + +_July 29, 2018_ + +- Fixed: Non-breaking issue with rules being unnecessarily split + +### 7.0.0 + +_September 17, 2018_ + +- Updated: Support for PostCSS v7+ +- Updated: Support for Node v6+ + +In a comment, a CSSWG member expressed interest in handling nested `@media` +while handling selector nesting. Since the specification has yet to be added +to the official CSSWG repository, nested at-rule deprecation is further delayed. + +### 6.0.0 + +_June 9, 2018_ + +- Deprecated: Nested at-rules like `@media` will no longer work in 7.0.0 +- Refactored code to improve efficiency + +### 5.0.0 + +_March 24, 2018_ + +- Refactored code to use Imports babel-transformed for Node v4 compatibility + +### 4.2.1 + +_September 19, 2017_ + +- Updated: Exposing the transform function as its own for postcss-extend + +### 4.2.0 + +_September 18, 2017_ + +- Added: Reduced splitting of rules + +### 4.1.0 + +_August 19, 2017_ + +- Added: Mutation-safe walk method +- Improved: Complex selector validity testing +- Thanks: A special thanks to @JLHwung for these improvements + +### 4.0.1 + +_May 22, 2017_ + +- Improved: Selector validity testing + +### 4.0.0 + +_May 20, 2017_ + +- Changed: Transform only compliant nesting +- Added: Preserve more raws formatting + +### 3.0.0 + +_May 8, 2017_ + +- Added: Node 4.x support +- Added: PostCSS 6 support +- Added: Preserved ordering +- Removed: Node 0.12 support + +### 2.3.1 + +_March 16, 2016_ + +- Updated: Allow any direct nesting that follows the syntactic constraints +- Updated: PostCSS 5.0.6 +- Updated: Tests +- Updated: Dependencies +- Updated: Project configuration + +### 2.3.0 + +_February 20, 2016_ + +- Updated: JavaScript formatting, linting, tests, and documentation +- Updated: Properly concatenate at-rules with or expressions +- Updated: Update internal plugin name to postcss-nesting + +### 2.2.0 + +_January 30, 2016_ + +- Added: Nesting of all at-rules +- Updated: Direct nesting order maintains order +- Updated: Tests and documentation + +### 2.1.1 + +_January 3, 2016_ + +- Updated: Project conventions + +### 2.1.0 + +_January 3, 2016_ + +- Added: Support for valid direct nesting + +### 2.0.6 + +_October 15, 2015_ + +- Fixed: Issue with new PostCSS rules + +### 2.0.5 + +_October 12, 2015_ + +- Updated: Nested rules source map to the parent rule +- Updated: PostCSS 5.0.9 +- Updated: Tests and documentation +- Updated: Project configuration + +### 2.0.4 + +_September 23, 2015_ + +- Updated: Map source raws + +### 2.0.3 + +_September 22, 2015_ + +- Updated: Refactored plugin +- Updated: Tests +- Updated: PostCSS 5.0.6 + +### 2.0.2 + +_September 16, 2015_ + +- Fixed: Issue where the new rule’s children were not mapped to the parent internally + +### 2.0.1 + +_September 16, 2015_ + +- Fixed: Issue where a `@nest` rule followed by another bubbling at-rule would not bubble +- Added: CONTRIBUTING.md + +### 2.0.0 + +_September 16, 2015_ + +- Added: Requirement of `&` per the specification +- Added: New prefix option +- Added: `@document` and `@supports` as bubbles +- Updated: Documentation + +### 1.0.0 + +_September 15, 2015_ + +- Added: New `@nest` at-rule syntax +- Updated: PostCSS 5 +- Removed: Old inner bracket syntax + +### 0.1.0 + +_June 17, 2015_ + +- Added: Initial release diff --git a/node_modules/postcss-nesting/LICENSE.md b/node_modules/postcss-nesting/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/postcss-nesting/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools 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. + +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-nesting/README.md b/node_modules/postcss-nesting/README.md new file mode 100644 index 00000000..bec68284 --- /dev/null +++ b/node_modules/postcss-nesting/README.md @@ -0,0 +1,207 @@ +# PostCSS Nesting [<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-nesting.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/nesting-rules.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 Nesting] lets you nest style rules inside each other, following the [CSS Nesting specification]. + +If you want nested rules the same way [Sass] works +you might want to use [PostCSS Nested] instead. + +```pcss +.foo { + color: red; + + &:hover { + color: green; + } + + > .bar { + color: blue; + } + + @media (prefers-color-scheme: dark) { + color: cyan; + } +} + +/* becomes */ + +.foo { + color: red; +} +.foo:hover { + color: green; + } +.foo > .bar { + color: blue; + } +@media (prefers-color-scheme: dark) { + .foo { + color: cyan; +} + } +``` + +## Usage + +Add [PostCSS Nesting] to your project: + +```bash +npm install postcss postcss-nesting --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssNesting = require('postcss-nesting'); + +postcss([ + postcssNesting(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Nesting] 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) + +## ⚠️ `@nest` has been removed from the specification. + +Previous iterations of the [CSS Nesting specification] required using `@nest` for certain selectors. + +`@nest` was removed from the specification completely. +Future versions of this plugin will error if you use `@nest`. + +We advice everyone to migrate their codebase **now** to nested CSS without `@nest`. +We published a [Stylelint Plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint/no-at-nest-rule#csstoolsstylelint-no-at-nest-rule) to help you migrate. + +example warning: +> `@nest` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version. +> Change `@nest foo & {}` to `foo & {}` to migrate to the latest standard. + +You can silence this warning with a new `silenceAtNestWarning` plugin option. + +```js +postcssNesting({ + silenceAtNestWarning: true +}) +``` + +## Options + +### noIsPseudoSelector + +#### Specificity + +Before : + +```css +#alpha, +.beta { + &:hover { + order: 1; + } +} +``` + +After **without** the option : + +```js +postcssNesting() +``` + +```css +:is(#alpha,.beta):hover { + order: 1; +} +``` + +_`.beta:hover` has specificity as if `.beta` where an id selector, matching the specification._ + +[specificity: 1, 1, 0](https://polypane.app/css-specificity-calculator/#selector=%3Ais(%23alpha%2C.beta)%3Ahover) + +After **with** the option : + +```js +postcssNesting({ + noIsPseudoSelector: true +}) +``` + +```css +#alpha:hover, .beta:hover { + order: 1; +} +``` + +_`.beta:hover` has specificity as if `.beta` where a class selector, conflicting with the specification._ + +[specificity: 0, 2, 0](https://polypane.app/css-specificity-calculator/#selector=.beta%3Ahover) + + +#### Complex selectors + +Before : + +```css +.alpha > .beta { + & + & { + order: 2; + } +} +``` + +After **without** the option : + +```js +postcssNesting() +``` + +```css +:is(.alpha > .beta) + :is(.alpha > .beta) { + order: 2; +} +``` + +After **with** the option : + +```js +postcssNesting({ + noIsPseudoSelector: true +}) +``` + +```css +.alpha > .beta + .alpha > .beta { + order: 2; +} +``` + +_this is a different selector than expected as `.beta + .alpha` matches `.beta` followed by `.alpha`._<br> +_avoid these cases when you disable `:is()`_<br> +_writing the selector without nesting is advised here_ + +```css +/* without nesting */ +.alpha > .beta + .beta { + order: 2; +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#nesting-rules +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/postcss-nesting + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Nesting]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting +[PostCSS Nested]: https://github.com/postcss/postcss-nested +[Sass]: https://sass-lang.com/ +[CSS Nesting specification]: https://www.w3.org/TR/css-nesting-1/ diff --git a/node_modules/postcss-nesting/dist/index.cjs b/node_modules/postcss-nesting/dist/index.cjs new file mode 100644 index 00000000..d5716ad9 --- /dev/null +++ b/node_modules/postcss-nesting/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity");const n=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const r=[];let o=[];for(let s=0;s<t.nodes.length;s++)if("combinator"!==t.nodes[s].type)if(e.isPseudoElement(t.nodes[s]))r.push(o),o=[t.nodes[s]];else{if("tag"===t.nodes[s].type&&o.find((e=>"tag"===e.type))){const r=n.clone({}),o=t.nodes[s];o.replaceWith(r),r.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else r.push(o),r.push([t.nodes[s]]),o=[];r.push(o);const s=[];for(let e=0;e<r.length;e++){const t=r[e];t.sort(((e,t)=>"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e<t.length;e++)s.push(t[e])}for(let e=s.length-1;e>=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?r.pseudoElement:r[t.type]}const r={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e<t;e++)n[e]=0;const r=[];for(;;){const o=[];for(let s=t-1;s>=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t.selectorSpecificity(e))),o=r[0];for(let e=1;e<r.length;e++)if(o.a!==r[e].a||o.b!==r[e].b||o.c!==r[e].c)return!1;return!0}function mergeSelectors(t,n,r){let o=[];o=nodesAreEquallySpecific(t)||r.noIsPseudoSelector?t.map((t=>e().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t<n.length;t++){let i,l=n[t];{const t=e().astSync(l);let n=!1;t.walk((e=>{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e<o.length;e++){c.push([]);for(let t=0;t<a;t++)c[e].push(o[e])}}for(let t=0;t<i;t++){let n=0;const o=e().astSync(l);o.walk((o=>{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),u=isSimpleSelector(o),p=isCompoundSelector(o);if(l&&u)return void o.replaceWith(s.clone());if((l||a)&&(u||p)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t<e.parent.nodes.length;t++)if("combinator"===e.parent.nodes[t].type&&" "!==e.parent.nodes[t].value&&">"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;t<e.parent.nodes.length;t++)if("nesting"!==e.parent.nodes[t].type&&(e.parent.nodes[t].prev()||e.parent.nodes[t].next())){if(e.parent.nodes[t].prev()&&"combinator"!==e.parent.nodes[t].prev().type)return!1;if(e.parent.nodes[t].next()&&"combinator"!==e.parent.nodes[t].next().type)return!1}return!0}function groupDeclarations(e){let t=-1;e.each(((n,r)=>{if("decl"===n.type)return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)));if("atrule"===n.type&&"mixin"===n.name.toLowerCase()){let o=n.prev();for(;o;){if("rule"===o.type||"atrule"===o.type)return;o=o.prev()}return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)))}if("comment"===n.type){const o=n.next();if(o&&("comment"===o.type||"rule"===o.type||"atrule"===o.type&&"mixin"!==o.name.toLowerCase()))return;return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)))}}))}function transformRuleWithinRule(e,t,n,r){let o=[];try{o=mergeSelectors(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r.message}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function transformNestRuleWithinRule(e,t,n,r,o){let s=[];try{s=mergeSelectors(t.selectors,comma(e.params),o)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.params}" with message: "${r.message}"`)}if(!s.length)return;shiftNodesBeforeParent(e,t);const i=t.clone().removeAll().append(e.nodes);i.raws.semicolon=!0,i.selectors=s,e.replaceWith(i),cleanupParent(t),r(i,n,o)}function isValidNestRuleWithinRule(e){return comma(e.params).every((e=>e.split("&").length>=2&&-1===e.indexOf("|")))}var o=["container","document","media","supports","layer","starting-style"];function atruleWithinRule(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule(e){return o.includes(e.name)}function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return o.includes(e.name)&&e.name===t.name}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule(r)?transformRuleWithinRule(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule(r)?atruleWithinRule(r,o,t,walk,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk(r,t,n)}))}const creator=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk(e,n,t),e.selector.includes("&")&&ersandToScope(e,n)}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/postcss-nesting/dist/index.d.ts b/node_modules/postcss-nesting/dist/index.d.ts new file mode 100644 index 00000000..777ed3e5 --- /dev/null +++ b/node_modules/postcss-nesting/dist/index.d.ts @@ -0,0 +1,10 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-nesting plugin options */ +export type pluginOptions = { + /** Avoid the `:is()` pseudo class as much as possible. default: false */ + noIsPseudoSelector?: boolean; + /** Silence the `@nest` warning. */ + silenceAtNestWarning?: boolean; +}; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/postcss-nesting/dist/index.mjs b/node_modules/postcss-nesting/dist/index.mjs new file mode 100644 index 00000000..442c0159 --- /dev/null +++ b/node_modules/postcss-nesting/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-selector-parser";import{selectorSpecificity as t}from"@csstools/selector-specificity";const n=e.pseudo({value:":is"});function sortCompoundSelectorsInsideComplexSelector(t){if(!t||!t.nodes)return;const r=[];let o=[];for(let s=0;s<t.nodes.length;s++)if("combinator"!==t.nodes[s].type)if(e.isPseudoElement(t.nodes[s]))r.push(o),o=[t.nodes[s]];else{if("tag"===t.nodes[s].type&&o.find((e=>"tag"===e.type))){const r=n.clone({}),o=t.nodes[s];o.replaceWith(r),r.append(e.selector({nodes:[o],value:void 0}))}o.push(t.nodes[s])}else r.push(o),r.push([t.nodes[s]]),o=[];r.push(o);const s=[];for(let e=0;e<r.length;e++){const t=r[e];t.sort(((e,t)=>"selector"===e.type&&"selector"===t.type&&e.nodes.length&&t.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t.nodes[0]):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0])-selectorTypeOrder(t):"selector"===t.type&&t.nodes.length?selectorTypeOrder(e)-selectorTypeOrder(t.nodes[0]):selectorTypeOrder(e)-selectorTypeOrder(t)));for(let e=0;e<t.length;e++)s.push(t[e])}for(let e=s.length-1;e>=0;e--)s[e].remove(),t.prepend(s[e])}function selectorTypeOrder(t){return e.isPseudoElement(t)?r.pseudoElement:r[t.type]}const r={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function ampersandToScope(t,n){let r,o=t.parent;for(;o;){if("rule"===o.type)return;o=o.parent}try{r=e().astSync(t.selector)}catch(e){return void t.warn(n,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}r&&(r.walkNesting((t=>{const n=t.parent;t.replaceWith(e.pseudo({value:":scope"})),n&&sortCompoundSelectorsInsideComplexSelector(n)})),t.selector=r.toString())}function cleanupParent(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function shiftNodesBeforeParent(e,t){const n=t.index(e);if(n){const e=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));e.raws.semicolon=!0,cleanupParent(e)}t.before(e),t.raws.semicolon=!0}function combinationsWithSizeN(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e<t;e++)n[e]=0;const r=[];for(;;){const o=[];for(let s=t-1;s>=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return r;n[s-1]+=1}o[s]=e[t]}r.push(o),n[n.length-1]++}}function nodesAreEquallySpecific(n){const r=n.map((t=>e().astSync(t))).map((e=>t(e))),o=r[0];for(let e=1;e<r.length;e++)if(o.a!==r[e].a||o.b!==r[e].b||o.c!==r[e].c)return!1;return!0}function mergeSelectors(t,n,r){let o=[];o=nodesAreEquallySpecific(t)||r.noIsPseudoSelector?t.map((t=>e().astSync(t))):[e().astSync(`:is(${t.join(",")})`)];const s=[];for(let t=0;t<n.length;t++){let i,l=n[t];{const t=e().astSync(l);let n=!1;t.walk((e=>{"nesting"===e.type&&(n=!0)}));const r=t.nodes[0];let o=!1;r.each((e=>"combinator"===e.type&&(o=!0,!1))),n?o&&r.insertBefore(r.at(0),e.nesting({})):(r.insertBefore(r.at(0),e.combinator({value:" "})),r.insertBefore(r.at(0),e.nesting({}))),l=t.toString()}let c=[],a=0;if(e().astSync(l).walkNesting((()=>{a++})),a>1&&o.length>1)c=combinationsWithSizeN(o,a),i=c.length;else{i=o.length;for(let e=0;e<o.length;e++){c.push([]);for(let t=0;t<a;t++)c[e].push(o[e])}}for(let t=0;t<i;t++){let n=0;const o=e().astSync(l);o.walk((o=>{if("nesting"!==o.type)return;let s=c[t][n];n++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const i=e().astSync(`:is(${s.toString()})`),l=isSimpleSelector(s.nodes[0]),a=isCompoundSelector(s.nodes[0]),p=isSimpleSelector(o),u=isCompoundSelector(o);if(l&&p)return void o.replaceWith(s.clone());if((l||a)&&(p||u)){const e=o.parent;return l&&"selector"===s.type?o.replaceWith(s.clone().nodes[0]):o.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&sortCompoundSelectorsInsideComplexSelector(e))}if(l){const e=o.parent;return o.replaceWith(s.clone().nodes[0]),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(a){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}if(nestingIsNotInsideCompoundSelector(o)){const e=o.parent;return o.replaceWith(...s.clone().nodes),void(e&&sortCompoundSelectorsInsideComplexSelector(e))}const d=o.parent;r.noIsPseudoSelector?o.replaceWith(...s.clone().nodes):o.replaceWith(...i.clone({}).nodes),d&&sortCompoundSelectorsInsideComplexSelector(d)})),s.push(o.toString())}}return s}function isSimpleSelector(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function isCompoundSelector(e,t=null){if(isSimpleSelector(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!isCompoundSelector(t))}function nestingIsFirstAndOnlyInSelectorWithEitherSpaceOrChildCombinator(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t<e.parent.nodes.length;t++)if("combinator"===e.parent.nodes[t].type&&" "!==e.parent.nodes[t].value&&">"!==e.parent.nodes[t].value)return!1;return!0}function nestingIsNotInsideCompoundSelector(e){if(isSimpleSelector(e))return!0;if(!e.parent)return!1;for(let t=0;t<e.parent.nodes.length;t++)if("nesting"!==e.parent.nodes[t].type&&(e.parent.nodes[t].prev()||e.parent.nodes[t].next())){if(e.parent.nodes[t].prev()&&"combinator"!==e.parent.nodes[t].prev().type)return!1;if(e.parent.nodes[t].next()&&"combinator"!==e.parent.nodes[t].next().type)return!1}return!0}function groupDeclarations(e){let t=-1;e.each(((n,r)=>{if("decl"===n.type)return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)));if("atrule"===n.type&&"mixin"===n.name.toLowerCase()){let o=n.prev();for(;o;){if("rule"===o.type||"atrule"===o.type)return;o=o.prev()}return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)))}if("comment"===n.type){const o=n.next();if(o&&("comment"===o.type||"rule"===o.type||"atrule"===o.type&&"mixin"!==o.name.toLowerCase()))return;return t===r-1?void(t=r):(n.remove(),e.insertAfter(t,n),void(t=e.index(n)))}}))}function transformRuleWithinRule(e,t,n,r){let o=[];try{o=mergeSelectors(t.selectors,e.selectors,r)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${r.message}"`)}if(!o.length)return;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.selectors=o;"rule"===e.type&&"rule"===t.type&&e.selector===t.selector&&e.append(...t.nodes),cleanupParent(t)}function isValidRuleWithinRule(e){return e.selectors.every((e=>-1===e.indexOf("|")))}function comma(e){const t=[];let n="",r=!1,o=0,s=!1,i=!1;for(const l of e)i?i=!1:"\\"===l?i=!0:s?l===s&&(s=!1):'"'===l||"'"===l?s=l:"("===l?o+=1:")"===l?o>0&&(o-=1):0===o&&","===l&&(r=!0),r?(""!==n&&t.push(n.trim()),n="",r=!1):n+=l;return t.push(n.trim()),t}function transformNestRuleWithinRule(e,t,n,r,o){let s=[];try{s=mergeSelectors(t.selectors,comma(e.params),o)}catch(r){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.params}" with message: "${r.message}"`)}if(!s.length)return;shiftNodesBeforeParent(e,t);const i=t.clone().removeAll().append(e.nodes);i.raws.semicolon=!0,i.selectors=s,e.replaceWith(i),cleanupParent(t),r(i,n,o)}function isValidNestRuleWithinRule(e){return comma(e.params).every((e=>e.split("&").length>=2&&-1===e.indexOf("|")))}var o=["container","document","media","supports","layer","starting-style"];function atruleWithinRule(e,t,n,r,o){if(groupDeclarations(t),shiftNodesBeforeParent(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),cleanupParent(t),r(s,n,o)}else cleanupParent(t)}function isAtruleWithinRule(e){return o.includes(e.name)}function transformAtruleWithinAtrule(e,t){var n,r;groupDeclarations(t),shiftNodesBeforeParent(e,t),e.params=(n=t.params,r=e.params,comma(n).map((e=>comma(r).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),cleanupParent(t)}function isAtruleWithinAtrule(e,t){return o.includes(e.name)&&e.name===t.name}function isAtRule(e){return e&&"atrule"===e.type}function isNestRule(e){return e&&isAtRule(e)&&"nest"===e.name}function isRule(e){return e&&"rule"===e.type}function walk(e,t,n){e.each((r=>{const o=r.parent;isNestRule(r)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.\nChange \`@nest ${r.params} {}\` to \`${r.params} {}\` to migrate to the latest standard.`),isRule(r)&&isRule(o)&&isValidRuleWithinRule(r)?transformRuleWithinRule(r,o,t,n):isNestRule(r)&&isRule(o)&&isValidNestRuleWithinRule(r)?transformNestRuleWithinRule(r,o,t,walk,n):isAtRule(r)&&isRule(o)&&isAtruleWithinRule(r)?atruleWithinRule(r,o,t,walk,n):isAtRule(r)&&isAtRule(o)&&isAtruleWithinAtrule(r,o)&&transformAtruleWithinAtrule(r,o),"nodes"in r&&r.nodes.length&&walk(r,t,n)}))}const creator=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(e,{result:n}){walk(e,n,t),e.selector.includes("&")&&ersandToScope(e,n)}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/postcss-nesting/dist/lib/ampersand-to-scope.d.ts b/node_modules/postcss-nesting/dist/lib/ampersand-to-scope.d.ts new file mode 100644 index 00000000..f82c36f9 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/ampersand-to-scope.d.ts @@ -0,0 +1,2 @@ +import type { Result, Rule } from 'postcss'; +export default function ampersandToScope(rule: Rule, result: Result): void; diff --git a/node_modules/postcss-nesting/dist/lib/atrule-within-atrule.d.ts b/node_modules/postcss-nesting/dist/lib/atrule-within-atrule.d.ts new file mode 100644 index 00000000..f06ffa9a --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/atrule-within-atrule.d.ts @@ -0,0 +1,3 @@ +import type { AtRule } from 'postcss'; +export default function transformAtruleWithinAtrule(node: AtRule, parent: AtRule): void; +export declare function isAtruleWithinAtrule(node: AtRule, parent: AtRule): boolean; diff --git a/node_modules/postcss-nesting/dist/lib/atrule-within-rule.d.ts b/node_modules/postcss-nesting/dist/lib/atrule-within-rule.d.ts new file mode 100644 index 00000000..3c7c0911 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/atrule-within-rule.d.ts @@ -0,0 +1,5 @@ +import { options } from './options.js'; +import { walkFunc } from './walk-func.js'; +import type { AtRule, Result, Rule } from 'postcss'; +export default function atruleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void; +export declare function isAtruleWithinRule(node: AtRule): boolean; diff --git a/node_modules/postcss-nesting/dist/lib/cleanup-parent.d.ts b/node_modules/postcss-nesting/dist/lib/cleanup-parent.d.ts new file mode 100644 index 00000000..5547db14 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/cleanup-parent.d.ts @@ -0,0 +1,2 @@ +import type { ChildNode, Container } from 'postcss'; +export default function cleanupParent(parent: Container<ChildNode>): void; diff --git a/node_modules/postcss-nesting/dist/lib/group-declarations.d.ts b/node_modules/postcss-nesting/dist/lib/group-declarations.d.ts new file mode 100644 index 00000000..11643420 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/group-declarations.d.ts @@ -0,0 +1,2 @@ +import type { ChildNode, Container } from 'postcss'; +export default function groupDeclarations(node: Container<ChildNode>): void; diff --git a/node_modules/postcss-nesting/dist/lib/is-type-of-rule.d.ts b/node_modules/postcss-nesting/dist/lib/is-type-of-rule.d.ts new file mode 100644 index 00000000..d6cb2458 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/is-type-of-rule.d.ts @@ -0,0 +1,4 @@ +import type { AtRule, Node, Rule } from 'postcss'; +export declare function isAtRule(node?: Node): node is AtRule; +export declare function isNestRule(node?: Node): node is AtRule; +export declare function isRule(node?: Node): node is Rule; diff --git a/node_modules/postcss-nesting/dist/lib/list.d.ts b/node_modules/postcss-nesting/dist/lib/list.d.ts new file mode 100644 index 00000000..67a64736 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/list.d.ts @@ -0,0 +1 @@ +export declare function comma(string: string): string[]; diff --git a/node_modules/postcss-nesting/dist/lib/merge-params.d.ts b/node_modules/postcss-nesting/dist/lib/merge-params.d.ts new file mode 100644 index 00000000..0547e8f7 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/merge-params.d.ts @@ -0,0 +1 @@ +export default function mergeParams(fromParams: string, toParams: string): string; diff --git a/node_modules/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts b/node_modules/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts new file mode 100644 index 00000000..56bbf723 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts @@ -0,0 +1 @@ +export declare function combinationsWithSizeN(set: Array<string>, n: number): Array<Array<string>>; diff --git a/node_modules/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts b/node_modules/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts new file mode 100644 index 00000000..3d43458e --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts @@ -0,0 +1,2 @@ +import type { Container, Node } from 'postcss-selector-parser'; +export declare function sortCompoundSelectorsInsideComplexSelector(node: Container<string, Node>): void; diff --git a/node_modules/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts b/node_modules/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts new file mode 100644 index 00000000..f46fd8d7 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts @@ -0,0 +1,2 @@ +import { options } from '../options'; +export default function mergeSelectors(fromSelectors: Array<string>, toSelectors: Array<string>, opts: options): any[]; diff --git a/node_modules/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts b/node_modules/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts new file mode 100644 index 00000000..2afcbaf9 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts @@ -0,0 +1 @@ +export declare function nodesAreEquallySpecific(nodes: Array<string>): boolean; diff --git a/node_modules/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts b/node_modules/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts new file mode 100644 index 00000000..a0ea699b --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts @@ -0,0 +1,5 @@ +import type { AtRule, Result, Rule } from 'postcss'; +import { walkFunc } from './walk-func.js'; +import { options } from './options.js'; +export default function transformNestRuleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void; +export declare function isValidNestRuleWithinRule(node: AtRule): boolean; diff --git a/node_modules/postcss-nesting/dist/lib/options.d.ts b/node_modules/postcss-nesting/dist/lib/options.d.ts new file mode 100644 index 00000000..87677184 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/options.d.ts @@ -0,0 +1,4 @@ +export type options = { + noIsPseudoSelector: boolean; + silenceAtNestWarning: boolean; +}; diff --git a/node_modules/postcss-nesting/dist/lib/rule-within-rule.d.ts b/node_modules/postcss-nesting/dist/lib/rule-within-rule.d.ts new file mode 100644 index 00000000..5f733d3b --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/rule-within-rule.d.ts @@ -0,0 +1,4 @@ +import type { Result, Rule } from 'postcss'; +import { options } from './options.js'; +export default function transformRuleWithinRule(node: Rule, parent: Rule, result: Result, opts: options): void; +export declare function isValidRuleWithinRule(node: Rule): boolean; diff --git a/node_modules/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts b/node_modules/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts new file mode 100644 index 00000000..0876f2ba --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts @@ -0,0 +1,2 @@ +import type { ChildNode, Container } from 'postcss'; +export default function shiftNodesBeforeParent(node: ChildNode, parent: Container<ChildNode>): void; diff --git a/node_modules/postcss-nesting/dist/lib/valid-atrules.d.ts b/node_modules/postcss-nesting/dist/lib/valid-atrules.d.ts new file mode 100644 index 00000000..d451d2bc --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/valid-atrules.d.ts @@ -0,0 +1,2 @@ +declare const _default: string[]; +export default _default; diff --git a/node_modules/postcss-nesting/dist/lib/walk-func.d.ts b/node_modules/postcss-nesting/dist/lib/walk-func.d.ts new file mode 100644 index 00000000..36cff833 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/walk-func.d.ts @@ -0,0 +1,4 @@ +import type { Container, Result } from 'postcss'; +export type walkFunc = (node: Container, result: Result, opts: { + noIsPseudoSelector: boolean; +}) => void; diff --git a/node_modules/postcss-nesting/dist/lib/walk.d.ts b/node_modules/postcss-nesting/dist/lib/walk.d.ts new file mode 100644 index 00000000..b50ece78 --- /dev/null +++ b/node_modules/postcss-nesting/dist/lib/walk.d.ts @@ -0,0 +1,3 @@ +import type { Container, Result } from 'postcss'; +import { options } from './options.js'; +export default function walk(node: Container, result: Result, opts: options): void; diff --git a/node_modules/postcss-nesting/package.json b/node_modules/postcss-nesting/package.json new file mode 100644 index 00000000..53907745 --- /dev/null +++ b/node_modules/postcss-nesting/package.json @@ -0,0 +1,107 @@ +{ + "name": "postcss-nesting", + "description": "Nest rules inside each other in CSS", + "version": "12.0.1", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Jonathan Neal", + "email": "jonathantneal@hotmail.com" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "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", + "jsdelivr": "dist/index.mjs", + "unpkg": "dist/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "dependencies": { + "@csstools/selector-specificity": "^3.0.0", + "postcss-selector-parser": "^6.0.13" + }, + "peerDependencies": { + "postcss": "^8.4" + }, + "devDependencies": { + "@csstools/postcss-tape": "*", + "puppeteer": "^21.0.1" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", + "test:browser": "node ./test/_browser.mjs", + "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-nesting" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "atrules", + "child", + "children", + "css", + "cssnext", + "csswg", + "nested", + "nestings", + "postcss", + "postcss-plugin", + "rules", + "selectors", + "specifications", + "specs", + "syntax", + "w3c" + ], + "csstools": { + "cssdbId": "nesting-rules", + "exportName": "postcssNesting", + "humanReadableName": "PostCSS Nesting", + "specUrl": "https://www.w3.org/TR/css-nesting-1/" + }, + "volta": { + "extends": "../../package.json" + } +} |
