diff options
Diffstat (limited to 'node_modules/postcss-double-position-gradients')
9 files changed, 28 insertions, 163 deletions
diff --git a/node_modules/postcss-double-position-gradients/CHANGELOG.md b/node_modules/postcss-double-position-gradients/CHANGELOG.md index 0d6567e7..6a471fde 100644 --- a/node_modules/postcss-double-position-gradients/CHANGELOG.md +++ b/node_modules/postcss-double-position-gradients/CHANGELOG.md @@ -1,5 +1,12 @@ # Changes to PostCSS Double Position Gradients +### 5.0.3 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) + ### 5.0.2 _October 9, 2023_ @@ -13,130 +20,4 @@ _September 18, 2023_ - Improve performance - Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) -### 5.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/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) - -### 4.0.4 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - -### 4.0.3 - -_May 19, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) - -### 4.0.2 - -_February 8, 2023_ - -- Reduce the amount of duplicate fallback CSS. - -### 4.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 4.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 3.1.2 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 3.1.1 - -_March 7, 2022_ - -- Add TypeScript support -- Fix color functions. -- Fix `at` keyword with `at 20px 20px` being interpreted as a double position color stop. - -### 3.1.0 - -_February 15, 2022_ - -- Ignore values in relevant `@supports` rules. -- Support double position gradients in Custom Properties. - -```css -@supports (order: linear-gradient(90deg, black 25% 50%, blue 50% 75%)) { - .support { - /* is not processed */ - order: linear-gradient(90deg, black 25% 50%, blue 50% 75%); - } -} -``` - -### 3.0.5 - -_February 5, 2022_ - -- Improved `es module` and `commonjs` compatibility - -### 3.0.4 - -_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.3 - -_December 14, 2021_ - -- Fixed: infinite loop in complex gradients. - -### 3.0.2 - -_December 13, 2021_ - -- Changed: now uses `postcss-value-parser` for parsing. -- Updated: documentation - -### 3.0.1 - -_November 18, 2021_ - -- Added: Safeguards against postcss-values-parser potentially throwing an error. - -- Fixed: Issue with some gradients creating an infinite loop. - -- Updated: `postcss-value-parser` to 6.0.1 (patch) -- Updated: `eslint` to 8.2.0 (major) -- Updated: `postcss` to 8.3.11 (patch) - -- Removed: yarn.lock is no longer version controlled - -### 3.0.0 - -_September 17, 2021_ - -- Updated: Support for PostCS 8+ (major). -- Updated: Support for Node 12+ (major). - -### 2.0.0 - -_April 25, 2020_ - -- Updated: `postcss` to 7.0.27 (patch) -- Updated: `postcss-value-parser` to 3.2.1 (major) -- Updated: Support for Node 10+ (major) - -### 1.0.0 - -_October 28, 2018_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients/CHANGELOG.md) diff --git a/node_modules/postcss-double-position-gradients/README.md b/node_modules/postcss-double-position-gradients/README.md index 6604ff5d..efcc1d1a 100644 --- a/node_modules/postcss-double-position-gradients/README.md +++ b/node_modules/postcss-double-position-gradients/README.md @@ -97,7 +97,8 @@ postcssDoublePositionGradients({ preserve: false }) The `enableProgressiveCustomProperties` option determines whether the original notation is wrapped with `@supports` when used in Custom Properties. By default, it is enabled. -⚠️ We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). +> [!NOTE] +> We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). ```js postcssDoublePositionGradients({ enableProgressiveCustomProperties: false }) diff --git a/node_modules/postcss-double-position-gradients/dist/has-fallback-decl.d.ts b/node_modules/postcss-double-position-gradients/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/postcss-double-position-gradients/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/postcss-double-position-gradients/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/postcss-double-position-gradients/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/postcss-double-position-gradients/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/postcss-double-position-gradients/dist/index.cjs b/node_modules/postcss-double-position-gradients/dist/index.cjs index 3c38b391..d5a656fb 100644 --- a/node_modules/postcss-double-position-gradients/dist/index.cjs +++ b/node_modules/postcss-double-position-gradients/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),t=require("postcss-value-parser");function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const r=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,s=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i;function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&r.test(t.params))return!0;t=t.parent}else t=t.parent;return!1}const o=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"],isPunctuationCommaNode=e=>"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),t=require("postcss-value-parser");function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const r=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,s=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i;function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&r.test(t.params))return!0;t=t.parent}else t=t.parent;return!1}const o=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"],isPunctuationCommaNode=e=>"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(e?.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),e?.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/postcss-double-position-gradients/dist/index.d.ts b/node_modules/postcss-double-position-gradients/dist/index.d.ts index 75ff88fb..b002dc64 100644 --- a/node_modules/postcss-double-position-gradients/dist/index.d.ts +++ b/node_modules/postcss-double-position-gradients/dist/index.d.ts @@ -1,10 +1,14 @@ import type { PluginCreator } from 'postcss'; + /** postcss-double-position-gradients plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ enableProgressiveCustomProperties?: boolean; }; + declare const postcssPlugin: PluginCreator<pluginOptions>; export default postcssPlugin; + +export { } diff --git a/node_modules/postcss-double-position-gradients/dist/index.mjs b/node_modules/postcss-double-position-gradients/dist/index.mjs index f3fe49ec..ed1d2c2e 100644 --- a/node_modules/postcss-double-position-gradients/dist/index.mjs +++ b/node_modules/postcss-double-position-gradients/dist/index.mjs @@ -1 +1 @@ -import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const r=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,s=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i;function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&r.test(t.params))return!0;t=t.parent}else t=t.parent;return!1}const o=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"],isPunctuationCommaNode=e=>"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e<s;e++){const s=t.nodes[e];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1}const r=/(?:repeating-)?(?:conic|linear|radial)-gradient\(/i,s=/^(?:repeating-)?(?:conic|linear|radial)-gradient$/i;function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&r.test(t.params))return!0;t=t.parent}else t=t.parent;return!1}const o=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"],isPunctuationCommaNode=e=>"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(e?.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),e?.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/postcss-double-position-gradients/dist/is-gradient.d.ts b/node_modules/postcss-double-position-gradients/dist/is-gradient.d.ts deleted file mode 100644 index 72378209..00000000 --- a/node_modules/postcss-double-position-gradients/dist/is-gradient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const HAS_GRADIENT_FUNCTION: RegExp; -export declare const IS_GRADIENT_FUNCTION: RegExp; diff --git a/node_modules/postcss-double-position-gradients/package.json b/node_modules/postcss-double-position-gradients/package.json index a94cfc0d..dcb64659 100644 --- a/node_modules/postcss-double-position-gradients/package.json +++ b/node_modules/postcss-double-position-gradients/package.json @@ -1,7 +1,7 @@ { "name": "postcss-double-position-gradients", "description": "Use double-position gradients in CSS", - "version": "5.0.2", + "version": "5.0.3", "author": "Jonathan Neal <jonathantneal@hotmail.com>", "license": "MIT-0", "funding": [ @@ -17,15 +17,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" + } } }, "files": [ @@ -35,23 +38,12 @@ "dist" ], "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^3.0.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.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:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients#readme", "repository": { "type": "git", @@ -73,12 +65,5 @@ "repeating", "stop", "syntax" - ], - "csstools": { - "exportName": "postcssDoublePositionGradients", - "humanReadableName": "PostCSS Double Position Gradients" - }, - "volta": { - "extends": "../../package.json" - } + ] } |
