diff options
Diffstat (limited to 'node_modules/postcss-focus-within/dist')
| -rw-r--r-- | node_modules/postcss-focus-within/dist/index.cjs | 2 | ||||
| -rw-r--r-- | node_modules/postcss-focus-within/dist/index.d.ts | 10 | ||||
| -rw-r--r-- | node_modules/postcss-focus-within/dist/index.mjs | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/node_modules/postcss-focus-within/dist/index.cjs b/node_modules/postcss-focus-within/dist/index.cjs index 87ac8dc3..68442069 100644 --- a/node_modules/postcss-focus-within/dist/index.cjs +++ b/node_modules/postcss-focus-within/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser");const s=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(e){let t=!0;for(let n=0,o=s.length;n<o&&t;n++)e.indexOf(s[n])>-1&&(t=!1);return t}const t="js-focus-within",n=":focus-within",creator=s=>{const o=Object.assign({preserve:!0,replaceWith:"[focus-within]",disablePolyfillReadyClass:!1},s),l=e().astSync(o.replaceWith);return isValidReplacement(o.replaceWith)?{postcssPlugin:"postcss-focus-within",prepare(){const s=new WeakSet;return{Rule(r,{result:a}){if(s.has(r))return;if(!r.selector.toLowerCase().includes(n))return;const i=r.selectors.flatMap((s=>{if(!s.toLowerCase().includes(n))return[s];let i;try{i=e().astSync(s)}catch(e){return r.warn(a,`Failed to parse selector : "${s}" with message: "${e.message}"`),s}if(void 0===i)return[s];let c=!1;if(i.walkPseudos((e=>{e.value.toLowerCase()===n&&(e.nodes&&e.nodes.length||(c=!0,e.replaceWith(l.clone({}))))})),!c)return[s];const u=i.clone();if(!o.disablePolyfillReadyClass){var d,p,f,h,g;if(null!=(d=i.nodes)&&null!=(p=d[0])&&null!=(f=p.nodes)&&f.length)for(let s=0;s<i.nodes[0].nodes.length;s++){const n=i.nodes[0].nodes[s];if("combinator"===n.type||e.isPseudoElement(n)){i.nodes[0].insertBefore(n,e.className({value:t}));break}if(s===i.nodes[0].nodes.length-1){i.nodes[0].append(e.className({value:t}));break}}return null!=(h=i.nodes)&&null!=(g=h[0])&&g.nodes&&(u.nodes[0].prepend(e.combinator({value:" "})),u.nodes[0].prepend(e.className({value:t}))),[i.toString(),u.toString()]}return[i.toString()]}));i.join(",")!==r.selectors.join(",")&&(s.add(r),r.cloneBefore({selectors:i}),o.preserve||r.remove())}}}}:{postcssPlugin:"postcss-focus-within",Once:(e,{result:s})=>{e.warn(s,`${o.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-selector-parser");const s=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(e){let t=!0;for(let n=0,o=s.length;n<o&&t;n++)e.indexOf(s[n])>-1&&(t=!1);return t}const t="js-focus-within",n=":focus-within",creator=s=>{const o=Object.assign({preserve:!0,replaceWith:"[focus-within]",disablePolyfillReadyClass:!1},s),r=e().astSync(o.replaceWith);return isValidReplacement(o.replaceWith)?{postcssPlugin:"postcss-focus-within",prepare(){const s=new WeakSet;return{Rule(l,{result:i}){if(s.has(l))return;if(!l.selector.toLowerCase().includes(n))return;const a=l.selectors.flatMap((s=>{if(!s.toLowerCase().includes(n))return[s];let a;try{a=e().astSync(s)}catch(e){return l.warn(i,`Failed to parse selector : "${s}" with message: "${e instanceof Error?e.message:e}"`),s}if(void 0===a)return[s];let c=!1;if(a.walkPseudos((e=>{e.value.toLowerCase()===n&&(e.nodes&&e.nodes.length||(c=!0,e.replaceWith(r.clone({}))))})),!c)return[s];const d=a.clone();if(!o.disablePolyfillReadyClass){if(a.nodes?.[0]?.nodes?.length)for(let s=0;s<a.nodes[0].nodes.length;s++){const n=a.nodes[0].nodes[s];if("combinator"===n.type||e.isPseudoElement(n)){a.nodes[0].insertBefore(n,e.className({value:t}));break}if(s===a.nodes[0].nodes.length-1){a.nodes[0].append(e.className({value:t}));break}}return a.nodes?.[0]?.nodes&&(d.nodes[0].prepend(e.combinator({value:" "})),d.nodes[0].prepend(e.className({value:t}))),[a.toString(),d.toString()]}return[a.toString()]}));a.join(",")!==l.selectors.join(",")&&(s.add(l),l.cloneBefore({selectors:a}),o.preserve||l.remove())}}}}:{postcssPlugin:"postcss-focus-within",Once:(e,{result:s})=>{e.warn(s,`${o.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/postcss-focus-within/dist/index.d.ts b/node_modules/postcss-focus-within/dist/index.d.ts index 864b359f..767fddfc 100644 --- a/node_modules/postcss-focus-within/dist/index.d.ts +++ b/node_modules/postcss-focus-within/dist/index.d.ts @@ -1,6 +1,10 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator<pluginOptions>; +export default creator; + /** postcss-focus-within plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** The replacement class to be used in the polyfill. default: "[focus-within]" */ @@ -8,5 +12,5 @@ export type pluginOptions = { /** Disable the selector prefix that is used to prevent a flash of incorrectly styled content. default: false */ disablePolyfillReadyClass?: boolean; }; -declare const creator: PluginCreator<pluginOptions>; -export default creator; + +export { } diff --git a/node_modules/postcss-focus-within/dist/index.mjs b/node_modules/postcss-focus-within/dist/index.mjs index 4dcbf50e..c852057c 100644 --- a/node_modules/postcss-focus-within/dist/index.mjs +++ b/node_modules/postcss-focus-within/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";const s=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(e){let t=!0;for(let n=0,o=s.length;n<o&&t;n++)e.indexOf(s[n])>-1&&(t=!1);return t}const t="js-focus-within",n=":focus-within",creator=s=>{const o=Object.assign({preserve:!0,replaceWith:"[focus-within]",disablePolyfillReadyClass:!1},s),l=e().astSync(o.replaceWith);return isValidReplacement(o.replaceWith)?{postcssPlugin:"postcss-focus-within",prepare(){const s=new WeakSet;return{Rule(r,{result:a}){if(s.has(r))return;if(!r.selector.toLowerCase().includes(n))return;const i=r.selectors.flatMap((s=>{if(!s.toLowerCase().includes(n))return[s];let i;try{i=e().astSync(s)}catch(e){return r.warn(a,`Failed to parse selector : "${s}" with message: "${e.message}"`),s}if(void 0===i)return[s];let c=!1;if(i.walkPseudos((e=>{e.value.toLowerCase()===n&&(e.nodes&&e.nodes.length||(c=!0,e.replaceWith(l.clone({}))))})),!c)return[s];const d=i.clone();if(!o.disablePolyfillReadyClass){var u,p,f,h,m;if(null!=(u=i.nodes)&&null!=(p=u[0])&&null!=(f=p.nodes)&&f.length)for(let s=0;s<i.nodes[0].nodes.length;s++){const n=i.nodes[0].nodes[s];if("combinator"===n.type||e.isPseudoElement(n)){i.nodes[0].insertBefore(n,e.className({value:t}));break}if(s===i.nodes[0].nodes.length-1){i.nodes[0].append(e.className({value:t}));break}}return null!=(h=i.nodes)&&null!=(m=h[0])&&m.nodes&&(d.nodes[0].prepend(e.combinator({value:" "})),d.nodes[0].prepend(e.className({value:t}))),[i.toString(),d.toString()]}return[i.toString()]}));i.join(",")!==r.selectors.join(",")&&(s.add(r),r.cloneBefore({selectors:i}),o.preserve||r.remove())}}}}:{postcssPlugin:"postcss-focus-within",Once:(e,{result:s})=>{e.warn(s,`${o.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-selector-parser";const s=[" ",">","~",":","+","@","#","(",")"];function isValidReplacement(e){let t=!0;for(let n=0,o=s.length;n<o&&t;n++)e.indexOf(s[n])>-1&&(t=!1);return t}const t="js-focus-within",n=":focus-within",creator=s=>{const o=Object.assign({preserve:!0,replaceWith:"[focus-within]",disablePolyfillReadyClass:!1},s),r=e().astSync(o.replaceWith);return isValidReplacement(o.replaceWith)?{postcssPlugin:"postcss-focus-within",prepare(){const s=new WeakSet;return{Rule(l,{result:a}){if(s.has(l))return;if(!l.selector.toLowerCase().includes(n))return;const i=l.selectors.flatMap((s=>{if(!s.toLowerCase().includes(n))return[s];let i;try{i=e().astSync(s)}catch(e){return l.warn(a,`Failed to parse selector : "${s}" with message: "${e instanceof Error?e.message:e}"`),s}if(void 0===i)return[s];let c=!1;if(i.walkPseudos((e=>{e.value.toLowerCase()===n&&(e.nodes&&e.nodes.length||(c=!0,e.replaceWith(r.clone({}))))})),!c)return[s];const d=i.clone();if(!o.disablePolyfillReadyClass){if(i.nodes?.[0]?.nodes?.length)for(let s=0;s<i.nodes[0].nodes.length;s++){const n=i.nodes[0].nodes[s];if("combinator"===n.type||e.isPseudoElement(n)){i.nodes[0].insertBefore(n,e.className({value:t}));break}if(s===i.nodes[0].nodes.length-1){i.nodes[0].append(e.className({value:t}));break}}return i.nodes?.[0]?.nodes&&(d.nodes[0].prepend(e.combinator({value:" "})),d.nodes[0].prepend(e.className({value:t}))),[i.toString(),d.toString()]}return[i.toString()]}));i.join(",")!==l.selectors.join(",")&&(s.add(l),l.cloneBefore({selectors:i}),o.preserve||l.remove())}}}}:{postcssPlugin:"postcss-focus-within",Once:(e,{result:s})=>{e.warn(s,`${o.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};creator.postcss=!0;export{creator as default}; |
