From efbc2ffe6a1ee5ec38a4396305561d6515d0943e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 30 Aug 2024 17:21:18 +0800 Subject: node fixes, updates --- .../postcss-content-alt-text/dist/index.cjs | 1 + .../postcss-content-alt-text/dist/index.d.ts | 24 ++++++++++++++++++++++ .../postcss-content-alt-text/dist/index.mjs | 1 + 3 files changed, 26 insertions(+) create mode 100644 node_modules/@csstools/postcss-content-alt-text/dist/index.cjs create mode 100644 node_modules/@csstools/postcss-content-alt-text/dist/index.d.ts create mode 100644 node_modules/@csstools/postcss-content-alt-text/dist/index.mjs (limited to 'node_modules/@csstools/postcss-content-alt-text/dist') diff --git a/node_modules/@csstools/postcss-content-alt-text/dist/index.cjs b/node_modules/@csstools/postcss-content-alt-text/dist/index.cjs new file mode 100644 index 00000000..f016340f --- /dev/null +++ b/node_modules/@csstools/postcss-content-alt-text/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("@csstools/css-parser-algorithms"),s=require("@csstools/css-tokenizer"),t=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/utilities");const r={test:e=>e.includes("content:")&&e.includes("/")},basePlugin=t=>({postcssPlugin:"postcss-content-alt-text",Declaration(n){if("content"!==n.prop||!n.value.includes("/"))return;if(o.hasFallback(n))return;if(o.hasSupportsAtRuleAncestor(n,r))return;const i=e.parseListOfComponentValues(s.tokenize({css:n.value}));let c=0;for(let o=i.length-1;o>=0;o--){const r=i[o];if(!e.isTokenNode(r))continue;const n=r.value;s.isTokenDelim(n)&&("/"===n[4].value&&(c++,!0===t?.stripAltText?i.splice(o,i.length):i.splice(o,1)))}if(1!==c)return;const l=e.stringify([i]);l!==n.value&&(n.cloneBefore({value:l}),!1===t?.preserve&&n.remove())}});basePlugin.postcss=!0;const creator=e=>{const s=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0,stripAltText:!1},e);return s.enableProgressiveCustomProperties&&s.preserve?{postcssPlugin:"postcss-content-alt-text",plugins:[t(),basePlugin(s)]}:basePlugin(s)};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-content-alt-text/dist/index.d.ts b/node_modules/@csstools/postcss-content-alt-text/dist/index.d.ts new file mode 100644 index 00000000..2ebb7a3b --- /dev/null +++ b/node_modules/@csstools/postcss-content-alt-text/dist/index.d.ts @@ -0,0 +1,24 @@ +import type { PluginCreator } from 'postcss'; + +/** postcss-content-alt-text plugin options */ +export declare type basePluginOptions = { + /** Preserve the original notation. default: true */ + preserve: boolean; + /** Strip alt text */ + stripAltText: boolean; +}; + +declare const creator: PluginCreator; +export default creator; + +/** postcss-content-alt-text plugin options */ +export declare type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Strip alt text */ + stripAltText?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; + +export { } diff --git a/node_modules/@csstools/postcss-content-alt-text/dist/index.mjs b/node_modules/@csstools/postcss-content-alt-text/dist/index.mjs new file mode 100644 index 00000000..0b488d05 --- /dev/null +++ b/node_modules/@csstools/postcss-content-alt-text/dist/index.mjs @@ -0,0 +1 @@ +import{parseListOfComponentValues as s,isTokenNode as e,stringify as t}from"@csstools/css-parser-algorithms";import{tokenize as o,isTokenDelim as r}from"@csstools/css-tokenizer";import n from"@csstools/postcss-progressive-custom-properties";import{hasFallback as c,hasSupportsAtRuleAncestor as i}from"@csstools/utilities";const l={test:s=>s.includes("content:")&&s.includes("/")},basePlugin=n=>({postcssPlugin:"postcss-content-alt-text",Declaration(p){if("content"!==p.prop||!p.value.includes("/"))return;if(c(p))return;if(i(p,l))return;const u=s(o({css:p.value}));let a=0;for(let s=u.length-1;s>=0;s--){const t=u[s];if(!e(t))continue;const o=t.value;r(o)&&("/"===o[4].value&&(a++,!0===n?.stripAltText?u.splice(s,u.length):u.splice(s,1)))}if(1!==a)return;const m=t([u]);m!==p.value&&(p.cloneBefore({value:m}),!1===n?.preserve&&p.remove())}});basePlugin.postcss=!0;const creator=s=>{const e=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0,stripAltText:!1},s);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-content-alt-text",plugins:[n(),basePlugin(e)]}:basePlugin(e)};creator.postcss=!0;export{creator as default}; -- cgit v1.2.3