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 --- .../@csstools/media-query-list-parser/CHANGELOG.md | 84 ++++++++++++++ .../@csstools/media-query-list-parser/LICENSE.md | 20 ++++ .../@csstools/media-query-list-parser/README.md | 61 ++++++++++ .../media-query-list-parser/dist/index.cjs | 1 + .../media-query-list-parser/dist/index.d.ts | 23 ++++ .../media-query-list-parser/dist/index.mjs | 1 + .../dist/nodes/custom-media.d.ts | 44 ++++++++ .../dist/nodes/general-enclosed.d.ts | 25 +++++ .../dist/nodes/media-and.d.ts | 23 ++++ .../dist/nodes/media-condition-list.d.ts | 50 +++++++++ .../dist/nodes/media-condition.d.ts | 24 ++++ .../dist/nodes/media-feature-boolean.d.ts | 27 +++++ .../dist/nodes/media-feature-comparison.d.ts | 17 +++ .../dist/nodes/media-feature-name.d.ts | 24 ++++ .../dist/nodes/media-feature-plain.d.ts | 42 +++++++ .../dist/nodes/media-feature-range.d.ts | 123 +++++++++++++++++++++ .../dist/nodes/media-feature-value.d.ts | 31 ++++++ .../dist/nodes/media-feature.d.ts | 45 ++++++++ .../dist/nodes/media-in-parens.d.ts | 41 +++++++ .../dist/nodes/media-not.d.ts | 32 ++++++ .../dist/nodes/media-or.d.ts | 32 ++++++ .../dist/nodes/media-query-modifier.d.ts | 6 + .../dist/nodes/media-query.d.ts | 83 ++++++++++++++ .../dist/nodes/media-type.d.ts | 24 ++++ .../dist/parser/parse-custom-media.d.ts | 8 ++ .../dist/parser/parse-media-query.d.ts | 24 ++++ .../media-query-list-parser/dist/parser/parse.d.ts | 8 ++ .../dist/util/clone-media-query.d.ts | 2 + .../dist/util/component-value-is.d.ts | 5 + .../dist/util/node-type.d.ts | 22 ++++ .../dist/util/to-lower-case-a-z.d.ts | 1 + .../dist/util/type-predicates.d.ts | 37 +++++++ .../@csstools/media-query-list-parser/package.json | 74 +++++++++++++ 33 files changed, 1064 insertions(+) create mode 100644 node_modules/@csstools/media-query-list-parser/CHANGELOG.md create mode 100644 node_modules/@csstools/media-query-list-parser/LICENSE.md create mode 100644 node_modules/@csstools/media-query-list-parser/README.md create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.cjs create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.mjs create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/custom-media.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/package.json (limited to 'node_modules/@csstools/media-query-list-parser') diff --git a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md new file mode 100644 index 00000000..d8f8b70f --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md @@ -0,0 +1,84 @@ +# Changes to Media Query List Parser + +### 2.1.5 + +_September 24, 2023_ + +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) + +### 2.1.4 + +_August 5, 2023_ + +- Do not allow keywords as media feature values in range context queries. + +### 2.1.3 + +_July 24, 2023_ + +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) + +### 2.1.2 + +_July 3, 2023_ + +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) + +### 2.1.1 + +_June 21, 2023_ + +- Fix parsing of `(width == 100px)`. This was erroneously parsed as a range query and will now instead be a general enclosed node. + +### 2.1.0 + +_June 1, 2023_ + +- Fix `walk` for `MediaFeatureValue` with complex component values. +- Add `state` to `walk` methods. + +This makes it possible pass down information from a parent structure to children. +e.g. you can set `entry.state.inInPrintQuery = true` for `print and (min-width: 30cm)`. + +### 2.0.4 + +_April 10, 2023_ + +- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) +- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) + +### 2.0.3 + +_April 10, 2023_ + +- Add support for `env()` functions as values in media queries. +- Improve the detection of math function as values in media queries. + +### 2.0.2 + +_March 25, 2023_ + +- Improve case insensitive string matching. + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 19, 2023_ + +- Refactor `MediaFeatureBoolean` so that it follows the same structure as `MediaFeaturePlain` (breaking) +- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) +- Add `getName` and `getNameToken` to all nodes that have a feature name. +- Add `@custom-media` parsing. + +### 1.0.0 + +_November 14, 2022_ + +- Initial version diff --git a/node_modules/@csstools/media-query-list-parser/LICENSE.md b/node_modules/@csstools/media-query-list-parser/LICENSE.md new file mode 100644 index 00000000..af5411fa --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/media-query-list-parser/README.md b/node_modules/@csstools/media-query-list-parser/README.md new file mode 100644 index 00000000..d72dc7dd --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/README.md @@ -0,0 +1,61 @@ +# Media Query List Parser + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://www.w3.org/TR/mediaqueries-5/ + +## Usage + +Add [Media Query List Parser] to your project: + +```bash +npm install @csstools/media-query-list-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +[Media Query List Parser] depends on our CSS tokenizer and parser algorithms. +It must be used together with `@csstools/css-tokenizer` and `@csstools/css-parser-algorithms`. + +```ts +import { parse } from '@csstools/media-query-list-parser'; + +export function parseCustomMedia() { + const mediaQueryList = parse('screen and (min-width: 300px), (50px < height < 30vw)'); + + mediaQueryList.forEach((mediaQuery) => { + mediaQuery.walk((entry, index) => { + // Index of the current Node in `parent`. + console.log(index); + // Type of `parent`. + console.log(entry.parent.type); + + // Type of `node` + { + // Sometimes nodes can be arrays. + if (Array.isArray(entry.node)) { + entry.node.forEach((item) => { + console.log(item.type); + }); + } + + if ('type' in entry.node) { + console.log(entry.node.type); + } + } + + // stringified version of the current node. + console.log(entry.node.toString()); + + // Return `false` to stop the walker. + return false; + }); + }); +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/media-query-list-parser + +[Media Query List Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.cjs b/node_modules/@csstools/media-query-list-parser/dist/index.cjs new file mode 100644 index 00000000..aabcfbcc --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";const a=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(a,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,r=-1;for(let n=0;ne.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(s=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",s.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;ne.tokens())),-1!==r&&(o=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(o=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(s,[...o,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(s,o,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;ie.tokens())),r.startToken],s=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(r,n,s);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,s):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;re.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:null==i?void 0:i.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===(null==i?void 0:i.preserveInvalidMediaQueries)?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(o=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",o.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;tString.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=f.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===f.MediaCondition)}}class MediaInParens{type=f.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return u(...this.before)+this.media.toString()+u(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===f.MediaInParens)}}class MediaQueryWithType{type=f.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===f.MediaQueryInvalid)}}class GeneralEnclosed{type=f.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===f.GeneralEnclosed)}}class MediaAnd{type=f.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return u(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===f.MediaAnd)}}class MediaConditionListWithAnd{type=f.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===f.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=f.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===f.MediaConditionListWithOr)}}function isNumber(t){return!!(t.type===e.Token&&t.value[0]===d.Number||t.type===e.Function&&M.has(toLowerCaseAZ(t.name[4].value)))}const M=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(t){return t.type===e.Token&&t.value[0]===d.Dimension}function isIdent(t){return t.type===e.Token&&t.value[0]===d.Ident}function isEnvironmentVariable(t){return t.type===e.Function&&"env"===toLowerCaseAZ(t.name[4].value)}class MediaFeatureName{type=f.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return u(...this.before)+this.name.toString()+u(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===f.MediaFeatureName)}}function parseMediaFeatureName(t){let i=-1;for(let a=0;ae.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=f.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===f.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=f.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?u(...this.before)+this.value.map((e=>e.toString())).join("")+u(...this.after):u(...this.before)+this.value.toString()+u(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===f.MediaFeatureValue)}}function parseMediaFeatureValue(t,i=!1){let a=-1,n=-1;for(let r=0;re.tokens())),t.slice(n+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==d.Delim)return!1;if(1===e.length)switch(e[0][4].value){case v.EQ:return v.EQ;case p.LT:return p.LT;case y.GT:return y.GT;default:return!1}if(e[1][0]!==d.Delim)return!1;if(e[1][4].value!==v.EQ)return!1;switch(e[0][4].value){case p.LT:return p.LT_OR_EQ;case y.GT:return y.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case v.EQ:return v.EQ;case p.LT:return y.GT;case p.LT_OR_EQ:return y.GT_OR_EQ;case y.GT:return p.LT;case y.GT_OR_EQ:return p.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(p||(p={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(y||(y={})),function(e){e.EQ="="}(v||(v={}));class MediaFeatureRangeNameValue{type=f.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+u(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===f.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=f.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+u(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===f.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=f.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+u(...this.valueOneOperator)+this.name.toString()+u(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===f.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(t){let i=!1,a=!1;for(let n=0;ne.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const l=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,s)+1));return!1===l?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,s+1).flatMap((e=>e.tokens())),l)}}function parseMediaConditionListWithOr(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(t){let i=-1;for(let a=0;ae.tokens())),a.startToken],r=[a.endToken,...t.slice(i+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(a,n,r);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),t.slice(0,i).flatMap((e=>e.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==d.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(t){let i=!1,a=null;for(let n=0;ne.tokens())),e)}}}return a||!1}function parseMediaOr(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseMediaAnd(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseFromTokens(e,t){const i=o(e,{onParseError:null==t?void 0:t.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===(null==t?void 0:t.preserveInvalidMediaQueries)?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=h({css:e},{onParseError:null==t?void 0:t.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(g||(g={}));class CustomMedia{type=f.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===f.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t; + mediaQueryList: Array | null; + trueOrFalseKeyword: Array | null; + constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); + getName(): string; + getNameToken(): CSSToken | null; + hasMediaQueryList(): boolean; + hasTrueKeyword(): boolean; + hasFalseKeyword(): boolean; + tokens(): Array; + toString(): string; + toJSON(): { + type: NodeType; + string: string; + nameValue: string; + name: CSSToken[]; + hasFalseKeyword: boolean; + hasTrueKeyword: boolean; + trueOrFalseKeyword: CSSToken[] | null; + mediaQueryList: ({ + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: import("./media-condition").MediaCondition | undefined; + } | { + type: NodeType; + string: string; + media: import("./media-condition").MediaCondition; + } | { + type: NodeType; + string: string; + media: import("@csstools/css-parser-algorithms").ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts new file mode 100644 index 00000000..5ab840f5 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts @@ -0,0 +1,25 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class GeneralEnclosed { + type: NodeType; + value: ComponentValue; + constructor(value: ComponentValue); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + walk>(cb: (entry: { + node: GeneralEnclosedWalkerEntry; + parent: GeneralEnclosedWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + tokens: CSSToken[]; + }; + isGeneralEnclosed(): this is GeneralEnclosed; + static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +} +export type GeneralEnclosedWalkerEntry = ComponentValue; +export type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts new file mode 100644 index 00000000..ddd73d53 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts @@ -0,0 +1,23 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaAnd { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | null; + walk>(cb: (entry: { + node: MediaAndWalkerEntry; + parent: MediaAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaAnd(): this is MediaAnd; + static isMediaAnd(x: unknown): x is MediaAnd; +} +export type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts new file mode 100644 index 00000000..ddc51062 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts @@ -0,0 +1,50 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and'; +import { MediaInParens } from './media-in-parens'; +import { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or'; +import { NodeType } from '../util/node-type'; +export type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; +export declare class MediaConditionListWithAnd { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaAnd): number | string; + at(index: number | string): MediaInParens | MediaAnd | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithAndWalkerEntry; + parent: MediaConditionListWithAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; + static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +} +export type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; +export type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; +export declare class MediaConditionListWithOr { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaOr): number | string; + at(index: number | string): MediaInParens | MediaOr | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithOrWalkerEntry; + parent: MediaConditionListWithOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithOr(): this is MediaConditionListWithOr; + static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +} +export type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; +export type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts new file mode 100644 index 00000000..faf2b49d --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts @@ -0,0 +1,24 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list'; +import { MediaInParens } from './media-in-parens'; +import { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not'; +import { NodeType } from '../util/node-type'; +export declare class MediaCondition { + type: NodeType; + media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; + constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); + tokens(): Array; + toString(): string; + indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; + at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; + walk>(cb: (entry: { + node: MediaConditionWalkerEntry; + parent: MediaConditionWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaCondition(): this is MediaCondition; + static isMediaCondition(x: unknown): x is MediaCondition; +} +export type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; +export type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts new file mode 100644 index 00000000..a5c64ec1 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts @@ -0,0 +1,27 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { MediaFeatureName } from './media-feature-name'; +import { NodeType } from '../util/node-type'; +import { CSSToken } from '@csstools/css-tokenizer'; +export declare class MediaFeatureBoolean { + type: NodeType; + name: MediaFeatureName; + constructor(name: MediaFeatureName); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName): number | string; + at(index: number | string): MediaFeatureName | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureBoolean(): this is MediaFeatureBoolean; + static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +} +export declare function parseMediaFeatureBoolean(componentValues: Array): false | MediaFeatureBoolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts new file mode 100644 index 00000000..37769657 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts @@ -0,0 +1,17 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { TokenDelim } from '@csstools/css-tokenizer'; +export declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} +export declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} +export declare enum MediaFeatureEQ { + EQ = "=" +} +export type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; +export declare function matchesComparison(componentValues: Array): false | [number, number]; +export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; +export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts new file mode 100644 index 00000000..332b421a --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts @@ -0,0 +1,24 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeatureName { + type: NodeType; + name: ComponentValue; + before: Array; + after: Array; + constructor(name: ComponentValue, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + toJSON(): { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + isMediaFeatureName(): this is MediaFeatureName; + static isMediaFeatureName(x: unknown): x is MediaFeatureName; +} +export declare function parseMediaFeatureName(componentValues: Array): MediaFeatureName | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts new file mode 100644 index 00000000..32f22c40 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts @@ -0,0 +1,42 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken, TokenColon } from '@csstools/css-tokenizer'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeaturePlain { + type: NodeType; + name: MediaFeatureName; + colon: TokenColon; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeaturePlainWalkerEntry; + parent: MediaFeaturePlainWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeaturePlain(): this is MediaFeaturePlain; + static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +} +export type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +export type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; +export declare function parseMediaFeaturePlain(componentValues: Array): MediaFeaturePlain | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts new file mode 100644 index 00000000..afe322ae --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts @@ -0,0 +1,123 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken, TokenDelim } from '@csstools/css-tokenizer'; +import { MediaFeatureComparison } from './media-feature-comparison'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +export type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; +export declare class MediaFeatureRangeNameValue { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; + static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +} +export declare class MediaFeatureRangeValueName { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; + static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +} +export declare class MediaFeatureRangeValueNameValue { + type: NodeType; + name: MediaFeatureName; + valueOne: MediaFeatureValue; + valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + valueTwo: MediaFeatureValue; + valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); + valueOneOperatorKind(): MediaFeatureComparison | false; + valueTwoOperatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + valueOne: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + valueTwo: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; + static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +} +export type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +export type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; +export declare function parseMediaFeatureRange(componentValues: Array): MediaFeatureRange | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts new file mode 100644 index 00000000..dda072bb --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts @@ -0,0 +1,31 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeatureValue { + type: NodeType; + value: ComponentValue | Array; + before: Array; + after: Array; + constructor(value: ComponentValue | Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | Array | undefined; + walk>(cb: (entry: { + node: MediaFeatureValueWalkerEntry; + parent: MediaFeatureValueWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + isMediaFeatureValue(): this is MediaFeatureValue; + static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +} +export type MediaFeatureValueWalkerEntry = ComponentValue; +export type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; +export declare function parseMediaFeatureValue(componentValues: Array, inRangeContext?: boolean): MediaFeatureValue | false; +export declare function matchesRatioExactly(componentValues: Array): number[] | -1; +export declare function matchesRatio(componentValues: Array): number[] | -1; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts new file mode 100644 index 00000000..bf9c0384 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts @@ -0,0 +1,45 @@ +import { SimpleBlockNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaFeatureBoolean } from './media-feature-boolean'; +import { MediaFeaturePlain, MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent } from './media-feature-plain'; +import { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent } from './media-feature-range'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeature { + type: NodeType; + feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; + before: Array; + after: Array; + constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; + at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; + walk>(cb: (entry: { + node: MediaFeatureWalkerEntry; + parent: MediaFeatureWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + feature: { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaFeature(): this is MediaFeature; + static isMediaFeature(x: unknown): x is MediaFeature; +} +export type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; +export type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; +export declare function parseMediaFeature(simpleBlock: SimpleBlockNode, before?: Array, after?: Array): false | MediaFeature; +export declare function newMediaFeatureBoolean(name: string): MediaFeature; +export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts new file mode 100644 index 00000000..904a0725 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts @@ -0,0 +1,41 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { GeneralEnclosed } from './general-enclosed'; +import { MediaAnd } from './media-and'; +import { MediaCondition } from './media-condition'; +import { MediaConditionList } from './media-condition-list'; +import { MediaFeature } from './media-feature'; +import { MediaFeatureBoolean } from './media-feature-boolean'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeaturePlain } from './media-feature-plain'; +import { MediaFeatureRange } from './media-feature-range'; +import { MediaFeatureValue } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +import { MediaNot } from './media-not'; +import { MediaOr } from './media-or'; +export declare class MediaInParens { + type: NodeType; + media: MediaCondition | MediaFeature | GeneralEnclosed; + before: Array; + after: Array; + constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; + at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; + walk>(cb: (entry: { + node: MediaInParensWalkerEntry; + parent: MediaInParensWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaInParens(): this is MediaInParens; + static isMediaInParens(x: unknown): x is MediaInParens; +} +export type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +export type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts new file mode 100644 index 00000000..2bedcaa3 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts @@ -0,0 +1,32 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaNot { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaNotWalkerEntry; + parent: MediaNotWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaNot(): this is MediaNot; + static isMediaNot(x: unknown): x is MediaNot; +} +export type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts new file mode 100644 index 00000000..4459412d --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts @@ -0,0 +1,32 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaOr { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaOrWalkerEntry; + parent: MediaOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaOr(): this is MediaOr; + static isMediaOr(x: unknown): x is MediaOr; +} +export type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts new file mode 100644 index 00000000..df9733cb --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts @@ -0,0 +1,6 @@ +import { TokenIdent } from '@csstools/css-tokenizer'; +export declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} +export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts new file mode 100644 index 00000000..aa77dee0 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts @@ -0,0 +1,83 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +import { MediaCondition, MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition'; +export type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; +export declare class MediaQueryWithType { + type: NodeType; + modifier: Array; + mediaType: Array; + and: Array | undefined; + media: MediaCondition | undefined; + constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); + getModifier(): string; + negateQuery(): MediaQuery; + getMediaType(): string; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithTypeWalkerEntry; + parent: MediaQueryWithTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: MediaCondition | undefined; + }; + isMediaQueryWithType(): this is MediaQueryWithType; + static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +} +export type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +export type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; +export declare class MediaQueryWithoutType { + type: NodeType; + media: MediaCondition; + constructor(media: MediaCondition); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithoutTypeWalkerEntry; + parent: MediaQueryWithoutTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: MediaCondition; + }; + isMediaQueryWithoutType(): this is MediaQueryWithoutType; + static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +} +export type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +export type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; +export declare class MediaQueryInvalid { + type: NodeType; + media: Array; + constructor(media: Array); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + walk>(cb: (entry: { + node: MediaQueryInvalidWalkerEntry; + parent: MediaQueryInvalidWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: ComponentValue[]; + }; + isMediaQueryInvalid(): this is MediaQueryInvalid; + static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +} +export type MediaQueryInvalidWalkerEntry = ComponentValue; +export type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts new file mode 100644 index 00000000..b7924b76 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts @@ -0,0 +1,24 @@ +import { TokenIdent } from '@csstools/css-tokenizer'; +export declare enum MediaType { + /** Always matches */ + All = "all", + Print = "print", + Screen = "screen", + /** Never matches */ + Tty = "tty", + /** Never matches */ + Tv = "tv", + /** Never matches */ + Projection = "projection", + /** Never matches */ + Handheld = "handheld", + /** Never matches */ + Braille = "braille", + /** Never matches */ + Embossed = "embossed", + /** Never matches */ + Aural = "aural", + /** Never matches */ + Speech = "speech" +} +export declare function typeFromToken(token: TokenIdent): MediaType | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts new file mode 100644 index 00000000..1be3d0f3 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts @@ -0,0 +1,8 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { CustomMedia } from '../nodes/custom-media'; +export type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +export declare function parseCustomMediaFromTokens(tokens: Array, options?: Options): CustomMedia | false; +export declare function parseCustomMedia(source: string, options?: Options): CustomMedia | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts new file mode 100644 index 00000000..3801d178 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts @@ -0,0 +1,24 @@ +import { ComponentValue, SimpleBlockNode } from '@csstools/css-parser-algorithms'; +import { MediaAnd } from '../nodes/media-and'; +import { MediaCondition } from '../nodes/media-condition'; +import { MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; +import { MediaInParens } from '../nodes/media-in-parens'; +import { MediaNot } from '../nodes/media-not'; +import { MediaOr } from '../nodes/media-or'; +import { MediaQuery } from '../nodes/media-query'; +export declare function parseMediaQuery(componentValues: Array): MediaQuery | false; +export declare function parseMediaConditionListWithOr(componentValues: Array): MediaConditionListWithOr | false; +export declare function parseMediaConditionListWithAnd(componentValues: Array): MediaConditionListWithAnd | false; +export declare function parseMediaCondition(componentValues: Array): MediaCondition | false; +export declare function parseMediaConditionWithoutOr(componentValues: Array): MediaCondition | false; +export declare function parseMediaInParens(componentValues: Array): MediaInParens | false; +export declare function parseMediaInParensFromSimpleBlock(simpleBlock: SimpleBlockNode): MediaInParens | false; +export declare function parseMediaNot(componentValues: Array): MediaNot | false; +export declare function parseMediaOr(componentValues: Array): false | { + advance: number; + node: MediaOr; +}; +export declare function parseMediaAnd(componentValues: Array): false | { + advance: number; + node: MediaAnd; +}; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts new file mode 100644 index 00000000..a09339bd --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts @@ -0,0 +1,8 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { MediaQuery } from '../nodes/media-query'; +export type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +export declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; +export declare function parse(source: string, options?: Options): MediaQuery[]; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts new file mode 100644 index 00000000..e0702c23 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts @@ -0,0 +1,2 @@ +import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; +export declare function cloneMediaQuery(x: T): T; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts new file mode 100644 index 00000000..f0763807 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts @@ -0,0 +1,5 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +export declare function isNumber(componentValue: ComponentValue): boolean; +export declare function isDimension(componentValue: ComponentValue): boolean; +export declare function isIdent(componentValue: ComponentValue): boolean; +export declare function isEnvironmentVariable(componentValue: ComponentValue): boolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts new file mode 100644 index 00000000..935e6eb5 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts @@ -0,0 +1,22 @@ +export declare enum NodeType { + CustomMedia = "custom-media", + GeneralEnclosed = "general-enclosed", + MediaAnd = "media-and", + MediaCondition = "media-condition", + MediaConditionListWithAnd = "media-condition-list-and", + MediaConditionListWithOr = "media-condition-list-or", + MediaFeature = "media-feature", + MediaFeatureBoolean = "mf-boolean", + MediaFeatureName = "mf-name", + MediaFeaturePlain = "mf-plain", + MediaFeatureRangeNameValue = "mf-range-name-value", + MediaFeatureRangeValueName = "mf-range-value-name", + MediaFeatureRangeValueNameValue = "mf-range-value-name-value", + MediaFeatureValue = "mf-value", + MediaInParens = "media-in-parens", + MediaNot = "media-not", + MediaOr = "media-or", + MediaQueryWithType = "media-query-with-type", + MediaQueryWithoutType = "media-query-without-type", + MediaQueryInvalid = "media-query-invalid" +} diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts new file mode 100644 index 00000000..396b252e --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts @@ -0,0 +1 @@ +export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts new file mode 100644 index 00000000..2313f29b --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts @@ -0,0 +1,37 @@ +import { GeneralEnclosed } from '../nodes/general-enclosed'; +import { MediaAnd } from '../nodes/media-and'; +import { MediaCondition } from '../nodes/media-condition'; +import { MediaConditionList, MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; +import { MediaFeature } from '../nodes/media-feature'; +import { MediaFeatureBoolean } from '../nodes/media-feature-boolean'; +import { MediaFeatureName } from '../nodes/media-feature-name'; +import { MediaFeaturePlain } from '../nodes/media-feature-plain'; +import { MediaFeatureRange, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range'; +import { MediaFeatureValue } from '../nodes/media-feature-value'; +import { MediaInParens } from '../nodes/media-in-parens'; +import { MediaNot } from '../nodes/media-not'; +import { MediaOr } from '../nodes/media-or'; +import { MediaQuery, MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; +export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; +export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +export declare function isMediaAnd(x: unknown): x is MediaAnd; +export declare function isMediaConditionList(x: unknown): x is MediaConditionList; +export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +export declare function isMediaCondition(x: unknown): x is MediaCondition; +export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; +export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; +export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +export declare function isMediaFeature(x: unknown): x is MediaFeature; +export declare function isMediaInParens(x: unknown): x is MediaInParens; +export declare function isMediaNot(x: unknown): x is MediaNot; +export declare function isMediaOr(x: unknown): x is MediaOr; +export declare function isMediaQuery(x: unknown): x is MediaQuery; +export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/package.json b/node_modules/@csstools/media-query-list-parser/package.json new file mode 100644 index 00000000..d9037c74 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/package.json @@ -0,0 +1,74 @@ +{ + "name": "@csstools/media-query-list-parser", + "description": "Parse CSS media query lists.", + "version": "2.1.5", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "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" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.3.2", + "@csstools/css-tokenizer": "^2.2.1" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "stryker": "stryker run --logLevel error", + "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", + "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "packages/media-query-list-parser" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "media query", + "parser" + ], + "volta": { + "extends": "../../package.json" + } +} -- cgit v1.2.3