From c06f7ee0a40255214c477e13d9b956a7e07c2900 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:05:55 +0800 Subject: postcss,(plugins): nanocss, postcss-preset-env --- .../dist/color-stop-list.d.ts | 9 +++++++++ .../dist/has-fallback-decl.d.ts | 2 ++ .../dist/has-supports-at-rule-ancestor.d.ts | 2 ++ .../postcss-gradients-interpolation-method/dist/index.cjs | 1 + .../postcss-gradients-interpolation-method/dist/index.d.ts | 10 ++++++++++ .../postcss-gradients-interpolation-method/dist/index.mjs | 1 + .../dist/is-gradient.d.ts | 2 ++ .../dist/modify-gradient-component-values.d.ts | 2 ++ .../dist/parse-color-stops.d.ts | 3 +++ 9 files changed, 32 insertions(+) create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts create mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts (limited to 'node_modules/@csstools/postcss-gradients-interpolation-method/dist') diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts new file mode 100644 index 00000000..4159c39f --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts @@ -0,0 +1,9 @@ +import type { ColorData } from '@csstools/css-color-parser'; +import type { ComponentValue } from '@csstools/css-parser-algorithms'; +import { TokenNode } from '@csstools/css-parser-algorithms'; +export type ColorStop = { + color: ComponentValue; + colorData: ColorData; + position: ComponentValue; +}; +export declare function interpolateColorsInColorStopsList(colorStops: Array, colorSpace: TokenNode, hueInterpolationMethod: TokenNode | null, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts new file mode 100644 index 00000000..d7ae8d89 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts @@ -0,0 +1,2 @@ +import type { Declaration } from 'postcss'; +export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts new file mode 100644 index 00000000..a46009ec --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts @@ -0,0 +1,2 @@ +import type { Node } from 'postcss'; +export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs new file mode 100644 index 00000000..3ab3f55e --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const i=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,s=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),n=o.index(e);for(let e=0;e0&&N.some((e=>!o.isCommentNode(e)))&&N.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let t=0,n=e.length-1;for(let n=0;n=0;t--)if(!o.isWhitespaceNode(e[t])){n=t;break}return e.slice(t,n+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!i.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const s=t.tokenize({css:n.value}),r=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e);t&&(e.value=t)})));if(r===n.value)return;const a=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e,!0);t&&(e.value=t)})));n.cloneBefore({value:r}),r!==a&&n.cloneBefore({value:a}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts new file mode 100644 index 00000000..0520e965 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts @@ -0,0 +1,10 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-gradients-interpolation-method plugin options */ +export type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const postcssPlugin: PluginCreator; +export default postcssPlugin; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs new file mode 100644 index 00000000..392d72e1 --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs @@ -0,0 +1 @@ +import o from"@csstools/postcss-progressive-custom-properties";import{WhitespaceNode as e,TokenNode as t,FunctionNode as r,isCommentNode as n,isWhitespaceNode as i,isTokenNode as s,stringify as l,replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u}from"@csstools/css-parser-algorithms";import{TokenType as p,tokenize as f}from"@csstools/css-tokenizer";import{serializeP3 as v,color as h,colorDataFitsRGB_Gamut as d,serializeRGB as m}from"@csstools/css-color-parser";const g=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,w=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(o){const e=o.parent;if(!e)return!1;const t=o.prop.toLowerCase(),r=e.index(o);for(let o=0;o0&&S.some((o=>!n(o)))&&S.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]])),trim([...S,...trim(g)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t=0;e--)if(!i(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(e){if(!g.test(e.value))return;if(hasFallback(e))return;if(hasSupportsAtRuleAncestor(e))return;const t=f({css:e.value}),r=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(r===e.value)return;const n=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));e.cloneBefore({value:r}),r!==n&&e.cloneBefore({value:n}),null!=o&&o.preserve||e.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts new file mode 100644 index 00000000..2d83e89e --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts @@ -0,0 +1,2 @@ +export declare const gradientFunctionRegex: RegExp; +export declare const gradientNameRegex: RegExp; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts new file mode 100644 index 00000000..6917beda --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts @@ -0,0 +1,2 @@ +import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; +export declare function modifyGradientFunctionComponentValues(gradientFunction: FunctionNode, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts new file mode 100644 index 00000000..0342da5c --- /dev/null +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts @@ -0,0 +1,3 @@ +import type { ColorStop } from './color-stop-list'; +import type { ComponentValue } from '@csstools/css-parser-algorithms'; +export declare function parseColorStops(componentValues: Array): Array | false; -- cgit v1.2.3