diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/@csstools/cascade-layer-name-parser | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/@csstools/cascade-layer-name-parser')
7 files changed, 0 insertions, 180 deletions
diff --git a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md b/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md deleted file mode 100644 index 5a01af6f..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Changes to Cascade Layer Name Parser - -### 1.0.13 - -_July 6, 2024_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.4.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#241) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.7.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#271) (patch) - -### 1.0.12 - -_June 29, 2024_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.7.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#270) (minor) - -### 1.0.11 - -_May 4, 2024_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#231) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.6.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#263) (patch) - -[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser/CHANGELOG.md) diff --git a/node_modules/@csstools/cascade-layer-name-parser/LICENSE.md b/node_modules/@csstools/cascade-layer-name-parser/LICENSE.md deleted file mode 100644 index af5411fa..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es> - -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/cascade-layer-name-parser/README.md b/node_modules/@csstools/cascade-layer-name-parser/README.md deleted file mode 100644 index 44e2111e..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Cascade Layer Name Parser - -[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/cascade-layer-name-parser.svg" height="20">][npm-url] -[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] -[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord] - -## Usage - -Add [Cascade Layer Name Parser] to your project: - -```bash -npm install @csstools/cascade-layer-name-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev -``` - -[Cascade Layer Name 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/cascade-layer-name-parser'; - -const layerNames = parse('layer-name, foo.bar'); -layerNames.forEach((layerName) => { - console.log(layerName.name()) // "foo.bar" - console.log(layerName.segments()) // ["foo", "bar"] -}); -``` - -[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/cascade-layer-name-parser - -[Cascade Layer Name Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs deleted file mode 100644 index d22aa23e..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("@csstools/css-tokenizer"),r=require("@csstools/css-parser-algorithms");class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(r,n){const t=[];for(let r=0;r<this.parts.length;r++)e.isTokenIdent(this.parts[r])&&t.push(r);const s=t.slice(r,n);return new LayerName(this.parts.slice(s[0],s[s.length-1]+1))}concat(r){const n=[e.TokenType.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r))),n,...r.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r)))])}segments(){return this.parts.filter((r=>e.isTokenIdent(r))).map((e=>e[4].value))}name(){return this.parts.filter((r=>e.isTokenIdent(r)||e.isTokenDelim(r))).map((e=>e[1])).join("")}equal(e){const r=this.segments(),n=e.segments();if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){if(r[e]!==n[e])return!1}return!0}toString(){return e.stringify(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function parseFromTokens(n,t){const s=r.parseCommaSeparatedListOfComponentValues(n,{onParseError:t?.onParseError}),a=t?.onParseError??(()=>{}),o=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],i=n[0][2],l=n[n.length-1][3],m=[];for(let n=0;n<s.length;n++){const t=s[n];for(let n=0;n<t.length;n++){const s=t[n];if(!r.isTokenNode(s)&&!r.isCommentNode(s)&&!r.isWhitespaceNode(s))return a(new e.ParseError(`Invalid cascade layer name. Invalid layer name part "${s.toString()}"`,i,l,o)),[]}const c=t.flatMap((e=>e.tokens()));let d=!1,p=!1,u=null;for(let r=0;r<c.length;r++){const n=c[r];if(!(e.isTokenWhiteSpaceOrComment(n)||e.isTokenIdent(n)||e.isTokenDelim(n)&&"."===n[4].value))return a(new e.ParseError(`Invalid cascade layer name. Invalid character "${n[1]}"`,i,l,o)),[];if(!d&&e.isTokenDelim(n))return a(new e.ParseError("Invalid cascade layer name. Layer names can not start with a dot.",i,l,o)),[];if(d){if(e.isTokenWhitespace(n)){p=!0;continue}if(p&&e.isTokenComment(n))continue;if(p)return a(new e.ParseError("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",i,l,o)),[];if(e.isTokenIdent(u)&&e.isTokenIdent(n))return a(new e.ParseError("Invalid cascade layer name. Layer name parts must be separated by dots.",i,l,o)),[];if(e.isTokenDelim(u)&&e.isTokenDelim(n))return a(new e.ParseError("Invalid cascade layer name. Layer name parts must not be empty.",i,l,o)),[]}e.isTokenIdent(n)&&(d=!0),(e.isTokenIdent(n)||e.isTokenDelim(n))&&(u=n)}if(!u)return a(new e.ParseError("Invalid cascade layer name. Empty layer name.",i,l,o)),[];if(e.isTokenDelim(u))return a(new e.ParseError("Invalid cascade layer name. Layer name must not end with a dot.",i,l,o)),[];m.push(new LayerName(c))}return m}exports.LayerName=LayerName,exports.addLayerToModel=function addLayerToModel(e,r){r.forEach((r=>{const n=r.segments();e:for(let t=0;t<n.length;t++){const n=r.slice(0,t+1),s=n.segments();let a=-1,o=0;for(let r=0;r<e.length;r++){const n=e[r].segments();let t=0;r:for(let e=0;e<n.length;e++){const r=n[e],a=s[e];if(a===r&&e+1===s.length)continue e;if(a!==r){if(a!==r)break r}else t++}t>=o&&(a=r,o=t)}-1===a?e.push(n):e.splice(a+1,0,n)}}))},exports.parse=function parse(r,n){const t=e.tokenizer({css:r},{onParseError:n?.onParseError}),s=[];for(;!t.endOfFile();)s.push(t.nextToken());return s.push(t.nextToken()),parseFromTokens(s,n)},exports.parseFromTokens=parseFromTokens; diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts b/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts deleted file mode 100644 index df9eef3f..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { ParseError } from '@csstools/css-tokenizer'; - -export declare function addLayerToModel(layers: Array<LayerName>, currentLayerNames: Array<LayerName>): void; - -export declare class LayerName { - parts: Array<CSSToken>; - constructor(parts: Array<CSSToken>); - tokens(): Array<CSSToken>; - slice(start: number, end: number): LayerName; - concat(other: LayerName): LayerName; - segments(): Array<string>; - name(): string; - equal(other: LayerName): boolean; - toString(): string; - /** - * @internal - * - * A debug helper to convert the current object to a JSON representation. - */ - toJSON(): Record<string, unknown>; -} - -export declare function parse(source: string, options?: { - onParseError?: (error: ParseError) => void; -}): Array<LayerName>; - -/** - * Parses an array of {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/docs/css-tokenizer.csstoken.md | CSSTokens} into a list of cascade layer names. - */ -export declare function parseFromTokens(tokens: Array<CSSToken>, options?: { - onParseError?: (error: ParseError) => void; -}): Array<LayerName>; - -export { } diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs deleted file mode 100644 index 2b03390e..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import{isTokenIdent as e,TokenType as t,isTokenDelim as n,stringify as r,ParseError as a,isTokenWhiteSpaceOrComment as s,tokenizer as o,isTokenWhitespace as l,isTokenComment as i}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as c,isTokenNode as m,isCommentNode as u,isWhitespaceNode as p}from"@csstools/css-parser-algorithms";class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(t,n){const r=[];for(let t=0;t<this.parts.length;t++)e(this.parts[t])&&r.push(t);const a=r.slice(t,n);return new LayerName(this.parts.slice(a[0],a[a.length-1]+1))}concat(r){const a=[t.Delim,".",-1,-1,{value:"."}];return new LayerName([...this.parts.filter((t=>e(t)||n(t))),a,...r.parts.filter((t=>e(t)||n(t)))])}segments(){return this.parts.filter((t=>e(t))).map((e=>e[4].value))}name(){return this.parts.filter((t=>e(t)||n(t))).map((e=>e[1])).join("")}equal(e){const t=this.segments(),n=e.segments();if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++){if(t[e]!==n[e])return!1}return!0}toString(){return r(...this.parts)}toJSON(){return{parts:this.parts,segments:this.segments(),name:this.name()}}}function addLayerToModel(e,t){t.forEach((t=>{const n=t.segments();e:for(let r=0;r<n.length;r++){const n=t.slice(0,r+1),a=n.segments();let s=-1,o=0;for(let t=0;t<e.length;t++){const n=e[t].segments();let r=0;t:for(let e=0;e<n.length;e++){const t=n[e],s=a[e];if(s===t&&e+1===a.length)continue e;if(s!==t){if(s!==t)break t}else r++}r>=o&&(s=t,o=r)}-1===s?e.push(n):e.splice(s+1,0,n)}}))}function parseFromTokens(t,r){const o=c(t,{onParseError:r?.onParseError}),f=r?.onParseError??(()=>{}),h=["6.4.2. Layer Naming and Nesting","Layer name syntax","<layer-name> = <ident> [ '.' <ident> ]*"],d=t[0][2],y=t[t.length-1][3],g=[];for(let t=0;t<o.length;t++){const r=o[t];for(let e=0;e<r.length;e++){const t=r[e];if(!m(t)&&!u(t)&&!p(t))return f(new a(`Invalid cascade layer name. Invalid layer name part "${t.toString()}"`,d,y,h)),[]}const c=r.flatMap((e=>e.tokens()));let w=!1,v=!1,L=null;for(let t=0;t<c.length;t++){const r=c[t];if(!(s(r)||e(r)||n(r)&&"."===r[4].value))return f(new a(`Invalid cascade layer name. Invalid character "${r[1]}"`,d,y,h)),[];if(!w&&n(r))return f(new a("Invalid cascade layer name. Layer names can not start with a dot.",d,y,h)),[];if(w){if(l(r)){v=!0;continue}if(v&&i(r))continue;if(v)return f(new a("Invalid cascade layer name. Encountered unexpected whitespace between layer name parts.",d,y,h)),[];if(e(L)&&e(r))return f(new a("Invalid cascade layer name. Layer name parts must be separated by dots.",d,y,h)),[];if(n(L)&&n(r))return f(new a("Invalid cascade layer name. Layer name parts must not be empty.",d,y,h)),[]}e(r)&&(w=!0),(e(r)||n(r))&&(L=r)}if(!L)return f(new a("Invalid cascade layer name. Empty layer name.",d,y,h)),[];if(n(L))return f(new a("Invalid cascade layer name. Layer name must not end with a dot.",d,y,h)),[];g.push(new LayerName(c))}return g}function parse(e,t){const n=o({css:e},{onParseError:t?.onParseError}),r=[];for(;!n.endOfFile();)r.push(n.nextToken());return r.push(n.nextToken()),parseFromTokens(r,t)}export{LayerName,addLayerToModel,parse,parseFromTokens}; diff --git a/node_modules/@csstools/cascade-layer-name-parser/package.json b/node_modules/@csstools/cascade-layer-name-parser/package.json deleted file mode 100644 index a8364c58..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@csstools/cascade-layer-name-parser", - "description": "Parse CSS Cascade Layer names.", - "version": "1.0.13", - "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" - }, - "type": "module", - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "exports": { - ".": { - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.mjs" - }, - "require": { - "default": "./dist/index.cjs" - } - } - }, - "files": [ - "CHANGELOG.md", - "LICENSE.md", - "README.md", - "dist" - ], - "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.7.1", - "@csstools/css-tokenizer": "^2.4.1" - }, - "scripts": {}, - "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/csstools/postcss-plugins.git", - "directory": "packages/cascade-layer-name-parser" - }, - "bugs": "https://github.com/csstools/postcss-plugins/issues", - "keywords": [ - "cascade-layer", - "css", - "parser" - ] -} |
