From f06956efd2dc4bf77244a9fcce2b883a00b925af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Dec 2023 22:46:53 +0800 Subject: updated node modules --- node_modules/css-has-pseudo/CHANGELOG.md | 202 +-------------------- node_modules/css-has-pseudo/README.md | 20 +- node_modules/css-has-pseudo/dist/index.cjs | 2 +- node_modules/css-has-pseudo/dist/index.d.ts | 10 +- node_modules/css-has-pseudo/dist/index.mjs | 2 +- .../dist/is-guarded-by-at-supports.d.ts | 2 - node_modules/css-has-pseudo/package.json | 42 ++--- 7 files changed, 42 insertions(+), 238 deletions(-) delete mode 100644 node_modules/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts (limited to 'node_modules/css-has-pseudo') diff --git a/node_modules/css-has-pseudo/CHANGELOG.md b/node_modules/css-has-pseudo/CHANGELOG.md index d53900c2..6a95df5f 100644 --- a/node_modules/css-has-pseudo/CHANGELOG.md +++ b/node_modules/css-has-pseudo/CHANGELOG.md @@ -1,11 +1,18 @@ # Changes to CSS Has Pseudo +### 6.0.1 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#301) (patch) + ### 6.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`](/packages/selector-specificity) to [`3.0.0`](/packages/selector-specificity/CHANGELOG.md#300) (major) +- 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) ### 5.0.2 @@ -13,195 +20,4 @@ _February 6, 2023_ - Reduce the amount of duplicate fallback CSS. -### 5.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 5.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). -- Fix: Do not throw when a selector is invalid, show a warning instead. -- Fix: make `:has()` unforgiving. `:has(.foo, :some-invalid-selector)` will no longer match elements that have children with `.foo`. - -### 4.0.2 - -_December 12, 2022_ - - - Fix: correctly cleanup style rules when a browser has native support. [backported](https://github.com/csstools/postcss-plugins/pull/752) - -### 4.0.1 - -_August 23, 2022_ - -- Fix: assign global browser polyfill to `window`, `self` or a blank object. - -### 4.0.0 - -_July 8, 2022_ - -[Read the full changelog](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-8) - -- Breaking: removed old CDN urls -- Added: 'hover' options for browser polyfill -- Added: 'observedAttributes' options for browser polyfill -- Added: 'forcePolyfill' options for browser polyfill -- Added: Rules within `@supports selector(:has(something))` won't be transformed. -- Fix: Use base36 encoding to support all possible selectors. -- Fix: case insensitive matching. - -#### How to migrate : - -##### Re-build your CSS with the new version of the library. - -##### If you use a CDN url, please update it. - -```diff -- -+ -``` - -```diff -- -+ -``` - -### 3.0.4 - -_February 5, 2022_ - -- Rebuild of browser polyfills - -### 3.0.3 - -_January 12, 2022_ - -- Fix compatibility with PostCSS `v8.2.x` [#147](https://github.com/csstools/postcss-plugins/issues/147) - -This version is not officially supported but some tool providers pinned PostCSS to `v8.2.x`, -making it impossible for end users to have a working setup. - -### 3.0.2 - -_January 2, 2022_ - -- Removed Sourcemaps from package tarball. -- Moved CLI to CLI Package. See [announcement](https://github.com/csstools/postcss-plugins/discussions/121). - -### 3.0.1 - -_December 27, 2021_ - -- Fixed: require/import paths for browser script - -### 3.0.0 - -_December 13, 2021_ - -- Breaking: require/import paths have changed -- Changed: new polyfill CDN urls. -- Updated: documentation - -**Migrating to 3.0.0** - -PostCSS plugin : - -```diff -- const postcssHasPseudo = require('css-has-pseudo/postcss'); -+ const postcssHasPseudo = require('css-has-pseudo'); -``` - -Browser Polyfill : - -```diff -- const cssHasPseudo = require('css-has-pseudo'); -+ const cssHasPseudo = require('css-has-pseudo/browser'); -``` - -_The old CND url is now deprecated and will be removed in a next major release._ -_It will continue to work for now._ - -```diff -- -+ -``` - -### 2.0.0 - -_September 16, 2021_ - -- Updated: Support for PostCS 8+ (major). -- Updated: Support for Node 12+ (major). - -### 1.0.0 - -_June 10, 2019_ - -- Updated: `postcss-selector-parser` to 6.0.2 (major) -- Updated: `postcss` to 7.0.16 (patch) -- Updated: Node 8+ compatibility (major) - -### 0.10.0 - -_December 11, 2018_ - -- Fixed an issue where inaccessible rules would crash the library - -### 0.9.0 - -_November 26, 2018_ - -- Improved CLI usage - -### 0.8.0 - -_November 26, 2018_ - -- Fixed an issue where attribute names were not being properly encoded - -### 0.7.0 - -_November 25, 2018_ - -- Replaced `setImmediate` with `requestAnimationFrame` for future compatibility - -### 0.6.0 - -_November 25, 2018_ - -- Fixed an issue where nested rules were not supported - -### 0.5.0 - -_November 21, 2018_ - -- Further optimize script; from 775 bytes to 757 bytes - -### 0.4.0 - -_November 21, 2018_ - -- Fixed an issue with the browser script not picking up added nodes - -### 0.3.0 - -_November 21, 2018_ - -- Fixed the misnamed function name for the browser-ready script - -### 0.2.0 - -_November 21, 2018_ - -- Improved browser compatibility with updated parsers, encoders, and decoders -- Improved performance by walking the DOM less -- Reduced script size by 9%; from 855 bytes to 775 bytes - -### 0.1.0 - -_November 20, 2018_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-has-pseudo/CHANGELOG.md) diff --git a/node_modules/css-has-pseudo/README.md b/node_modules/css-has-pseudo/README.md index be57a5a8..c7962f9b 100644 --- a/node_modules/css-has-pseudo/README.md +++ b/node_modules/css-has-pseudo/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install css-has-pseudo --save-dev +``` + [PostCSS Has Pseudo] lets you style elements relative to other elements in CSS, following the [Selectors Level 4] specification. To use this feature you need to do two things : @@ -162,12 +166,13 @@ or ```html - + ``` -⚠️ Please use a versioned url, like this : `https://unpkg.com/css-has-pseudo@6.0.0/dist/browser-global.js` -Without the version, you might unexpectedly get a new major version of the library with breaking changes. +> [!TIP] +> Please use a versioned url, like this : `https://unpkg.com/css-has-pseudo@6.0.1/dist/browser-global.js` +> Without the version, you might unexpectedly get a new major version of the library with breaking changes. [PostCSS Has Pseudo] works in all major browsers, including Internet Explorer 11. With a [Mutation Observer polyfill](https://github.com/webmodules/mutation-observer), the script will work @@ -234,10 +239,11 @@ ECMA Script: ## CORS -⚠️ Applies to you if you load CSS from a different domain than the page. - -In this case the CSS is treated as untrusted and will not be made available to the JavaScript polyfill. -The polyfill will not work without applying the correct configuration for CORS. +> [!IMPORTANT] +> Applies to you if you load CSS from a different domain than the page. +> +> In this case the CSS is treated as untrusted and will not be made available to the JavaScript polyfill. +> The polyfill will not work without applying the correct configuration for CORS. Example : diff --git a/node_modules/css-has-pseudo/dist/index.cjs b/node_modules/css-has-pseudo/dist/index.cjs index 2746cb0c..235c888d 100644 --- a/node_modules/css-has-pseudo/dist/index.cjs +++ b/node_modules/css-has-pseudo/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser"),t=require("postcss-value-parser"),s=require("@csstools/selector-specificity");function encodeCSS(e){if(""===e)return"";let t,s="";for(let r=0;r{if("function"===e.type&&"selector"===e.value.toLowerCase())return r.add(t.stringify(e.nodes)),!1})),r.forEach((e=>{selectorContainsHasPseudo(e)&&(s=!0)}))}catch(e){}return s}function selectorContainsHasPseudo(t){if(!t.toLowerCase().includes(":has("))return!1;let s=!1;try{e().astSync(t).walk((e=>{if("pseudo"===e.type&&":has"===e.value.toLowerCase()&&e.nodes&&e.nodes.length>0)return s=!0,!1}))}catch(e){}return s}const creator=t=>{const r={preserve:!0,specificityMatchingName:"does-not-exist",...t||{}},o=":not(#"+r.specificityMatchingName+")",n=":not(."+r.specificityMatchingName+")",a=":not("+r.specificityMatchingName+")";return{postcssPlugin:"css-has-pseudo",prepare(){const t=new WeakSet;return{RuleExit:(c,{result:i})=>{if(t.has(c))return;if(!c.selector.toLowerCase().includes(":has(")||isWithinSupportCheck(c))return;const l=c.selectors.map((t=>{if(!t.toLowerCase().includes(":has("))return t;let l;try{l=e().astSync(t)}catch(e){return c.warn(i,`Failed to parse selector : "${t}" with message: "${e.message}"`),t}if(void 0===l)return t;l.walkPseudos((t=>{let s=t.parent,o=!1;for(;s;)e.isPseudoClass(s)&&":has"===s.value.toLowerCase()&&(o=!0),s=s.parent;o&&(":visited"===t.value.toLowerCase()&&t.replaceWith(e.className({value:r.specificityMatchingName})),":any-link"===t.value.toLowerCase()&&(t.value=":link"))})),l.walkPseudos((t=>{if(":has"!==t.value.toLowerCase()||!t.nodes)return;let r=t.parent??t;if(r!==t){let t=r.nodes.length;e:for(let s=0;s=0;e--)if("combinator"!==r.nodes[s].type&&"comment"!==r.nodes[s].type){t=e+1;break e}}if(t{delete e.parent,s.append(e)}));const o=e.selector({value:"",nodes:[]});r.nodes.slice(t).forEach((e=>{delete e.parent,o.append(e)}));const n=e.selector({value:"",nodes:[]});n.append(s),n.append(o),r.replaceWith(n),r=s}}const c="["+encodeCSS(r.toString())+"]",i=s.selectorSpecificity(r);let l=c;for(let e=0;e{if("function"===e.type&&"selector"===e.value.toLowerCase())return r.add(t.stringify(e.nodes)),!1})),r.forEach((e=>{selectorContainsHasPseudo(e)&&(s=!0)}))}catch(e){}return s}function selectorContainsHasPseudo(t){if(!t.toLowerCase().includes(":has("))return!1;let s=!1;try{e().astSync(t).walk((e=>{if("pseudo"===e.type&&":has"===e.value.toLowerCase()&&e.nodes&&e.nodes.length>0)return s=!0,!1}))}catch(e){}return s}const creator=t=>{const r={preserve:!0,specificityMatchingName:"does-not-exist",...t||{}},o=":not(#"+r.specificityMatchingName+")",n=":not(."+r.specificityMatchingName+")",a=":not("+r.specificityMatchingName+")";return{postcssPlugin:"css-has-pseudo",prepare(){const t=new WeakSet;return{RuleExit:(c,{result:i})=>{if(t.has(c))return;if(!c.selector.toLowerCase().includes(":has(")||isWithinSupportCheck(c))return;const l=c.selectors.map((t=>{if(!t.toLowerCase().includes(":has("))return t;let l;try{l=e().astSync(t)}catch(e){return c.warn(i,`Failed to parse selector : "${t}" with message: "${e instanceof Error?e.message:e}"`),t}if(void 0===l)return t;l.walkPseudos((t=>{let s=t.parent,o=!1;for(;s;)e.isPseudoClass(s)&&":has"===s.value.toLowerCase()&&(o=!0),s=s.parent;o&&(":visited"===t.value.toLowerCase()&&t.replaceWith(e.className({value:r.specificityMatchingName})),":any-link"===t.value.toLowerCase()&&(t.value=":link"))})),l.walkPseudos((t=>{if(":has"!==t.value.toLowerCase()||!t.nodes)return;const r=t.parent;if(!r)return;const c=e.selector({value:"",nodes:[]});{let t=r.nodes.length;e:for(let s=0;s=0;e--)if("combinator"!==r.nodes[s].type&&"comment"!==r.nodes[s].type){t=e+1;break e}}r.nodes.slice(0,t).forEach((e=>{e.remove(),"selector"===e.type?e.nodes.forEach((e=>{delete e.parent,c.append(e)})):(delete e.parent,c.append(e))}))}const i="["+encodeCSS(c.toString())+"]",l=s.selectorSpecificity(c);let u=i;for(let e=0;e=0;e--)r.prepend(d[e])}));const u=l.toString();return u!==t?".js-has-pseudo "+u:t}));l.join(",")!==c.selectors.join(",")&&(t.add(c),c.cloneBefore({selectors:l}),r.preserve||c.remove())}}}}};function isWithinSupportCheck(e){let t=e.parent;for(;t;){if("atrule"===t.type&&isGuardedByAtSupportsFromAtRuleParams(t.params))return!0;t=t.parent}return!1}creator.postcss=!0,module.exports=creator; diff --git a/node_modules/css-has-pseudo/dist/index.d.ts b/node_modules/css-has-pseudo/dist/index.d.ts index 2f29343a..fa7b7362 100644 --- a/node_modules/css-has-pseudo/dist/index.d.ts +++ b/node_modules/css-has-pseudo/dist/index.d.ts @@ -1,10 +1,14 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** css-has-pseudo plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Change the selector that is used to adjust specificity. default: "does-not-exist" */ specificityMatchingName?: string; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/css-has-pseudo/dist/index.mjs b/node_modules/css-has-pseudo/dist/index.mjs index 497b8fc1..7d44b523 100644 --- a/node_modules/css-has-pseudo/dist/index.mjs +++ b/node_modules/css-has-pseudo/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";import t from"postcss-value-parser";import{selectorSpecificity as s}from"@csstools/selector-specificity";function encodeCSS(e){if(""===e)return"";let t,s="";for(let o=0;o{if("function"===e.type&&"selector"===e.value.toLowerCase())return o.add(t.stringify(e.nodes)),!1})),o.forEach((e=>{selectorContainsHasPseudo(e)&&(s=!0)}))}catch(e){}return s}function selectorContainsHasPseudo(t){if(!t.toLowerCase().includes(":has("))return!1;let s=!1;try{e().astSync(t).walk((e=>{if("pseudo"===e.type&&":has"===e.value.toLowerCase()&&e.nodes&&e.nodes.length>0)return s=!0,!1}))}catch(e){}return s}const creator=t=>{const o={preserve:!0,specificityMatchingName:"does-not-exist",...t||{}},r=":not(#"+o.specificityMatchingName+")",n=":not(."+o.specificityMatchingName+")",a=":not("+o.specificityMatchingName+")";return{postcssPlugin:"css-has-pseudo",prepare(){const t=new WeakSet;return{RuleExit:(c,{result:i})=>{if(t.has(c))return;if(!c.selector.toLowerCase().includes(":has(")||isWithinSupportCheck(c))return;const l=c.selectors.map((t=>{if(!t.toLowerCase().includes(":has("))return t;let l;try{l=e().astSync(t)}catch(e){return c.warn(i,`Failed to parse selector : "${t}" with message: "${e.message}"`),t}if(void 0===l)return t;l.walkPseudos((t=>{let s=t.parent,r=!1;for(;s;)e.isPseudoClass(s)&&":has"===s.value.toLowerCase()&&(r=!0),s=s.parent;r&&(":visited"===t.value.toLowerCase()&&t.replaceWith(e.className({value:o.specificityMatchingName})),":any-link"===t.value.toLowerCase()&&(t.value=":link"))})),l.walkPseudos((t=>{if(":has"!==t.value.toLowerCase()||!t.nodes)return;let o=t.parent??t;if(o!==t){let t=o.nodes.length;e:for(let s=0;s=0;e--)if("combinator"!==o.nodes[s].type&&"comment"!==o.nodes[s].type){t=e+1;break e}}if(t{delete e.parent,s.append(e)}));const r=e.selector({value:"",nodes:[]});o.nodes.slice(t).forEach((e=>{delete e.parent,r.append(e)}));const n=e.selector({value:"",nodes:[]});n.append(s),n.append(r),o.replaceWith(n),o=s}}const c="["+encodeCSS(o.toString())+"]",i=s(o);let l=c;for(let e=0;e{if("function"===e.type&&"selector"===e.value.toLowerCase())return o.add(t.stringify(e.nodes)),!1})),o.forEach((e=>{selectorContainsHasPseudo(e)&&(s=!0)}))}catch(e){}return s}function selectorContainsHasPseudo(t){if(!t.toLowerCase().includes(":has("))return!1;let s=!1;try{e().astSync(t).walk((e=>{if("pseudo"===e.type&&":has"===e.value.toLowerCase()&&e.nodes&&e.nodes.length>0)return s=!0,!1}))}catch(e){}return s}const creator=t=>{const o={preserve:!0,specificityMatchingName:"does-not-exist",...t||{}},r=":not(#"+o.specificityMatchingName+")",n=":not(."+o.specificityMatchingName+")",a=":not("+o.specificityMatchingName+")";return{postcssPlugin:"css-has-pseudo",prepare(){const t=new WeakSet;return{RuleExit:(c,{result:i})=>{if(t.has(c))return;if(!c.selector.toLowerCase().includes(":has(")||isWithinSupportCheck(c))return;const l=c.selectors.map((t=>{if(!t.toLowerCase().includes(":has("))return t;let l;try{l=e().astSync(t)}catch(e){return c.warn(i,`Failed to parse selector : "${t}" with message: "${e instanceof Error?e.message:e}"`),t}if(void 0===l)return t;l.walkPseudos((t=>{let s=t.parent,r=!1;for(;s;)e.isPseudoClass(s)&&":has"===s.value.toLowerCase()&&(r=!0),s=s.parent;r&&(":visited"===t.value.toLowerCase()&&t.replaceWith(e.className({value:o.specificityMatchingName})),":any-link"===t.value.toLowerCase()&&(t.value=":link"))})),l.walkPseudos((t=>{if(":has"!==t.value.toLowerCase()||!t.nodes)return;const o=t.parent;if(!o)return;const c=e.selector({value:"",nodes:[]});{let t=o.nodes.length;e:for(let s=0;s=0;e--)if("combinator"!==o.nodes[s].type&&"comment"!==o.nodes[s].type){t=e+1;break e}}o.nodes.slice(0,t).forEach((e=>{e.remove(),"selector"===e.type?e.nodes.forEach((e=>{delete e.parent,c.append(e)})):(delete e.parent,c.append(e))}))}const i="["+encodeCSS(c.toString())+"]",l=s(c);let u=i;for(let e=0;e=0;e--)o.prepend(d[e])}));const u=l.toString();return u!==t?".js-has-pseudo "+u:t}));l.join(",")!==c.selectors.join(",")&&(t.add(c),c.cloneBefore({selectors:l}),o.preserve||c.remove())}}}}};function isWithinSupportCheck(e){let t=e.parent;for(;t;){if("atrule"===t.type&&isGuardedByAtSupportsFromAtRuleParams(t.params))return!0;t=t.parent}return!1}creator.postcss=!0;export{creator as default}; diff --git a/node_modules/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts b/node_modules/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts deleted file mode 100644 index 1be40860..00000000 --- a/node_modules/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isGuardedByAtSupportsFromAtRuleParams(atSupportsParams: string): boolean; -export declare function selectorContainsHasPseudo(selector: string): boolean; diff --git a/node_modules/css-has-pseudo/package.json b/node_modules/css-has-pseudo/package.json index 93e06086..c7568854 100644 --- a/node_modules/css-has-pseudo/package.json +++ b/node_modules/css-has-pseudo/package.json @@ -1,7 +1,7 @@ { "name": "css-has-pseudo", "description": "Style elements relative to other elements in CSS", - "version": "6.0.0", + "version": "6.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -31,15 +31,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "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" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", @@ -57,27 +60,13 @@ "dist" ], "dependencies": { - "@csstools/selector-specificity": "^3.0.0", + "@csstools/selector-specificity": "^3.0.1", "postcss-selector-parser": "^6.0.13", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*", - "@mrhenry/core-web": "^1.1.1", - "puppeteer": "^20.7.4" - }, - "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 ./src/encode/test.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/css-has-pseudo#readme", "repository": { "type": "git", @@ -97,14 +86,5 @@ "postcss-plugin", "pseudo", "selector" - ], - "csstools": { - "cssdbId": "has-pseudo-class", - "exportName": "postcssHasPseudo", - "humanReadableName": "PostCSS Has Pseudo", - "specUrl": "https://www.w3.org/TR/selectors-4/#has-pseudo" - }, - "volta": { - "extends": "../../package.json" - } + ] } -- cgit v1.2.3