@projectwallace/css-parser 0.18.9 → 0.18.11

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.
Files changed (40) hide show
  1. package/README.md +186 -18
  2. package/dist/{arena-e9O_g2AN.js → arena-Bsf96CQK.js} +27 -19
  3. package/dist/{arena-BGvFdbj5.d.ts → arena-DvT75bvK.d.ts} +2 -0
  4. package/dist/constants.d.ts +1 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/{css-node-DfJEsKN0.js → css-node-yoUdFtNg.js} +101 -100
  7. package/dist/index.d.ts +6 -20
  8. package/dist/index.js +9 -146
  9. package/dist/{node-types-YnOKcNfU.d.ts → node-types-DG8OKqPu.d.ts} +8 -54
  10. package/dist/node-types.d.ts +2 -0
  11. package/dist/node-types.js +142 -0
  12. package/dist/parse-anplusb.d.ts +2 -2
  13. package/dist/parse-anplusb.js +5 -4
  14. package/dist/parse-atrule-prelude.d.ts +2 -2
  15. package/dist/parse-atrule-prelude.js +62 -61
  16. package/dist/parse-declaration.d.ts +3 -3
  17. package/dist/parse-declaration.js +20 -19
  18. package/dist/parse-dimension.js +47 -1
  19. package/dist/{parse-selector-rTXB4IN2.js → parse-selector-CqIpnBrQ.js} +74 -81
  20. package/dist/parse-selector.d.ts +2 -2
  21. package/dist/parse-selector.js +1 -1
  22. package/dist/parse-value.d.ts +2 -2
  23. package/dist/parse-value.js +8 -8
  24. package/dist/parse.d.ts +3 -3
  25. package/dist/parse.js +45 -44
  26. package/dist/string-helpers-BMWJduts.d.ts +18 -0
  27. package/dist/string-helpers.d.ts +2 -0
  28. package/dist/string-helpers.js +1 -0
  29. package/dist/{parse-dimension-CIaPOmBc.js → string-utils-DiRRd28d.js} +5 -49
  30. package/dist/token-types-Bqsf5FX-.d.ts +38 -0
  31. package/dist/token-types.d.ts +2 -0
  32. package/dist/token-types.js +30 -0
  33. package/dist/{tokenize-0ADWAELW.js → tokenize-Ccg58Z_k.js} +67 -96
  34. package/dist/tokenize.d.ts +97 -2
  35. package/dist/tokenize.js +1 -1
  36. package/dist/{value-node-parser-DizbcN1a.js → value-node-parser-D0qnA_bD.js} +129 -134
  37. package/dist/walk.d.ts +3 -2
  38. package/dist/walk.js +2 -2
  39. package/package.json +17 -4
  40. package/dist/tokenize-CaWtrHw_.d.ts +0 -134
@@ -1,54 +1,7 @@
1
- import "./arena-e9O_g2AN.js";
2
- import { c as str_equals, d as str_starts_with, o as is_vendor_prefixed, s as is_whitespace, t as dimension_number_end } from "./parse-dimension-CIaPOmBc.js";
1
+ import "./arena-Bsf96CQK.js";
2
+ import { a as is_vendor_prefixed, o as is_whitespace, s as str_equals, u as str_starts_with } from "./string-utils-DiRRd28d.js";
3
+ import { dimension_number_end } from "./parse-dimension.js";
3
4
  //#region src/css-node.ts
