iobroker.mywebui 1.37.21 → 1.37.22
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/io-package.json +1 -1
- package/package.json +1 -1
- package/www/node_modules/@node-projects/css-parser/LICENSE +11 -0
- package/www/node_modules/@node-projects/css-parser/README.md +161 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssParseError.d.ts +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssParseError.js +15 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssPosition.d.ts +25 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssPosition.js +13 -0
- package/www/node_modules/@node-projects/css-parser/dist/index-min.js +56 -0
- package/www/node_modules/@node-projects/css-parser/dist/index-min.js.map +7 -0
- package/www/node_modules/@node-projects/css-parser/dist/index.d.ts +12 -0
- package/www/node_modules/@node-projects/css-parser/dist/index.js +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/index.d.ts +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/index.js +1293 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/lexer.d.ts +118 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/lexer.js +248 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/compiler.d.ts +172 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/compiler.js +732 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/index.d.ts +5 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/index.js +5 -0
- package/www/node_modules/@node-projects/css-parser/dist/type.d.ts +205 -0
- package/www/node_modules/@node-projects/css-parser/dist/type.js +31 -0
- package/www/node_modules/@node-projects/css-parser/dist/utils/stringSearch.d.ts +53 -0
- package/www/node_modules/@node-projects/css-parser/dist/utils/stringSearch.js +166 -0
- package/www/node_modules/@node-projects/css-parser/docs/API.md +362 -0
- package/www/node_modules/@node-projects/css-parser/docs/AST.md +417 -0
- package/www/node_modules/@node-projects/css-parser/docs/CHANGELOG.md +205 -0
- package/www/node_modules/@node-projects/css-parser/docs/EXAMPLES.md +497 -0
- package/www/node_modules/@node-projects/css-parser/package.json +66 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fast lexer (scanner) for CSS input.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by the approach used in es-module-shims / es-module-lexer,
|
|
5
|
+
* this lexer uses numeric character-code comparisons (`charCodeAt`)
|
|
6
|
+
* instead of single-character string comparisons, and employs sticky
|
|
7
|
+
* (`y`-flag) regular expressions matched directly against the full
|
|
8
|
+
* input to avoid creating temporary substring slices.
|
|
9
|
+
*
|
|
10
|
+
* The Lexer keeps an index (`pos`) into the original input. Simple
|
|
11
|
+
* token types (whitespace, braces, colons, semicolons, commas) are
|
|
12
|
+
* scanned character-by-character via `charCodeAt`, avoiding regular
|
|
13
|
+
* expressions for those cases. For complex patterns `matchRegex` uses
|
|
14
|
+
* a sticky regex positioned at `pos` so no string copy is needed.
|
|
15
|
+
*/
|
|
16
|
+
declare const Ch_SLASH = 47;
|
|
17
|
+
declare const Ch_AT = 64;
|
|
18
|
+
declare const Ch_CLOSE = 125;
|
|
19
|
+
declare const Ch_STAR = 42;
|
|
20
|
+
export declare class Lexer {
|
|
21
|
+
/** The complete CSS source string. */
|
|
22
|
+
readonly input: string;
|
|
23
|
+
/** Current read position (index into `input`). */
|
|
24
|
+
pos: number;
|
|
25
|
+
/** Current source line (1-based). */
|
|
26
|
+
lineno: number;
|
|
27
|
+
/** Current source column (1-based). */
|
|
28
|
+
column: number;
|
|
29
|
+
constructor(input: string);
|
|
30
|
+
/** Returns `true` when there is still input to consume. */
|
|
31
|
+
get hasMore(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the character code at `pos + offset` without advancing,
|
|
34
|
+
* or `NaN` when past the end of input.
|
|
35
|
+
*
|
|
36
|
+
* Comparing numeric codes (`charCodeAt`) is faster than creating
|
|
37
|
+
* single-character strings with bracket indexing.
|
|
38
|
+
*/
|
|
39
|
+
charCodeAt(offset?: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the character at `pos + offset` without advancing, or an
|
|
42
|
+
* empty string when past the end of input.
|
|
43
|
+
*/
|
|
44
|
+
charAt(offset?: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the remaining input from the current position.
|
|
47
|
+
*
|
|
48
|
+
* This creates a new string (same cost as the old `css.slice(…)` approach)
|
|
49
|
+
* and is provided for compatibility with the bracket/quote-aware search
|
|
50
|
+
* utilities that accept a plain string.
|
|
51
|
+
*/
|
|
52
|
+
get remaining(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Advance `pos` by `n` characters, updating line/column tracking.
|
|
55
|
+
* Returns the consumed slice.
|
|
56
|
+
*/
|
|
57
|
+
consume(n: number): string;
|
|
58
|
+
/**
|
|
59
|
+
* Advance `pos` up to (but not including) `absolutePos`, updating
|
|
60
|
+
* line/column tracking. Returns the consumed slice.
|
|
61
|
+
*/
|
|
62
|
+
consumeTo(absolutePos: number): string;
|
|
63
|
+
/**
|
|
64
|
+
* Apply a sticky (`y`-flag) regex directly against the full input
|
|
65
|
+
* at the current position. If the regex matches, the matched text
|
|
66
|
+
* is consumed and the `RegExpExecArray` is returned; otherwise
|
|
67
|
+
* `null` is returned and `pos` is not changed.
|
|
68
|
+
*
|
|
69
|
+
* Using the `y` flag with `lastIndex` avoids creating a temporary
|
|
70
|
+
* substring slice (which the old `^`-anchor + `this.remaining`
|
|
71
|
+
* approach required).
|
|
72
|
+
*/
|
|
73
|
+
matchRegex(re: RegExp): RegExpExecArray | null;
|
|
74
|
+
/**
|
|
75
|
+
* Consume zero or more whitespace characters (space, tab, CR, LF,
|
|
76
|
+
* form-feed) using `charCodeAt` instead of string comparisons.
|
|
77
|
+
*/
|
|
78
|
+
skipWhitespace(): void;
|
|
79
|
+
/**
|
|
80
|
+
* If the current character is `{`, consume it and any following
|
|
81
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
82
|
+
*/
|
|
83
|
+
tryOpenBrace(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* If the current character is `}`, consume it and return `true`.
|
|
86
|
+
* Otherwise return `false`.
|
|
87
|
+
*/
|
|
88
|
+
tryCloseBrace(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If the current character is `:`, consume it and any following
|
|
91
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
92
|
+
*/
|
|
93
|
+
tryColon(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Consume any leading semicolons and whitespace characters using
|
|
96
|
+
* `charCodeAt` instead of string comparisons.
|
|
97
|
+
*/
|
|
98
|
+
skipSemicolonAndWhitespace(): void;
|
|
99
|
+
/**
|
|
100
|
+
* If the current character is `,`, consume it and any following
|
|
101
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
102
|
+
*/
|
|
103
|
+
tryCommaAndWhitespace(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Returns a snapshot of the current source position as an object
|
|
106
|
+
* suitable for use in `Position` nodes.
|
|
107
|
+
*/
|
|
108
|
+
getPosition(): {
|
|
109
|
+
line: number;
|
|
110
|
+
column: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Update `lineno`, `column`, and `pos` for a range of characters in
|
|
114
|
+
* the original input. Uses `charCodeAt` for the newline check.
|
|
115
|
+
*/
|
|
116
|
+
private _advanceRange;
|
|
117
|
+
}
|
|
118
|
+
export { Ch_AT, Ch_CLOSE, Ch_SLASH, Ch_STAR };
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fast lexer (scanner) for CSS input.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by the approach used in es-module-shims / es-module-lexer,
|
|
5
|
+
* this lexer uses numeric character-code comparisons (`charCodeAt`)
|
|
6
|
+
* instead of single-character string comparisons, and employs sticky
|
|
7
|
+
* (`y`-flag) regular expressions matched directly against the full
|
|
8
|
+
* input to avoid creating temporary substring slices.
|
|
9
|
+
*
|
|
10
|
+
* The Lexer keeps an index (`pos`) into the original input. Simple
|
|
11
|
+
* token types (whitespace, braces, colons, semicolons, commas) are
|
|
12
|
+
* scanned character-by-character via `charCodeAt`, avoiding regular
|
|
13
|
+
* expressions for those cases. For complex patterns `matchRegex` uses
|
|
14
|
+
* a sticky regex positioned at `pos` so no string copy is needed.
|
|
15
|
+
*/
|
|
16
|
+
// ─── Character-code constants ────────────────────────────────────────────────
|
|
17
|
+
// Using charCodeAt comparisons is measurably faster than creating
|
|
18
|
+
// single-character strings and comparing with `===`.
|
|
19
|
+
const Ch_TAB = 9; // \t
|
|
20
|
+
const Ch_LF = 10; // \n
|
|
21
|
+
const Ch_FF = 12; // \f
|
|
22
|
+
const Ch_CR = 13; // \r
|
|
23
|
+
const Ch_SPACE = 32; // ' '
|
|
24
|
+
const Ch_COMMA = 44; // ,
|
|
25
|
+
const Ch_SLASH = 47; // /
|
|
26
|
+
const Ch_COLON = 58; // :
|
|
27
|
+
const Ch_SEMI = 59; // ;
|
|
28
|
+
const Ch_AT = 64; // @
|
|
29
|
+
const Ch_OPEN = 123; // {
|
|
30
|
+
const Ch_CLOSE = 125; // }
|
|
31
|
+
const Ch_STAR = 42; // *
|
|
32
|
+
export class Lexer {
|
|
33
|
+
/** The complete CSS source string. */
|
|
34
|
+
input;
|
|
35
|
+
/** Current read position (index into `input`). */
|
|
36
|
+
pos;
|
|
37
|
+
/** Current source line (1-based). */
|
|
38
|
+
lineno;
|
|
39
|
+
/** Current source column (1-based). */
|
|
40
|
+
column;
|
|
41
|
+
constructor(input) {
|
|
42
|
+
this.input = input;
|
|
43
|
+
this.pos = 0;
|
|
44
|
+
this.lineno = 1;
|
|
45
|
+
this.column = 1;
|
|
46
|
+
}
|
|
47
|
+
// ─── Lookahead helpers ────────────────────────────────────────────────────
|
|
48
|
+
/** Returns `true` when there is still input to consume. */
|
|
49
|
+
get hasMore() {
|
|
50
|
+
return this.pos < this.input.length;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the character code at `pos + offset` without advancing,
|
|
54
|
+
* or `NaN` when past the end of input.
|
|
55
|
+
*
|
|
56
|
+
* Comparing numeric codes (`charCodeAt`) is faster than creating
|
|
57
|
+
* single-character strings with bracket indexing.
|
|
58
|
+
*/
|
|
59
|
+
charCodeAt(offset = 0) {
|
|
60
|
+
return this.input.charCodeAt(this.pos + offset);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns the character at `pos + offset` without advancing, or an
|
|
64
|
+
* empty string when past the end of input.
|
|
65
|
+
*/
|
|
66
|
+
charAt(offset = 0) {
|
|
67
|
+
return this.input[this.pos + offset] ?? '';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the remaining input from the current position.
|
|
71
|
+
*
|
|
72
|
+
* This creates a new string (same cost as the old `css.slice(…)` approach)
|
|
73
|
+
* and is provided for compatibility with the bracket/quote-aware search
|
|
74
|
+
* utilities that accept a plain string.
|
|
75
|
+
*/
|
|
76
|
+
get remaining() {
|
|
77
|
+
return this.input.slice(this.pos);
|
|
78
|
+
}
|
|
79
|
+
// ─── Consumption helpers ──────────────────────────────────────────────────
|
|
80
|
+
/**
|
|
81
|
+
* Advance `pos` by `n` characters, updating line/column tracking.
|
|
82
|
+
* Returns the consumed slice.
|
|
83
|
+
*/
|
|
84
|
+
consume(n) {
|
|
85
|
+
const start = this.pos;
|
|
86
|
+
const end = start + n;
|
|
87
|
+
this._advanceRange(start, end);
|
|
88
|
+
return this.input.slice(start, end);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Advance `pos` up to (but not including) `absolutePos`, updating
|
|
92
|
+
* line/column tracking. Returns the consumed slice.
|
|
93
|
+
*/
|
|
94
|
+
consumeTo(absolutePos) {
|
|
95
|
+
return this.consume(absolutePos - this.pos);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Apply a sticky (`y`-flag) regex directly against the full input
|
|
99
|
+
* at the current position. If the regex matches, the matched text
|
|
100
|
+
* is consumed and the `RegExpExecArray` is returned; otherwise
|
|
101
|
+
* `null` is returned and `pos` is not changed.
|
|
102
|
+
*
|
|
103
|
+
* Using the `y` flag with `lastIndex` avoids creating a temporary
|
|
104
|
+
* substring slice (which the old `^`-anchor + `this.remaining`
|
|
105
|
+
* approach required).
|
|
106
|
+
*/
|
|
107
|
+
matchRegex(re) {
|
|
108
|
+
re.lastIndex = this.pos;
|
|
109
|
+
const m = re.exec(this.input);
|
|
110
|
+
if (m) {
|
|
111
|
+
this._advanceRange(this.pos, this.pos + m[0].length);
|
|
112
|
+
}
|
|
113
|
+
return m;
|
|
114
|
+
}
|
|
115
|
+
// ─── Character-based token scanners ──────────────────────────────────────
|
|
116
|
+
/**
|
|
117
|
+
* Consume zero or more whitespace characters (space, tab, CR, LF,
|
|
118
|
+
* form-feed) using `charCodeAt` instead of string comparisons.
|
|
119
|
+
*/
|
|
120
|
+
skipWhitespace() {
|
|
121
|
+
const src = this.input;
|
|
122
|
+
const len = src.length;
|
|
123
|
+
while (this.pos < len) {
|
|
124
|
+
const ch = src.charCodeAt(this.pos);
|
|
125
|
+
if (ch === Ch_LF) {
|
|
126
|
+
this.lineno++;
|
|
127
|
+
this.column = 1;
|
|
128
|
+
this.pos++;
|
|
129
|
+
}
|
|
130
|
+
else if (ch === Ch_SPACE ||
|
|
131
|
+
ch === Ch_TAB ||
|
|
132
|
+
ch === Ch_CR ||
|
|
133
|
+
ch === Ch_FF) {
|
|
134
|
+
this.column++;
|
|
135
|
+
this.pos++;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* If the current character is `{`, consume it and any following
|
|
144
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
145
|
+
*/
|
|
146
|
+
tryOpenBrace() {
|
|
147
|
+
if (this.input.charCodeAt(this.pos) !== Ch_OPEN) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
this.pos++;
|
|
151
|
+
this.column++;
|
|
152
|
+
this.skipWhitespace();
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* If the current character is `}`, consume it and return `true`.
|
|
157
|
+
* Otherwise return `false`.
|
|
158
|
+
*/
|
|
159
|
+
tryCloseBrace() {
|
|
160
|
+
if (this.input.charCodeAt(this.pos) !== Ch_CLOSE) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
this.pos++;
|
|
164
|
+
this.column++;
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* If the current character is `:`, consume it and any following
|
|
169
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
170
|
+
*/
|
|
171
|
+
tryColon() {
|
|
172
|
+
if (this.input.charCodeAt(this.pos) !== Ch_COLON) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
this.pos++;
|
|
176
|
+
this.column++;
|
|
177
|
+
this.skipWhitespace();
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Consume any leading semicolons and whitespace characters using
|
|
182
|
+
* `charCodeAt` instead of string comparisons.
|
|
183
|
+
*/
|
|
184
|
+
skipSemicolonAndWhitespace() {
|
|
185
|
+
const src = this.input;
|
|
186
|
+
const len = src.length;
|
|
187
|
+
while (this.pos < len) {
|
|
188
|
+
const ch = src.charCodeAt(this.pos);
|
|
189
|
+
if (ch === Ch_LF) {
|
|
190
|
+
this.lineno++;
|
|
191
|
+
this.column = 1;
|
|
192
|
+
this.pos++;
|
|
193
|
+
}
|
|
194
|
+
else if (ch === Ch_SEMI ||
|
|
195
|
+
ch === Ch_SPACE ||
|
|
196
|
+
ch === Ch_TAB ||
|
|
197
|
+
ch === Ch_CR ||
|
|
198
|
+
ch === Ch_FF) {
|
|
199
|
+
this.column++;
|
|
200
|
+
this.pos++;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* If the current character is `,`, consume it and any following
|
|
209
|
+
* whitespace, then return `true`. Otherwise return `false`.
|
|
210
|
+
*/
|
|
211
|
+
tryCommaAndWhitespace() {
|
|
212
|
+
if (this.input.charCodeAt(this.pos) !== Ch_COMMA) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
this.pos++;
|
|
216
|
+
this.column++;
|
|
217
|
+
this.skipWhitespace();
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
// ─── Position snapshot ────────────────────────────────────────────────────
|
|
221
|
+
/**
|
|
222
|
+
* Returns a snapshot of the current source position as an object
|
|
223
|
+
* suitable for use in `Position` nodes.
|
|
224
|
+
*/
|
|
225
|
+
getPosition() {
|
|
226
|
+
return { line: this.lineno, column: this.column };
|
|
227
|
+
}
|
|
228
|
+
// ─── Internal helpers ─────────────────────────────────────────────────────
|
|
229
|
+
/**
|
|
230
|
+
* Update `lineno`, `column`, and `pos` for a range of characters in
|
|
231
|
+
* the original input. Uses `charCodeAt` for the newline check.
|
|
232
|
+
*/
|
|
233
|
+
_advanceRange(from, to) {
|
|
234
|
+
const src = this.input;
|
|
235
|
+
for (let i = from; i < to; i++) {
|
|
236
|
+
if (src.charCodeAt(i) === Ch_LF) {
|
|
237
|
+
this.lineno++;
|
|
238
|
+
this.column = 1;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this.column++;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
this.pos = to;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// Re-export character codes so the parser can use them for fast checks
|
|
248
|
+
export { Ch_AT, Ch_CLOSE, Ch_SLASH, Ch_STAR };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { type CssAllNodesAST, type CssCharsetAST, type CssCommentAST, type CssCommonPositionAST, type CssContainerAST, type CssCounterStyleAST, type CssCustomMediaAST, type CssDeclarationAST, type CssDocumentAST, type CssFontFaceAST, type CssFontFeatureValuesAST, type CssGenericAtRuleAST, type CssHostAST, type CssImportAST, type CssKeyframeAST, type CssKeyframesAST, type CssLayerAST, type CssMediaAST, type CssNamespaceAST, type CssPageAST, type CssPageMarginBoxAST, type CssPositionTryAST, type CssPropertyAST, type CssRuleAST, type CssScopeAST, type CssStartingStyleAST, type CssStylesheetAST, type CssSupportsAST, type CssViewTransitionAST, type CssWhitespaceAST } from '../type.js';
|
|
2
|
+
export type CompilerOptions = {
|
|
3
|
+
indent?: string;
|
|
4
|
+
compress?: boolean;
|
|
5
|
+
identity?: boolean;
|
|
6
|
+
removeEmptyRules?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare class Compiler {
|
|
9
|
+
level: number;
|
|
10
|
+
indentation: string;
|
|
11
|
+
compress: boolean;
|
|
12
|
+
identity: boolean;
|
|
13
|
+
removeEmptyRules: boolean;
|
|
14
|
+
constructor(options?: CompilerOptions);
|
|
15
|
+
emit(str: string, _position?: CssCommonPositionAST['position']): string;
|
|
16
|
+
/**
|
|
17
|
+
* Increase, decrease or return current indentation.
|
|
18
|
+
*/
|
|
19
|
+
indent(level?: number): string;
|
|
20
|
+
visit(node: CssAllNodesAST): string;
|
|
21
|
+
mapVisit(nodes: Array<CssAllNodesAST>, delim?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Emit a block at-rule that contains nested rules (e.g. @media, @supports, @container).
|
|
24
|
+
*/
|
|
25
|
+
private rulesBlock;
|
|
26
|
+
/**
|
|
27
|
+
* Emit a block at-rule that contains declarations (e.g. @font-face, @property).
|
|
28
|
+
*/
|
|
29
|
+
private declsBlock;
|
|
30
|
+
compile(node: CssStylesheetAST): string;
|
|
31
|
+
/**
|
|
32
|
+
* Identity mode: walk the AST including whitespace nodes.
|
|
33
|
+
* Falls back to beautified output when whitespace nodes are not available.
|
|
34
|
+
*/
|
|
35
|
+
private identityCompile;
|
|
36
|
+
/**
|
|
37
|
+
* Visit stylesheet node.
|
|
38
|
+
*/
|
|
39
|
+
stylesheet(node: CssStylesheetAST): string;
|
|
40
|
+
/**
|
|
41
|
+
* Strip whitespace nodes from an array (used in beautified/compressed modes).
|
|
42
|
+
*/
|
|
43
|
+
private stripWhitespace;
|
|
44
|
+
/**
|
|
45
|
+
* Filter out empty rules when removeEmptyRules is enabled.
|
|
46
|
+
*/
|
|
47
|
+
private filterEmptyRules;
|
|
48
|
+
/**
|
|
49
|
+
* Check whether a node was newly created (not parsed from source).
|
|
50
|
+
* New nodes lack the raw formatting properties set by the parser.
|
|
51
|
+
*/
|
|
52
|
+
private isNewNode;
|
|
53
|
+
/**
|
|
54
|
+
* Visit block children in identity mode, formatting newly added nodes
|
|
55
|
+
* with beautified output while preserving original formatting for
|
|
56
|
+
* existing nodes.
|
|
57
|
+
*
|
|
58
|
+
* @param nodes - The child nodes to visit
|
|
59
|
+
* @param context - 'decls' for declaration blocks, 'rules' for nested
|
|
60
|
+
* rule blocks (e.g. @media), 'stylesheet' for top-level
|
|
61
|
+
*/
|
|
62
|
+
private identityVisitBlock;
|
|
63
|
+
/**
|
|
64
|
+
* Visit whitespace node.
|
|
65
|
+
*/
|
|
66
|
+
whitespace(node: CssWhitespaceAST): string;
|
|
67
|
+
/**
|
|
68
|
+
* Visit comment node.
|
|
69
|
+
*/
|
|
70
|
+
comment(node: CssCommentAST): string;
|
|
71
|
+
/**
|
|
72
|
+
* Visit container node.
|
|
73
|
+
*/
|
|
74
|
+
container(node: CssContainerAST): string;
|
|
75
|
+
/**
|
|
76
|
+
* Visit container node.
|
|
77
|
+
*/
|
|
78
|
+
layer(node: CssLayerAST): string;
|
|
79
|
+
/**
|
|
80
|
+
* Visit import node.
|
|
81
|
+
*/
|
|
82
|
+
import(node: CssImportAST): string;
|
|
83
|
+
/**
|
|
84
|
+
* Visit media node.
|
|
85
|
+
*/
|
|
86
|
+
media(node: CssMediaAST): string;
|
|
87
|
+
/**
|
|
88
|
+
* Visit document node.
|
|
89
|
+
*/
|
|
90
|
+
document(node: CssDocumentAST): string;
|
|
91
|
+
/**
|
|
92
|
+
* Visit charset node.
|
|
93
|
+
*/
|
|
94
|
+
charset(node: CssCharsetAST): string;
|
|
95
|
+
/**
|
|
96
|
+
* Visit namespace node.
|
|
97
|
+
*/
|
|
98
|
+
namespace(node: CssNamespaceAST): string;
|
|
99
|
+
/**
|
|
100
|
+
* Visit starting-style node.
|
|
101
|
+
*/
|
|
102
|
+
startingStyle(node: CssStartingStyleAST): string;
|
|
103
|
+
/**
|
|
104
|
+
* Visit supports node.
|
|
105
|
+
*/
|
|
106
|
+
supports(node: CssSupportsAST): string;
|
|
107
|
+
/**
|
|
108
|
+
* Visit keyframes node.
|
|
109
|
+
*/
|
|
110
|
+
keyframes(node: CssKeyframesAST): string;
|
|
111
|
+
/**
|
|
112
|
+
* Visit keyframe node.
|
|
113
|
+
*/
|
|
114
|
+
keyframe(node: CssKeyframeAST): string;
|
|
115
|
+
/**
|
|
116
|
+
* Visit page node.
|
|
117
|
+
*/
|
|
118
|
+
page(node: CssPageAST): string;
|
|
119
|
+
/**
|
|
120
|
+
* Visit @page margin box node (@top-left, @bottom-right, etc.).
|
|
121
|
+
*/
|
|
122
|
+
pageMarginBox(node: CssPageMarginBoxAST): string;
|
|
123
|
+
/**
|
|
124
|
+
* Visit font-face node.
|
|
125
|
+
*/
|
|
126
|
+
fontFace(node: CssFontFaceAST): string;
|
|
127
|
+
/**
|
|
128
|
+
* Visit host node.
|
|
129
|
+
*/
|
|
130
|
+
host(node: CssHostAST): string;
|
|
131
|
+
/**
|
|
132
|
+
* Visit custom-media node.
|
|
133
|
+
*/
|
|
134
|
+
customMedia(node: CssCustomMediaAST): string;
|
|
135
|
+
/**
|
|
136
|
+
* Visit @property node.
|
|
137
|
+
*/
|
|
138
|
+
property(node: CssPropertyAST): string;
|
|
139
|
+
/**
|
|
140
|
+
* Visit @counter-style node.
|
|
141
|
+
*/
|
|
142
|
+
counterStyle(node: CssCounterStyleAST): string;
|
|
143
|
+
/**
|
|
144
|
+
* Visit @font-feature-values node.
|
|
145
|
+
*/
|
|
146
|
+
fontFeatureValues(node: CssFontFeatureValuesAST): string;
|
|
147
|
+
/**
|
|
148
|
+
* Visit @scope node.
|
|
149
|
+
*/
|
|
150
|
+
scope(node: CssScopeAST): string;
|
|
151
|
+
/**
|
|
152
|
+
* Visit @view-transition node.
|
|
153
|
+
*/
|
|
154
|
+
viewTransition(node: CssViewTransitionAST): string;
|
|
155
|
+
/**
|
|
156
|
+
* Visit @position-try node.
|
|
157
|
+
*/
|
|
158
|
+
positionTry(node: CssPositionTryAST): string;
|
|
159
|
+
/**
|
|
160
|
+
* Visit generic at-rule node (fallback for any unrecognized at-rule).
|
|
161
|
+
*/
|
|
162
|
+
genericAtRule(node: CssGenericAtRuleAST): string;
|
|
163
|
+
/**
|
|
164
|
+
* Visit rule node.
|
|
165
|
+
*/
|
|
166
|
+
rule(node: CssRuleAST): string;
|
|
167
|
+
/**
|
|
168
|
+
* Visit declaration node.
|
|
169
|
+
*/
|
|
170
|
+
declaration(node: CssDeclarationAST): string;
|
|
171
|
+
}
|
|
172
|
+
export default Compiler;
|