@eslint/css-tree 3.4.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/syntax/node/Block.cjs +15 -1
- package/data/patch.json +4 -0
- package/dist/csstree.esm.js +5 -5
- package/dist/csstree.js +5 -5
- package/dist/data.cjs +2 -1
- package/dist/data.js +2 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/syntax/node/Block.js +19 -1
- package/package.json +1 -1
package/dist/data.cjs
CHANGED
|
@@ -526,7 +526,8 @@ module.exports = {
|
|
|
526
526
|
"inset-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
|
|
527
527
|
"font-variant-css2": "normal|small-caps",
|
|
528
528
|
"font-width-css3": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
|
|
529
|
-
"system-family-name": "caption|icon|menu|message-box|small-caption|status-bar"
|
|
529
|
+
"system-family-name": "caption|icon|menu|message-box|small-caption|status-bar",
|
|
530
|
+
"parentheses-block": "( <any-value>* )"
|
|
530
531
|
},
|
|
531
532
|
"properties": {
|
|
532
533
|
"--*": "<declaration-value>",
|
package/dist/data.js
CHANGED
|
@@ -526,7 +526,8 @@ export default {
|
|
|
526
526
|
"inset-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
|
|
527
527
|
"font-variant-css2": "normal|small-caps",
|
|
528
528
|
"font-width-css3": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
|
|
529
|
-
"system-family-name": "caption|icon|menu|message-box|small-caption|status-bar"
|
|
529
|
+
"system-family-name": "caption|icon|menu|message-box|small-caption|status-bar",
|
|
530
|
+
"parentheses-block": "( <any-value>* )"
|
|
530
531
|
},
|
|
531
532
|
"properties": {
|
|
532
533
|
"--*": "<declaration-value>",
|
package/dist/version.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = "3.
|
|
1
|
+
module.exports = "3.5.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "3.
|
|
1
|
+
export const version = "3.5.1";
|
package/lib/index.d.ts
CHANGED
|
@@ -2697,7 +2697,7 @@ type StructureValue = string | Function | null;
|
|
|
2697
2697
|
type StructureDescriptor = StructureValue | Array<StructureValue> | Array<Array<StructureValue>>;
|
|
2698
2698
|
|
|
2699
2699
|
interface StructureDefinition {
|
|
2700
|
-
children?: Array<string
|
|
2700
|
+
children?: Array<Array<string>>;
|
|
2701
2701
|
|
|
2702
2702
|
[key: string]: StructureDescriptor | undefined;
|
|
2703
2703
|
}
|
|
@@ -2712,7 +2712,7 @@ interface NodeSyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
|
|
|
2712
2712
|
|
|
2713
2713
|
interface AtruleSyntax {
|
|
2714
2714
|
prelude: string | null;
|
|
2715
|
-
descriptors
|
|
2715
|
+
descriptors?: Record<string, string> | null;
|
|
2716
2716
|
}
|
|
2717
2717
|
|
|
2718
2718
|
// https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/syntax/config/parser.js#L7-L28
|
package/lib/syntax/node/Block.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WhiteSpace,
|
|
3
3
|
Comment,
|
|
4
|
+
Delim,
|
|
4
5
|
Semicolon,
|
|
6
|
+
Hash,
|
|
7
|
+
Colon,
|
|
5
8
|
AtKeyword,
|
|
9
|
+
LeftSquareBracket,
|
|
6
10
|
LeftCurlyBracket,
|
|
7
11
|
RightCurlyBracket
|
|
8
12
|
} from '../../tokenizer/index.js';
|
|
9
13
|
|
|
10
14
|
const AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)
|
|
15
|
+
const DOT = 0x002E; // U+002E FULL STOP (.)
|
|
16
|
+
const STAR = 0x002A; // U+002A ASTERISK (*);
|
|
17
|
+
|
|
18
|
+
const selectorStarts = new Set([
|
|
19
|
+
AMPERSAND,
|
|
20
|
+
DOT,
|
|
21
|
+
STAR
|
|
22
|
+
]);
|
|
11
23
|
|
|
12
24
|
function consumeRaw() {
|
|
13
25
|
return this.Raw(null, true);
|
|
@@ -32,6 +44,12 @@ function consumeDeclaration() {
|
|
|
32
44
|
return node;
|
|
33
45
|
}
|
|
34
46
|
|
|
47
|
+
function isSelectorStart() {
|
|
48
|
+
return this.tokenType === Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart)) ||
|
|
49
|
+
this.tokenType === Hash || this.tokenType === LeftSquareBracket ||
|
|
50
|
+
this.tokenType === Colon;
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
export const name = 'Block';
|
|
36
54
|
export const walkContext = 'block';
|
|
37
55
|
export const structure = {
|
|
@@ -65,7 +83,7 @@ export function parse(isStyleBlock) {
|
|
|
65
83
|
break;
|
|
66
84
|
|
|
67
85
|
default:
|
|
68
|
-
if (isStyleBlock &&
|
|
86
|
+
if (isStyleBlock && isSelectorStart.call(this)) {
|
|
69
87
|
children.push(consumeRule.call(this));
|
|
70
88
|
} else {
|
|
71
89
|
children.push(consumer.call(this));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint/css-tree",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations",
|
|
5
5
|
"author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
|
|
6
6
|
"license": "MIT",
|