4
- const TYPE_NAMES = {
5
- [1]: "StyleSheet",
6
- [2]: "Rule",
7
- [3]: "Atrule",
8
- [4]: "Declaration",
9
- [5]: "Selector",
10
- [6]: "Comment",
11
- [7]: "Block",
12
- [8]: "Raw",
13
- [10]: "Identifier",
14
- [11]: "Number",
15
- [12]: "Dimension",
16
- [13]: "String",
17
- [14]: "Hash",
18
- [15]: "Function",
19
- [16]: "Operator",
20
- [17]: "Parentheses",
21
- [18]: "Url",
22
- [19]: "UnicodeRange",
23
- [50]: "Value",
24
- [20]: "SelectorList",
25
- [21]: "TypeSelector",
26
- [22]: "ClassSelector",
27
- [23]: "IdSelector",
28
- [24]: "AttributeSelector",
29
- [25]: "PseudoClassSelector",
30
- [26]: "PseudoElementSelector",
31
- [27]: "Combinator",
32
- [28]: "UniversalSelector",
33
- [29]: "NestingSelector",
34
- [30]: "Nth",
35
- [31]: "NthOf",
36
- [56]: "Lang",
37
- [32]: "MediaQuery",
38
- [33]: "Feature",
39
- [34]: "MediaType",
40
- [35]: "ContainerQuery",
41
- [36]: "SupportsQuery",
42
- [57]: "SupportsDeclaration",
43
- [37]: "Layer",
44
- [38]: "Operator",
45
- [39]: "MediaFeatureRange",
46
- [40]: "AtrulePrelude",
47
- [41]: "PreludeSelectorList",
48
- [58]: "Ratio",
49
- [59]: "IfBranch",
50
- [60]: "IfCondition"
51
- };
52
5
  const nodes_with_name = /* @__PURE__ */ new Set([
53
6
  3,
54
7
  10,
@@ -124,8 +77,8 @@ var CSSNode = class CSSNode {
124
77
  return this.index;
125
78
  }
126
79
  get_content() {
127
- let start = this.arena.get_content_start(this.index);
128
- let length = this.arena.get_content_length(this.index);
80
+ const start = this.arena.get_content_start(this.index);
81
+ const length = this.arena.get_content_length(this.index);
129
82
  if (length === 0) return "";
130
83
  return this.source.substring(start, start + length);
131
84
  }
@@ -135,35 +88,83 @@ var CSSNode = class CSSNode {
135
88
  }
136
89
  /** Get node type as human-readable string */
137
90
  get type_name() {
138
- return TYPE_NAMES[this.type] || "unknown";
91
+ switch (this.type) {
92
+ case 1: return "StyleSheet";
93
+ case 2: return "Rule";
94
+ case 3: return "Atrule";
95
+ case 4: return "Declaration";
96
+ case 5: return "Selector";
97
+ case 6: return "Comment";
98
+ case 7: return "Block";
99
+ case 8: return "Raw";
100
+ case 10: return "Identifier";
101
+ case 11: return "Number";
102
+ case 12: return "Dimension";
103
+ case 13: return "String";
104
+ case 14: return "Hash";
105
+ case 15: return "Function";
106
+ case 16: return "Operator";
107
+ case 17: return "Parentheses";
108
+ case 18: return "Url";
109
+ case 19: return "UnicodeRange";
110
+ case 50: return "Value";
111
+ case 20: return "SelectorList";
112
+ case 21: return "TypeSelector";
113
+ case 22: return "ClassSelector";
114
+ case 23: return "IdSelector";
115
+ case 24: return "AttributeSelector";
116
+ case 25: return "PseudoClassSelector";
117
+ case 26: return "PseudoElementSelector";
118
+ case 27: return "Combinator";
119
+ case 28: return "UniversalSelector";
120
+ case 29: return "NestingSelector";
121
+ case 30: return "Nth";
122
+ case 31: return "NthOf";
123
+ case 56: return "Lang";
124
+ case 32: return "MediaQuery";
125
+ case 33: return "Feature";
126
+ case 34: return "MediaType";
127
+ case 35: return "ContainerQuery";
128
+ case 36: return "SupportsQuery";
129
+ case 57: return "SupportsDeclaration";
130
+ case 37: return "Layer";
131
+ case 38: return "Operator";
132
+ case 39: return "MediaFeatureRange";
133
+ case 40: return "AtrulePrelude";
134
+ case 41: return "PreludeSelectorList";
135
+ case 58: return "Ratio";
136
+ case 59: return "IfBranch";
137
+ case 60: return "IfCondition";
138
+ default: return "unknown";
139
+ }
139
140
  }
140
141
  /** Get the full text of this node from source */
141
142
  get text() {
142
- let start = this.arena.get_start_offset(this.index);
143
- let length = this.arena.get_length(this.index);
143
+ const start = this.arena.get_start_offset(this.index);
144
+ const length = this.arena.get_length(this.index);
144
145
  return this.source.substring(start, start + length);
145
146
  }
146
147
  /** Get the "content" text (at-rule name for at-rules, layer name for import layers) */
147
148
  get name() {
148
149
  if (!nodes_with_name.has(this.type)) return;
149
- let { type } = this;
150
+ const { type } = this;
150
151
  if (type === 28) return null;
151
- let content = this.get_content();
152
+ const content = this.get_content();
152
153
  if (type === 56 && content === "") return null;
153
154
  return content;
154
155
  }
155
156
  /** Namespace prefix for type/universal selectors: null (none), '' (`|div`), 'ns' (`ns|div`), or '*' (`*|div`). */
156
157
  get namespace() {
157
- let { type } = this;
158
+ const { type } = this;
158
159
  if (type !== 21 && type !== 28) return void 0;
159
160
  if (!this.arena.has_flag(this.index, 16)) return null;
160
- let start = this.arena.get_value_start(this.index);
161
- let length = this.arena.get_value_length(this.index);
161
+ const start = this.arena.get_value_start(this.index);
162
+ const length = this.arena.get_value_length(this.index);
162
163
  return this.source.substring(start, start + length);
163
164
  }
164
165
  /** Alias for `name` on declarations ("color" in "color: blue"), more semantic than `name` there. */
165
166
  get property() {
166
- let { type } = this;
167
+ const { type } = this;
167
168
  if (type !== 4 && type !== 33 && type !== 57) return;
168
169
  return this.get_content();
169
170
  }
@@ -172,7 +173,7 @@ var CSSNode = class CSSNode {
172
173
  * String: content without quotes. URL: quoted string keeps quotes, unquoted URL doesn't.
173
174
  */
174
175
  get value() {
175
- let { type, text, first_child } = this;
176
+ const { type, text, first_child } = this;
176
177
  if (type === 3) return void 0;
177
178
  if (type === 34) return text;
178
179
  if (type === 4 && first_child) return first_child;
@@ -180,29 +181,29 @@ var CSSNode = class CSSNode {
180
181
  if (type === 57) return first_child?.first_child ?? null;
181
182
  if (type === 59) return first_child?.next_sibling ?? null;
182
183
  if (type === 12) {
183
- let num_str = text.substring(0, dimension_number_end(text));
184
+ const num_str = text.substring(0, dimension_number_end(text));
184
185
  return num_str ? Number.parseFloat(num_str) : 0;
185
186
  }
186
187
  if (type === 11) return Number(text);
187
188
  if (type === 18) {
188
189
  if (first_child?.type === 13) return first_child.text;
189
190
  if (str_starts_with(text, "url(")) {
190
- let open_paren = text.indexOf("(");
191
- let close_paren = text.lastIndexOf(")");
191
+ const open_paren = text.indexOf("(");
192
+ const close_paren = text.lastIndexOf(")");
192
193
  if (open_paren !== -1 && close_paren !== -1 && close_paren > open_paren) return text.substring(open_paren + 1, close_paren).trim();
193
194
  } else if (text.startsWith("\"") || text.startsWith("'")) return text;
194
195
  }
195
196
  if (type === 16 || type === 37) return this.get_content();
196
197
  if (type !== 4 && type !== 15 && type !== 24 && type !== 36 && type !== 41) return;
197
- let start = this.arena.get_value_start(this.index);
198
- let length = this.arena.get_value_length(this.index);
198
+ const start = this.arena.get_value_start(this.index);
199
+ const length = this.arena.get_value_length(this.index);
199
200
  if (length === 0) return null;
200
201
  return this.source.substring(start, start + length);
201
202
  }
202
203
  /** At-rules: AT_RULE_PRELUDE wrapper (media queries, layer names, …). Style rules: SELECTOR_LIST/SELECTOR. Null if none. */
203
204
  get prelude() {
204
205
  if (this.type === 3) {
205
- let first = this.first_child;
206
+ const first = this.first_child;
206
207
  if (first?.type === 40 || first?.type === 8) return first;
207
208
  return null;
208
209
  }
@@ -211,13 +212,13 @@ var CSSNode = class CSSNode {
211
212
  /** Attribute selector operator (=, ~=, |=, ^=, $=, *=), or null for the bare `[attr]` form. */
212
213
  get attr_operator() {
213
214
  if (this.type !== 24) return void 0;
214
- let content_end = this.arena.get_content_start(this.index) + this.arena.get_content_length(this.index);
215
- let node_end = this.arena.get_start_offset(this.index) + this.arena.get_length(this.index);
215
+ const content_end = this.arena.get_content_start(this.index) + this.arena.get_content_length(this.index);
216
+ const node_end = this.arena.get_start_offset(this.index) + this.arena.get_length(this.index);
216
217
  let pos = content_end;
217
218
  while (pos < node_end && is_whitespace(this.source.charCodeAt(pos))) pos++;
218
219
  if (pos >= node_end) return null;
219
- let ch1 = this.source.charCodeAt(pos);
220
- let ch2 = pos + 1 < node_end ? this.source.charCodeAt(pos + 1) : 0;
220
+ const ch1 = this.source.charCodeAt(pos);
221
+ const ch2 = pos + 1 < node_end ? this.source.charCodeAt(pos + 1) : 0;
221
222
  if (ch1 === 61) return this.source.at(pos);
222
223
  if (ch1 === 126 && ch2 === 61) return this.source.substring(pos, pos + 2);
223
224
  if (ch1 === 124 && ch2 === 61) return this.source.substring(pos, pos + 2);
@@ -229,21 +230,21 @@ var CSSNode = class CSSNode {
229
230
  /** Attribute selector flag: "i" (case-insensitive), "s" (case-sensitive), or null if absent. */
230
231
  get attr_flags() {
231
232
  if (this.type !== 24) return void 0;
232
- let value_len = this.arena.get_value_length(this.index);
233
+ const value_len = this.arena.get_value_length(this.index);
233
234
  if (value_len === 0) return null;
234
- let value_end = this.arena.get_value_start(this.index) + value_len;
235
- let node_end = this.arena.get_start_offset(this.index) + this.arena.get_length(this.index);
235
+ const value_end = this.arena.get_value_start(this.index) + value_len;
236
+ const node_end = this.arena.get_start_offset(this.index) + this.arena.get_length(this.index);
236
237
  let pos = value_end;
237
238
  while (pos < node_end && is_whitespace(this.source.charCodeAt(pos))) pos++;
238
239
  if (pos >= node_end) return null;
239
- let flag_ch = this.source.charCodeAt(pos);
240
+ const flag_ch = this.source.charCodeAt(pos);
240
241
  if (flag_ch === 105 || flag_ch === 73 || flag_ch === 115 || flag_ch === 83) return this.source.at(pos);
241
242
  return null;
242
243
  }
243
244
  /** Get the unit for dimension nodes (e.g., "px" from "100px", "%" from "50%") */
244
245
  get unit() {
245
246
  if (this.type !== 12) return void 0;
246
- let text = this.text;
247
+ const text = this.text;
247
248
  return text.substring(dimension_number_end(text));
248
249
  }
249
250
  /** Numerator for ratio values, e.g. the Number "16" in `aspect-ratio: 16/9` */
@@ -295,7 +296,7 @@ var CSSNode = class CSSNode {
295
296
  }
296
297
  /** Check if this node has a prelude (at-rules and style rules) */
297
298
  get has_prelude() {
298
- let { type } = this;
299
+ const { type } = this;
299
300
  if (type === 3) return this.first_child !== null && this.first_child.type !== 7;
300
301
  if (type === 2) return this.first_child !== null;
301
302
  return false;
@@ -306,17 +307,17 @@ var CSSNode = class CSSNode {
306
307
  }
307
308
  /** Check if this style rule has declarations */
308
309
  get has_declarations() {
309
- let { type } = this;
310
+ const { type } = this;
310
311
  if (type !== 3 && type !== 2) return void 0;
311
312
  return this.arena.has_flag(this.index, 32);
312
313
  }
313
314
  /** Get the block node (for style rules and at-rules with blocks) */
314
315
  get block() {
315
- let { type } = this;
316
+ const { type } = this;
316
317
  if (type === 2) {
317
- let first = this.first_child;
318
+ const first = this.first_child;
318
319
  if (!first) return null;
319
- let block_node = first.next_sibling;
320
+ const block_node = first.next_sibling;
320
321
  if (block_node?.type === 7) return block_node;
321
322
  return null;
322
323
  }
@@ -365,13 +366,13 @@ var CSSNode = class CSSNode {
365
366
  }
366
367
  /** Get first child node */
367
368
  get first_child() {
368
- let child_index = this.arena.get_first_child(this.index);
369
+ const child_index = this.arena.get_first_child(this.index);
369
370
  if (child_index === 0) return null;
370
371
  return new CSSNode(this.arena, this.source, child_index);
371
372
  }
372
373
  /** Get next sibling node */
373
374
  get next_sibling() {
374
- let sibling_index = this.arena.get_next_sibling(this.index);
375
+ const sibling_index = this.arena.get_next_sibling(this.index);
375
376
  if (sibling_index === 0) return null;
376
377
  return new CSSNode(this.arena, this.source, sibling_index);
377
378
  }
@@ -381,7 +382,7 @@ var CSSNode = class CSSNode {
381
382
  }
382
383
  /** Whether this node has children. For pseudo-class/element functions, tracks FLAG_HAS_PARENS so formatters can tell `:lang()` from `:hover`. */
383
384
  get has_children() {
384
- let { type } = this;
385
+ const { type } = this;
385
386
  if (type === 25 || type === 26) {
386
387
  if (this.arena.has_flag(this.index, 64)) return true;
387
388
  }
@@ -399,7 +400,7 @@ var CSSNode = class CSSNode {
399
400
  }
400
401
  /** Get all children as an array */
401
402
  get children() {
402
- let result = [];
403
+ const result = [];
403
404
  let child = this.first_child;
404
405
  while (child) {
405
406
  result.push(child);
@@ -417,24 +418,24 @@ var CSSNode = class CSSNode {
417
418
  }
418
419
  /** Get the 'a' coefficient from An+B expression (e.g., "2n" from "2n+1", "odd" from "odd") */
419
420
  get nth_a() {
420
- let { type, arena, index } = this;
421
+ const { type, arena, index } = this;
421
422
  if (type !== 30 && type !== 31) return void 0;
422
- let len = arena.get_content_length(index);
423
+ const len = arena.get_content_length(index);
423
424
  if (len === 0) return null;
424
- let start = arena.get_content_start(index);
425
+ const start = arena.get_content_start(index);
425
426
  return this.source.substring(start, start + len);
426
427
  }
427
428
  /** Get the 'b' coefficient from An+B expression (e.g., "+1" from "2n+1") */
428
429
  get nth_b() {
429
- let { type, arena, index, source } = this;
430
+ const { type, arena, index, source } = this;
430
431
  if (type !== 30 && type !== 31) return void 0;
431
- let len = arena.get_value_length(index);
432
+ const len = arena.get_value_length(index);
432
433
  if (len === 0) return null;
433
- let start = arena.get_value_start(index);
434
+ const start = arena.get_value_start(index);
434
435
  let value = source.substring(start, start + len);
435
436
  let check_pos = start - 1;
436
437
  while (check_pos >= 0) {
437
- let ch = source.charCodeAt(check_pos);
438
+ const ch = source.charCodeAt(check_pos);
438
439
  if (is_whitespace(ch)) {
439
440
  check_pos--;
440
441
  continue;
@@ -461,14 +462,14 @@ var CSSNode = class CSSNode {
461
462
  */
462
463
  clone(options = {}) {
463
464
  const { deep = true, locations = false } = options;
464
- let { type } = this;
465
- let plain = {
465
+ const { type } = this;
466
+ const plain = {
466
467
  type,
467
468
  type_name: this.type_name,
468
469
  text: this.text
469
470
  };
470
- for (let key of enumerable_properties) {
471
- let val = this[key];
471
+ for (const key of enumerable_properties) {
472
+ const val = this[key];
472
473
  if (val instanceof CSSNode) plain[key] = val.clone({
473
474
  deep,
474
475
  locations
@@ -486,8 +487,8 @@ var CSSNode = class CSSNode {
486
487
  plain.children = [];
487
488
  plain.child_count = this.child_count;
488
489
  plain.has_children = this.has_children;
489
- let children = this.children;
490
- if (children) for (let child of children) plain.children.push(child.clone({
490
+ const children = this.children;
491
+ if (children) for (const child of children) plain.children.push(child.clone({
491
492
  deep: true,
492
493
  locations
493
494
  }));
@@ -496,4 +497,4 @@ var CSSNode = class CSSNode {
496
497
  }
497
498
  };
498
499
  //#endregion
499
- export { TYPE_NAMES as n, CSSNode as t };
500
+ export { CSSNode as t };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { A as PARENTHESIS, B as STYLESHEET, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RATIO, G as UNICODE_RANGE, H as SUPPORTS_DECLARATION, I as RAW, J as VALUE, K as UNIVERSAL_SELECTOR, L as SELECTOR, N as PSEUDO_CLASS_SELECTOR, O as NUMBER, P as PSEUDO_ELEMENT_SELECTOR, R as SELECTOR_LIST, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as SUPPORTS_QUERY, V as STYLE_RULE, W as TYPE_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as URL, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STRING } from "./arena-BGvFdbj5.js";
1
+ import { A as PARENTHESIS, B as STYLESHEET, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RATIO, G as UNICODE_RANGE, H as SUPPORTS_DECLARATION, I as RAW, J as VALUE, K as UNIVERSAL_SELECTOR, L as SELECTOR, N as PSEUDO_CLASS_SELECTOR, O as NUMBER, P as PSEUDO_ELEMENT_SELECTOR, R as SELECTOR_LIST, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as SUPPORTS_QUERY, V as STYLE_RULE, W as TYPE_SELECTOR, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as URL, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STRING } from "./arena-DvT75bvK.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-CaWtrHw_.js";
4
- import { $ as is_atrule_prelude, A as Parenthesis, At as is_ratio, B as SelectorNode, Bt as is_unicode_range, C as MediaQuery, Ct as is_number, D as NthSelector, Dt as is_prelude_selectorlist, E as NthOfSelector, Et as is_prelude_operator, F as Ratio, Ft as is_string, G as ToPlain, Gt as PlainCSSNode, H as StyleSheet, Ht as is_url, I as Raw, It as is_stylesheet, J as UniversalSelector, K as TypeSelector, Kt as TYPE_NAMES, L as Rule, Lt as is_supports_declaration, M as PreludeSelectorList, Mt as is_rule, N as PseudoClassSelector, Nt as is_selector, O as Number, Ot as is_pseudo_class_selector, P as PseudoElementSelector, Pt as is_selector_list, Q as is_atrule, R as Selector, Rt as is_supports_query, S as MediaFeature, St as is_nth_selector, T as NestingSelector, Tt as is_parenthesis, U as SupportsDeclaration, Ut as is_value, V as String, Vt as is_universal_selector, W as SupportsQuery, Wt as CloneOptions, X as Value, Y as Url, Z as WithChildren, _ as Identifier, _t as is_media_feature, a as Block, at as is_container_query, b as LangSelector, bt as is_nesting_selector, c as Combinator, ct as is_feature_range, d as Declaration, dt as is_id_selector, et as is_attribute_selector, f as Dimension, ft as is_identifier, g as IdSelector, gt as is_layer_name, h as Hash, ht as is_lang_selector, i as AttributeSelector, it as is_comment, j as PreludeOperator, jt as is_raw, k as Operator, kt as is_pseudo_element_selector, l as Comment, lt as is_function, m as Function, mt as is_if_condition, n as Atrule, nt as is_class_selector, o as CSSNode, ot as is_declaration, p as FeatureRange, pt as is_if_branch, q as UnicodeRange, r as AtrulePrelude, rt as is_combinator, s as ClassSelector, st as is_dimension, t as AnyNode, tt as is_block, u as ContainerQuery, ut as is_hash, v as IfBranch, vt as is_media_query, w as MediaType, wt as is_operator, x as LayerName, xt as is_nth_of_selector, y as IfCondition, yt as is_media_type, z as SelectorList, zt as is_type_selector } from "./node-types-YnOKcNfU.js";
3
+ import { C as TOKEN_SEMICOLON, D as TOKEN_WHITESPACE, E as TOKEN_URL, O as Token, S as TOKEN_RIGHT_PAREN, T as TOKEN_UNICODE_RANGE, _ as TOKEN_LEFT_PAREN, a as TOKEN_CDO, b as TOKEN_RIGHT_BRACE, c as TOKEN_COMMENT, d as TOKEN_EOF, f as TOKEN_FUNCTION, g as TOKEN_LEFT_BRACKET, h as TOKEN_LEFT_BRACE, i as TOKEN_CDC, k as TokenType, l as TOKEN_DELIM, m as TOKEN_IDENT, n as TOKEN_BAD_STRING, o as TOKEN_COLON, p as TOKEN_HASH, r as TOKEN_BAD_URL, s as TOKEN_COMMA, t as TOKEN_AT_KEYWORD, u as TOKEN_DIMENSION, v as TOKEN_NUMBER, w as TOKEN_STRING, x as TOKEN_RIGHT_BRACKET, y as TOKEN_PERCENTAGE } from "./token-types-Bqsf5FX-.js";
4
+ import { CommentInfo, LexerPosition, tokenize } from "./tokenize.js";
5
+ import { $ as is_atrule, A as Operator, At as is_pseudo_element_selector, B as SelectorList, Bt as is_type_selector, C as MediaFeature, Ct as is_nth_selector, D as NthOfSelector, Dt as is_prelude_operator, E as NestingSelector, Et as is_parenthesis, F as PseudoElementSelector, Ft as is_selector_list, G as SupportsQuery, Gt as CloneOptions, H as String, Ht as is_universal_selector, I as Ratio, It as is_string, J as UnicodeRange, K as ToPlain, Kt as PlainCSSNode, L as Raw, Lt as is_stylesheet, M as PreludeOperator, Mt as is_raw, N as PreludeSelectorList, Nt as is_rule, O as NthSelector, Ot as is_prelude_selectorlist, P as PseudoClassSelector, Pt as is_selector, Q as WithChildren, R as Rule, Rt as is_supports_declaration, S as LayerName, St as is_nth_of_selector, T as MediaType, Tt as is_operator, U as StyleSheet, Ut as is_url, V as SelectorNode, Vt as is_unicode_range, W as SupportsDeclaration, Wt as is_value, X as Url, Y as UniversalSelector, Z as Value, _ as IdSelector, _t as is_layer_name, a as Block, at as is_comment, b as IfCondition, bt as is_media_type, c as ClassSelector, ct as is_dimension, d as ContainerQuery, dt as is_hash, et as is_atrule_prelude, f as Declaration, ft as is_id_selector, g as Hash, gt as is_lang_selector, h as Function, ht as is_if_condition, i as AttributeSelector, it as is_combinator, j as Parenthesis, jt as is_ratio, k as Number, kt as is_pseudo_class_selector, l as Combinator, lt as is_feature_range, m as FeatureRange, mt as is_if_branch, n as Atrule, nt as is_block, ot as is_container_query, p as Dimension, pt as is_identifier, q as TypeSelector, r as AtrulePrelude, rt as is_class_selector, s as CSSNode, st as is_declaration, t as AnyNode, tt as is_attribute_selector, u as Comment, ut as is_function, v as Identifier, vt as is_media_feature, w as MediaQuery, wt as is_number, x as LangSelector, xt as is_nesting_selector, y as IfBranch, yt as is_media_query, z as Selector, zt as is_supports_query } from "./node-types-DG8OKqPu.js";
5
6
  import { ParserOptions, parse } from "./parse.js";
6
7
  import { parse_selector, parse_selector_list } from "./parse-selector.js";
7
8
  import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
@@ -9,20 +10,5 @@ import { parse_declaration } from "./parse-declaration.js";
9
10
  import { parse_value } from "./parse-value.js";
10
11
  import { parse_dimension } from "./parse-dimension.js";
11
12
  import { BREAK, SKIP, traverse, walk } from "./walk.js";
12
- //#region src/string-utils.d.ts
13
- /**
14
- * @param a Base string, MUST be lowercase!
15
- * @param b Compare string
16
- */
17
- export declare function str_equals(a: string, b: string): boolean;
18
- /** Case-insensitive ASCII prefix check without allocations. `prefix` MUST be lowercase. */
19
- export declare function str_starts_with(str: string, prefix: string): boolean;
20
- /** Case-insensitive substring search without allocations, or -1 if not found. `searchChar` MUST be lowercase. */
21
- export declare function str_index_of(str: string, searchChar: string): number;
22
- /** True if the string/range is vendor-prefixed (-webkit-, -moz-, -ms-, -o-). `--custom-property` is not. */
23
- export declare function is_vendor_prefixed(text: string): boolean;
24
- export declare function is_vendor_prefixed(source: string, start: number, end: number): boolean;
25
- /** True if the string is a CSS custom property (starts with `--`). */
26
- export declare function is_custom(str: string): boolean;
27
- //#endregion
28
- 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, IF_BRANCH, IF_CONDITION, type IdSelector, type Identifier, type IfBranch, type IfCondition, 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, RATIO, RAW, type Ratio, 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_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_if_condition, 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_ratio, 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, parse, parse_atrule_prelude, parse_declaration, parse_dimension, parse_selector, parse_selector_list, parse_value, tokenize, traverse, walk };
13
+ import { a as str_starts_with, i as str_index_of, n as is_vendor_prefixed, o as strip_vendor_prefix, r as str_equals, t as is_custom } from "./string-helpers-BMWJduts.js";
14
+ 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, IF_BRANCH, IF_CONDITION, type IdSelector, type Identifier, type IfBranch, type IfCondition, 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, RATIO, RAW, type Ratio, 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_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_if_branch, is_if_condition, 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_ratio, 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, strip_vendor_prefix, tokenize, traverse, walk };
package/dist/index.js CHANGED
@@ -1,152 +1,15 @@
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-0ADWAELW.js";
2
- import { A as PARENTHESIS, B as STYLE_RULE, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as NUMBER, P as RATIO, R as STRING, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STYLESHEET } from "./arena-e9O_g2AN.js";
3
- import { a as is_custom, c as str_equals, d as str_starts_with, n as parse_dimension, o as is_vendor_prefixed, u as str_index_of } from "./parse-dimension-CIaPOmBc.js";
4
- import { n as TYPE_NAMES } from "./css-node-DfJEsKN0.js";
5
- import { n as parse_selector, r as parse_selector_list } from "./parse-selector-rTXB4IN2.js";
1
+ import { n as tokenize } from "./tokenize-Ccg58Z_k.js";
2
+ import { 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 } from "./token-types.js";
3
+ import { A as PARENTHESIS, B as STYLE_RULE, C as MEDIA_QUERY, D as NTH_SELECTOR, E as NTH_OF_SELECTOR, F as RAW, G as UNIVERSAL_SELECTOR, H as SUPPORTS_QUERY, I as SELECTOR, K as URL, L as SELECTOR_LIST, M as PSEUDO_CLASS_SELECTOR, N as PSEUDO_ELEMENT_SELECTOR, O as NUMBER, P as RATIO, R as STRING, S as MEDIA_FEATURE, T as NESTING_SELECTOR, U as TYPE_SELECTOR, V as SUPPORTS_DECLARATION, W as UNICODE_RANGE, _ as ID_SELECTOR, a as CLASS_SELECTOR, b as LANG_SELECTOR, c as CONTAINER_QUERY, d as DIMENSION, f as FEATURE_RANGE, g as IDENTIFIER, h as HASH, i as BLOCK, j as PRELUDE_OPERATOR, k as OPERATOR, m as FUNCTION, n as AT_RULE, o as COMBINATOR, p as FLAG_IMPORTANT, q as VALUE, r as AT_RULE_PRELUDE, s as COMMENT, t as ATTRIBUTE_SELECTOR, u as DECLARATION, v as IF_BRANCH, w as MEDIA_TYPE, x as LAYER_NAME, y as IF_CONDITION, z as STYLESHEET } from "./arena-Bsf96CQK.js";
4
+ import { a as is_vendor_prefixed, d as strip_vendor_prefix, l as str_index_of, r as is_custom, s as str_equals, u as str_starts_with } from "./string-utils-DiRRd28d.js";
5
+ import { parse_dimension } from "./parse-dimension.js";
6
+ import { n as parse_selector, r as parse_selector_list } from "./parse-selector-CqIpnBrQ.js";
6
7
  import { parse_atrule_prelude } from "./parse-atrule-prelude.js";
7
8
  import { parse_value } from "./parse-value.js";
8
9
  import { parse_declaration } from "./parse-declaration.js";
9
10
  import { parse } from "./parse.js";
10
11
  import { NODE_TYPES } from "./constants.js";
11
12
  import { BREAK, SKIP, traverse, walk } from "./walk.js";
12
- //#region src/node-types.ts
13
- function is_stylesheet(node) {
14
- return node.type === 1;
15
- }
16
- function is_rule(node) {
17
- return node.type === 2;
18
- }
19
- function is_atrule(node) {
20
- return node.type === 3;
21
- }
22
- function is_declaration(node) {
23
- return node.type === 4;
24
- }
25
- function is_selector(node) {
26
- return node.type === 5;
27
- }
28
- function is_selector_list(node) {
29
- return node.type === 20;
30
- }
31
- function is_block(node) {
32
- return node.type === 7;
33
- }
34
- function is_comment(node) {
35
- return node.type === 6;
36
- }
37
- function is_raw(node) {
38
- return node.type === 8;
39
- }
40
- function is_identifier(node) {
41
- return node.type === 10;
42
- }
43
- function is_number(node) {
44
- return node.type === 11;
45
- }
46
- function is_dimension(node) {
47
- return node.type === 12;
48
- }
49
- function is_string(node) {
50
- return node.type === 13;
51
- }
52
- function is_hash(node) {
53
- return node.type === 14;
54
- }
55
- function is_function(node) {
56
- return node.type === 15;
57
- }
58
- function is_operator(node) {
59
- return node.type === 16;
60
- }
61
- function is_parenthesis(node) {
62
- return node.type === 17;
63
- }
64
- function is_url(node) {
65
- return node.type === 18;
66
- }
67
- function is_unicode_range(node) {
68
- return node.type === 19;
69
- }
70
- function is_if_branch(node) {
71
- return node.type === 59;
72
- }
73
- function is_if_condition(node) {
74
- return node.type === 60;
75
- }
76
- function is_value(node) {
77
- return node.type === 50;
78
- }
79
- function is_type_selector(node) {
80
- return node.type === 21;
81
- }
82
- function is_class_selector(node) {
83
- return node.type === 22;
84
- }
85
- function is_id_selector(node) {
86
- return node.type === 23;
87
- }
88
- function is_attribute_selector(node) {
89
- return node.type === 24;
90
- }
91
- function is_pseudo_class_selector(node) {
92
- return node.type === 25;
93
- }
94
- function is_pseudo_element_selector(node) {
95
- return node.type === 26;
96
- }
97
- function is_combinator(node) {
98
- return node.type === 27;
99
- }
100
- function is_universal_selector(node) {
101
- return node.type === 28;
102
- }
103
- function is_nesting_selector(node) {
104
- return node.type === 29;
105
- }
106
- function is_nth_selector(node) {
107
- return node.type === 30;
108
- }
109
- function is_nth_of_selector(node) {
110
- return node.type === 31;
111
- }
112
- function is_lang_selector(node) {
113
- return node.type === 56;
114
- }
115
- function is_atrule_prelude(node) {
116
- return node.type === 40;
117
- }
118
- function is_media_query(node) {
119
- return node.type === 32;
120
- }
121
- function is_media_feature(node) {
122
- return node.type === 33;
123
- }
124
- function is_media_type(node) {
125
- return node.type === 34;
126
- }
127
- function is_container_query(node) {
128
- return node.type === 35;
129
- }
130
- function is_supports_query(node) {
131
- return node.type === 36;
132
- }
133
- function is_supports_declaration(node) {
134
- return node.type === 57;
135
- }
136
- function is_layer_name(node) {
137
- return node.type === 37;
138
- }
139
- function is_prelude_operator(node) {
140
- return node.type === 38;
141
- }
142
- function is_feature_range(node) {
143
- return node.type === 39;
144
- }
145
- function is_ratio(node) {
146
- return node.type === 58;
147
- }
148
- function is_prelude_selectorlist(node) {
149
- return node.type === 41;
150
- }
151
- //#endregion
152
- 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, IF_BRANCH, IF_CONDITION, 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, RATIO, 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_if_branch, is_if_condition, 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_ratio, 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 };
13
+ import "./string-helpers.js";
14
+ import { is_atrule, is_atrule_prelude, is_attribute_selector, is_block, is_class_selector, is_combinator, is_comment, is_container_query, is_declaration, is_dimension, is_feature_range, is_function, is_hash, is_id_selector, is_identifier, is_if_branch, is_if_condition, 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_ratio, 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 } from "./node-types.js";
15
+ 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, IF_BRANCH, IF_CONDITION, 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, RATIO, 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_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_if_branch, is_if_condition, 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_ratio, 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, strip_vendor_prefix, tokenize, traverse, walk };