From 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 14 May 2024 14:05:49 +0800 Subject: updated node_modules --- node_modules/postcss-image-set-function/dist/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'node_modules/postcss-image-set-function/dist/index.mjs') diff --git a/node_modules/postcss-image-set-function/dist/index.mjs b/node_modules/postcss-image-set-function/dist/index.mjs index 10bb7b06..c091d01a 100644 --- a/node_modules/postcss-image-set-function/dist/index.mjs +++ b/node_modules/postcss-image-set-function/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-value-parser";const t=/^(cross-fade|image|(repeating-)?(conic|linear|radial)-gradient|url|var)$/i;function getImage(n){return!(!n||!n.type)&&("string"===n.type?"url("+e.stringify(n)+")":!("function"!==n.type||!t.test(n.value.toLowerCase()))&&e.stringify(n))}const n=new Map([["dpcm",2.54],["dpi",1],["dppx",96],["x",96]]);function getMedia(e,t,n){if("boolean"==typeof e)return!1;const r=Math.floor(e/96*100)/100;return t.atRule({name:"media",params:`(-webkit-min-device-pixel-ratio: ${r}), (min-resolution: ${e}dpi)`,source:n.source})}function getMediaDPI(t){if(!t)return!1;if("word"!==t.type)return!1;if(!isNumericNode(t))return!1;const r=e.unit(t.value);if(!r)return!1;const i=n.get(r.unit.toLowerCase());return!!i&&Number(r.number)*i}function isNumericNode(t){if(!t||!t.value)return!1;try{return!1!==e.unit(t.value)}catch(e){return!1}}const handleInvalidation=(e,t,n)=>{if("warn"===e.oninvalid)e.decl.warn(e.result,t,{word:String(n)});else if("throw"===e.oninvalid)throw e.decl.error(t,{word:String(n)})},processImageSet=(t,n,r)=>{const i=n.parent;if(!i)return;const o=new Map,a=n.value;for(let i=0;ie-t)).map((e=>o.get(e)?.atRule)).filter((e=>!!e));if(!l.length)return;const u=l[0],c=l.slice(1);c.length&&i.after(c);const p=u.nodes[0].nodes[0];n.cloneBefore({value:p.value.trim()}),r.preserve||(n.remove(),i.nodes.length||i.remove())};function hasFallback(e){const t=e.parent;if(!t)return!1;const n=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e{const n=!("preserve"in Object(t))||Boolean(t?.preserve),o="onInvalid"in Object(t)?t?.onInvalid:"ignore";if("oninvalid"in Object(t))throw new Error('"oninvalid" was changed to "onInvalid" to match other plugins with similar options');return{postcssPlugin:"postcss-image-set-function",Declaration(t,{result:a,postcss:s}){const l=t.value;if(!r.test(l))return;if(hasFallback(t))return;let u;try{u=e(l)}catch(e){t.warn(a,`Failed to parse value '${l}' as an image-set function. Leaving the original value intact.`)}if(void 0===u)return;const c=[];u.walk((n=>{if("function"!==n.type)return;if(!i.test(n.value))return;let r=!1;if(e.walk(n.nodes,(e=>{"function"===e.type&&i.test(e.value)&&(r=!0)})),r)return handleInvalidation({decl:t,oninvalid:o,result:a},"nested image-set functions are not allowed",e.stringify(n)),!1;const s=n.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));c.push({imageSetFunction:n,imageSetOptionNodes:s})})),processImageSet(c,t,{decl:t,oninvalid:o,preserve:n,result:a,postcss:s})}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-value-parser";import{hasFallback as t}from"@csstools/utilities";const n=/^(cross-fade|image|(repeating-)?(conic|linear|radial)-gradient|url|var)$/i;function getImage(t){return!(!t||!t.type)&&("string"===t.type?"url("+e.stringify(t)+")":!("function"!==t.type||!n.test(t.value))&&e.stringify(t))}const i=new Map([["dpcm",2.54],["dpi",1],["dppx",96],["x",96]]);function getMedia(e,t,n){if("boolean"==typeof e)return!1;const i=Math.floor(e/96*100)/100;return t.atRule({name:"media",params:`(-webkit-min-device-pixel-ratio: ${i}), (min-resolution: ${e}dpi)`,source:n.source})}function getMediaDPI(t){if(!t)return!1;if("word"!==t.type)return!1;if(!isNumericNode(t))return!1;const n=e.unit(t.value);if(!n)return!1;const r=i.get(n.unit.toLowerCase());return!!r&&Number(n.number)*r}function isNumericNode(t){if(!t||!t.value)return!1;try{return!1!==e.unit(t.value)}catch(e){return!1}}const handleInvalidation=(e,t,n)=>{if("warn"===e.oninvalid)e.decl.warn(e.result,t,{word:String(n)});else if("throw"===e.oninvalid)throw e.decl.error(t,{word:String(n)})},processImageSet=(t,n,i)=>{const r=n.parent;if(!r)return;const o=new Map,s=n.value;for(let r=0;re-t)),u=l.map((e=>o.get(e)?.atRule)).filter((e=>!!e));if(!u.length)return;const c=o.get(l[0])?.value;if(!c)return;const f=u.slice(1);f.length&&r.after(f),n.cloneBefore({value:c.trim()}),i.preserve||(n.remove(),r.nodes?.length||r.remove())},r=/(^|[^\w-])(-webkit-)?image-set\(/i,o=/^(-webkit-)?image-set$/i,creator=n=>{const i=!("preserve"in Object(n))||Boolean(n?.preserve),s="onInvalid"in Object(n)?n?.onInvalid:"ignore";if("oninvalid"in Object(n))throw new Error('"oninvalid" was changed to "onInvalid" to match other plugins with similar options');return{postcssPlugin:"postcss-image-set-function",Declaration(n,{result:a,postcss:l}){const u=n.value;if(!r.test(u))return;if(t(n))return;let c;try{c=e(u)}catch(e){n.warn(a,`Failed to parse value '${u}' as an image-set function. Leaving the original value intact.`)}if(void 0===c)return;const f=[];c.walk((t=>{if("function"!==t.type)return;if(!o.test(t.value))return;let i=!1;if(e.walk(t.nodes,(e=>{"function"===e.type&&o.test(e.value)&&(i=!0)})),i)return handleInvalidation({decl:n,oninvalid:s,result:a},"nested image-set functions are not allowed",e.stringify(t)),!1;const r=t.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));f.push({imageSetFunction:t,imageSetOptionNodes:r})})),processImageSet(f,n,{decl:n,oninvalid:s,preserve:i,result:a,postcss:l})}}};creator.postcss=!0;export{creator as default}; -- cgit v1.2.3