@tbela99/css-parser 1.6.7 → 1.6.9
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/CHANGELOG.md +64 -4
- package/dist/index-umd-web.js +126 -49
- package/dist/index.cjs +119 -49
- package/dist/index.d.ts +51 -3
- package/dist/package.json.js +10 -0
- package/dist/{data → src/data}/properties.json.js +7 -0
- package/dist/{data → src/data}/validation.json.js +7 -0
- package/dist/{lib → src/lib}/ast/clone.js +7 -0
- package/dist/{lib → src/lib}/ast/expand.js +7 -0
- package/dist/{lib → src/lib}/ast/features/calc.js +7 -0
- package/dist/{lib → src/lib}/ast/features/if.js +7 -0
- package/dist/{lib → src/lib}/ast/features/index.js +7 -0
- package/dist/{lib → src/lib}/ast/features/inlinecssvariables.js +7 -0
- package/dist/{lib → src/lib}/ast/features/prefix.js +7 -0
- package/dist/{lib → src/lib}/ast/features/shorthand.js +7 -0
- package/dist/{lib → src/lib}/ast/features/transform.js +7 -0
- package/dist/{lib → src/lib}/ast/features/type.js +7 -0
- package/dist/{lib → src/lib}/ast/find.js +7 -0
- package/dist/{lib → src/lib}/ast/math/expression.js +7 -0
- package/dist/{lib → src/lib}/ast/math/math.js +7 -0
- package/dist/{lib → src/lib}/ast/minify.js +7 -0
- package/dist/{lib → src/lib}/ast/node.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/compute.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/matrix.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/minify.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/perspective.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/rotate.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/scale.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/skew.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/translate.js +7 -0
- package/dist/{lib → src/lib}/ast/transform/utils.js +7 -0
- package/dist/{lib → src/lib}/ast/types.js +12 -1
- package/dist/{lib → src/lib}/ast/walk.js +7 -0
- package/dist/{lib → src/lib}/fs/resolve.js +7 -0
- package/dist/{lib → src/lib}/parser/declaration/list.js +7 -0
- package/dist/{lib → src/lib}/parser/declaration/map.js +7 -0
- package/dist/{lib → src/lib}/parser/declaration/set.js +7 -0
- package/dist/{lib → src/lib}/parser/linesmap.js +7 -0
- package/dist/{lib → src/lib}/parser/parse.js +61 -21
- package/dist/{lib → src/lib}/parser/source.js +7 -0
- package/dist/{lib → src/lib}/parser/tokenize.js +24 -3
- package/dist/{lib → src/lib}/parser/utils/angle.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-container.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-font-feature-values.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-generic.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-import.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-media.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-support.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule-when-else.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/at-rule.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/base64.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/cache.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/config.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/declaration.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/eq.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/hash.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/selector.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/text.js +7 -0
- package/dist/{lib → src/lib}/parser/utils/token.js +15 -4
- package/dist/{lib → src/lib}/parser/utils/type.js +7 -0
- package/dist/{lib → src/lib}/printer/render.js +9 -1
- package/dist/{lib → src/lib}/printer/sourcemap/lib/codec.js +7 -0
- package/dist/{lib → src/lib}/printer/sourcemap/sourcemap.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/a98rgb.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/alpha.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/cmyk.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/color-mix.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/color.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/hex.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/hsl.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/hwb.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/lab.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/lch.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/oklab.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/oklch.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/p3.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/prophotorgb.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/rec2020.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/relative-color.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/rgb.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/srgb.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/color-type.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/colorspace.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/components.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/distance.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/make-color.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/utils/matrix.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/xyz.js +7 -0
- package/dist/{lib → src/lib}/syntax/color/xyzd50.js +7 -0
- package/dist/{lib → src/lib}/syntax/constants.js +7 -0
- package/dist/{lib → src/lib}/syntax/syntax.js +7 -0
- package/dist/{lib → src/lib}/validation/config.js +7 -0
- package/dist/{lib → src/lib}/validation/match.js +37 -19
- package/dist/{lib → src/lib}/validation/parser/parse.js +7 -0
- package/dist/{lib → src/lib}/validation/parser/typedef.js +7 -0
- package/dist/{lib → src/lib}/validation/utils/list.js +7 -0
- package/dist/{node.js → src/node.js} +8 -0
- package/dist/{types.js → src/types.js} +7 -0
- package/dist/{utils → src/utils}/sync.js +7 -0
- package/dist/{web.js → src/web.js} +8 -0
- package/package.json +5 -4
- package/dist/lib/syntax/color/hsv.js +0 -6
package/dist/index.cjs
CHANGED
|
@@ -550,7 +550,7 @@ exports.EnumToken = void 0;
|
|
|
550
550
|
/**
|
|
551
551
|
* '|'
|
|
552
552
|
*/
|
|
553
|
-
EnumToken[EnumToken["
|
|
553
|
+
EnumToken[EnumToken["PipeTokenType"] = 109] = "PipeTokenType";
|
|
554
554
|
/**
|
|
555
555
|
* '::'
|
|
556
556
|
*/
|
|
@@ -689,6 +689,10 @@ exports.EnumToken = void 0;
|
|
|
689
689
|
* negative infinity token
|
|
690
690
|
*/
|
|
691
691
|
EnumToken[EnumToken["NegativeInfinityTokenType"] = 143] = "NegativeInfinityTokenType";
|
|
692
|
+
/**
|
|
693
|
+
* CSS type token
|
|
694
|
+
*/
|
|
695
|
+
EnumToken[EnumToken["CssTypeTokenType"] = 144] = "CssTypeTokenType";
|
|
692
696
|
/* aliases */
|
|
693
697
|
/**
|
|
694
698
|
* alias for time token type
|
|
@@ -12488,8 +12492,7 @@ function isMFValue(featureName, tokens, isMFRange) {
|
|
|
12488
12492
|
case MediaFeatureType.RatioType:
|
|
12489
12493
|
return {
|
|
12490
12494
|
valid: true,
|
|
12491
|
-
success: (tokens.length == 1 &&
|
|
12492
|
-
tokens[0].typ == exports.EnumToken.NumberTokenType) ||
|
|
12495
|
+
success: (tokens.length == 1 && tokens[0].typ == exports.EnumToken.NumberTokenType) ||
|
|
12493
12496
|
(tokens.length === 3 &&
|
|
12494
12497
|
tokens[0].typ == exports.EnumToken.NumberTokenType &&
|
|
12495
12498
|
typeof tokens[0].val === "number" &&
|
|
@@ -12796,7 +12799,7 @@ function matchSelectorSyntax(stream, errors, options, nested = true) {
|
|
|
12796
12799
|
}
|
|
12797
12800
|
stack.push(token);
|
|
12798
12801
|
break;
|
|
12799
|
-
case exports.EnumToken.
|
|
12802
|
+
case exports.EnumToken.PipeTokenType:
|
|
12800
12803
|
case exports.EnumToken.DelimTokenType:
|
|
12801
12804
|
case exports.EnumToken.StringTokenType:
|
|
12802
12805
|
case exports.EnumToken.IncludeMatchTokenType:
|
|
@@ -12844,10 +12847,10 @@ function matchSelectorSyntax(stream, errors, options, nested = true) {
|
|
|
12844
12847
|
}
|
|
12845
12848
|
slice.push(tokens[n]);
|
|
12846
12849
|
}
|
|
12847
|
-
if (slice[1]?.typ === exports.EnumToken.
|
|
12850
|
+
if (slice[1]?.typ === exports.EnumToken.PipeTokenType) {
|
|
12848
12851
|
slice.shift();
|
|
12849
12852
|
}
|
|
12850
|
-
if (slice[0].typ === exports.EnumToken.
|
|
12853
|
+
if (slice[0].typ === exports.EnumToken.PipeTokenType) {
|
|
12851
12854
|
slice.shift();
|
|
12852
12855
|
}
|
|
12853
12856
|
if (slice.length === 1) {
|
|
@@ -13209,8 +13212,8 @@ function matchSyntax(syntaxes, context, options) {
|
|
|
13209
13212
|
// custom function token
|
|
13210
13213
|
if (token.typ === exports.EnumToken.CustomFunctionTokenDefType) {
|
|
13211
13214
|
if (syntaxes[i].typ != ValidationTokenEnum.PropertyType ||
|
|
13212
|
-
syntaxes[i + 1]
|
|
13213
|
-
syntaxes[i + 2]
|
|
13215
|
+
syntaxes[i + 1]?.typ != ValidationTokenEnum.OpenParenthesis ||
|
|
13216
|
+
syntaxes[i + 2]?.typ == null) {
|
|
13214
13217
|
if (!isOptional) {
|
|
13215
13218
|
return {
|
|
13216
13219
|
success: false,
|
|
@@ -14057,17 +14060,15 @@ function matchProperty(property, context, options) {
|
|
|
14057
14060
|
case "display-internal":
|
|
14058
14061
|
case "display-outside":
|
|
14059
14062
|
case "display-legacy":
|
|
14060
|
-
case "content-position":
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
propertyKeywordValues.set(property.val, values);
|
|
14066
|
-
}
|
|
14067
|
-
success =
|
|
14068
|
-
token?.typ == exports.EnumToken.IdenTokenType && values.has(token.val.toLowerCase());
|
|
14069
|
-
break;
|
|
14063
|
+
case "content-position": {
|
|
14064
|
+
let values = propertyKeywordValues.get(property.val);
|
|
14065
|
+
if (values == null) {
|
|
14066
|
+
values = new Set(config$3.syntaxes[property.val].syntax.split(/[\s|]+/));
|
|
14067
|
+
propertyKeywordValues.set(property.val, values);
|
|
14070
14068
|
}
|
|
14069
|
+
success = token?.typ == exports.EnumToken.IdenTokenType && values.has(token.val.toLowerCase());
|
|
14070
|
+
break;
|
|
14071
|
+
}
|
|
14071
14072
|
case "mf-name":
|
|
14072
14073
|
{
|
|
14073
14074
|
const token = context.peek();
|
|
@@ -14087,8 +14088,7 @@ function matchProperty(property, context, options) {
|
|
|
14087
14088
|
case "custom-ident":
|
|
14088
14089
|
case "counter-name":
|
|
14089
14090
|
case "counter-style-name":
|
|
14090
|
-
success =
|
|
14091
|
-
token?.typ == exports.EnumToken.IdenTokenType || token?.typ == exports.EnumToken.DashedIdenTokenType;
|
|
14091
|
+
success = token?.typ == exports.EnumToken.IdenTokenType || token?.typ == exports.EnumToken.DashedIdenTokenType;
|
|
14092
14092
|
if (success && token?.typ === exports.EnumToken.IdenTokenType) {
|
|
14093
14093
|
const val = token.val.toLowerCase();
|
|
14094
14094
|
success = "none" !== val && !allValues.includes(val);
|
|
@@ -14559,6 +14559,21 @@ function matchProperty(property, context, options) {
|
|
|
14559
14559
|
}
|
|
14560
14560
|
break;
|
|
14561
14561
|
}
|
|
14562
|
+
case "css-type": {
|
|
14563
|
+
success = context.peek()?.typ == exports.EnumToken.CssTypeTokenType;
|
|
14564
|
+
if (success) {
|
|
14565
|
+
context.next();
|
|
14566
|
+
return {
|
|
14567
|
+
success: true,
|
|
14568
|
+
valid: true,
|
|
14569
|
+
token: null,
|
|
14570
|
+
context,
|
|
14571
|
+
syntaxToken: null,
|
|
14572
|
+
errors: [],
|
|
14573
|
+
};
|
|
14574
|
+
}
|
|
14575
|
+
break;
|
|
14576
|
+
}
|
|
14562
14577
|
default:
|
|
14563
14578
|
if (!(property.val in config$3.syntaxes)) {
|
|
14564
14579
|
console.debug("Unknown syntax", context.peek(), property);
|
|
@@ -21135,12 +21150,15 @@ const trimTokenSpace = new Set([
|
|
|
21135
21150
|
exports.EnumToken.LtTokenType,
|
|
21136
21151
|
exports.EnumToken.LteTokenType,
|
|
21137
21152
|
exports.EnumToken.ChildCombinatorTokenType,
|
|
21153
|
+
exports.EnumToken.PipeTokenType,
|
|
21138
21154
|
]);
|
|
21139
21155
|
const trimSpaceAfter = new Set([
|
|
21140
21156
|
...tokensfuncSet.values(),
|
|
21141
21157
|
exports.EnumToken.ChildCombinatorTokenType,
|
|
21142
21158
|
exports.EnumToken.SupportsQueryConditionTokenType,
|
|
21143
21159
|
exports.EnumToken.SupportsQueryUnaryConditionTokenType,
|
|
21160
|
+
exports.EnumToken.CommaTokenType,
|
|
21161
|
+
exports.EnumToken.PipeTokenType,
|
|
21144
21162
|
]);
|
|
21145
21163
|
/**
|
|
21146
21164
|
* Replace token in its parent node
|
|
@@ -21210,17 +21228,18 @@ function trimWhiteSpaceTokens(tokens) {
|
|
|
21210
21228
|
return tokens;
|
|
21211
21229
|
}
|
|
21212
21230
|
for (; i < tokens.length; i++) {
|
|
21213
|
-
if (
|
|
21214
|
-
tokens.splice(i + 1, 1);
|
|
21215
|
-
}
|
|
21216
|
-
else if (trimTokenSpace.has(tokens[i].typ)) {
|
|
21231
|
+
if (trimTokenSpace.has(tokens[i].typ)) {
|
|
21217
21232
|
if (tokens[i + 1]?.typ === exports.EnumToken.WhitespaceTokenType) {
|
|
21218
21233
|
tokens.splice(i + 1, 1);
|
|
21219
21234
|
}
|
|
21220
21235
|
if (i > 0 && tokens[i - 1].typ === exports.EnumToken.Whitespace) {
|
|
21221
21236
|
tokens.splice(--i, 1);
|
|
21237
|
+
continue;
|
|
21222
21238
|
}
|
|
21223
21239
|
}
|
|
21240
|
+
if (trimSpaceAfter.has(tokens[i].typ) && tokens[i + 1]?.typ === exports.EnumToken.WhitespaceTokenType) {
|
|
21241
|
+
tokens.splice(i + 1, 1);
|
|
21242
|
+
}
|
|
21224
21243
|
}
|
|
21225
21244
|
return tokens;
|
|
21226
21245
|
}
|
|
@@ -26670,7 +26689,7 @@ function renderValue(token, options = {}, cache = Object.create(null), reducer,
|
|
|
26670
26689
|
return ",";
|
|
26671
26690
|
case exports.EnumToken.ImportantTokenType:
|
|
26672
26691
|
return "!important";
|
|
26673
|
-
case exports.EnumToken.
|
|
26692
|
+
case exports.EnumToken.PipeTokenType:
|
|
26674
26693
|
return "|";
|
|
26675
26694
|
case exports.EnumToken.AttrTokenType:
|
|
26676
26695
|
case exports.EnumToken.IdenListTokenType:
|
|
@@ -26793,6 +26812,7 @@ function renderValue(token, options = {}, cache = Object.create(null), reducer,
|
|
|
26793
26812
|
pseudoElements.includes(token.val.slice(1))) {
|
|
26794
26813
|
return token.val.slice(1);
|
|
26795
26814
|
}
|
|
26815
|
+
case exports.EnumToken.CssTypeTokenType:
|
|
26796
26816
|
case exports.EnumToken.UrlTokenTokenType:
|
|
26797
26817
|
case exports.EnumToken.HashTokenType:
|
|
26798
26818
|
case exports.EnumToken.IdenTokenType:
|
|
@@ -26946,7 +26966,7 @@ function assignTokenMap(entries, tokenType, suffix = "", lowercase = false) {
|
|
|
26946
26966
|
SymbolsMapTokens[""] = exports.EnumToken.DelimTokenType;
|
|
26947
26967
|
SymbolsMapTokens["+"] = exports.EnumToken.Plus;
|
|
26948
26968
|
SymbolsMapTokens["="] = exports.EnumToken.DelimTokenType;
|
|
26949
|
-
SymbolsMapTokens["|"] = exports.EnumToken.
|
|
26969
|
+
SymbolsMapTokens["|"] = exports.EnumToken.PipeTokenType;
|
|
26950
26970
|
SymbolsMapTokens["||"] = exports.EnumToken.ColumnCombinatorTokenType;
|
|
26951
26971
|
SymbolsMapTokens["|="] = exports.EnumToken.DashMatchTokenType;
|
|
26952
26972
|
SymbolsMapTokens["&"] = exports.EnumToken.NestingSelectorTokenType;
|
|
@@ -27605,7 +27625,6 @@ class Tokenizer {
|
|
|
27605
27625
|
if (codepoint == 92 /* TokenMap.REVERSE_SOLIDUS */) {
|
|
27606
27626
|
// eof
|
|
27607
27627
|
if ((codepoint = parseInfo.stream.charCodeAt(position + 1)) != codepoint) {
|
|
27608
|
-
// this.next(parseInfo, position);
|
|
27609
27628
|
return 0;
|
|
27610
27629
|
}
|
|
27611
27630
|
// \n \r \f \v
|
|
@@ -28378,7 +28397,7 @@ class Tokenizer {
|
|
|
28378
28397
|
return this.makeToken(parseInfo, exports.EnumToken.DashMatchTokenType);
|
|
28379
28398
|
}
|
|
28380
28399
|
this.advance(parseInfo);
|
|
28381
|
-
return this.makeToken(parseInfo, exports.EnumToken.
|
|
28400
|
+
return this.makeToken(parseInfo, exports.EnumToken.PipeTokenType);
|
|
28382
28401
|
case 33 /* TokenMap.EXCLAMATION */:
|
|
28383
28402
|
if (parseInfo.position < parseInfo.currentPosition) {
|
|
28384
28403
|
return this.makeToken(parseInfo);
|
|
@@ -28444,6 +28463,21 @@ class Tokenizer {
|
|
|
28444
28463
|
return this.makeToken(parseInfo, exports.EnumToken.CDOCOMMTokenType);
|
|
28445
28464
|
}
|
|
28446
28465
|
}
|
|
28466
|
+
{
|
|
28467
|
+
const startPosition = parseInfo.position - parseInfo.offset;
|
|
28468
|
+
let offset = 1;
|
|
28469
|
+
let charCode = parseInfo.stream.charCodeAt(startPosition + offset);
|
|
28470
|
+
if (isLetter(charCode)) {
|
|
28471
|
+
charCode = parseInfo.stream.charCodeAt(++offset + startPosition);
|
|
28472
|
+
while (offset < endPosition && (charCode == 45 /* TokenMap.MINUS */ || isLetter(charCode))) {
|
|
28473
|
+
charCode = parseInfo.stream.charCodeAt(++offset + startPosition);
|
|
28474
|
+
}
|
|
28475
|
+
if (offset > 1 && charCode == 62 /* TokenMap.GREATERTHAN */) {
|
|
28476
|
+
this.advance(parseInfo, offset);
|
|
28477
|
+
return this.makeToken(parseInfo, exports.EnumToken.CssTypeTokenType);
|
|
28478
|
+
}
|
|
28479
|
+
}
|
|
28480
|
+
}
|
|
28447
28481
|
break;
|
|
28448
28482
|
case 35 /* TokenMap.HASH */:
|
|
28449
28483
|
if (parseInfo.position < parseInfo.currentPosition) {
|
|
@@ -31173,6 +31207,9 @@ function parseVisitors(visitorsDef, errors) {
|
|
|
31173
31207
|
let key;
|
|
31174
31208
|
let value;
|
|
31175
31209
|
let i;
|
|
31210
|
+
const allVisitorsHandlers = new Set();
|
|
31211
|
+
const preAllVisitorsHandlers = new Set();
|
|
31212
|
+
const postAllVisitorsHandlers = new Set();
|
|
31176
31213
|
const valuesHandlers = new Map();
|
|
31177
31214
|
const preValuesHandlers = new Map();
|
|
31178
31215
|
const postValuesHandlers = new Map();
|
|
@@ -31273,6 +31310,21 @@ function parseVisitors(visitorsDef, errors) {
|
|
|
31273
31310
|
errors.push({ action: "ignore", message: `doParse: visitor.${key} is not a valid key name` });
|
|
31274
31311
|
}
|
|
31275
31312
|
}
|
|
31313
|
+
else if (key == "All" || key == "visitor") {
|
|
31314
|
+
if (typeof value == "function") {
|
|
31315
|
+
allVisitorsHandlers.add(value);
|
|
31316
|
+
}
|
|
31317
|
+
else if (typeof value == "object") {
|
|
31318
|
+
if ("type" in value && "handler" in value && value.type in exports.WalkerEvent) {
|
|
31319
|
+
if (value.type == exports.WalkerEvent.Enter) {
|
|
31320
|
+
preAllVisitorsHandlers.add(value.handler);
|
|
31321
|
+
}
|
|
31322
|
+
else if (value.type == exports.WalkerEvent.Leave) {
|
|
31323
|
+
postAllVisitorsHandlers.add(value.handler);
|
|
31324
|
+
}
|
|
31325
|
+
}
|
|
31326
|
+
}
|
|
31327
|
+
}
|
|
31276
31328
|
else {
|
|
31277
31329
|
errors.push({ action: "ignore", message: `doParse: visitor.${key} is not a valid key name` });
|
|
31278
31330
|
}
|
|
@@ -31296,10 +31348,25 @@ function parseVisitors(visitorsDef, errors) {
|
|
|
31296
31348
|
if (postValuesHandlers.size > 0) {
|
|
31297
31349
|
allHandlers.push(postValuesHandlers);
|
|
31298
31350
|
}
|
|
31299
|
-
|
|
31351
|
+
const result = {
|
|
31300
31352
|
allHandlers,
|
|
31301
|
-
includeTokens: preValuesHandlers.size > 0 ||
|
|
31353
|
+
includeTokens: preValuesHandlers.size > 0 ||
|
|
31354
|
+
valuesHandlers.size > 0 ||
|
|
31355
|
+
postValuesHandlers.size > 0 ||
|
|
31356
|
+
allVisitorsHandlers.size > 0 ||
|
|
31357
|
+
preAllVisitorsHandlers.size > 0 ||
|
|
31358
|
+
postAllVisitorsHandlers.size > 0,
|
|
31302
31359
|
};
|
|
31360
|
+
if (allVisitorsHandlers.size > 0) {
|
|
31361
|
+
result.allVisitorsHandlers = allVisitorsHandlers;
|
|
31362
|
+
}
|
|
31363
|
+
if (preAllVisitorsHandlers.size > 0) {
|
|
31364
|
+
result.preAllVisitorsHandlers = preAllVisitorsHandlers;
|
|
31365
|
+
}
|
|
31366
|
+
if (postAllVisitorsHandlers.size > 0) {
|
|
31367
|
+
result.postAllVisitorsHandlers = postAllVisitorsHandlers;
|
|
31368
|
+
}
|
|
31369
|
+
return result;
|
|
31303
31370
|
}
|
|
31304
31371
|
/**
|
|
31305
31372
|
* Parse css string
|
|
@@ -31372,12 +31439,10 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31372
31439
|
// @ts-ignore ignore error
|
|
31373
31440
|
let parensMatch = 0;
|
|
31374
31441
|
let curlyBracketMatch = 0;
|
|
31375
|
-
// let currentItemIndex: number;
|
|
31376
31442
|
ast[LOCSRCID] = options.source.id;
|
|
31377
31443
|
ast[LOCSTA] = 0;
|
|
31378
31444
|
while (!tokenizer.done()) {
|
|
31379
31445
|
tokenizer.next();
|
|
31380
|
-
// item = (iter as Array<TokenizeResult>)[currentItemIndex];
|
|
31381
31446
|
if (tokenizer.unit != null) {
|
|
31382
31447
|
item = {
|
|
31383
31448
|
typ: tokenizer.typ,
|
|
@@ -31523,7 +31588,6 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31523
31588
|
parensMatch = 0;
|
|
31524
31589
|
curlyBracketMatch = 0;
|
|
31525
31590
|
}
|
|
31526
|
-
// }
|
|
31527
31591
|
}
|
|
31528
31592
|
if (tokens.length > 0) {
|
|
31529
31593
|
node = parseNode(tokens, context, options, errors, stats, invalidNodes);
|
|
@@ -31593,6 +31657,9 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31593
31657
|
}
|
|
31594
31658
|
parens = null;
|
|
31595
31659
|
handlers.length = 0;
|
|
31660
|
+
if (visitors.preAllVisitorsHandlers?.size > 0) {
|
|
31661
|
+
handlers.push(...visitors.preAllVisitorsHandlers);
|
|
31662
|
+
}
|
|
31596
31663
|
genericKey =
|
|
31597
31664
|
nodes[i].typ == exports.EnumToken.DeclarationNodeType
|
|
31598
31665
|
? "Declaration"
|
|
@@ -31612,6 +31679,9 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31612
31679
|
: nodes[i].typ == exports.EnumToken.KeyframesAtRuleNodeType
|
|
31613
31680
|
? camelize(nodes[i].val)
|
|
31614
31681
|
: null;
|
|
31682
|
+
if (visitors.allVisitorsHandlers?.size > 0) {
|
|
31683
|
+
handlers.push(...visitors.allVisitorsHandlers);
|
|
31684
|
+
}
|
|
31615
31685
|
for (const map of visitors.allHandlers) {
|
|
31616
31686
|
// @ts-ignore
|
|
31617
31687
|
if (genericKey != null && map.has(genericKey)) {
|
|
@@ -31620,20 +31690,6 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31620
31690
|
if (typeof handler == "function") {
|
|
31621
31691
|
handlers.push(handler);
|
|
31622
31692
|
}
|
|
31623
|
-
// else if (Array.isArray(handler)) {
|
|
31624
|
-
// for (const h of handler) {
|
|
31625
|
-
// if (typeof h == "function") {
|
|
31626
|
-
// handlers.push(h);
|
|
31627
|
-
// }
|
|
31628
|
-
// // @ts-ignore
|
|
31629
|
-
// else if (h[keyName] != null) {
|
|
31630
|
-
// // @ts-ignore
|
|
31631
|
-
// handlers.push(h[keyName]);
|
|
31632
|
-
// }
|
|
31633
|
-
// }
|
|
31634
|
-
// } else if (typeof handler.handler! == "function") {
|
|
31635
|
-
// handlers.push(handler.handler);
|
|
31636
|
-
// }
|
|
31637
31693
|
// @ts-ignore
|
|
31638
31694
|
else if (typeof handler[keyName] == "function") {
|
|
31639
31695
|
// @ts-ignore
|
|
@@ -31666,6 +31722,9 @@ function doParseSync(tokenizer, options = {}) {
|
|
|
31666
31722
|
}
|
|
31667
31723
|
}
|
|
31668
31724
|
}
|
|
31725
|
+
if (visitors.postAllVisitorsHandlers?.size > 0) {
|
|
31726
|
+
handlers.push(...visitors.postAllVisitorsHandlers);
|
|
31727
|
+
}
|
|
31669
31728
|
if (handlers.length == 0) {
|
|
31670
31729
|
continue;
|
|
31671
31730
|
}
|
|
@@ -32585,6 +32644,9 @@ async function doParse(iter, options = {}) {
|
|
|
32585
32644
|
}
|
|
32586
32645
|
parens = null;
|
|
32587
32646
|
handlers.length = 0;
|
|
32647
|
+
if (visitors.preAllVisitorsHandlers?.size > 0) {
|
|
32648
|
+
handlers.push(...visitors.preAllVisitorsHandlers);
|
|
32649
|
+
}
|
|
32588
32650
|
genericKey =
|
|
32589
32651
|
nodes[i].typ == exports.EnumToken.DeclarationNodeType
|
|
32590
32652
|
? "Declaration"
|
|
@@ -32604,6 +32666,9 @@ async function doParse(iter, options = {}) {
|
|
|
32604
32666
|
: nodes[i].typ == exports.EnumToken.KeyframesAtRuleNodeType
|
|
32605
32667
|
? camelize(nodes[i].val)
|
|
32606
32668
|
: null;
|
|
32669
|
+
if (visitors.allVisitorsHandlers?.size > 0) {
|
|
32670
|
+
handlers.push(...visitors.allVisitorsHandlers);
|
|
32671
|
+
}
|
|
32607
32672
|
for (const map of visitors.allHandlers) {
|
|
32608
32673
|
// @ts-ignore
|
|
32609
32674
|
if (genericKey != null && map.has(genericKey)) {
|
|
@@ -32658,6 +32723,9 @@ async function doParse(iter, options = {}) {
|
|
|
32658
32723
|
}
|
|
32659
32724
|
}
|
|
32660
32725
|
}
|
|
32726
|
+
if (visitors.postAllVisitorsHandlers?.size > 0) {
|
|
32727
|
+
handlers.push(...visitors.postAllVisitorsHandlers);
|
|
32728
|
+
}
|
|
32661
32729
|
if (handlers.length == 0) {
|
|
32662
32730
|
continue;
|
|
32663
32731
|
}
|
|
@@ -33518,7 +33586,6 @@ function parseAtRule(stream, context, options, errors, parseAsBlock = null) {
|
|
|
33518
33586
|
const syntax = syntaxRules?.getPreludeRules()?.slice?.(1);
|
|
33519
33587
|
const blockAllowed = syntaxRules?.getBlockRules() != null;
|
|
33520
33588
|
if (syntaxRules == null) {
|
|
33521
|
-
// if (!options.lenient) {
|
|
33522
33589
|
errors.push({
|
|
33523
33590
|
action: "drop",
|
|
33524
33591
|
node: atRule,
|
|
@@ -34235,7 +34302,7 @@ function parseAtRule(stream, context, options, errors, parseAsBlock = null) {
|
|
|
34235
34302
|
stream[index][LOCEND] = stream[i][LOCEND];
|
|
34236
34303
|
Object.assign(stream[index], {
|
|
34237
34304
|
typ: tokensfuncDefMap.get(stream[index].typ),
|
|
34238
|
-
chi: stream.splice(index + 1, i - index - 1),
|
|
34305
|
+
chi: trimWhiteSpaceTokens(stream.splice(index + 1, i - index - 1)),
|
|
34239
34306
|
});
|
|
34240
34307
|
i = index;
|
|
34241
34308
|
stream.splice(index + 1, 1);
|
|
@@ -34707,6 +34774,8 @@ function setNodeProperty(node, key, value) {
|
|
|
34707
34774
|
}
|
|
34708
34775
|
}
|
|
34709
34776
|
|
|
34777
|
+
var version = "1.6.9";
|
|
34778
|
+
|
|
34710
34779
|
/**
|
|
34711
34780
|
* Load file or url
|
|
34712
34781
|
* @param url
|
|
@@ -35190,5 +35259,6 @@ exports.setNodeProperty = setNodeProperty;
|
|
|
35190
35259
|
exports.transform = transform;
|
|
35191
35260
|
exports.transformFile = transformFile;
|
|
35192
35261
|
exports.transformSync = transformSync;
|
|
35262
|
+
exports.version = version;
|
|
35193
35263
|
exports.walk = walk;
|
|
35194
35264
|
exports.walkValues = walkValues;
|
package/dist/index.d.ts
CHANGED
|
@@ -534,7 +534,7 @@ declare enum EnumToken {
|
|
|
534
534
|
/**
|
|
535
535
|
* '|'
|
|
536
536
|
*/
|
|
537
|
-
|
|
537
|
+
PipeTokenType = 109,
|
|
538
538
|
/**
|
|
539
539
|
* '::'
|
|
540
540
|
*/
|
|
@@ -673,6 +673,10 @@ declare enum EnumToken {
|
|
|
673
673
|
* negative infinity token
|
|
674
674
|
*/
|
|
675
675
|
NegativeInfinityTokenType = 143,
|
|
676
|
+
/**
|
|
677
|
+
* CSS type token
|
|
678
|
+
*/
|
|
679
|
+
CssTypeTokenType = 144,
|
|
676
680
|
/**
|
|
677
681
|
* alias for time token type
|
|
678
682
|
*/
|
|
@@ -1070,6 +1074,20 @@ export declare interface IdentToken extends BaseToken {
|
|
|
1070
1074
|
val: string;
|
|
1071
1075
|
}
|
|
1072
1076
|
|
|
1077
|
+
/**
|
|
1078
|
+
* Css type token
|
|
1079
|
+
*/
|
|
1080
|
+
export declare interface CssTypeTokenType extends BaseToken {
|
|
1081
|
+
/**
|
|
1082
|
+
* @inheritdoc
|
|
1083
|
+
*/
|
|
1084
|
+
typ: EnumToken.CssTypeTokenType;
|
|
1085
|
+
/**
|
|
1086
|
+
* css type value
|
|
1087
|
+
*/
|
|
1088
|
+
val: string;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1073
1091
|
/**
|
|
1074
1092
|
* Ident list token
|
|
1075
1093
|
*/
|
|
@@ -2693,6 +2711,7 @@ export declare type Token$1 =
|
|
|
2693
2711
|
| NaNToken
|
|
2694
2712
|
| InfinityToken
|
|
2695
2713
|
| NegativeInfinityToken
|
|
2714
|
+
| CssTypeTokenType
|
|
2696
2715
|
| EOFToken;
|
|
2697
2716
|
|
|
2698
2717
|
/**
|
|
@@ -3407,6 +3426,7 @@ export declare type GenericVisitorSyncHandler<T> = (
|
|
|
3407
3426
|
export declare type GenericVisitorAstNodeSyncHandlerMap<T> =
|
|
3408
3427
|
| Record<string, GenericVisitorSyncHandler<T>>
|
|
3409
3428
|
| GenericVisitorSyncHandler<T>
|
|
3429
|
+
| Function<T>
|
|
3410
3430
|
| { type: WalkerEvent; handler: GenericVisitorSyncHandler<T> }
|
|
3411
3431
|
| { type: WalkerEvent; handler: Record<string, GenericVisitorSyncHandler<T>> };
|
|
3412
3432
|
|
|
@@ -3978,6 +3998,32 @@ export declare interface VisitorNodeMap {
|
|
|
3978
3998
|
[key: keyof typeof EnumToken]: GenericVisitorAstNodeHandlerMap<Token> | GenericVisitorAstNodeHandlerMap<AstNode>;
|
|
3979
3999
|
}
|
|
3980
4000
|
|
|
4001
|
+
/**
|
|
4002
|
+
* Parsed visitor handlers
|
|
4003
|
+
*/
|
|
4004
|
+
interface ParsedVisitorHandlers {
|
|
4005
|
+
/**
|
|
4006
|
+
* include tokens
|
|
4007
|
+
*/
|
|
4008
|
+
includeTokens: boolean;
|
|
4009
|
+
/**
|
|
4010
|
+
* all handlers
|
|
4011
|
+
*/
|
|
4012
|
+
allHandlers: Array<GenericVisitorAstNodeHandlerMap | Record<string, GenericVisitorAstNodeHandlerMap>>;
|
|
4013
|
+
/**
|
|
4014
|
+
* all visitors
|
|
4015
|
+
*/
|
|
4016
|
+
allVisitorsHandlers?: Set<GenericVisitorHandler<Token>> | Set<GenericVisitorHandler<AstNode>>;
|
|
4017
|
+
/**
|
|
4018
|
+
* pre all visitors
|
|
4019
|
+
*/
|
|
4020
|
+
preAllVisitorsHandlers?: Set<GenericVisitorHandler<Token>> | Set<GenericVisitorHandler<AstNode>>;
|
|
4021
|
+
/**
|
|
4022
|
+
* post all visitors
|
|
4023
|
+
*/
|
|
4024
|
+
postAllVisitorsHandlers?: Set<GenericVisitorHandler<Token>> | Set<GenericVisitorHandler<AstNode>>;
|
|
4025
|
+
}
|
|
4026
|
+
|
|
3981
4027
|
/**
|
|
3982
4028
|
* Generate and parse source map
|
|
3983
4029
|
*
|
|
@@ -6641,6 +6687,8 @@ declare function setNodeProperty(node: AstNode$1, key: 'errors', value: ErrorDes
|
|
|
6641
6687
|
*/
|
|
6642
6688
|
declare function setNodeProperty(node: AstNode$1, key: 'tokens', value: Token$1[] | null): void;
|
|
6643
6689
|
|
|
6690
|
+
declare let version: string;
|
|
6691
|
+
|
|
6644
6692
|
/**
|
|
6645
6693
|
* Load file or url
|
|
6646
6694
|
* @param url
|
|
@@ -7028,5 +7076,5 @@ declare function transform(options: ParseInputStreamOptions & TransformOptions):
|
|
|
7028
7076
|
*/
|
|
7029
7077
|
declare function transform(options: ParseInputFileOptions & TransformOptions): Promise<TransformResult>;
|
|
7030
7078
|
|
|
7031
|
-
export { ColorType$1 as ColorType, EnumAstNodeStatus$1 as EnumAstNodeStatus, EnumToken, FeatureWalkMode, ModuleCaseTransformEnum, ModuleScopeEnumOptions, ResponseType, SourceMap, ValidationLevel, WalkerEvent, WalkerOptionEnum, cloneNode, convertColor, dirname, expand, find, findAll, findByValue, findLast, getNodeProperty, isOkLabClose, load, minify, okLabDistance, parse, parseDeclarations, parseFile, parseString, parseSync, render, renderValue as renderToken, replaceNodeOrValue, resolve, setNodeProperty, transform, transformFile, transformSync, walk, walkValues };
|
|
7032
|
-
export type { AddToken, AndToken, AngleToken, AstAtRule, AstComment, AstDeclaration, AstInvalidAtRule, AstInvalidDeclaration, AstInvalidRule, AstKeyframesAtRule, AstKeyframesRule, AstNode$1 as AstNode, AstNodeStatus, AstRule, AstRuleList, AstStyleSheet, AstValueMatcher, AtRuleToken, AtRuleVisitorHandler, AttrEndToken, AttrStartToken, AttrToken, Background, BackgroundAttachmentMapping, BackgroundPosition, BackgroundPositionClass, BackgroundPositionConstraints, BackgroundPositionMapping, BackgroundProperties, BackgroundRepeat, BackgroundRepeatMapping, BackgroundSize, BackgroundSizeMapping, BadCDOCommentToken, BadCommentToken, BadStringToken, BadUrlToken, BaseToken, BinaryExpressionNode, BinaryExpressionToken, BlockEndToken, BlockStartToken, Border, BorderColor, BorderColorClass, BorderProperties, BorderRadius, CDOCommentToken, ChildCombinatorToken, ClassSelectorToken, ColonToken, ColorToken, ColumnCombinatorToken, CommaToken, CommentToken, ComposesSelectorToken, ConstraintsMapping, ContainMatchToken, ContainerStyleRangeToken, CssVariableImportTokenType, CssVariableMapTokenType, CssVariableToken, DashMatchToken, DashedIdentToken, DeclarationVisitorHandler, DelimToken, DescendantCombinatorToken, DimensionToken, DivToken, DoubleColonToken, EOFToken, EndMatchToken, EqualMatchToken, ErrorDescription$1 as ErrorDescription, FlexToken, Font, FontFamily, FontProperties, FontWeight, FontWeightConstraints, FontWeightMapping, FractionToken, FrequencyToken, FunctionDefToken, FunctionImageToken, FunctionToken, FunctionURLToken, GenericVisitorAstNodeHandlerMap, GenericVisitorAstNodeSyncHandlerMap, GenericVisitorAsyncResult, GenericVisitorHandler, GenericVisitorResult, GenericVisitorSyncHandler, GenericVisitorSyncResult, GreaterThanOrEqualToken, GreaterThanToken, GridTemplateFuncToken, HashToken, IdentListToken, IdentToken, IfConditionToken, IfElseConditionToken, ImportantToken, IncludeMatchToken, InfinityToken, InvalidAttrToken, InvalidClassSelectorToken, InvalidMediaQueryToken, LengthToken, LessThanOrEqualToken, LessThanToken, LineHeight, ListToken, LiteralToken, LoadResult, Map$1 as Map, MatchExpressionToken, MatchedSelector, MediaFeatureOnlyToken, MediaFeatureToken, MediaQueryConditionToken, MediaQueryUnaryFeatureToken, MediaRangeQueryToken, MinifyFeature, MinifyFeatureOptions, MinifyOptions, ModuleAsyncOptions, ModuleSyncOptions, MulToken, NaNToken, NameSpaceAttributeToken, NegativeInfinityToken, NestingSelectorToken, NextSiblingCombinatorToken, NotToken, NumberToken, OptimizedSelector, OptimizedSelectorToken, OrToken, Outline, OutlineProperties, ParensEndToken, ParensStartToken, ParensToken, ParseInfo$1 as ParseInfo, ParseInputFileOptions, ParseInputOptions, ParseInputStreamOptions, ParseResult, ParseResultStats, ParseSourceOptions, ParseTokenOptions, ParserOptions, ParserSourceMapOptions, ParserSyncOptions, PercentageToken, Prefix, PropertiesConfig, PropertiesConfigProperties, PropertyListOptions, PropertyMapType, PropertySetType, PropertyType, PseudoClassFunctionToken, PseudoClassToken, PseudoElementToken, PseudoPageToken, PurpleBackgroundAttachment, RawNodeToken, RawSelectorTokens, RenderOptions, RenderResult, ResolutionToken, ResolvedPath, RuleVisitorHandler, SemiColonToken, Separator, ShorthandDef, ShorthandMapType, ShorthandProperties, ShorthandPropertyType, ShorthandType, SinglePropertyType, SinglePropertyTypeMapping, SourceLocation, SourceMapObject, StartMatchToken, StringToken, SubToken, SubsequentCombinatorToken, SupportsQueryConditionToken, SupportsQueryUnaryConditionToken, TimeToken, TimelineFunctionToken, TimingFunctionToken, Token$1 as Token, TokenSearchResult, TokenizeResult, TransformOptions, TransformResult, TransformSyncOptions, UnaryExpression, UnaryExpressionNode, UnclosedStringToken, UniversalSelectorToken, UrlToken, ValidationConfiguration, ValidationMediaFeature, ValidationOptions, ValidationResult, ValidationSelectorOptions, ValidationSyntaxNode, ValidationSyntaxResult, ValidationToken$1 as ValidationToken, Value, ValueVisitorHandler, ValueVisitorSyncHandler, VariableScopeInfo, VisitorNodeMap, VisitorSyncNodeMap, WalkAttributesResult, WalkResult, WalkerFilter, WalkerOption, WalkerOptions, WalkerValueFilter, WhenElseQueryConditionToken, WhenElseUnaryConditionToken, WhitespaceToken, WrappedValuesToken };
|
|
7079
|
+
export { ColorType$1 as ColorType, EnumAstNodeStatus$1 as EnumAstNodeStatus, EnumToken, FeatureWalkMode, ModuleCaseTransformEnum, ModuleScopeEnumOptions, ResponseType, SourceMap, ValidationLevel, WalkerEvent, WalkerOptionEnum, cloneNode, convertColor, dirname, expand, find, findAll, findByValue, findLast, getNodeProperty, isOkLabClose, load, minify, okLabDistance, parse, parseDeclarations, parseFile, parseString, parseSync, render, renderValue as renderToken, replaceNodeOrValue, resolve, setNodeProperty, transform, transformFile, transformSync, version, walk, walkValues };
|
|
7080
|
+
export type { AddToken, AndToken, AngleToken, AstAtRule, AstComment, AstDeclaration, AstInvalidAtRule, AstInvalidDeclaration, AstInvalidRule, AstKeyframesAtRule, AstKeyframesRule, AstNode$1 as AstNode, AstNodeStatus, AstRule, AstRuleList, AstStyleSheet, AstValueMatcher, AtRuleToken, AtRuleVisitorHandler, AttrEndToken, AttrStartToken, AttrToken, Background, BackgroundAttachmentMapping, BackgroundPosition, BackgroundPositionClass, BackgroundPositionConstraints, BackgroundPositionMapping, BackgroundProperties, BackgroundRepeat, BackgroundRepeatMapping, BackgroundSize, BackgroundSizeMapping, BadCDOCommentToken, BadCommentToken, BadStringToken, BadUrlToken, BaseToken, BinaryExpressionNode, BinaryExpressionToken, BlockEndToken, BlockStartToken, Border, BorderColor, BorderColorClass, BorderProperties, BorderRadius, CDOCommentToken, ChildCombinatorToken, ClassSelectorToken, ColonToken, ColorToken, ColumnCombinatorToken, CommaToken, CommentToken, ComposesSelectorToken, ConstraintsMapping, ContainMatchToken, ContainerStyleRangeToken, CssTypeTokenType, CssVariableImportTokenType, CssVariableMapTokenType, CssVariableToken, DashMatchToken, DashedIdentToken, DeclarationVisitorHandler, DelimToken, DescendantCombinatorToken, DimensionToken, DivToken, DoubleColonToken, EOFToken, EndMatchToken, EqualMatchToken, ErrorDescription$1 as ErrorDescription, FlexToken, Font, FontFamily, FontProperties, FontWeight, FontWeightConstraints, FontWeightMapping, FractionToken, FrequencyToken, FunctionDefToken, FunctionImageToken, FunctionToken, FunctionURLToken, GenericVisitorAstNodeHandlerMap, GenericVisitorAstNodeSyncHandlerMap, GenericVisitorAsyncResult, GenericVisitorHandler, GenericVisitorResult, GenericVisitorSyncHandler, GenericVisitorSyncResult, GreaterThanOrEqualToken, GreaterThanToken, GridTemplateFuncToken, HashToken, IdentListToken, IdentToken, IfConditionToken, IfElseConditionToken, ImportantToken, IncludeMatchToken, InfinityToken, InvalidAttrToken, InvalidClassSelectorToken, InvalidMediaQueryToken, LengthToken, LessThanOrEqualToken, LessThanToken, LineHeight, ListToken, LiteralToken, LoadResult, Map$1 as Map, MatchExpressionToken, MatchedSelector, MediaFeatureOnlyToken, MediaFeatureToken, MediaQueryConditionToken, MediaQueryUnaryFeatureToken, MediaRangeQueryToken, MinifyFeature, MinifyFeatureOptions, MinifyOptions, ModuleAsyncOptions, ModuleSyncOptions, MulToken, NaNToken, NameSpaceAttributeToken, NegativeInfinityToken, NestingSelectorToken, NextSiblingCombinatorToken, NotToken, NumberToken, OptimizedSelector, OptimizedSelectorToken, OrToken, Outline, OutlineProperties, ParensEndToken, ParensStartToken, ParensToken, ParseInfo$1 as ParseInfo, ParseInputFileOptions, ParseInputOptions, ParseInputStreamOptions, ParseResult, ParseResultStats, ParseSourceOptions, ParseTokenOptions, ParsedVisitorHandlers, ParserOptions, ParserSourceMapOptions, ParserSyncOptions, PercentageToken, Prefix, PropertiesConfig, PropertiesConfigProperties, PropertyListOptions, PropertyMapType, PropertySetType, PropertyType, PseudoClassFunctionToken, PseudoClassToken, PseudoElementToken, PseudoPageToken, PurpleBackgroundAttachment, RawNodeToken, RawSelectorTokens, RenderOptions, RenderResult, ResolutionToken, ResolvedPath, RuleVisitorHandler, SemiColonToken, Separator, ShorthandDef, ShorthandMapType, ShorthandProperties, ShorthandPropertyType, ShorthandType, SinglePropertyType, SinglePropertyTypeMapping, SourceLocation, SourceMapObject, StartMatchToken, StringToken, SubToken, SubsequentCombinatorToken, SupportsQueryConditionToken, SupportsQueryUnaryConditionToken, TimeToken, TimelineFunctionToken, TimingFunctionToken, Token$1 as Token, TokenSearchResult, TokenizeResult, TransformOptions, TransformResult, TransformSyncOptions, UnaryExpression, UnaryExpressionNode, UnclosedStringToken, UniversalSelectorToken, UrlToken, ValidationConfiguration, ValidationMediaFeature, ValidationOptions, ValidationResult, ValidationSelectorOptions, ValidationSyntaxNode, ValidationSyntaxResult, ValidationToken$1 as ValidationToken, Value, ValueVisitorHandler, ValueVisitorSyncHandler, VariableScopeInfo, VisitorNodeMap, VisitorSyncNodeMap, WalkAttributesResult, WalkResult, WalkerFilter, WalkerOption, WalkerOptions, WalkerValueFilter, WhenElseQueryConditionToken, WhenElseUnaryConditionToken, WhitespaceToken, WrappedValuesToken };
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { splitRule } from './minify.js';
|
|
2
9
|
import { STATE, PARENT, combinators, RAW } from '../syntax/constants.js';
|
|
3
10
|
import { parseString } from '../parser/parse.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { EnumToken } from '../types.js';
|
|
2
9
|
import { walkValues } from '../walk.js';
|
|
3
10
|
import { evaluate } from '../math/expression.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { EnumToken } from '../types.js';
|
|
2
9
|
import { renderValue } from '../../printer/render.js';
|
|
3
10
|
import { FeatureWalkMode } from './type.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
export { ComputePrefixFeature } from './prefix.js';
|
|
2
9
|
export { InlineCssVariablesFeature } from './inlinecssvariables.js';
|
|
3
10
|
export { ComputeShorthandFeature } from './shorthand.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { EnumToken } from '../types.js';
|
|
2
9
|
import { walkValues } from '../walk.js';
|
|
3
10
|
import { renderValue } from '../../printer/render.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { EnumAstNodeStatus, EnumToken } from '../types.js';
|
|
2
9
|
import { walkValues } from '../walk.js';
|
|
3
10
|
import { pseudoAliasMap } from '../../syntax/syntax.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { PropertyList } from '../../parser/declaration/list.js';
|
|
2
9
|
import { EnumToken } from '../types.js';
|
|
3
10
|
import { FeatureWalkMode } from './type.js';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
CSS parser, minifier and validator for node and the browser
|
|
3
|
+
|
|
4
|
+
Author(s): Thierry Bela
|
|
5
|
+
Version: 1.6.9
|
|
6
|
+
License: MIT
|
|
7
|
+
*/
|
|
1
8
|
import { EnumToken, EnumAstNodeStatus } from '../types.js';
|
|
2
9
|
import { compute } from '../transform/compute.js';
|
|
3
10
|
import { filterValues, renderValue } from '../../printer/render.js';
|