@projectwallace/css-parser 0.14.10 → 0.16.0
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/dist/{arena-D6TANE5e.d.ts → arena-CSK5NfHq.d.ts} +2 -1
- package/dist/{arena-CveFYH2l.js → arena-DnV0a_Ne.js} +2 -1
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +3 -2
- package/dist/{css-node-DMd5jbdm.js → css-node-BTgoFWDU.js} +34 -4
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -5
- package/dist/{node-types-D282RMOz.d.ts → node-types-mntWKkN-.d.ts} +81 -29
- package/dist/parse-anplusb.d.ts +2 -2
- package/dist/parse-anplusb.js +6 -6
- package/dist/parse-atrule-prelude.d.ts +4 -2
- package/dist/parse-atrule-prelude.js +53 -17
- package/dist/parse-declaration.d.ts +3 -3
- package/dist/parse-declaration.js +3 -3
- package/dist/parse-selector.d.ts +6 -9
- package/dist/parse-selector.js +56 -55
- package/dist/parse-value.d.ts +2 -2
- package/dist/parse-value.js +4 -4
- package/dist/parse.d.ts +3 -3
- package/dist/parse.js +21 -21
- package/dist/{tokenize-BSycRGm0.js → tokenize-BxUina14.js} +240 -181
- package/dist/{tokenize-CyiJelQC.d.ts → tokenize-mV23Aiyb.d.ts} +1 -0
- package/dist/tokenize.d.ts +1 -1
- package/dist/tokenize.js +1 -1
- package/dist/walk.d.ts +1 -1
- package/dist/walk.js +47 -14
- package/package.json +109 -103
|
@@ -40,6 +40,7 @@ declare const PRELUDE_OPERATOR = 38;
|
|
|
40
40
|
declare const FEATURE_RANGE = 39;
|
|
41
41
|
declare const AT_RULE_PRELUDE = 40;
|
|
42
42
|
declare const PRELUDE_SELECTORLIST = 41;
|
|
43
|
+
declare const SUPPORTS_DECLARATION = 57;
|
|
43
44
|
declare const VALUE = 50;
|
|
44
45
|
declare const FLAG_IMPORTANT: number;
|
|
45
46
|
/** @internal */
|
|
@@ -90,4 +91,4 @@ declare class CSSDataArena {
|
|
|
90
91
|
has_flag(node_index: number, flag: number): boolean;
|
|
91
92
|
}
|
|
92
93
|
//#endregion
|
|
93
|
-
export { PRELUDE_SELECTORLIST as A,
|
|
94
|
+
export { PRELUDE_SELECTORLIST as A, SUPPORTS_QUERY as B, NESTING_SELECTOR as C, OPERATOR as D, NUMBER as E, SELECTOR_LIST as F, VALUE as G, UNICODE_RANGE as H, STRING as I, STYLESHEET as L, PSEUDO_ELEMENT_SELECTOR as M, RAW as N, PARENTHESIS as O, SELECTOR as P, STYLE_RULE as R, MEDIA_TYPE as S, NTH_SELECTOR as T, UNIVERSAL_SELECTOR as U, TYPE_SELECTOR as V, URL as W, ID_SELECTOR as _, CLASS_SELECTOR as a, MEDIA_FEATURE as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PSEUDO_CLASS_SELECTOR as j, PRELUDE_OPERATOR as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, LANG_SELECTOR as v, NTH_OF_SELECTOR as w, MEDIA_QUERY as x, LAYER_NAME as y, SUPPORTS_DECLARATION as z };
|
|
@@ -40,6 +40,7 @@ const LAYER_NAME = 37;
|
|
|
40
40
|
const PRELUDE_OPERATOR = 38;
|
|
41
41
|
const FEATURE_RANGE = 39;
|
|
42
42
|
const AT_RULE_PRELUDE = 40;
|
|
43
|
+
const SUPPORTS_DECLARATION = 57;
|
|
43
44
|
const VALUE = 50;
|
|
44
45
|
const FLAG_IMPORTANT = 1;
|
|
45
46
|
/** @internal */
|
|
@@ -196,4 +197,4 @@ var CSSDataArena = class CSSDataArena {
|
|
|
196
197
|
}
|
|
197
198
|
};
|
|
198
199
|
//#endregion
|
|
199
|
-
export { PSEUDO_CLASS_SELECTOR as A,
|
|
200
|
+
export { PSEUDO_CLASS_SELECTOR as A, TYPE_SELECTOR as B, NESTING_SELECTOR as C, OPERATOR as D, NUMBER as E, STRING as F, UNIVERSAL_SELECTOR as H, STYLESHEET as I, STYLE_RULE as L, RAW as M, SELECTOR as N, PARENTHESIS as O, SELECTOR_LIST as P, SUPPORTS_DECLARATION as R, MEDIA_TYPE as S, NTH_SELECTOR as T, URL as U, UNICODE_RANGE as V, VALUE as W, ID_SELECTOR as _, CLASS_SELECTOR as a, MEDIA_FEATURE as b, CONTAINER_QUERY as c, DIMENSION as d, FEATURE_RANGE as f, IDENTIFIER as g, HASH as h, BLOCK as i, PSEUDO_ELEMENT_SELECTOR as j, PRELUDE_OPERATOR as k, CSSDataArena as l, FUNCTION as m, AT_RULE as n, COMBINATOR as o, FLAG_IMPORTANT as p, AT_RULE_PRELUDE as r, COMMENT as s, ATTRIBUTE_SELECTOR as t, DECLARATION as u, LANG_SELECTOR as v, NTH_OF_SELECTOR as w, MEDIA_QUERY as x, LAYER_NAME as y, SUPPORTS_QUERY as z };
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as SUPPORTS_QUERY, C as NESTING_SELECTOR, D as OPERATOR, E as NUMBER, F as SELECTOR_LIST, G as VALUE, H as UNICODE_RANGE, I as STRING, L as STYLESHEET, M as PSEUDO_ELEMENT_SELECTOR, N as RAW, O as PARENTHESIS, P as SELECTOR, R as STYLE_RULE, S as MEDIA_TYPE, T as NTH_SELECTOR, U as UNIVERSAL_SELECTOR, V as TYPE_SELECTOR, W as URL, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as MEDIA_FEATURE, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_CLASS_SELECTOR, k as PRELUDE_OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as LANG_SELECTOR, w as NTH_OF_SELECTOR, x as MEDIA_QUERY, y as LAYER_NAME, z as SUPPORTS_DECLARATION } from "./arena-CSK5NfHq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/constants.d.ts
|
|
4
4
|
declare const NODE_TYPES: {
|
|
@@ -39,10 +39,11 @@ declare const NODE_TYPES: {
|
|
|
39
39
|
readonly MEDIA_TYPE: 34;
|
|
40
40
|
readonly CONTAINER_QUERY: 35;
|
|
41
41
|
readonly SUPPORTS_QUERY: 36;
|
|
42
|
+
readonly SUPPORTS_DECLARATION: 57;
|
|
42
43
|
readonly LAYER_NAME: 37;
|
|
43
44
|
readonly PRELUDE_OPERATOR: 38;
|
|
44
45
|
readonly FEATURE_RANGE: 39;
|
|
45
46
|
readonly AT_RULE_PRELUDE: 40;
|
|
46
47
|
};
|
|
47
48
|
//#endregion
|
|
48
|
-
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
|
|
49
|
+
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
|
package/dist/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as PSEUDO_CLASS_SELECTOR, B as
|
|
1
|
+
import { A as PSEUDO_CLASS_SELECTOR, B as TYPE_SELECTOR, C as NESTING_SELECTOR, D as OPERATOR, E as NUMBER, F as STRING, H as UNIVERSAL_SELECTOR, I as STYLESHEET, L as STYLE_RULE, M as RAW, N as SELECTOR, O as PARENTHESIS, P as SELECTOR_LIST, R as SUPPORTS_DECLARATION, S as MEDIA_TYPE, T as NTH_SELECTOR, U as URL, V as UNICODE_RANGE, W as VALUE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as MEDIA_FEATURE, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_ELEMENT_SELECTOR, k as PRELUDE_OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as LANG_SELECTOR, w as NTH_OF_SELECTOR, x as MEDIA_QUERY, y as LAYER_NAME, z as SUPPORTS_QUERY } from "./arena-DnV0a_Ne.js";
|
|
2
2
|
//#region src/constants.ts
|
|
3
3
|
const NODE_TYPES = {
|
|
4
4
|
STYLESHEET: 1,
|
|
@@ -38,10 +38,11 @@ const NODE_TYPES = {
|
|
|
38
38
|
MEDIA_TYPE: 34,
|
|
39
39
|
CONTAINER_QUERY: 35,
|
|
40
40
|
SUPPORTS_QUERY: 36,
|
|
41
|
+
SUPPORTS_DECLARATION: 57,
|
|
41
42
|
LAYER_NAME: 37,
|
|
42
43
|
PRELUDE_OPERATOR: 38,
|
|
43
44
|
FEATURE_RANGE: 39,
|
|
44
45
|
AT_RULE_PRELUDE: 40
|
|
45
46
|
};
|
|
46
47
|
//#endregion
|
|
47
|
-
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
|
|
48
|
+
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./arena-
|
|
1
|
+
import "./arena-DnV0a_Ne.js";
|
|
2
2
|
import { a as is_whitespace, c as str_starts_with, i as is_vendor_prefixed, t as parse_dimension } from "./parse-dimension-CCn_XRDe.js";
|
|
3
3
|
//#region src/css-node.ts
|
|
4
4
|
const TYPE_NAMES = {
|
|
@@ -39,6 +39,7 @@ const TYPE_NAMES = {
|
|
|
39
39
|
[34]: "MediaType",
|
|
40
40
|
[35]: "ContainerQuery",
|
|
41
41
|
[36]: "SupportsQuery",
|
|
42
|
+
[57]: "SupportsDeclaration",
|
|
42
43
|
[37]: "Layer",
|
|
43
44
|
[38]: "Operator",
|
|
44
45
|
[39]: "MediaFeatureRange",
|
|
@@ -75,10 +76,13 @@ const nodes_with_children = new Set([
|
|
|
75
76
|
32,
|
|
76
77
|
33,
|
|
77
78
|
35,
|
|
78
|
-
39
|
|
79
|
+
39,
|
|
80
|
+
36,
|
|
81
|
+
57
|
|
79
82
|
]);
|
|
80
83
|
const enumerable_properties = [
|
|
81
84
|
"name",
|
|
85
|
+
"namespace",
|
|
82
86
|
"property",
|
|
83
87
|
"value",
|
|
84
88
|
"unit",
|
|
@@ -108,6 +112,14 @@ var CSSNode = class CSSNode {
|
|
|
108
112
|
__get_arena() {
|
|
109
113
|
return this.arena;
|
|
110
114
|
}
|
|
115
|
+
/** @internal */
|
|
116
|
+
__get_source() {
|
|
117
|
+
return this.source;
|
|
118
|
+
}
|
|
119
|
+
/** @internal */
|
|
120
|
+
__get_index() {
|
|
121
|
+
return this.index;
|
|
122
|
+
}
|
|
111
123
|
get_content() {
|
|
112
124
|
let start = this.arena.get_content_start(this.index);
|
|
113
125
|
let length = this.arena.get_content_length(this.index);
|
|
@@ -131,12 +143,28 @@ var CSSNode = class CSSNode {
|
|
|
131
143
|
/** Get the "content" text (at-rule name for at-rules, layer name for import layers) */
|
|
132
144
|
get name() {
|
|
133
145
|
if (!nodes_with_name.has(this.type)) return;
|
|
134
|
-
let content = this.get_content();
|
|
135
146
|
let { type } = this;
|
|
136
|
-
if (
|
|
147
|
+
if (type === 28) return null;
|
|
148
|
+
let content = this.get_content();
|
|
149
|
+
if (type === 56 && content === "") return null;
|
|
137
150
|
return content;
|
|
138
151
|
}
|
|
139
152
|
/**
|
|
153
|
+
* Namespace prefix for type and universal selectors.
|
|
154
|
+
* - `null` — no namespace qualifier (plain `div` or `*`)
|
|
155
|
+
* - `''` — empty namespace (`|div` or `|*`)
|
|
156
|
+
* - `'ns'` — named namespace (`ns|div` or `ns|*`)
|
|
157
|
+
* - `'*'` — any namespace (`*|div` or `*|*`)
|
|
158
|
+
*/
|
|
159
|
+
get namespace() {
|
|
160
|
+
let { type } = this;
|
|
161
|
+
if (type !== 21 && type !== 28) return void 0;
|
|
162
|
+
if (!this.arena.has_flag(this.index, 16)) return null;
|
|
163
|
+
let start = this.arena.get_value_start(this.index);
|
|
164
|
+
let length = this.arena.get_value_length(this.index);
|
|
165
|
+
return this.source.substring(start, start + length);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
140
168
|
* Alias for name (for declarations: "color" in "color: blue")
|
|
141
169
|
* More semantic than `name` for declaration nodes
|
|
142
170
|
*/
|
|
@@ -157,6 +185,7 @@ var CSSNode = class CSSNode {
|
|
|
157
185
|
if (type === 3) return void 0;
|
|
158
186
|
if (type === 34) return text;
|
|
159
187
|
if (type === 4 && first_child) return first_child;
|
|
188
|
+
if (type === 33) return first_child ?? null;
|
|
160
189
|
if (type === 12) return parse_dimension(text).value;
|
|
161
190
|
if (type === 11) return Number.parseFloat(text);
|
|
162
191
|
if (type === 18) {
|
|
@@ -251,6 +280,7 @@ var CSSNode = class CSSNode {
|
|
|
251
280
|
case 3: return is_vendor_prefixed(this.get_content());
|
|
252
281
|
case 15: return is_vendor_prefixed(this.get_content());
|
|
253
282
|
case 10: return is_vendor_prefixed(this.text);
|
|
283
|
+
case 33: return is_vendor_prefixed(this.get_content());
|
|
254
284
|
default: return false;
|
|
255
285
|
}
|
|
256
286
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as SUPPORTS_QUERY, C as NESTING_SELECTOR, D as OPERATOR, E as NUMBER, F as SELECTOR_LIST, G as VALUE, H as UNICODE_RANGE, I as STRING, L as STYLESHEET, M as PSEUDO_ELEMENT_SELECTOR, N as RAW, O as PARENTHESIS, P as SELECTOR, R as STYLE_RULE, S as MEDIA_TYPE, T as NTH_SELECTOR, U as UNIVERSAL_SELECTOR, V as TYPE_SELECTOR, W as URL, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as MEDIA_FEATURE, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_CLASS_SELECTOR, k as PRELUDE_OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as LANG_SELECTOR, w as NTH_OF_SELECTOR, x as MEDIA_QUERY, y as LAYER_NAME, z as SUPPORTS_DECLARATION } from "./arena-CSK5NfHq.js";
|
|
2
2
|
import { NODE_TYPES } from "./constants.js";
|
|
3
|
-
import { A as TOKEN_URL, C as TOKEN_PERCENTAGE, D as TOKEN_SEMICOLON, E as TOKEN_RIGHT_PAREN, M as Token, N as TokenType, O as TOKEN_STRING, S as TOKEN_NUMBER, T as TOKEN_RIGHT_BRACKET, _ as TOKEN_HASH, a as TOKEN_AT_KEYWORD, b as TOKEN_LEFT_BRACKET, c as TOKEN_CDC, d as TOKEN_COMMA, f as TOKEN_COMMENT, g as TOKEN_FUNCTION, h as TOKEN_EOF, i as tokenize, j as TOKEN_WHITESPACE, k as TOKEN_UNICODE_RANGE, l as TOKEN_CDO, m as TOKEN_DIMENSION, o as TOKEN_BAD_STRING, p as TOKEN_DELIM, r as LexerPosition, s as TOKEN_BAD_URL, t as CommentInfo, u as TOKEN_COLON, v as TOKEN_IDENT, w as TOKEN_RIGHT_BRACE, x as TOKEN_LEFT_PAREN, y as TOKEN_LEFT_BRACE } from "./tokenize-
|
|
4
|
-
import { $ as
|
|
3
|
+
import { A as TOKEN_URL, C as TOKEN_PERCENTAGE, D as TOKEN_SEMICOLON, E as TOKEN_RIGHT_PAREN, M as Token, N as TokenType, O as TOKEN_STRING, S as TOKEN_NUMBER, T as TOKEN_RIGHT_BRACKET, _ as TOKEN_HASH, a as TOKEN_AT_KEYWORD, b as TOKEN_LEFT_BRACKET, c as TOKEN_CDC, d as TOKEN_COMMA, f as TOKEN_COMMENT, g as TOKEN_FUNCTION, h as TOKEN_EOF, i as tokenize, j as TOKEN_WHITESPACE, k as TOKEN_UNICODE_RANGE, l as TOKEN_CDO, m as TOKEN_DIMENSION, o as TOKEN_BAD_STRING, p as TOKEN_DELIM, r as LexerPosition, s as TOKEN_BAD_URL, t as CommentInfo, u as TOKEN_COLON, v as TOKEN_IDENT, w as TOKEN_RIGHT_BRACE, x as TOKEN_LEFT_PAREN, y as TOKEN_LEFT_BRACE } from "./tokenize-mV23Aiyb.js";
|
|
4
|
+
import { $ as is_class_selector, A as PreludeSelectorList, At as is_stylesheet, B as SupportsDeclaration, Bt as TYPE_NAMES, C as NestingSelector, Ct as is_pseudo_class_selector, D as Operator, Dt as is_selector, E as Number, Et as is_rule, F as Selector, Ft as is_universal_selector, G as UniversalSelector, H as ToPlain, I as SelectorList, It as is_url, J as WithChildren, K as Url, L as SelectorNode, Lt as is_value, M as PseudoElementSelector, Mt as is_supports_query, N as Raw, Nt as is_type_selector, O as Parenthesis, Ot as is_selector_list, P as Rule, Pt as is_unicode_range, Q as is_block, R as String, Rt as CloneOptions, S as MediaType, St as is_prelude_selectorlist, T as NthSelector, Tt as is_raw, U as TypeSelector, V as SupportsQuery, W as UnicodeRange, X as is_atrule_prelude, Y as is_atrule, Z as is_attribute_selector, _ as Identifier, _t as is_nth_selector, a as Block, at as is_feature_range, b as MediaFeature, bt as is_parenthesis, c as Combinator, ct as is_id_selector, d as Declaration, dt as is_layer_name, et as is_combinator, f as Dimension, ft as is_media_feature, g as IdSelector, gt as is_nth_of_selector, h as Hash, ht as is_nesting_selector, i as AttributeSelector, it as is_dimension, j as PseudoClassSelector, jt as is_supports_declaration, k as PreludeOperator, kt as is_string, l as Comment, lt as is_identifier, m as Function, mt as is_media_type, n as Atrule, nt as is_container_query, o as CSSNode, ot as is_function, p as FeatureRange, pt as is_media_query, q as Value, r as AtrulePrelude, rt as is_declaration, s as ClassSelector, st as is_hash, t as AnyNode, tt as is_comment, u as ContainerQuery, ut as is_lang_selector, v as LangSelector, vt as is_number, w as NthOfSelector, wt as is_pseudo_element_selector, x as MediaQuery, xt as is_prelude_operator, y as LayerName, yt as is_operator, z as StyleSheet, zt as PlainCSSNode } from "./node-types-mntWKkN-.js";
|
|
5
5
|
import { ParserOptions, parse } from "./parse.js";
|
|
6
|
-
import { parse_selector } from "./parse-selector.js";
|
|
6
|
+
import { parse_selector, parse_selector_list } from "./parse-selector.js";
|
|
7
7
|
import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
|
|
8
8
|
import { parse_declaration } from "./parse-declaration.js";
|
|
9
9
|
import { parse_value } from "./parse-value.js";
|
|
@@ -75,4 +75,4 @@ declare function is_vendor_prefixed(source: string, start: number, end: number):
|
|
|
75
75
|
*/
|
|
76
76
|
declare function is_custom(str: string): boolean;
|
|
77
77
|
//#endregion
|
|
78
|
-
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, type AnyNode, type Atrule, type AtrulePrelude, type AttributeSelector, BLOCK, BREAK, type Block, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, type CSSNode, type ClassSelector, type CloneOptions, type Combinator, type Comment, type CommentInfo, type ContainerQuery, DECLARATION, DIMENSION, type Declaration, type Dimension, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, type FeatureRange, type Function, HASH, type Hash, IDENTIFIER, ID_SELECTOR, type IdSelector, type Identifier, LANG_SELECTOR, LAYER_NAME, type LangSelector, type LayerName, type LexerPosition, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, type MediaFeature, type MediaQuery, type MediaType, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, type NestingSelector, type NthOfSelector, type NthSelector, type Number, OPERATOR, type Operator, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, type Parenthesis, type ParserOptions, type PlainCSSNode, type PreludeOperator, type PreludeSelectorList, type PseudoClassSelector, type PseudoElementSelector, RAW, type Raw, type Rule, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_QUERY, type Selector, type SelectorList, type SelectorNode, type String, type StyleSheet, type SupportsQuery, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, type ToPlain, Token, TokenType, type TypeSelector, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, type UnicodeRange, type UniversalSelector, type Url, VALUE, type Value, type WithChildren, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
|
|
78
|
+
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, type AnyNode, type Atrule, type AtrulePrelude, type AttributeSelector, BLOCK, BREAK, type Block, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, type CSSNode, type ClassSelector, type CloneOptions, type Combinator, type Comment, type CommentInfo, type ContainerQuery, DECLARATION, DIMENSION, type Declaration, type Dimension, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, type FeatureRange, type Function, HASH, type Hash, IDENTIFIER, ID_SELECTOR, type IdSelector, type Identifier, LANG_SELECTOR, LAYER_NAME, type LangSelector, type LayerName, type LexerPosition, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, type MediaFeature, type MediaQuery, type MediaType, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, type NestingSelector, type NthOfSelector, type NthSelector, type Number, OPERATOR, type Operator, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, type Parenthesis, type ParserOptions, type PlainCSSNode, type PreludeOperator, type PreludeSelectorList, type PseudoClassSelector, type PseudoElementSelector, RAW, type Raw, type Rule, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, type Selector, type SelectorList, type SelectorNode, type String, type StyleSheet, type SupportsDeclaration, type SupportsQuery, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, type ToPlain, Token, TokenType, type TypeSelector, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, type UnicodeRange, type UniversalSelector, type Url, VALUE, type Value, type WithChildren, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as TOKEN_RIGHT_BRACKET, D as TOKEN_UNICODE_RANGE, E as TOKEN_STRING, O as TOKEN_URL, S as TOKEN_RIGHT_BRACE, T as TOKEN_SEMICOLON, _ as TOKEN_LEFT_BRACE, a as TOKEN_BAD_URL, b as TOKEN_NUMBER, c as TOKEN_COLON, d as TOKEN_DELIM, f as TOKEN_DIMENSION, g as TOKEN_IDENT, h as TOKEN_HASH, i as TOKEN_BAD_STRING, k as TOKEN_WHITESPACE, l as TOKEN_COMMA, m as TOKEN_FUNCTION, n as tokenize, o as TOKEN_CDC, p as TOKEN_EOF, r as TOKEN_AT_KEYWORD, s as TOKEN_CDO, u as TOKEN_COMMENT, v as TOKEN_LEFT_BRACKET, w as TOKEN_RIGHT_PAREN, x as TOKEN_PERCENTAGE, y as TOKEN_LEFT_PAREN } from "./tokenize-
|
|
2
|
-
import { A as PSEUDO_CLASS_SELECTOR, B as
|
|
1
|
+
import { C as TOKEN_RIGHT_BRACKET, D as TOKEN_UNICODE_RANGE, E as TOKEN_STRING, O as TOKEN_URL, S as TOKEN_RIGHT_BRACE, T as TOKEN_SEMICOLON, _ as TOKEN_LEFT_BRACE, a as TOKEN_BAD_URL, b as TOKEN_NUMBER, c as TOKEN_COLON, d as TOKEN_DELIM, f as TOKEN_DIMENSION, g as TOKEN_IDENT, h as TOKEN_HASH, i as TOKEN_BAD_STRING, k as TOKEN_WHITESPACE, l as TOKEN_COMMA, m as TOKEN_FUNCTION, n as tokenize, o as TOKEN_CDC, p as TOKEN_EOF, r as TOKEN_AT_KEYWORD, s as TOKEN_CDO, u as TOKEN_COMMENT, v as TOKEN_LEFT_BRACKET, w as TOKEN_RIGHT_PAREN, x as TOKEN_PERCENTAGE, y as TOKEN_LEFT_PAREN } from "./tokenize-BxUina14.js";
|
|
2
|
+
import { A as PSEUDO_CLASS_SELECTOR, B as TYPE_SELECTOR, C as NESTING_SELECTOR, D as OPERATOR, E as NUMBER, F as STRING, H as UNIVERSAL_SELECTOR, I as STYLESHEET, L as STYLE_RULE, M as RAW, N as SELECTOR, O as PARENTHESIS, P as SELECTOR_LIST, R as SUPPORTS_DECLARATION, S as MEDIA_TYPE, T as NTH_SELECTOR, U as URL, V as UNICODE_RANGE, W as VALUE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as MEDIA_FEATURE, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_ELEMENT_SELECTOR, k as PRELUDE_OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as LANG_SELECTOR, w as NTH_OF_SELECTOR, x as MEDIA_QUERY, y as LAYER_NAME, z as SUPPORTS_QUERY } from "./arena-DnV0a_Ne.js";
|
|
3
3
|
import { c as str_starts_with, i as is_vendor_prefixed, o as str_equals, r as is_custom, s as str_index_of, t as parse_dimension } from "./parse-dimension-CCn_XRDe.js";
|
|
4
|
-
import { n as TYPE_NAMES } from "./css-node-
|
|
5
|
-
import { parse_selector } from "./parse-selector.js";
|
|
4
|
+
import { n as TYPE_NAMES } from "./css-node-BTgoFWDU.js";
|
|
5
|
+
import { parse_selector, parse_selector_list } from "./parse-selector.js";
|
|
6
6
|
import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
|
|
7
7
|
import { parse_value } from "./parse-value.js";
|
|
8
8
|
import { parse_declaration } from "./parse-declaration.js";
|
|
@@ -124,6 +124,9 @@ function is_container_query(node) {
|
|
|
124
124
|
function is_supports_query(node) {
|
|
125
125
|
return node.type === 36;
|
|
126
126
|
}
|
|
127
|
+
function is_supports_declaration(node) {
|
|
128
|
+
return node.type === 57;
|
|
129
|
+
}
|
|
127
130
|
function is_layer_name(node) {
|
|
128
131
|
return node.type === 37;
|
|
129
132
|
}
|
|
@@ -137,4 +140,4 @@ function is_prelude_selectorlist(node) {
|
|
|
137
140
|
return node.type === 41;
|
|
138
141
|
}
|
|
139
142
|
//#endregion
|
|
140
|
-
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, BREAK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_QUERY, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
|
|
143
|
+
export { ATTRIBUTE_SELECTOR, AT_RULE, AT_RULE_PRELUDE, BLOCK, BREAK, CLASS_SELECTOR, COMBINATOR, COMMENT, CONTAINER_QUERY, DECLARATION, DIMENSION, FEATURE_RANGE, FLAG_IMPORTANT, FUNCTION, HASH, IDENTIFIER, ID_SELECTOR, LANG_SELECTOR, LAYER_NAME, MEDIA_FEATURE, MEDIA_QUERY, MEDIA_TYPE, NESTING_SELECTOR, NODE_TYPES, NTH_OF_SELECTOR, NTH_SELECTOR, NUMBER, OPERATOR, PARENTHESIS, PRELUDE_OPERATOR, PSEUDO_CLASS_SELECTOR, PSEUDO_ELEMENT_SELECTOR, RAW, SELECTOR, SELECTOR_LIST, SKIP, STRING, STYLESHEET, STYLE_RULE, SUPPORTS_DECLARATION, SUPPORTS_QUERY, TOKEN_AT_KEYWORD, TOKEN_BAD_STRING, TOKEN_BAD_URL, TOKEN_CDC, TOKEN_CDO, TOKEN_COLON, TOKEN_COMMA, TOKEN_COMMENT, TOKEN_DELIM, TOKEN_DIMENSION, TOKEN_EOF, TOKEN_FUNCTION, TOKEN_HASH, TOKEN_IDENT, TOKEN_LEFT_BRACE, TOKEN_LEFT_BRACKET, TOKEN_LEFT_PAREN, TOKEN_NUMBER, TOKEN_PERCENTAGE, TOKEN_RIGHT_BRACE, TOKEN_RIGHT_BRACKET, TOKEN_RIGHT_PAREN, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNICODE_RANGE, TOKEN_URL, TOKEN_WHITESPACE, TYPE_NAMES, TYPE_SELECTOR, UNICODE_RANGE, UNIVERSAL_SELECTOR, URL, VALUE, is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_custom, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_lang_selector, is_layer_name, is_media_feature, is_media_query, is_media_type, is_nesting_selector, is_nth_of_selector, is_nth_selector, is_number, is_operator, is_parenthesis, is_prelude_operator, is_prelude_selectorlist, is_pseudo_class_selector, is_pseudo_element_selector, is_raw, is_rule, is_selector, is_selector_list, is_string, is_stylesheet, is_supports_declaration, is_supports_query, is_type_selector, is_unicode_range, is_universal_selector, is_url, is_value, is_vendor_prefixed, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, str_equals, str_index_of, str_starts_with, tokenize, traverse, walk };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as PRELUDE_SELECTORLIST, B as
|
|
1
|
+
import { A as PRELUDE_SELECTORLIST, B as SUPPORTS_QUERY, C as NESTING_SELECTOR, D as OPERATOR, E as NUMBER, F as SELECTOR_LIST, G as VALUE, H as UNICODE_RANGE, I as STRING, L as STYLESHEET, M as PSEUDO_ELEMENT_SELECTOR, N as RAW, O as PARENTHESIS, P as SELECTOR, R as STYLE_RULE, S as MEDIA_TYPE, T as NTH_SELECTOR, U as UNIVERSAL_SELECTOR, V as TYPE_SELECTOR, W as URL, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as MEDIA_FEATURE, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PSEUDO_CLASS_SELECTOR, k as PRELUDE_OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as LANG_SELECTOR, w as NTH_OF_SELECTOR, x as MEDIA_QUERY, y as LAYER_NAME, z as SUPPORTS_DECLARATION } from "./arena-CSK5NfHq.js";
|
|
2
2
|
|
|
3
3
|
//#region src/css-node.d.ts
|
|
4
4
|
declare const TYPE_NAMES: {
|
|
@@ -39,6 +39,7 @@ declare const TYPE_NAMES: {
|
|
|
39
39
|
readonly 34: "MediaType";
|
|
40
40
|
readonly 35: "ContainerQuery";
|
|
41
41
|
readonly 36: "SupportsQuery";
|
|
42
|
+
readonly 57: "SupportsDeclaration";
|
|
42
43
|
readonly 37: "Layer";
|
|
43
44
|
readonly 38: "Operator";
|
|
44
45
|
readonly 39: "MediaFeatureRange";
|
|
@@ -46,7 +47,7 @@ declare const TYPE_NAMES: {
|
|
|
46
47
|
readonly 41: "PreludeSelectorList";
|
|
47
48
|
};
|
|
48
49
|
type TypeName = (typeof TYPE_NAMES)[keyof typeof TYPE_NAMES] | 'unknown';
|
|
49
|
-
type CSSNodeType = typeof STYLESHEET | typeof STYLE_RULE | typeof AT_RULE | typeof DECLARATION | typeof SELECTOR | typeof COMMENT | typeof BLOCK | typeof RAW | typeof IDENTIFIER | typeof NUMBER | typeof DIMENSION | typeof STRING | typeof HASH | typeof FUNCTION | typeof OPERATOR | typeof PARENTHESIS | typeof URL | typeof UNICODE_RANGE | typeof VALUE | typeof SELECTOR_LIST | typeof TYPE_SELECTOR | typeof CLASS_SELECTOR | typeof ID_SELECTOR | typeof ATTRIBUTE_SELECTOR | typeof PSEUDO_CLASS_SELECTOR | typeof PSEUDO_ELEMENT_SELECTOR | typeof COMBINATOR | typeof UNIVERSAL_SELECTOR | typeof NESTING_SELECTOR | typeof NTH_SELECTOR | typeof NTH_OF_SELECTOR | typeof LANG_SELECTOR | typeof MEDIA_QUERY | typeof MEDIA_FEATURE | typeof MEDIA_TYPE | typeof CONTAINER_QUERY | typeof SUPPORTS_QUERY | typeof LAYER_NAME | typeof PRELUDE_OPERATOR | typeof FEATURE_RANGE | typeof AT_RULE_PRELUDE | typeof PRELUDE_SELECTORLIST;
|
|
50
|
+
type CSSNodeType = typeof STYLESHEET | typeof STYLE_RULE | typeof AT_RULE | typeof DECLARATION | typeof SELECTOR | typeof COMMENT | typeof BLOCK | typeof RAW | typeof IDENTIFIER | typeof NUMBER | typeof DIMENSION | typeof STRING | typeof HASH | typeof FUNCTION | typeof OPERATOR | typeof PARENTHESIS | typeof URL | typeof UNICODE_RANGE | typeof VALUE | typeof SELECTOR_LIST | typeof TYPE_SELECTOR | typeof CLASS_SELECTOR | typeof ID_SELECTOR | typeof ATTRIBUTE_SELECTOR | typeof PSEUDO_CLASS_SELECTOR | typeof PSEUDO_ELEMENT_SELECTOR | typeof COMBINATOR | typeof UNIVERSAL_SELECTOR | typeof NESTING_SELECTOR | typeof NTH_SELECTOR | typeof NTH_OF_SELECTOR | typeof LANG_SELECTOR | typeof MEDIA_QUERY | typeof MEDIA_FEATURE | typeof MEDIA_TYPE | typeof CONTAINER_QUERY | typeof SUPPORTS_QUERY | typeof LAYER_NAME | typeof PRELUDE_OPERATOR | typeof FEATURE_RANGE | typeof AT_RULE_PRELUDE | typeof PRELUDE_SELECTORLIST | typeof SUPPORTS_DECLARATION;
|
|
50
51
|
interface CloneOptions {
|
|
51
52
|
/**
|
|
52
53
|
* Recursively clone all children
|
|
@@ -144,10 +145,12 @@ type ToPlain<T extends CSSNode> = PlainCSSNode & {
|
|
|
144
145
|
} & { [K in Exclude<keyof T, keyof CSSNode | symbol | 'attr_operator' | 'attr_flags' | 'has_children' | 'child_count' | 'children'> as T[K] extends ((...args: any[]) => any) ? never : K]: T[K] extends CSSNode | null | undefined ? PlainCSSNode | Exclude<T[K], CSSNode> : T[K] extends CSSNode[] ? PlainCSSNode[] : T[K] };
|
|
145
146
|
type StyleSheet = CSSNode & WithChildren & {
|
|
146
147
|
readonly type: typeof STYLESHEET;
|
|
148
|
+
readonly type_name: 'StyleSheet';
|
|
147
149
|
clone(options?: CloneOptions): ToPlain<StyleSheet>;
|
|
148
150
|
};
|
|
149
151
|
type Rule = CSSNode & {
|
|
150
152
|
readonly type: typeof STYLE_RULE;
|
|
153
|
+
readonly type_name: 'Rule';
|
|
151
154
|
readonly has_declarations: boolean;
|
|
152
155
|
clone(options?: CloneOptions): ToPlain<Rule>;
|
|
153
156
|
} & /** SELECTOR_LIST (parse_selectors=true) or RAW (parse_selectors=false) */({
|
|
@@ -164,7 +167,8 @@ type Rule = CSSNode & {
|
|
|
164
167
|
readonly block: null;
|
|
165
168
|
});
|
|
166
169
|
type Atrule = CSSNode & {
|
|
167
|
-
readonly type: typeof AT_RULE;
|
|
170
|
+
readonly type: typeof AT_RULE;
|
|
171
|
+
readonly type_name: 'Atrule'; /** At-rule keyword, e.g. "media", "keyframes" */
|
|
168
172
|
readonly name: string;
|
|
169
173
|
readonly has_declarations: boolean;
|
|
170
174
|
clone(options?: CloneOptions): ToPlain<Atrule>;
|
|
@@ -182,7 +186,8 @@ type Atrule = CSSNode & {
|
|
|
182
186
|
readonly block: null;
|
|
183
187
|
});
|
|
184
188
|
type Declaration = CSSNode & {
|
|
185
|
-
readonly type: typeof DECLARATION;
|
|
189
|
+
readonly type: typeof DECLARATION;
|
|
190
|
+
readonly type_name: 'Declaration'; /** Property name, e.g. "color" */
|
|
186
191
|
readonly property: string; /** VALUE node (parse_values=true), RAW node (parse_values=false), or null */
|
|
187
192
|
readonly value: Value | Raw | null;
|
|
188
193
|
readonly is_important: boolean;
|
|
@@ -192,10 +197,12 @@ type Declaration = CSSNode & {
|
|
|
192
197
|
type SelectorNode = TypeSelector | IdSelector | ClassSelector | NthSelector | NthOfSelector | LangSelector | NestingSelector | AttributeSelector | UniversalSelector | PseudoClassSelector | PseudoElementSelector;
|
|
193
198
|
type Selector = CSSNode & WithChildren<SelectorNode> & {
|
|
194
199
|
readonly type: typeof SELECTOR;
|
|
200
|
+
readonly type_name: 'Selector';
|
|
195
201
|
clone(options?: CloneOptions): ToPlain<Selector>;
|
|
196
202
|
};
|
|
197
203
|
type SelectorList = CSSNode & WithChildren<Selector> & {
|
|
198
204
|
readonly type: typeof SELECTOR_LIST;
|
|
205
|
+
readonly type_name: 'SelectorList';
|
|
199
206
|
clone(options?: CloneOptions): ToPlain<SelectorList>;
|
|
200
207
|
};
|
|
201
208
|
/**
|
|
@@ -215,6 +222,7 @@ type BlockChild = (Raw | Declaration | Atrule | Rule) & ({
|
|
|
215
222
|
});
|
|
216
223
|
type Block = CSSNode & WithChildren<Raw | Declaration | Atrule | Rule> & {
|
|
217
224
|
readonly type: typeof BLOCK;
|
|
225
|
+
readonly type_name: 'Block';
|
|
218
226
|
readonly is_empty: boolean; /** Block children with next_sibling narrowed to the Block child union. */
|
|
219
227
|
readonly first_child: BlockChild;
|
|
220
228
|
readonly children: BlockChild[];
|
|
@@ -223,82 +231,100 @@ type Block = CSSNode & WithChildren<Raw | Declaration | Atrule | Rule> & {
|
|
|
223
231
|
};
|
|
224
232
|
type Comment = CSSNode & {
|
|
225
233
|
readonly type: typeof COMMENT;
|
|
234
|
+
readonly type_name: 'Comment';
|
|
226
235
|
clone(options?: CloneOptions): ToPlain<Comment>;
|
|
227
236
|
};
|
|
228
237
|
type Raw = CSSNode & {
|
|
229
238
|
readonly type: typeof RAW;
|
|
239
|
+
readonly type_name: 'Raw';
|
|
230
240
|
clone(options?: CloneOptions): ToPlain<Raw>;
|
|
231
241
|
};
|
|
232
242
|
type ValueLike = Function | Identifier | Operator | Parenthesis | Url | UnicodeRange | String | Hash | Dimension | Number;
|
|
233
243
|
type Identifier = CSSNode & {
|
|
234
244
|
readonly type: typeof IDENTIFIER;
|
|
245
|
+
readonly type_name: 'Identifier';
|
|
235
246
|
readonly name: string;
|
|
236
247
|
clone(options?: CloneOptions): ToPlain<Identifier>;
|
|
237
248
|
};
|
|
238
249
|
type Number = CSSNode & {
|
|
239
250
|
readonly type: typeof NUMBER;
|
|
251
|
+
readonly type_name: 'Number';
|
|
240
252
|
readonly value: number;
|
|
241
253
|
clone(options?: CloneOptions): ToPlain<Number>;
|
|
242
254
|
};
|
|
243
255
|
type Dimension = CSSNode & {
|
|
244
256
|
readonly type: typeof DIMENSION;
|
|
257
|
+
readonly type_name: 'Dimension';
|
|
245
258
|
readonly value: number; /** Unit string, e.g. "px", "%" */
|
|
246
259
|
readonly unit: string;
|
|
247
260
|
clone(options?: CloneOptions): ToPlain<Dimension>;
|
|
248
261
|
};
|
|
249
262
|
type String = CSSNode & {
|
|
250
263
|
readonly type: typeof STRING;
|
|
264
|
+
readonly type_name: 'String';
|
|
251
265
|
clone(options?: CloneOptions): ToPlain<String>;
|
|
252
266
|
};
|
|
253
267
|
type Hash = CSSNode & {
|
|
254
268
|
readonly type: typeof HASH;
|
|
269
|
+
readonly type_name: 'Hash';
|
|
255
270
|
clone(options?: CloneOptions): ToPlain<Hash>;
|
|
256
271
|
};
|
|
257
272
|
type Function = CSSNode & WithChildren<ValueLike> & {
|
|
258
|
-
readonly type: typeof FUNCTION;
|
|
273
|
+
readonly type: typeof FUNCTION;
|
|
274
|
+
readonly type_name: 'Function'; /** Function name, e.g. "rgb", "calc" */
|
|
259
275
|
readonly name: string; /** Function arguments as raw text, e.g. "255, 0, 0" for rgb(255, 0, 0) */
|
|
260
276
|
readonly value: string | null;
|
|
261
277
|
clone(options?: CloneOptions): ToPlain<Function>;
|
|
262
278
|
};
|
|
263
279
|
type Operator = CSSNode & {
|
|
264
|
-
readonly type: typeof OPERATOR;
|
|
280
|
+
readonly type: typeof OPERATOR;
|
|
281
|
+
readonly type_name: 'Operator'; /** The operator character(s), e.g. ",", "+", "-" */
|
|
265
282
|
readonly value: string;
|
|
266
283
|
clone(options?: CloneOptions): ToPlain<Operator>;
|
|
267
284
|
};
|
|
268
285
|
type Parenthesis = CSSNode & WithChildren & {
|
|
269
286
|
readonly type: typeof PARENTHESIS;
|
|
287
|
+
readonly type_name: 'Parentheses';
|
|
270
288
|
clone(options?: CloneOptions): ToPlain<Parenthesis>;
|
|
271
289
|
};
|
|
272
290
|
type Url = CSSNode & {
|
|
273
|
-
readonly type: typeof URL;
|
|
291
|
+
readonly type: typeof URL;
|
|
292
|
+
readonly type_name: 'Url'; /** URL content, e.g. '"image.png"' (with quotes) or 'mycursor.cur' (unquoted) */
|
|
274
293
|
readonly value: string | null;
|
|
275
294
|
clone(options?: CloneOptions): ToPlain<Url>;
|
|
276
295
|
};
|
|
277
296
|
type UnicodeRange = CSSNode & {
|
|
278
297
|
readonly type: typeof UNICODE_RANGE;
|
|
298
|
+
readonly type_name: 'UnicodeRange';
|
|
279
299
|
clone(options?: CloneOptions): ToPlain<UnicodeRange>;
|
|
280
300
|
};
|
|
281
301
|
type Value = CSSNode & WithChildren<ValueLike> & {
|
|
282
302
|
readonly type: typeof VALUE;
|
|
303
|
+
readonly type_name: 'Value';
|
|
283
304
|
clone(options?: CloneOptions): ToPlain<Value>;
|
|
284
305
|
};
|
|
285
306
|
type TypeSelector = CSSNode & {
|
|
286
|
-
readonly type: typeof TYPE_SELECTOR;
|
|
287
|
-
readonly
|
|
307
|
+
readonly type: typeof TYPE_SELECTOR;
|
|
308
|
+
readonly type_name: 'TypeSelector'; /** Local element name, e.g. "div" in both "div" and "ns|div" */
|
|
309
|
+
readonly name: string; /** Namespace prefix: null if no qualifier, '' for |div, 'ns' for ns|div, '*' for *|div */
|
|
310
|
+
readonly namespace: string | null;
|
|
288
311
|
clone(options?: CloneOptions): ToPlain<TypeSelector>;
|
|
289
312
|
};
|
|
290
313
|
type ClassSelector = CSSNode & {
|
|
291
|
-
readonly type: typeof CLASS_SELECTOR;
|
|
314
|
+
readonly type: typeof CLASS_SELECTOR;
|
|
315
|
+
readonly type_name: 'ClassSelector'; /** Class name without dot, e.g. "foo" from ".foo" */
|
|
292
316
|
readonly name: string;
|
|
293
317
|
clone(options?: CloneOptions): ToPlain<ClassSelector>;
|
|
294
318
|
};
|
|
295
319
|
type IdSelector = CSSNode & {
|
|
296
|
-
readonly type: typeof ID_SELECTOR;
|
|
320
|
+
readonly type: typeof ID_SELECTOR;
|
|
321
|
+
readonly type_name: 'IdSelector'; /** Id without hash, e.g. "bar" from "#bar" */
|
|
297
322
|
readonly name: string;
|
|
298
323
|
clone(options?: CloneOptions): ToPlain<IdSelector>;
|
|
299
324
|
};
|
|
300
325
|
type AttributeSelector = CSSNode & {
|
|
301
|
-
readonly type: typeof ATTRIBUTE_SELECTOR;
|
|
326
|
+
readonly type: typeof ATTRIBUTE_SELECTOR;
|
|
327
|
+
readonly type_name: 'AttributeSelector'; /** Attribute name, e.g. "href" from "[href]" */
|
|
302
328
|
readonly name: string; /** Operator string, e.g. "=", "~=", "|="; null if no operator ([attr] form) */
|
|
303
329
|
readonly attr_operator: string | null; /** Flag character, e.g. "i", "s"; null if no flag */
|
|
304
330
|
readonly attr_flags: string | null; /** Attribute value, e.g. "external" from [rel="external"] */
|
|
@@ -306,75 +332,97 @@ type AttributeSelector = CSSNode & {
|
|
|
306
332
|
clone(options?: CloneOptions): ToPlain<AttributeSelector>;
|
|
307
333
|
};
|
|
308
334
|
type PseudoClassSelector = CSSNode & WithChildren<Selector | NthOfSelector> & {
|
|
309
|
-
readonly type: typeof PSEUDO_CLASS_SELECTOR;
|
|
335
|
+
readonly type: typeof PSEUDO_CLASS_SELECTOR;
|
|
336
|
+
readonly type_name: 'PseudoClassSelector'; /** Pseudo-class name without colon, e.g. "hover" */
|
|
310
337
|
readonly name: string;
|
|
311
338
|
clone(options?: CloneOptions): ToPlain<PseudoClassSelector>;
|
|
312
339
|
};
|
|
313
340
|
type PseudoElementSelector = CSSNode & WithChildren<SelectorList> & {
|
|
314
|
-
readonly type: typeof PSEUDO_ELEMENT_SELECTOR;
|
|
341
|
+
readonly type: typeof PSEUDO_ELEMENT_SELECTOR;
|
|
342
|
+
readonly type_name: 'PseudoElementSelector'; /** Pseudo-element name without colons, e.g. "before" */
|
|
315
343
|
readonly name: string;
|
|
316
344
|
clone(options?: CloneOptions): ToPlain<PseudoElementSelector>;
|
|
317
345
|
};
|
|
318
346
|
type Combinator = CSSNode & {
|
|
319
|
-
readonly type: typeof COMBINATOR;
|
|
347
|
+
readonly type: typeof COMBINATOR;
|
|
348
|
+
readonly type_name: 'Combinator'; /** Combinator character(s), e.g. " ", ">", "~", "+", "||", "/deep/" */
|
|
320
349
|
readonly name: string;
|
|
321
350
|
clone(options?: CloneOptions): ToPlain<Combinator>;
|
|
322
351
|
};
|
|
323
352
|
type UniversalSelector = CSSNode & {
|
|
324
|
-
readonly type: typeof UNIVERSAL_SELECTOR;
|
|
325
|
-
readonly
|
|
353
|
+
readonly type: typeof UNIVERSAL_SELECTOR;
|
|
354
|
+
readonly type_name: 'UniversalSelector'; /** Always null — universal selector has no element name */
|
|
355
|
+
readonly name: null; /** Namespace prefix: null if no qualifier, '' for |*, 'ns' for ns|*, '*' for *|* */
|
|
356
|
+
readonly namespace: string | null;
|
|
326
357
|
clone(options?: CloneOptions): ToPlain<UniversalSelector>;
|
|
327
358
|
};
|
|
328
359
|
type NestingSelector = CSSNode & {
|
|
329
360
|
readonly type: typeof NESTING_SELECTOR;
|
|
361
|
+
readonly type_name: 'NestingSelector';
|
|
330
362
|
clone(options?: CloneOptions): ToPlain<NestingSelector>;
|
|
331
363
|
};
|
|
332
364
|
type NthSelector = CSSNode & {
|
|
333
|
-
readonly type: typeof NTH_SELECTOR;
|
|
365
|
+
readonly type: typeof NTH_SELECTOR;
|
|
366
|
+
readonly type_name: 'Nth'; /** The `An` part of the An+B formula, including keywords `odd`/`even`. Null when only a B value is present (e.g. `:nth-child(3)`). */
|
|
334
367
|
readonly nth_a: string | null; /** The `+B` part of the An+B formula. Null when only an A value is present (e.g. `:nth-child(2n)` or `:nth-child(odd)`). */
|
|
335
368
|
readonly nth_b: string | null;
|
|
336
369
|
clone(options?: CloneOptions): ToPlain<NthSelector>;
|
|
337
370
|
};
|
|
338
371
|
type NthOfSelector = CSSNode & {
|
|
339
|
-
readonly type: typeof NTH_OF_SELECTOR;
|
|
372
|
+
readonly type: typeof NTH_OF_SELECTOR;
|
|
373
|
+
readonly type_name: 'NthOf'; /** The An+B formula node */
|
|
340
374
|
readonly nth: NthSelector | null; /** The selector list from :nth-child(An+B of <selector>) */
|
|
341
375
|
readonly selector: SelectorList | null;
|
|
342
376
|
clone(options?: CloneOptions): ToPlain<NthOfSelector>;
|
|
343
377
|
};
|
|
344
378
|
type LangSelector = CSSNode & {
|
|
345
|
-
readonly type: typeof LANG_SELECTOR;
|
|
379
|
+
readonly type: typeof LANG_SELECTOR;
|
|
380
|
+
readonly type_name: 'Lang'; /** `"nl"`, `en-US` */
|
|
346
381
|
readonly name: string | null;
|
|
347
382
|
clone(options?: CloneOptions): ToPlain<LangSelector>;
|
|
348
383
|
};
|
|
349
384
|
type AtrulePrelude = CSSNode & WithChildren<Raw | MediaQuery | MediaType | ContainerQuery | SupportsQuery | LayerName | PreludeOperator | PreludeSelectorList | Parenthesis | Url> & {
|
|
350
385
|
readonly type: typeof AT_RULE_PRELUDE;
|
|
386
|
+
readonly type_name: 'AtrulePrelude';
|
|
351
387
|
clone(options?: CloneOptions): ToPlain<AtrulePrelude>;
|
|
352
388
|
};
|
|
353
389
|
type MediaQuery = CSSNode & WithChildren<MediaFeature | PreludeOperator | MediaType | FeatureRange> & {
|
|
354
390
|
readonly type: typeof MEDIA_QUERY;
|
|
391
|
+
readonly type_name: 'MediaQuery';
|
|
355
392
|
clone(options?: CloneOptions): ToPlain<MediaQuery>;
|
|
356
393
|
};
|
|
357
|
-
type MediaFeature = CSSNode &
|
|
358
|
-
readonly type: typeof MEDIA_FEATURE;
|
|
359
|
-
readonly
|
|
394
|
+
type MediaFeature = CSSNode & {
|
|
395
|
+
readonly type: typeof MEDIA_FEATURE;
|
|
396
|
+
readonly type_name: 'Feature'; /** Feature name, e.g. "min-width" */
|
|
397
|
+
readonly property: string; /** Feature value node, or null for boolean features like (hover) */
|
|
398
|
+
readonly value: CSSNode | null;
|
|
360
399
|
clone(options?: CloneOptions): ToPlain<MediaFeature>;
|
|
361
400
|
};
|
|
362
401
|
type MediaType = CSSNode & {
|
|
363
|
-
readonly type: typeof MEDIA_TYPE;
|
|
402
|
+
readonly type: typeof MEDIA_TYPE;
|
|
403
|
+
readonly type_name: 'MediaType'; /** Media type text, e.g. "screen", "print" */
|
|
364
404
|
readonly value: string;
|
|
365
405
|
clone(options?: CloneOptions): ToPlain<MediaType>;
|
|
366
406
|
};
|
|
367
407
|
type ContainerQuery = CSSNode & WithChildren<Identifier | MediaFeature | Function> & {
|
|
368
408
|
readonly type: typeof CONTAINER_QUERY;
|
|
409
|
+
readonly type_name: 'ContainerQuery';
|
|
369
410
|
clone(options?: CloneOptions): ToPlain<ContainerQuery>;
|
|
370
411
|
};
|
|
371
|
-
type SupportsQuery = CSSNode & {
|
|
372
|
-
readonly type: typeof SUPPORTS_QUERY;
|
|
412
|
+
type SupportsQuery = CSSNode & WithChildren<SupportsDeclaration> & {
|
|
413
|
+
readonly type: typeof SUPPORTS_QUERY;
|
|
414
|
+
readonly type_name: 'SupportsQuery'; /** The supports condition text, e.g. "display: flex" from "supports(display: flex)" */
|
|
373
415
|
readonly value: string;
|
|
374
416
|
clone(options?: CloneOptions): ToPlain<SupportsQuery>;
|
|
375
417
|
};
|
|
418
|
+
type SupportsDeclaration = CSSNode & WithChildren<Declaration> & {
|
|
419
|
+
readonly type: typeof SUPPORTS_DECLARATION;
|
|
420
|
+
readonly type_name: 'SupportsDeclaration';
|
|
421
|
+
clone(options?: CloneOptions): ToPlain<SupportsDeclaration>;
|
|
422
|
+
};
|
|
376
423
|
type LayerName = CSSNode & {
|
|
377
424
|
readonly type: typeof LAYER_NAME;
|
|
425
|
+
readonly type_name: 'Layer';
|
|
378
426
|
readonly name: string; /** Alias for name — the layer name string, e.g. "base" from "layer(base)" */
|
|
379
427
|
readonly value: string;
|
|
380
428
|
clone(options?: CloneOptions): ToPlain<LayerName>;
|
|
@@ -397,19 +445,22 @@ type LayerName = CSSNode & {
|
|
|
397
445
|
*/
|
|
398
446
|
type PreludeSelectorList = CSSNode & {
|
|
399
447
|
readonly type: typeof PRELUDE_SELECTORLIST;
|
|
448
|
+
readonly type_name: 'PreludeSelectorList';
|
|
400
449
|
readonly value: string;
|
|
401
450
|
clone(options?: CloneOptions): ToPlain<PreludeSelectorList>;
|
|
402
451
|
};
|
|
403
452
|
type PreludeOperator = CSSNode & {
|
|
404
453
|
readonly type: typeof PRELUDE_OPERATOR;
|
|
454
|
+
readonly type_name: 'Operator';
|
|
405
455
|
clone(options?: CloneOptions): ToPlain<PreludeOperator>;
|
|
406
456
|
};
|
|
407
457
|
type FeatureRange = CSSNode & WithChildren<Dimension | Operator> & {
|
|
408
|
-
readonly type: typeof FEATURE_RANGE;
|
|
458
|
+
readonly type: typeof FEATURE_RANGE;
|
|
459
|
+
readonly type_name: 'MediaFeatureRange'; /** The feature name in a range comparison, e.g. "width" from "(width >= 400px)" */
|
|
409
460
|
readonly name: string;
|
|
410
461
|
clone(options?: CloneOptions): ToPlain<FeatureRange>;
|
|
411
462
|
};
|
|
412
|
-
type AnyNode = StyleSheet | Rule | Atrule | Declaration | Selector | SelectorList | Block | Comment | Raw | Identifier | Number | Dimension | String | Hash | Function | Operator | Parenthesis | Url | UnicodeRange | Value | TypeSelector | ClassSelector | IdSelector | AttributeSelector | PseudoClassSelector | PseudoElementSelector | Combinator | UniversalSelector | NestingSelector | NthSelector | NthOfSelector | LangSelector | AtrulePrelude | MediaQuery | MediaFeature | MediaType | ContainerQuery | SupportsQuery | LayerName | PreludeOperator | FeatureRange | PreludeSelectorList;
|
|
463
|
+
type AnyNode = StyleSheet | Rule | Atrule | Declaration | Selector | SelectorList | Block | Comment | Raw | Identifier | Number | Dimension | String | Hash | Function | Operator | Parenthesis | Url | UnicodeRange | Value | TypeSelector | ClassSelector | IdSelector | AttributeSelector | PseudoClassSelector | PseudoElementSelector | Combinator | UniversalSelector | NestingSelector | NthSelector | NthOfSelector | LangSelector | AtrulePrelude | MediaQuery | MediaFeature | MediaType | ContainerQuery | SupportsQuery | SupportsDeclaration | LayerName | PreludeOperator | FeatureRange | PreludeSelectorList;
|
|
413
464
|
declare function is_stylesheet(node: CSSNode): node is StyleSheet;
|
|
414
465
|
declare function is_rule(node: CSSNode): node is Rule;
|
|
415
466
|
declare function is_atrule(node: CSSNode): node is Atrule;
|
|
@@ -448,9 +499,10 @@ declare function is_media_feature(node: CSSNode): node is MediaFeature;
|
|
|
448
499
|
declare function is_media_type(node: CSSNode): node is MediaType;
|
|
449
500
|
declare function is_container_query(node: CSSNode): node is ContainerQuery;
|
|
450
501
|
declare function is_supports_query(node: CSSNode): node is SupportsQuery;
|
|
502
|
+
declare function is_supports_declaration(node: CSSNode): node is SupportsDeclaration;
|
|
451
503
|
declare function is_layer_name(node: CSSNode): node is LayerName;
|
|
452
504
|
declare function is_prelude_operator(node: CSSNode): node is PreludeOperator;
|
|
453
505
|
declare function is_feature_range(node: CSSNode): node is FeatureRange;
|
|
454
506
|
declare function is_prelude_selectorlist(node: CSSNode): node is PreludeSelectorList;
|
|
455
507
|
//#endregion
|
|
456
|
-
export {
|
|
508
|
+
export { is_class_selector as $, PreludeSelectorList as A, is_stylesheet as At, SupportsDeclaration as B, TYPE_NAMES as Bt, NestingSelector as C, is_pseudo_class_selector as Ct, Operator as D, is_selector as Dt, Number as E, is_rule as Et, Selector as F, is_universal_selector as Ft, UniversalSelector as G, ToPlain as H, SelectorList as I, is_url as It, WithChildren as J, Url as K, SelectorNode as L, is_value as Lt, PseudoElementSelector as M, is_supports_query as Mt, Raw as N, is_type_selector as Nt, Parenthesis as O, is_selector_list as Ot, Rule as P, is_unicode_range as Pt, is_block as Q, String as R, CloneOptions as Rt, MediaType as S, is_prelude_selectorlist as St, NthSelector as T, is_raw as Tt, TypeSelector as U, SupportsQuery as V, UnicodeRange as W, is_atrule_prelude as X, is_atrule as Y, is_attribute_selector as Z, Identifier as _, is_nth_selector as _t, Block as a, is_feature_range as at, MediaFeature as b, is_parenthesis as bt, Combinator as c, is_id_selector as ct, Declaration as d, is_layer_name as dt, is_combinator as et, Dimension as f, is_media_feature as ft, IdSelector as g, is_nth_of_selector as gt, Hash as h, is_nesting_selector as ht, AttributeSelector as i, is_dimension as it, PseudoClassSelector as j, is_supports_declaration as jt, PreludeOperator as k, is_string as kt, Comment as l, is_identifier as lt, Function as m, is_media_type as mt, Atrule as n, is_container_query as nt, CSSNode as o, is_function as ot, FeatureRange as p, is_media_query as pt, Value as q, AtrulePrelude as r, is_declaration as rt, ClassSelector as s, is_hash as st, AnyNode as t, is_comment as tt, ContainerQuery as u, is_lang_selector as ut, LangSelector as v, is_number as vt, NthOfSelector as w, is_pseudo_element_selector as wt, MediaQuery as x, is_prelude_operator as xt, LayerName as y, is_operator as yt, StyleSheet as z, PlainCSSNode as zt };
|
package/dist/parse-anplusb.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as CSSDataArena } from "./arena-
|
|
2
|
-
import { T as NthSelector } from "./node-types-
|
|
1
|
+
import { l as CSSDataArena } from "./arena-CSK5NfHq.js";
|
|
2
|
+
import { T as NthSelector } from "./node-types-mntWKkN-.js";
|
|
3
3
|
|
|
4
4
|
//#region src/parse-anplusb.d.ts
|
|
5
5
|
/** @internal */
|