vite 2.0.4 → 2.1.2
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/CHANGELOG.md +60 -0
- package/LICENSE.md +210 -30
- package/dist/node/chunks/{dep-4a30cab3.js → dep-0c7ee4d5.js} +18 -18
- package/dist/node/chunks/{dep-f45d34a0.js → dep-0f464c78.js} +2 -2
- package/dist/node/chunks/{dep-2192e50e.js → dep-685e7ba2.js} +7 -7
- package/dist/node/chunks/{dep-73de6751.js → dep-8a660aa5.js} +159 -159
- package/dist/node/chunks/{dep-e293f0bf.js → dep-ce592790.js} +345 -345
- package/dist/node/chunks/{dep-1bdbec90.js → dep-efe32886.js} +39660 -38798
- package/dist/node/chunks/{dep-47146891.js → dep-fbc42d74.js} +455 -455
- package/dist/node/cli.js +59 -49
- package/dist/node/index.d.ts +3 -1
- package/dist/node/index.js +2 -1
- package/dist/node/terser.js +52 -52
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var build = require('./dep-
|
|
3
|
+
var build = require('./dep-efe32886.js');
|
|
4
4
|
var os = require('os');
|
|
5
5
|
var http = require('http');
|
|
6
6
|
var https = require('https');
|
|
@@ -22,7 +22,7 @@ function level0Optimize(tokens) {
|
|
|
22
22
|
return tokens;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var optimize = level0Optimize;
|
|
25
|
+
var optimize$3 = level0Optimize;
|
|
26
26
|
|
|
27
27
|
var COLORS = {
|
|
28
28
|
aliceblue: '#f0f8ff',
|
|
@@ -319,7 +319,7 @@ function tryParseInt(value) {
|
|
|
319
319
|
|
|
320
320
|
var naturalCompare_1 = naturalCompare;
|
|
321
321
|
|
|
322
|
-
function naturalSorter(scope1, scope2) {
|
|
322
|
+
function naturalSorter$1(scope1, scope2) {
|
|
323
323
|
return naturalCompare_1(scope1[1], scope2[1]);
|
|
324
324
|
}
|
|
325
325
|
|
|
@@ -330,7 +330,7 @@ function standardSorter(scope1, scope2) {
|
|
|
330
330
|
function sortSelectors(selectors, method) {
|
|
331
331
|
switch (method) {
|
|
332
332
|
case 'natural':
|
|
333
|
-
return selectors.sort(naturalSorter);
|
|
333
|
+
return selectors.sort(naturalSorter$1);
|
|
334
334
|
case 'standard':
|
|
335
335
|
return selectors.sort(standardSorter);
|
|
336
336
|
case 'none':
|
|
@@ -341,7 +341,7 @@ function sortSelectors(selectors, method) {
|
|
|
341
341
|
|
|
342
342
|
var sortSelectors_1 = sortSelectors;
|
|
343
343
|
|
|
344
|
-
function override(source1, source2) {
|
|
344
|
+
function override$1(source1, source2) {
|
|
345
345
|
var target = {};
|
|
346
346
|
var key1;
|
|
347
347
|
var key2;
|
|
@@ -353,7 +353,7 @@ function override(source1, source2) {
|
|
|
353
353
|
if (Array.isArray(item)) {
|
|
354
354
|
target[key1] = item.slice(0);
|
|
355
355
|
} else if (typeof item == 'object' && item !== null) {
|
|
356
|
-
target[key1] = override(item, {});
|
|
356
|
+
target[key1] = override$1(item, {});
|
|
357
357
|
} else {
|
|
358
358
|
target[key1] = item;
|
|
359
359
|
}
|
|
@@ -365,7 +365,7 @@ function override(source1, source2) {
|
|
|
365
365
|
if (key2 in target && Array.isArray(item)) {
|
|
366
366
|
target[key2] = item.slice(0);
|
|
367
367
|
} else if (key2 in target && typeof item == 'object' && item !== null) {
|
|
368
|
-
target[key2] = override(target[key2], item);
|
|
368
|
+
target[key2] = override$1(target[key2], item);
|
|
369
369
|
} else {
|
|
370
370
|
target[key2] = item;
|
|
371
371
|
}
|
|
@@ -374,13 +374,13 @@ function override(source1, source2) {
|
|
|
374
374
|
return target;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
var override_1 = override;
|
|
377
|
+
var override_1 = override$1;
|
|
378
378
|
|
|
379
379
|
var systemLineBreak = os__default.EOL;
|
|
380
380
|
|
|
381
381
|
|
|
382
382
|
|
|
383
|
-
var Breaks = {
|
|
383
|
+
var Breaks$1 = {
|
|
384
384
|
AfterAtRule: 'afterAtRule',
|
|
385
385
|
AfterBlockBegins: 'afterBlockBegins',
|
|
386
386
|
AfterBlockEnds: 'afterBlockEnds',
|
|
@@ -403,13 +403,13 @@ var IndentWith = {
|
|
|
403
403
|
Tab: '\t'
|
|
404
404
|
};
|
|
405
405
|
|
|
406
|
-
var Spaces = {
|
|
406
|
+
var Spaces$2 = {
|
|
407
407
|
AroundSelectorRelation: 'aroundSelectorRelation',
|
|
408
408
|
BeforeBlockBegins: 'beforeBlockBegins',
|
|
409
409
|
BeforeValue: 'beforeValue'
|
|
410
410
|
};
|
|
411
411
|
|
|
412
|
-
var DEFAULTS = {
|
|
412
|
+
var DEFAULTS$2 = {
|
|
413
413
|
breaks: breaks(false),
|
|
414
414
|
breakWith: BreakWith.System,
|
|
415
415
|
indentBy: 0,
|
|
@@ -422,28 +422,28 @@ var DEFAULTS = {
|
|
|
422
422
|
var BEAUTIFY_ALIAS = 'beautify';
|
|
423
423
|
var KEEP_BREAKS_ALIAS = 'keep-breaks';
|
|
424
424
|
|
|
425
|
-
var OPTION_SEPARATOR = ';';
|
|
425
|
+
var OPTION_SEPARATOR$1 = ';';
|
|
426
426
|
var OPTION_NAME_VALUE_SEPARATOR = ':';
|
|
427
427
|
var HASH_VALUES_OPTION_SEPARATOR = ',';
|
|
428
428
|
var HASH_VALUES_NAME_VALUE_SEPARATOR = '=';
|
|
429
429
|
|
|
430
|
-
var FALSE_KEYWORD_1 = 'false';
|
|
431
|
-
var FALSE_KEYWORD_2 = 'off';
|
|
432
|
-
var TRUE_KEYWORD_1 = 'true';
|
|
433
|
-
var TRUE_KEYWORD_2 = 'on';
|
|
430
|
+
var FALSE_KEYWORD_1$1 = 'false';
|
|
431
|
+
var FALSE_KEYWORD_2$1 = 'off';
|
|
432
|
+
var TRUE_KEYWORD_1$1 = 'true';
|
|
433
|
+
var TRUE_KEYWORD_2$1 = 'on';
|
|
434
434
|
|
|
435
435
|
function breaks(value) {
|
|
436
436
|
var breakOptions = {};
|
|
437
437
|
|
|
438
|
-
breakOptions[Breaks.AfterAtRule] = value;
|
|
439
|
-
breakOptions[Breaks.AfterBlockBegins] = value;
|
|
440
|
-
breakOptions[Breaks.AfterBlockEnds] = value;
|
|
441
|
-
breakOptions[Breaks.AfterComment] = value;
|
|
442
|
-
breakOptions[Breaks.AfterProperty] = value;
|
|
443
|
-
breakOptions[Breaks.AfterRuleBegins] = value;
|
|
444
|
-
breakOptions[Breaks.AfterRuleEnds] = value;
|
|
445
|
-
breakOptions[Breaks.BeforeBlockEnds] = value;
|
|
446
|
-
breakOptions[Breaks.BetweenSelectors] = value;
|
|
438
|
+
breakOptions[Breaks$1.AfterAtRule] = value;
|
|
439
|
+
breakOptions[Breaks$1.AfterBlockBegins] = value;
|
|
440
|
+
breakOptions[Breaks$1.AfterBlockEnds] = value;
|
|
441
|
+
breakOptions[Breaks$1.AfterComment] = value;
|
|
442
|
+
breakOptions[Breaks$1.AfterProperty] = value;
|
|
443
|
+
breakOptions[Breaks$1.AfterRuleBegins] = value;
|
|
444
|
+
breakOptions[Breaks$1.AfterRuleEnds] = value;
|
|
445
|
+
breakOptions[Breaks$1.BeforeBlockEnds] = value;
|
|
446
|
+
breakOptions[Breaks$1.BetweenSelectors] = value;
|
|
447
447
|
|
|
448
448
|
return breakOptions;
|
|
449
449
|
}
|
|
@@ -451,9 +451,9 @@ function breaks(value) {
|
|
|
451
451
|
function spaces(value) {
|
|
452
452
|
var spaceOptions = {};
|
|
453
453
|
|
|
454
|
-
spaceOptions[Spaces.AroundSelectorRelation] = value;
|
|
455
|
-
spaceOptions[Spaces.BeforeBlockBegins] = value;
|
|
456
|
-
spaceOptions[Spaces.BeforeValue] = value;
|
|
454
|
+
spaceOptions[Spaces$2.AroundSelectorRelation] = value;
|
|
455
|
+
spaceOptions[Spaces$2.BeforeBlockBegins] = value;
|
|
456
|
+
spaceOptions[Spaces$2.BeforeValue] = value;
|
|
457
457
|
|
|
458
458
|
return spaceOptions;
|
|
459
459
|
}
|
|
@@ -476,15 +476,15 @@ function formatFrom(source) {
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
if (typeof source == 'object') {
|
|
479
|
-
return override_1(DEFAULTS, source);
|
|
479
|
+
return override_1(DEFAULTS$2, source);
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
if (typeof source == 'object') {
|
|
483
|
-
return override_1(DEFAULTS, source);
|
|
483
|
+
return override_1(DEFAULTS$2, source);
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
if (typeof source == 'string' && source == BEAUTIFY_ALIAS) {
|
|
487
|
-
return override_1(DEFAULTS, {
|
|
487
|
+
return override_1(DEFAULTS$2, {
|
|
488
488
|
breaks: breaks(true),
|
|
489
489
|
indentBy: 2,
|
|
490
490
|
spaces: spaces(true)
|
|
@@ -492,7 +492,7 @@ function formatFrom(source) {
|
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
if (typeof source == 'string' && source == KEEP_BREAKS_ALIAS) {
|
|
495
|
-
return override_1(DEFAULTS, {
|
|
495
|
+
return override_1(DEFAULTS$2, {
|
|
496
496
|
breaks: {
|
|
497
497
|
afterAtRule: true,
|
|
498
498
|
afterBlockBegins: true,
|
|
@@ -505,15 +505,15 @@ function formatFrom(source) {
|
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
if (typeof source == 'string') {
|
|
508
|
-
return override_1(DEFAULTS, toHash(source));
|
|
508
|
+
return override_1(DEFAULTS$2, toHash(source));
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
return DEFAULTS;
|
|
511
|
+
return DEFAULTS$2;
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
function toHash(string) {
|
|
515
515
|
return string
|
|
516
|
-
.split(OPTION_SEPARATOR)
|
|
516
|
+
.split(OPTION_SEPARATOR$1)
|
|
517
517
|
.reduce(function (accumulator, directive) {
|
|
518
518
|
var parts = directive.split(OPTION_NAME_VALUE_SEPARATOR);
|
|
519
519
|
var name = parts[0];
|
|
@@ -541,20 +541,20 @@ function hashValuesToHash(string) {
|
|
|
541
541
|
var name = parts[0];
|
|
542
542
|
var value = parts[1];
|
|
543
543
|
|
|
544
|
-
accumulator[name] = normalizeValue(value);
|
|
544
|
+
accumulator[name] = normalizeValue$1(value);
|
|
545
545
|
|
|
546
546
|
return accumulator;
|
|
547
547
|
}, {});
|
|
548
548
|
}
|
|
549
549
|
|
|
550
550
|
|
|
551
|
-
function normalizeValue(value) {
|
|
551
|
+
function normalizeValue$1(value) {
|
|
552
552
|
switch (value) {
|
|
553
|
-
case FALSE_KEYWORD_1:
|
|
554
|
-
case FALSE_KEYWORD_2:
|
|
553
|
+
case FALSE_KEYWORD_1$1:
|
|
554
|
+
case FALSE_KEYWORD_2$1:
|
|
555
555
|
return false;
|
|
556
|
-
case TRUE_KEYWORD_1:
|
|
557
|
-
case TRUE_KEYWORD_2:
|
|
556
|
+
case TRUE_KEYWORD_1$1:
|
|
557
|
+
case TRUE_KEYWORD_2$1:
|
|
558
558
|
return true;
|
|
559
559
|
default:
|
|
560
560
|
return value;
|
|
@@ -588,8 +588,8 @@ function mapIndentWith(value) {
|
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
var format = {
|
|
591
|
-
Breaks: Breaks,
|
|
592
|
-
Spaces: Spaces,
|
|
591
|
+
Breaks: Breaks$1,
|
|
592
|
+
Spaces: Spaces$2,
|
|
593
593
|
formatFrom: formatFrom
|
|
594
594
|
};
|
|
595
595
|
|
|
@@ -643,8 +643,8 @@ var DOUBLE_QUOTE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g;
|
|
|
643
643
|
var HTML_COMMENT_PATTERN = /^(?:(?:<!--|-->)\s*)+/;
|
|
644
644
|
var SINGLE_QUOTE_CASE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g;
|
|
645
645
|
var SINGLE_QUOTE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g;
|
|
646
|
-
var RELATION_PATTERN = /[>\+~]/;
|
|
647
|
-
var WHITESPACE_PATTERN = /\s/;
|
|
646
|
+
var RELATION_PATTERN$1 = /[>\+~]/;
|
|
647
|
+
var WHITESPACE_PATTERN$1 = /\s/;
|
|
648
648
|
|
|
649
649
|
var ASTERISK_PLUS_HTML_HACK = '*+html ';
|
|
650
650
|
var ASTERISK_FIRST_CHILD_PLUS_HTML_HACK = '*:first-child+html ';
|
|
@@ -665,7 +665,7 @@ function hasInvalidCharacters(value) {
|
|
|
665
665
|
} else if (!isQuote && (character == marker.CLOSE_CURLY_BRACKET || character == marker.EXCLAMATION || character == LESS_THAN || character == marker.SEMICOLON)) {
|
|
666
666
|
isInvalid = true;
|
|
667
667
|
break;
|
|
668
|
-
} else if (!isQuote && i === 0 && RELATION_PATTERN.test(character)) {
|
|
668
|
+
} else if (!isQuote && i === 0 && RELATION_PATTERN$1.test(character)) {
|
|
669
669
|
isInvalid = true;
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
@@ -702,8 +702,8 @@ function removeWhitespace(value, format) {
|
|
|
702
702
|
isNewLineNix = character == marker.NEW_LINE_NIX;
|
|
703
703
|
isNewLineWin = character == marker.NEW_LINE_NIX && value[i - 1] == marker.CARRIAGE_RETURN;
|
|
704
704
|
isQuoted = isSingleQuoted || isDoubleQuoted;
|
|
705
|
-
isRelation = !isAttribute && !isEscaped && roundBracketLevel === 0 && RELATION_PATTERN.test(character);
|
|
706
|
-
isWhitespace = WHITESPACE_PATTERN.test(character);
|
|
705
|
+
isRelation = !isAttribute && !isEscaped && roundBracketLevel === 0 && RELATION_PATTERN$1.test(character);
|
|
706
|
+
isWhitespace = WHITESPACE_PATTERN$1.test(character);
|
|
707
707
|
|
|
708
708
|
if (wasEscaped && isQuoted && isNewLineWin) {
|
|
709
709
|
// swallow escaped new windows lines in comments
|
|
@@ -766,7 +766,7 @@ function removeWhitespace(value, format) {
|
|
|
766
766
|
stripped.join('');
|
|
767
767
|
}
|
|
768
768
|
|
|
769
|
-
function removeQuotes(value) {
|
|
769
|
+
function removeQuotes$1(value) {
|
|
770
770
|
if (value.indexOf('\'') == -1 && value.indexOf('"') == -1) {
|
|
771
771
|
return value;
|
|
772
772
|
}
|
|
@@ -799,7 +799,7 @@ function tidyRules(rules, removeUnsupported, adjacentSpace, format, warnings) {
|
|
|
799
799
|
}
|
|
800
800
|
|
|
801
801
|
reduced = removeWhitespace(reduced, format);
|
|
802
|
-
reduced = removeQuotes(reduced);
|
|
802
|
+
reduced = removeQuotes$1(reduced);
|
|
803
803
|
|
|
804
804
|
if (adjacentSpace && reduced.indexOf('nav') > 0) {
|
|
805
805
|
reduced = reduced.replace(/\+nav(\S|$)/, '+ nav$1');
|
|
@@ -1012,7 +1012,7 @@ function wrapAll(properties, includeVariable, skipProperties) {
|
|
|
1012
1012
|
continue;
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
|
-
single = wrapSingle(property);
|
|
1015
|
+
single = wrapSingle$3(property);
|
|
1016
1016
|
single.all = properties;
|
|
1017
1017
|
single.position = i;
|
|
1018
1018
|
wrapped.unshift(single);
|
|
@@ -1131,7 +1131,7 @@ function stripSuffixHack(property, hackFrom) {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
1134
|
-
function wrapSingle(property) {
|
|
1134
|
+
function wrapSingle$3(property) {
|
|
1135
1135
|
var importantProperty = isImportant(property);
|
|
1136
1136
|
if (importantProperty) {
|
|
1137
1137
|
stripImportant(property);
|
|
@@ -1159,9 +1159,9 @@ function wrapSingle(property) {
|
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
|
|
1162
|
-
var wrapForOptimizing = {
|
|
1162
|
+
var wrapForOptimizing$3 = {
|
|
1163
1163
|
all: wrapAll,
|
|
1164
|
-
single: wrapSingle
|
|
1164
|
+
single: wrapSingle$3
|
|
1165
1165
|
};
|
|
1166
1166
|
|
|
1167
1167
|
var INTEGER_PATTERN = /^\d+$/;
|
|
@@ -1171,11 +1171,11 @@ var DEFAULT_PRECISION = 'off'; // all precision changes are disabled
|
|
|
1171
1171
|
var DIRECTIVES_SEPARATOR = ','; // e.g. *=5,px=3
|
|
1172
1172
|
var DIRECTIVE_VALUE_SEPARATOR = '='; // e.g. *=5
|
|
1173
1173
|
|
|
1174
|
-
function roundingPrecisionFrom(source) {
|
|
1175
|
-
return override_1(defaults(DEFAULT_PRECISION), buildPrecisionFrom(source));
|
|
1174
|
+
function roundingPrecisionFrom$1(source) {
|
|
1175
|
+
return override_1(defaults$1(DEFAULT_PRECISION), buildPrecisionFrom(source));
|
|
1176
1176
|
}
|
|
1177
1177
|
|
|
1178
|
-
function defaults(value) {
|
|
1178
|
+
function defaults$1(value) {
|
|
1179
1179
|
return {
|
|
1180
1180
|
'ch': value,
|
|
1181
1181
|
'cm': value,
|
|
@@ -1206,19 +1206,19 @@ function buildPrecisionFrom(source) {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
|
|
1208
1208
|
if (typeof source == 'number' && source == -1) {
|
|
1209
|
-
return defaults(DEFAULT_PRECISION);
|
|
1209
|
+
return defaults$1(DEFAULT_PRECISION);
|
|
1210
1210
|
}
|
|
1211
1211
|
|
|
1212
1212
|
if (typeof source == 'number') {
|
|
1213
|
-
return defaults(source);
|
|
1213
|
+
return defaults$1(source);
|
|
1214
1214
|
}
|
|
1215
1215
|
|
|
1216
1216
|
if (typeof source == 'string' && INTEGER_PATTERN.test(source)) {
|
|
1217
|
-
return defaults(parseInt(source));
|
|
1217
|
+
return defaults$1(parseInt(source));
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
1220
|
if (typeof source == 'string' && source == DEFAULT_PRECISION) {
|
|
1221
|
-
return defaults(DEFAULT_PRECISION);
|
|
1221
|
+
return defaults$1(DEFAULT_PRECISION);
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
1224
|
if (typeof source == 'object') {
|
|
@@ -1237,7 +1237,7 @@ function buildPrecisionFrom(source) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
1239
|
if (ALL_UNITS.indexOf(name) > -1) {
|
|
1240
|
-
accumulator = override_1(accumulator, defaults(value));
|
|
1240
|
+
accumulator = override_1(accumulator, defaults$1(value));
|
|
1241
1241
|
} else {
|
|
1242
1242
|
accumulator[name] = value;
|
|
1243
1243
|
}
|
|
@@ -1248,14 +1248,14 @@ function buildPrecisionFrom(source) {
|
|
|
1248
1248
|
|
|
1249
1249
|
var roundingPrecision = {
|
|
1250
1250
|
DEFAULT: DEFAULT_PRECISION,
|
|
1251
|
-
roundingPrecisionFrom: roundingPrecisionFrom
|
|
1251
|
+
roundingPrecisionFrom: roundingPrecisionFrom$1
|
|
1252
1252
|
};
|
|
1253
1253
|
|
|
1254
|
-
var roundingPrecisionFrom
|
|
1254
|
+
var roundingPrecisionFrom = roundingPrecision.roundingPrecisionFrom;
|
|
1255
1255
|
|
|
1256
1256
|
|
|
1257
1257
|
|
|
1258
|
-
var OptimizationLevel = {
|
|
1258
|
+
var OptimizationLevel$6 = {
|
|
1259
1259
|
Zero: '0',
|
|
1260
1260
|
One: '1',
|
|
1261
1261
|
Two: '2'
|
|
@@ -1263,8 +1263,8 @@ var OptimizationLevel = {
|
|
|
1263
1263
|
|
|
1264
1264
|
var DEFAULTS$1 = {};
|
|
1265
1265
|
|
|
1266
|
-
DEFAULTS$1[OptimizationLevel.Zero] = {};
|
|
1267
|
-
DEFAULTS$1[OptimizationLevel.One] = {
|
|
1266
|
+
DEFAULTS$1[OptimizationLevel$6.Zero] = {};
|
|
1267
|
+
DEFAULTS$1[OptimizationLevel$6.One] = {
|
|
1268
1268
|
cleanupCharsets: true,
|
|
1269
1269
|
normalizeUrls: true,
|
|
1270
1270
|
optimizeBackground: true,
|
|
@@ -1279,7 +1279,7 @@ DEFAULTS$1[OptimizationLevel.One] = {
|
|
|
1279
1279
|
replaceMultipleZeros: true,
|
|
1280
1280
|
replaceTimeUnits: true,
|
|
1281
1281
|
replaceZeroUnits: true,
|
|
1282
|
-
roundingPrecision: roundingPrecisionFrom
|
|
1282
|
+
roundingPrecision: roundingPrecisionFrom(undefined),
|
|
1283
1283
|
selectorsSortingMethod: 'standard',
|
|
1284
1284
|
specialComments: 'all',
|
|
1285
1285
|
tidyAtRules: true,
|
|
@@ -1287,7 +1287,7 @@ DEFAULTS$1[OptimizationLevel.One] = {
|
|
|
1287
1287
|
tidySelectors: true,
|
|
1288
1288
|
transform: noop
|
|
1289
1289
|
};
|
|
1290
|
-
DEFAULTS$1[OptimizationLevel.Two] = {
|
|
1290
|
+
DEFAULTS$1[OptimizationLevel$6.Two] = {
|
|
1291
1291
|
mergeAdjacentRules: true,
|
|
1292
1292
|
mergeIntoShorthands: true,
|
|
1293
1293
|
mergeMedia: true,
|
|
@@ -1306,22 +1306,22 @@ DEFAULTS$1[OptimizationLevel.Two] = {
|
|
|
1306
1306
|
|
|
1307
1307
|
var ALL_KEYWORD_1 = '*';
|
|
1308
1308
|
var ALL_KEYWORD_2 = 'all';
|
|
1309
|
-
var FALSE_KEYWORD_1
|
|
1310
|
-
var FALSE_KEYWORD_2
|
|
1311
|
-
var TRUE_KEYWORD_1
|
|
1312
|
-
var TRUE_KEYWORD_2
|
|
1309
|
+
var FALSE_KEYWORD_1 = 'false';
|
|
1310
|
+
var FALSE_KEYWORD_2 = 'off';
|
|
1311
|
+
var TRUE_KEYWORD_1 = 'true';
|
|
1312
|
+
var TRUE_KEYWORD_2 = 'on';
|
|
1313
1313
|
|
|
1314
1314
|
var LIST_VALUE_SEPARATOR = ',';
|
|
1315
|
-
var OPTION_SEPARATOR
|
|
1315
|
+
var OPTION_SEPARATOR = ';';
|
|
1316
1316
|
var OPTION_VALUE_SEPARATOR = ':';
|
|
1317
1317
|
|
|
1318
1318
|
function noop() {}
|
|
1319
1319
|
|
|
1320
1320
|
function optimizationLevelFrom(source) {
|
|
1321
1321
|
var level = override_1(DEFAULTS$1, {});
|
|
1322
|
-
var Zero = OptimizationLevel.Zero;
|
|
1323
|
-
var One = OptimizationLevel.One;
|
|
1324
|
-
var Two = OptimizationLevel.Two;
|
|
1322
|
+
var Zero = OptimizationLevel$6.Zero;
|
|
1323
|
+
var One = OptimizationLevel$6.One;
|
|
1324
|
+
var Two = OptimizationLevel$6.Two;
|
|
1325
1325
|
|
|
1326
1326
|
|
|
1327
1327
|
if (undefined === source) {
|
|
@@ -1353,7 +1353,7 @@ function optimizationLevelFrom(source) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
1355
|
if (One in source && 'roundingPrecision' in source[One]) {
|
|
1356
|
-
source[One].roundingPrecision = roundingPrecisionFrom
|
|
1356
|
+
source[One].roundingPrecision = roundingPrecisionFrom(source[One].roundingPrecision);
|
|
1357
1357
|
}
|
|
1358
1358
|
|
|
1359
1359
|
if (Two in source && 'skipProperties' in source[Two] && typeof(source[Two].skipProperties) == 'string') {
|
|
@@ -1365,12 +1365,12 @@ function optimizationLevelFrom(source) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
|
|
1367
1367
|
if (One in source && ALL_KEYWORD_1 in source[One]) {
|
|
1368
|
-
level[One] = override_1(level[One], defaults
|
|
1368
|
+
level[One] = override_1(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_1])));
|
|
1369
1369
|
delete source[One][ALL_KEYWORD_1];
|
|
1370
1370
|
}
|
|
1371
1371
|
|
|
1372
1372
|
if (One in source && ALL_KEYWORD_2 in source[One]) {
|
|
1373
|
-
level[One] = override_1(level[One], defaults
|
|
1373
|
+
level[One] = override_1(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_2])));
|
|
1374
1374
|
delete source[One][ALL_KEYWORD_2];
|
|
1375
1375
|
}
|
|
1376
1376
|
|
|
@@ -1381,12 +1381,12 @@ function optimizationLevelFrom(source) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
|
|
1383
1383
|
if (Two in source && ALL_KEYWORD_1 in source[Two]) {
|
|
1384
|
-
level[Two] = override_1(level[Two], defaults
|
|
1384
|
+
level[Two] = override_1(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_1])));
|
|
1385
1385
|
delete source[Two][ALL_KEYWORD_1];
|
|
1386
1386
|
}
|
|
1387
1387
|
|
|
1388
1388
|
if (Two in source && ALL_KEYWORD_2 in source[Two]) {
|
|
1389
|
-
level[Two] = override_1(level[Two], defaults
|
|
1389
|
+
level[Two] = override_1(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_2])));
|
|
1390
1390
|
delete source[Two][ALL_KEYWORD_2];
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
@@ -1399,7 +1399,7 @@ function optimizationLevelFrom(source) {
|
|
|
1399
1399
|
return level;
|
|
1400
1400
|
}
|
|
1401
1401
|
|
|
1402
|
-
function defaults
|
|
1402
|
+
function defaults(level, value) {
|
|
1403
1403
|
var options = override_1(DEFAULTS$1[level], {});
|
|
1404
1404
|
var key;
|
|
1405
1405
|
|
|
@@ -1412,13 +1412,13 @@ function defaults$1(level, value) {
|
|
|
1412
1412
|
return options;
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
|
-
function normalizeValue
|
|
1415
|
+
function normalizeValue(value) {
|
|
1416
1416
|
switch (value) {
|
|
1417
|
-
case FALSE_KEYWORD_1
|
|
1418
|
-
case FALSE_KEYWORD_2
|
|
1417
|
+
case FALSE_KEYWORD_1:
|
|
1418
|
+
case FALSE_KEYWORD_2:
|
|
1419
1419
|
return false;
|
|
1420
|
-
case TRUE_KEYWORD_1
|
|
1421
|
-
case TRUE_KEYWORD_2
|
|
1420
|
+
case TRUE_KEYWORD_1:
|
|
1421
|
+
case TRUE_KEYWORD_2:
|
|
1422
1422
|
return true;
|
|
1423
1423
|
default:
|
|
1424
1424
|
return value;
|
|
@@ -1451,15 +1451,15 @@ function covertValuesToHashes(source) {
|
|
|
1451
1451
|
|
|
1452
1452
|
function covertToHash(asString, level) {
|
|
1453
1453
|
return asString
|
|
1454
|
-
.split(OPTION_SEPARATOR
|
|
1454
|
+
.split(OPTION_SEPARATOR)
|
|
1455
1455
|
.reduce(function (accumulator, directive) {
|
|
1456
1456
|
var parts = directive.split(OPTION_VALUE_SEPARATOR);
|
|
1457
1457
|
var name = parts[0];
|
|
1458
1458
|
var value = parts[1];
|
|
1459
|
-
var normalizedValue = normalizeValue
|
|
1459
|
+
var normalizedValue = normalizeValue(value);
|
|
1460
1460
|
|
|
1461
1461
|
if (ALL_KEYWORD_1 == name || ALL_KEYWORD_2 == name) {
|
|
1462
|
-
accumulator = override_1(accumulator, defaults
|
|
1462
|
+
accumulator = override_1(accumulator, defaults(level, normalizedValue));
|
|
1463
1463
|
} else {
|
|
1464
1464
|
accumulator[name] = normalizedValue;
|
|
1465
1465
|
}
|
|
@@ -1469,7 +1469,7 @@ function covertToHash(asString, level) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
|
|
1471
1471
|
var optimizationLevel = {
|
|
1472
|
-
OptimizationLevel: OptimizationLevel,
|
|
1472
|
+
OptimizationLevel: OptimizationLevel$6,
|
|
1473
1473
|
optimizationLevelFrom: optimizationLevelFrom,
|
|
1474
1474
|
};
|
|
1475
1475
|
|
|
@@ -1524,8 +1524,8 @@ var split_1 = split;
|
|
|
1524
1524
|
|
|
1525
1525
|
var emptyCharacter = '';
|
|
1526
1526
|
|
|
1527
|
-
var Breaks
|
|
1528
|
-
var Spaces
|
|
1527
|
+
var Breaks = format.Breaks;
|
|
1528
|
+
var Spaces = format.Spaces;
|
|
1529
1529
|
|
|
1530
1530
|
|
|
1531
1531
|
|
|
@@ -1566,7 +1566,7 @@ function disallowsSpace(context, token, valueIndex) {
|
|
|
1566
1566
|
afterComma(token, valueIndex);
|
|
1567
1567
|
}
|
|
1568
1568
|
|
|
1569
|
-
function rules(context, tokens) {
|
|
1569
|
+
function rules$1(context, tokens) {
|
|
1570
1570
|
var store = context.store;
|
|
1571
1571
|
|
|
1572
1572
|
for (var i = 0, l = tokens.length; i < l; i++) {
|
|
@@ -1578,11 +1578,11 @@ function rules(context, tokens) {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
}
|
|
1580
1580
|
|
|
1581
|
-
function body(context, tokens) {
|
|
1581
|
+
function body$1(context, tokens) {
|
|
1582
1582
|
var lastPropertyAt = lastPropertyIndex(tokens);
|
|
1583
1583
|
|
|
1584
1584
|
for (var i = 0, l = tokens.length; i < l; i++) {
|
|
1585
|
-
property(context, tokens, i, lastPropertyAt);
|
|
1585
|
+
property$1(context, tokens, i, lastPropertyAt);
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
@@ -1598,7 +1598,7 @@ function lastPropertyIndex(tokens) {
|
|
|
1598
1598
|
return index;
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
|
-
function property(context, tokens, position, lastPropertyAt) {
|
|
1601
|
+
function property$1(context, tokens, position, lastPropertyAt) {
|
|
1602
1602
|
var store = context.store;
|
|
1603
1603
|
var token$1 = tokens[position];
|
|
1604
1604
|
|
|
@@ -1623,13 +1623,13 @@ function property(context, tokens, position, lastPropertyAt) {
|
|
|
1623
1623
|
switch (token$1[0]) {
|
|
1624
1624
|
case token.AT_RULE:
|
|
1625
1625
|
store(context, token$1);
|
|
1626
|
-
store(context, semicolon(context, Breaks
|
|
1626
|
+
store(context, semicolon(context, Breaks.AfterProperty, false));
|
|
1627
1627
|
break;
|
|
1628
1628
|
case token.AT_RULE_BLOCK:
|
|
1629
|
-
rules(context, token$1[1]);
|
|
1630
|
-
store(context, openBrace(context, Breaks
|
|
1631
|
-
body(context, token$1[2]);
|
|
1632
|
-
store(context, closeBrace(context, Breaks
|
|
1629
|
+
rules$1(context, token$1[1]);
|
|
1630
|
+
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
|
|
1631
|
+
body$1(context, token$1[2]);
|
|
1632
|
+
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
|
|
1633
1633
|
break;
|
|
1634
1634
|
case token.COMMENT:
|
|
1635
1635
|
store(context, token$1);
|
|
@@ -1638,23 +1638,23 @@ function property(context, tokens, position, lastPropertyAt) {
|
|
|
1638
1638
|
store(context, token$1[1]);
|
|
1639
1639
|
store(context, colon(context));
|
|
1640
1640
|
if (propertyValue) {
|
|
1641
|
-
value(context, token$1);
|
|
1641
|
+
value$1(context, token$1);
|
|
1642
1642
|
}
|
|
1643
|
-
store(context, needsSemicolon ? semicolon(context, Breaks
|
|
1643
|
+
store(context, needsSemicolon ? semicolon(context, Breaks.AfterProperty, isLast) : emptyCharacter);
|
|
1644
1644
|
break;
|
|
1645
1645
|
case token.RAW:
|
|
1646
1646
|
store(context, token$1);
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
|
-
function value(context, token$1) {
|
|
1650
|
+
function value$1(context, token$1) {
|
|
1651
1651
|
var store = context.store;
|
|
1652
1652
|
var j, m;
|
|
1653
1653
|
|
|
1654
1654
|
if (token$1[2][0] == token.PROPERTY_BLOCK) {
|
|
1655
|
-
store(context, openBrace(context, Breaks
|
|
1656
|
-
body(context, token$1[2][1]);
|
|
1657
|
-
store(context, closeBrace(context, Breaks
|
|
1655
|
+
store(context, openBrace(context, Breaks.AfterBlockBegins, false));
|
|
1656
|
+
body$1(context, token$1[2][1]);
|
|
1657
|
+
store(context, closeBrace(context, Breaks.AfterBlockEnds, false, true));
|
|
1658
1658
|
} else {
|
|
1659
1659
|
for (j = 2, m = token$1.length; j < m; j++) {
|
|
1660
1660
|
store(context, token$1[j]);
|
|
@@ -1678,7 +1678,7 @@ function openBrace(context, where, needsPrefixSpace) {
|
|
|
1678
1678
|
if (context.format) {
|
|
1679
1679
|
context.indentBy += context.format.indentBy;
|
|
1680
1680
|
context.indentWith = context.format.indentWith.repeat(context.indentBy);
|
|
1681
|
-
return (needsPrefixSpace && allowsSpace(context, Spaces
|
|
1681
|
+
return (needsPrefixSpace && allowsSpace(context, Spaces.BeforeBlockBegins) ? marker.SPACE : emptyCharacter) +
|
|
1682
1682
|
marker.OPEN_CURLY_BRACKET +
|
|
1683
1683
|
(allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) +
|
|
1684
1684
|
context.indentWith;
|
|
@@ -1691,7 +1691,7 @@ function closeBrace(context, where, beforeBlockEnd, isLast) {
|
|
|
1691
1691
|
if (context.format) {
|
|
1692
1692
|
context.indentBy -= context.format.indentBy;
|
|
1693
1693
|
context.indentWith = context.format.indentWith.repeat(context.indentBy);
|
|
1694
|
-
return (allowsBreak(context, Breaks
|
|
1694
|
+
return (allowsBreak(context, Breaks.AfterProperty) || beforeBlockEnd && allowsBreak(context, Breaks.BeforeBlockEnds) ? context.format.breakWith : emptyCharacter) +
|
|
1695
1695
|
context.indentWith +
|
|
1696
1696
|
marker.CLOSE_CURLY_BRACKET +
|
|
1697
1697
|
(isLast ? emptyCharacter : (allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) + context.indentWith);
|
|
@@ -1702,7 +1702,7 @@ function closeBrace(context, where, beforeBlockEnd, isLast) {
|
|
|
1702
1702
|
|
|
1703
1703
|
function colon(context) {
|
|
1704
1704
|
return context.format ?
|
|
1705
|
-
marker.COLON + (allowsSpace(context, Spaces
|
|
1705
|
+
marker.COLON + (allowsSpace(context, Spaces.BeforeValue) ? marker.SPACE : emptyCharacter) :
|
|
1706
1706
|
marker.COLON;
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
@@ -1714,11 +1714,11 @@ function semicolon(context, where, isLast) {
|
|
|
1714
1714
|
|
|
1715
1715
|
function comma(context) {
|
|
1716
1716
|
return context.format ?
|
|
1717
|
-
marker.COMMA + (allowsBreak(context, Breaks
|
|
1717
|
+
marker.COMMA + (allowsBreak(context, Breaks.BetweenSelectors) ? context.format.breakWith : emptyCharacter) + context.indentWith :
|
|
1718
1718
|
marker.COMMA;
|
|
1719
1719
|
}
|
|
1720
1720
|
|
|
1721
|
-
function all(context, tokens) {
|
|
1721
|
+
function all$4(context, tokens) {
|
|
1722
1722
|
var store = context.store;
|
|
1723
1723
|
var token$1;
|
|
1724
1724
|
var isLast;
|
|
@@ -1731,99 +1731,99 @@ function all(context, tokens) {
|
|
|
1731
1731
|
switch (token$1[0]) {
|
|
1732
1732
|
case token.AT_RULE:
|
|
1733
1733
|
store(context, token$1);
|
|
1734
|
-
store(context, semicolon(context, Breaks
|
|
1734
|
+
store(context, semicolon(context, Breaks.AfterAtRule, isLast));
|
|
1735
1735
|
break;
|
|
1736
1736
|
case token.AT_RULE_BLOCK:
|
|
1737
|
-
rules(context, token$1[1]);
|
|
1738
|
-
store(context, openBrace(context, Breaks
|
|
1739
|
-
body(context, token$1[2]);
|
|
1740
|
-
store(context, closeBrace(context, Breaks
|
|
1737
|
+
rules$1(context, token$1[1]);
|
|
1738
|
+
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
|
|
1739
|
+
body$1(context, token$1[2]);
|
|
1740
|
+
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
|
|
1741
1741
|
break;
|
|
1742
1742
|
case token.NESTED_BLOCK:
|
|
1743
|
-
rules(context, token$1[1]);
|
|
1744
|
-
store(context, openBrace(context, Breaks
|
|
1745
|
-
all(context, token$1[2]);
|
|
1746
|
-
store(context, closeBrace(context, Breaks
|
|
1743
|
+
rules$1(context, token$1[1]);
|
|
1744
|
+
store(context, openBrace(context, Breaks.AfterBlockBegins, true));
|
|
1745
|
+
all$4(context, token$1[2]);
|
|
1746
|
+
store(context, closeBrace(context, Breaks.AfterBlockEnds, true, isLast));
|
|
1747
1747
|
break;
|
|
1748
1748
|
case token.COMMENT:
|
|
1749
1749
|
store(context, token$1);
|
|
1750
|
-
store(context, allowsBreak(context, Breaks
|
|
1750
|
+
store(context, allowsBreak(context, Breaks.AfterComment) ? context.format.breakWith : emptyCharacter);
|
|
1751
1751
|
break;
|
|
1752
1752
|
case token.RAW:
|
|
1753
1753
|
store(context, token$1);
|
|
1754
1754
|
break;
|
|
1755
1755
|
case token.RULE:
|
|
1756
|
-
rules(context, token$1[1]);
|
|
1757
|
-
store(context, openBrace(context, Breaks
|
|
1758
|
-
body(context, token$1[2]);
|
|
1759
|
-
store(context, closeBrace(context, Breaks
|
|
1756
|
+
rules$1(context, token$1[1]);
|
|
1757
|
+
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
|
|
1758
|
+
body$1(context, token$1[2]);
|
|
1759
|
+
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
|
|
1760
1760
|
break;
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
|
|
1765
1765
|
var helpers = {
|
|
1766
|
-
all: all,
|
|
1767
|
-
body: body,
|
|
1768
|
-
property: property,
|
|
1769
|
-
rules: rules,
|
|
1770
|
-
value: value
|
|
1766
|
+
all: all$4,
|
|
1767
|
+
body: body$1,
|
|
1768
|
+
property: property$1,
|
|
1769
|
+
rules: rules$1,
|
|
1770
|
+
value: value$1
|
|
1771
1771
|
};
|
|
1772
1772
|
|
|
1773
|
-
function store(serializeContext, token) {
|
|
1773
|
+
function store$2(serializeContext, token) {
|
|
1774
1774
|
serializeContext.output.push(typeof token == 'string' ? token : token[1]);
|
|
1775
1775
|
}
|
|
1776
1776
|
|
|
1777
1777
|
function context() {
|
|
1778
1778
|
var newContext = {
|
|
1779
1779
|
output: [],
|
|
1780
|
-
store: store
|
|
1780
|
+
store: store$2
|
|
1781
1781
|
};
|
|
1782
1782
|
|
|
1783
1783
|
return newContext;
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
function all$
|
|
1786
|
+
function all$3(tokens) {
|
|
1787
1787
|
var oneTimeContext = context();
|
|
1788
1788
|
helpers.all(oneTimeContext, tokens);
|
|
1789
1789
|
return oneTimeContext.output.join('');
|
|
1790
1790
|
}
|
|
1791
1791
|
|
|
1792
|
-
function body
|
|
1792
|
+
function body(tokens) {
|
|
1793
1793
|
var oneTimeContext = context();
|
|
1794
1794
|
helpers.body(oneTimeContext, tokens);
|
|
1795
1795
|
return oneTimeContext.output.join('');
|
|
1796
1796
|
}
|
|
1797
1797
|
|
|
1798
|
-
function property
|
|
1798
|
+
function property(tokens, position) {
|
|
1799
1799
|
var oneTimeContext = context();
|
|
1800
1800
|
helpers.property(oneTimeContext, tokens, position, true);
|
|
1801
1801
|
return oneTimeContext.output.join('');
|
|
1802
1802
|
}
|
|
1803
1803
|
|
|
1804
|
-
function rules
|
|
1804
|
+
function rules(tokens) {
|
|
1805
1805
|
var oneTimeContext = context();
|
|
1806
1806
|
helpers.rules(oneTimeContext, tokens);
|
|
1807
1807
|
return oneTimeContext.output.join('');
|
|
1808
1808
|
}
|
|
1809
1809
|
|
|
1810
|
-
function value
|
|
1810
|
+
function value(tokens) {
|
|
1811
1811
|
var oneTimeContext = context();
|
|
1812
1812
|
helpers.value(oneTimeContext, tokens);
|
|
1813
1813
|
return oneTimeContext.output.join('');
|
|
1814
1814
|
}
|
|
1815
1815
|
|
|
1816
1816
|
var oneTime = {
|
|
1817
|
-
all: all$
|
|
1818
|
-
body: body
|
|
1819
|
-
property: property
|
|
1820
|
-
rules: rules
|
|
1821
|
-
value: value
|
|
1817
|
+
all: all$3,
|
|
1818
|
+
body: body,
|
|
1819
|
+
property: property,
|
|
1820
|
+
rules: rules,
|
|
1821
|
+
value: value
|
|
1822
1822
|
};
|
|
1823
1823
|
|
|
1824
|
-
var wrapForOptimizing$
|
|
1824
|
+
var wrapForOptimizing$2 = wrapForOptimizing$3.all;
|
|
1825
1825
|
|
|
1826
|
-
var OptimizationLevel$
|
|
1826
|
+
var OptimizationLevel$5 = optimizationLevel.OptimizationLevel;
|
|
1827
1827
|
|
|
1828
1828
|
|
|
1829
1829
|
|
|
@@ -1831,7 +1831,7 @@ var OptimizationLevel$1 = optimizationLevel.OptimizationLevel;
|
|
|
1831
1831
|
|
|
1832
1832
|
|
|
1833
1833
|
|
|
1834
|
-
var serializeRules = oneTime.rules;
|
|
1834
|
+
var serializeRules$9 = oneTime.rules;
|
|
1835
1835
|
|
|
1836
1836
|
var IgnoreProperty = 'ignore-property';
|
|
1837
1837
|
|
|
@@ -1845,10 +1845,10 @@ var TIME_VALUE = /^(\-?[\d\.]+)(m?s)$/;
|
|
|
1845
1845
|
|
|
1846
1846
|
var HEX_VALUE_PATTERN = /[0-9a-f]/i;
|
|
1847
1847
|
var PROPERTY_NAME_PATTERN = /^(?:\-chrome\-|\-[\w\-]+\w|\w[\w\-]+\w|\-\-\S+)$/;
|
|
1848
|
-
var IMPORT_PREFIX_PATTERN = /^@import/i;
|
|
1848
|
+
var IMPORT_PREFIX_PATTERN$2 = /^@import/i;
|
|
1849
1849
|
var QUOTED_PATTERN = /^('.*'|".*")$/;
|
|
1850
1850
|
var QUOTED_BUT_SAFE_PATTERN = /^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/;
|
|
1851
|
-
var URL_PREFIX_PATTERN = /^url\(/i;
|
|
1851
|
+
var URL_PREFIX_PATTERN$2 = /^url\(/i;
|
|
1852
1852
|
var LOCAL_PREFIX_PATTERN = /^local\(/i;
|
|
1853
1853
|
var VARIABLE_NAME_PATTERN = /^--\S+$/;
|
|
1854
1854
|
|
|
@@ -1864,13 +1864,13 @@ function isQuoted(value) {
|
|
|
1864
1864
|
return QUOTED_PATTERN.test(value);
|
|
1865
1865
|
}
|
|
1866
1866
|
|
|
1867
|
-
function isUrl(value) {
|
|
1868
|
-
return URL_PREFIX_PATTERN.test(value);
|
|
1867
|
+
function isUrl$1(value) {
|
|
1868
|
+
return URL_PREFIX_PATTERN$2.test(value);
|
|
1869
1869
|
}
|
|
1870
1870
|
|
|
1871
1871
|
function normalizeUrl(value) {
|
|
1872
1872
|
return value
|
|
1873
|
-
.replace(URL_PREFIX_PATTERN, 'url(')
|
|
1873
|
+
.replace(URL_PREFIX_PATTERN$2, 'url(')
|
|
1874
1874
|
.replace(/\\?\n|\\?\r\n/g, '');
|
|
1875
1875
|
}
|
|
1876
1876
|
|
|
@@ -2162,7 +2162,7 @@ function optimizeZeroUnits(name, value) {
|
|
|
2162
2162
|
.replace(/(^|\D)0\.(\d)/g, '$1.$2');
|
|
2163
2163
|
}
|
|
2164
2164
|
|
|
2165
|
-
function removeQuotes
|
|
2165
|
+
function removeQuotes(name, value) {
|
|
2166
2166
|
if (name == 'content' || name.indexOf('font-variation-settings') > -1 || name.indexOf('font-feature-settings') > -1 || name == 'grid' || name.indexOf('grid-') > -1) {
|
|
2167
2167
|
return value;
|
|
2168
2168
|
}
|
|
@@ -2179,7 +2179,7 @@ function removeUrlQuotes(value) {
|
|
|
2179
2179
|
}
|
|
2180
2180
|
|
|
2181
2181
|
function transformValue(propertyName, propertyValue, rule, transformCallback) {
|
|
2182
|
-
var selector = serializeRules(rule);
|
|
2182
|
+
var selector = serializeRules$9(rule);
|
|
2183
2183
|
var transformedValue = transformCallback(propertyName, propertyValue, selector);
|
|
2184
2184
|
|
|
2185
2185
|
if (transformedValue === undefined) {
|
|
@@ -2195,11 +2195,11 @@ function transformValue(propertyName, propertyValue, rule, transformCallback) {
|
|
|
2195
2195
|
|
|
2196
2196
|
function optimizeBody(rule, properties, context) {
|
|
2197
2197
|
var options = context.options;
|
|
2198
|
-
var levelOptions = options.level[OptimizationLevel$
|
|
2198
|
+
var levelOptions = options.level[OptimizationLevel$5.One];
|
|
2199
2199
|
var property, name, type, value;
|
|
2200
2200
|
var valueIsUrl;
|
|
2201
2201
|
var propertyToken;
|
|
2202
|
-
var _properties = wrapForOptimizing$
|
|
2202
|
+
var _properties = wrapForOptimizing$2(properties, true);
|
|
2203
2203
|
|
|
2204
2204
|
propertyLoop:
|
|
2205
2205
|
for (var i = 0, l = _properties.length; i < l; i++) {
|
|
@@ -2249,7 +2249,7 @@ function optimizeBody(rule, properties, context) {
|
|
|
2249
2249
|
for (var j = 0, m = property.value.length; j < m; j++) {
|
|
2250
2250
|
type = property.value[j][0];
|
|
2251
2251
|
value = property.value[j][1];
|
|
2252
|
-
valueIsUrl = isUrl(value);
|
|
2252
|
+
valueIsUrl = isUrl$1(value);
|
|
2253
2253
|
|
|
2254
2254
|
if (type == token.PROPERTY_BLOCK) {
|
|
2255
2255
|
property.unused = true;
|
|
@@ -2272,7 +2272,7 @@ function optimizeBody(rule, properties, context) {
|
|
|
2272
2272
|
value;
|
|
2273
2273
|
} else if (isQuoted(value) || isLocal(value)) {
|
|
2274
2274
|
value = levelOptions.removeQuotes ?
|
|
2275
|
-
removeQuotes
|
|
2275
|
+
removeQuotes(name, value) :
|
|
2276
2276
|
value;
|
|
2277
2277
|
} else {
|
|
2278
2278
|
value = levelOptions.removeWhitespace ?
|
|
@@ -2350,7 +2350,7 @@ function removeComments(tokens, options) {
|
|
|
2350
2350
|
}
|
|
2351
2351
|
|
|
2352
2352
|
function optimizeComment(token, options) {
|
|
2353
|
-
if (token[1][2] == marker.EXCLAMATION && (options.level[OptimizationLevel$
|
|
2353
|
+
if (token[1][2] == marker.EXCLAMATION && (options.level[OptimizationLevel$5.One].specialComments == 'all' || options.commentsKept < options.level[OptimizationLevel$5.One].specialComments)) {
|
|
2354
2354
|
options.commentsKept++;
|
|
2355
2355
|
return;
|
|
2356
2356
|
}
|
|
@@ -2425,8 +2425,8 @@ function buildPrecisionOptions(roundingPrecision) {
|
|
|
2425
2425
|
return precisionOptions;
|
|
2426
2426
|
}
|
|
2427
2427
|
|
|
2428
|
-
function isImport(token) {
|
|
2429
|
-
return IMPORT_PREFIX_PATTERN.test(token[1]);
|
|
2428
|
+
function isImport$1(token) {
|
|
2429
|
+
return IMPORT_PREFIX_PATTERN$2.test(token[1]);
|
|
2430
2430
|
}
|
|
2431
2431
|
|
|
2432
2432
|
function isLegacyFilter(property) {
|
|
@@ -2445,7 +2445,7 @@ function isLegacyFilter(property) {
|
|
|
2445
2445
|
|
|
2446
2446
|
function level1Optimize(tokens, context) {
|
|
2447
2447
|
var options = context.options;
|
|
2448
|
-
var levelOptions = options.level[OptimizationLevel$
|
|
2448
|
+
var levelOptions = options.level[OptimizationLevel$5.One];
|
|
2449
2449
|
var ie7Hack = options.compatibility.selectors.ie7Hack;
|
|
2450
2450
|
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
|
|
2451
2451
|
var spaceAfterClosingBrace = options.compatibility.properties.spaceAfterClosingBrace;
|
|
@@ -2462,7 +2462,7 @@ function level1Optimize(tokens, context) {
|
|
|
2462
2462
|
|
|
2463
2463
|
switch (token$1[0]) {
|
|
2464
2464
|
case token.AT_RULE:
|
|
2465
|
-
token$1[1] = isImport(token$1) && afterRules ? '' : token$1[1];
|
|
2465
|
+
token$1[1] = isImport$1(token$1) && afterRules ? '' : token$1[1];
|
|
2466
2466
|
token$1[1] = levelOptions.tidyAtRules ? tidyAtRule_1(token$1[1]) : token$1[1];
|
|
2467
2467
|
mayHaveCharset = true;
|
|
2468
2468
|
break;
|
|
@@ -2500,7 +2500,7 @@ function level1Optimize(tokens, context) {
|
|
|
2500
2500
|
return tokens;
|
|
2501
2501
|
}
|
|
2502
2502
|
|
|
2503
|
-
var optimize$
|
|
2503
|
+
var optimize$2 = level1Optimize;
|
|
2504
2504
|
|
|
2505
2505
|
var DEEP_SELECTOR_PATTERN = /\/deep\//;
|
|
2506
2506
|
var DOUBLE_COLON_PATTERN = /^::/;
|
|
@@ -2514,7 +2514,7 @@ var PSEUDO_CLASSES_WITH_ARGUMENTS = [
|
|
|
2514
2514
|
':nth-last-of-type',
|
|
2515
2515
|
':nth-of-type'
|
|
2516
2516
|
];
|
|
2517
|
-
var RELATION_PATTERN
|
|
2517
|
+
var RELATION_PATTERN = /[>\+~]/;
|
|
2518
2518
|
var UNMIXABLE_PSEUDO_CLASSES = [
|
|
2519
2519
|
':after',
|
|
2520
2520
|
':before',
|
|
@@ -2529,7 +2529,7 @@ var UNMIXABLE_PSEUDO_ELEMENTS = [
|
|
|
2529
2529
|
'::first-line'
|
|
2530
2530
|
];
|
|
2531
2531
|
|
|
2532
|
-
var Level = {
|
|
2532
|
+
var Level$1 = {
|
|
2533
2533
|
DOUBLE_QUOTE: 'double-quote',
|
|
2534
2534
|
SINGLE_QUOTE: 'single-quote',
|
|
2535
2535
|
ROOT: 'root'
|
|
@@ -2561,7 +2561,7 @@ function extractPseudoFrom(selector) {
|
|
|
2561
2561
|
var list = [];
|
|
2562
2562
|
var character;
|
|
2563
2563
|
var buffer = [];
|
|
2564
|
-
var level = Level.ROOT;
|
|
2564
|
+
var level = Level$1.ROOT;
|
|
2565
2565
|
var roundBracketLevel = 0;
|
|
2566
2566
|
var isQuoted;
|
|
2567
2567
|
var isEscaped;
|
|
@@ -2574,23 +2574,23 @@ function extractPseudoFrom(selector) {
|
|
|
2574
2574
|
for (index = 0, len = selector.length; index < len; index++) {
|
|
2575
2575
|
character = selector[index];
|
|
2576
2576
|
|
|
2577
|
-
isRelation = !isEscaped && RELATION_PATTERN
|
|
2578
|
-
isQuoted = level == Level.DOUBLE_QUOTE || level == Level.SINGLE_QUOTE;
|
|
2577
|
+
isRelation = !isEscaped && RELATION_PATTERN.test(character);
|
|
2578
|
+
isQuoted = level == Level$1.DOUBLE_QUOTE || level == Level$1.SINGLE_QUOTE;
|
|
2579
2579
|
|
|
2580
2580
|
if (isEscaped) {
|
|
2581
2581
|
buffer.push(character);
|
|
2582
|
-
} else if (character == marker.DOUBLE_QUOTE && level == Level.ROOT) {
|
|
2582
|
+
} else if (character == marker.DOUBLE_QUOTE && level == Level$1.ROOT) {
|
|
2583
2583
|
buffer.push(character);
|
|
2584
|
-
level = Level.DOUBLE_QUOTE;
|
|
2585
|
-
} else if (character == marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) {
|
|
2584
|
+
level = Level$1.DOUBLE_QUOTE;
|
|
2585
|
+
} else if (character == marker.DOUBLE_QUOTE && level == Level$1.DOUBLE_QUOTE) {
|
|
2586
2586
|
buffer.push(character);
|
|
2587
|
-
level = Level.ROOT;
|
|
2588
|
-
} else if (character == marker.SINGLE_QUOTE && level == Level.ROOT) {
|
|
2587
|
+
level = Level$1.ROOT;
|
|
2588
|
+
} else if (character == marker.SINGLE_QUOTE && level == Level$1.ROOT) {
|
|
2589
2589
|
buffer.push(character);
|
|
2590
|
-
level = Level.SINGLE_QUOTE;
|
|
2591
|
-
} else if (character == marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) {
|
|
2590
|
+
level = Level$1.SINGLE_QUOTE;
|
|
2591
|
+
} else if (character == marker.SINGLE_QUOTE && level == Level$1.SINGLE_QUOTE) {
|
|
2592
2592
|
buffer.push(character);
|
|
2593
|
-
level = Level.ROOT;
|
|
2593
|
+
level = Level$1.ROOT;
|
|
2594
2594
|
} else if (isQuoted) {
|
|
2595
2595
|
buffer.push(character);
|
|
2596
2596
|
} else if (character == marker.OPEN_ROUND_BRACKET) {
|
|
@@ -2808,7 +2808,7 @@ InvalidPropertyError.prototype.constructor = InvalidPropertyError;
|
|
|
2808
2808
|
|
|
2809
2809
|
var invalidPropertyError = InvalidPropertyError;
|
|
2810
2810
|
|
|
2811
|
-
var wrapSingle$
|
|
2811
|
+
var wrapSingle$2 = wrapForOptimizing$3.single;
|
|
2812
2812
|
|
|
2813
2813
|
|
|
2814
2814
|
|
|
@@ -2842,20 +2842,20 @@ function _styleFilter(validator) {
|
|
|
2842
2842
|
function _wrapDefault(name, property, compactable) {
|
|
2843
2843
|
var descriptor = compactable[name];
|
|
2844
2844
|
if (descriptor.doubleValues && descriptor.defaultValue.length == 2) {
|
|
2845
|
-
return wrapSingle$
|
|
2845
|
+
return wrapSingle$2([
|
|
2846
2846
|
token.PROPERTY,
|
|
2847
2847
|
[token.PROPERTY_NAME, name],
|
|
2848
2848
|
[token.PROPERTY_VALUE, descriptor.defaultValue[0]],
|
|
2849
2849
|
[token.PROPERTY_VALUE, descriptor.defaultValue[1]]
|
|
2850
2850
|
]);
|
|
2851
2851
|
} else if (descriptor.doubleValues && descriptor.defaultValue.length == 1) {
|
|
2852
|
-
return wrapSingle$
|
|
2852
|
+
return wrapSingle$2([
|
|
2853
2853
|
token.PROPERTY,
|
|
2854
2854
|
[token.PROPERTY_NAME, name],
|
|
2855
2855
|
[token.PROPERTY_VALUE, descriptor.defaultValue[0]]
|
|
2856
2856
|
]);
|
|
2857
2857
|
} else {
|
|
2858
|
-
return wrapSingle$
|
|
2858
|
+
return wrapSingle$2([
|
|
2859
2859
|
token.PROPERTY,
|
|
2860
2860
|
[token.PROPERTY_NAME, name],
|
|
2861
2861
|
[token.PROPERTY_VALUE, descriptor.defaultValue]
|
|
@@ -2939,7 +2939,7 @@ function animation(property, compactable, validator) {
|
|
|
2939
2939
|
return components;
|
|
2940
2940
|
}
|
|
2941
2941
|
|
|
2942
|
-
function background(property, compactable, validator) {
|
|
2942
|
+
function background$1(property, compactable, validator) {
|
|
2943
2943
|
var image = _wrapDefault('background-image', property, compactable);
|
|
2944
2944
|
var position = _wrapDefault('background-position', property, compactable);
|
|
2945
2945
|
var size = _wrapDefault('background-size', property, compactable);
|
|
@@ -3034,7 +3034,7 @@ function background(property, compactable, validator) {
|
|
|
3034
3034
|
return components;
|
|
3035
3035
|
}
|
|
3036
3036
|
|
|
3037
|
-
function borderRadius(property, compactable) {
|
|
3037
|
+
function borderRadius$1(property, compactable) {
|
|
3038
3038
|
var values = property.value;
|
|
3039
3039
|
var splitAt = -1;
|
|
3040
3040
|
|
|
@@ -3053,13 +3053,13 @@ function borderRadius(property, compactable) {
|
|
|
3053
3053
|
target.value = splitAt > -1 ?
|
|
3054
3054
|
values.slice(0, splitAt) :
|
|
3055
3055
|
values.slice(0);
|
|
3056
|
-
target.components = fourValues(target, compactable);
|
|
3056
|
+
target.components = fourValues$1(target, compactable);
|
|
3057
3057
|
|
|
3058
3058
|
var remainder = _wrapDefault(property.name, property, compactable);
|
|
3059
3059
|
remainder.value = splitAt > -1 ?
|
|
3060
3060
|
values.slice(splitAt + 1) :
|
|
3061
3061
|
values.slice(0);
|
|
3062
|
-
remainder.components = fourValues(remainder, compactable);
|
|
3062
|
+
remainder.components = fourValues$1(remainder, compactable);
|
|
3063
3063
|
|
|
3064
3064
|
for (var j = 0; j < 4; j++) {
|
|
3065
3065
|
target.components[j].multiplex = true;
|
|
@@ -3069,7 +3069,7 @@ function borderRadius(property, compactable) {
|
|
|
3069
3069
|
return target.components;
|
|
3070
3070
|
}
|
|
3071
3071
|
|
|
3072
|
-
function font(property, compactable, validator) {
|
|
3072
|
+
function font$1(property, compactable, validator) {
|
|
3073
3073
|
var style = _wrapDefault('font-style', property, compactable);
|
|
3074
3074
|
var variant = _wrapDefault('font-variant', property, compactable);
|
|
3075
3075
|
var weight = _wrapDefault('font-weight', property, compactable);
|
|
@@ -3219,7 +3219,7 @@ function _anyIsFontFamily(values, validator) {
|
|
|
3219
3219
|
return false;
|
|
3220
3220
|
}
|
|
3221
3221
|
|
|
3222
|
-
function fourValues(property, compactable) {
|
|
3222
|
+
function fourValues$1(property, compactable) {
|
|
3223
3223
|
var componentNames = compactable[property.name].components;
|
|
3224
3224
|
var components = [];
|
|
3225
3225
|
var value = property.value;
|
|
@@ -3235,7 +3235,7 @@ function fourValues(property, compactable) {
|
|
|
3235
3235
|
value[3] = value[1].slice(0);
|
|
3236
3236
|
|
|
3237
3237
|
for (var i = componentNames.length - 1; i >= 0; i--) {
|
|
3238
|
-
var component = wrapSingle$
|
|
3238
|
+
var component = wrapSingle$2([
|
|
3239
3239
|
token.PROPERTY,
|
|
3240
3240
|
[token.PROPERTY_NAME, componentNames[i]]
|
|
3241
3241
|
]);
|
|
@@ -3246,7 +3246,7 @@ function fourValues(property, compactable) {
|
|
|
3246
3246
|
return components;
|
|
3247
3247
|
}
|
|
3248
3248
|
|
|
3249
|
-
function multiplex(splitWith) {
|
|
3249
|
+
function multiplex$1(splitWith) {
|
|
3250
3250
|
return function (property, compactable, validator) {
|
|
3251
3251
|
var splitsAt = [];
|
|
3252
3252
|
var values = property.value;
|
|
@@ -3440,13 +3440,13 @@ function widthStyleColor(property, compactable, validator) {
|
|
|
3440
3440
|
|
|
3441
3441
|
var breakUp = {
|
|
3442
3442
|
animation: animation,
|
|
3443
|
-
background: background,
|
|
3443
|
+
background: background$1,
|
|
3444
3444
|
border: widthStyleColor,
|
|
3445
|
-
borderRadius: borderRadius,
|
|
3446
|
-
font: font,
|
|
3447
|
-
fourValues: fourValues,
|
|
3445
|
+
borderRadius: borderRadius$1,
|
|
3446
|
+
font: font$1,
|
|
3447
|
+
fourValues: fourValues$1,
|
|
3448
3448
|
listStyle: listStyle,
|
|
3449
|
-
multiplex: multiplex,
|
|
3449
|
+
multiplex: multiplex$1,
|
|
3450
3450
|
outline: widthStyleColor,
|
|
3451
3451
|
transition: transition
|
|
3452
3452
|
};
|
|
@@ -3610,7 +3610,7 @@ function keywordWithGlobal(propertyName) {
|
|
|
3610
3610
|
};
|
|
3611
3611
|
}
|
|
3612
3612
|
|
|
3613
|
-
function propertyName(validator, value1, value2) {
|
|
3613
|
+
function propertyName$1(validator, value1, value2) {
|
|
3614
3614
|
if (!understandable_1(validator, value1, value2, 0, true) && !validator.isIdentifier(value2)) {
|
|
3615
3615
|
return false;
|
|
3616
3616
|
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
|
@@ -3723,7 +3723,7 @@ var canOverride = {
|
|
|
3723
3723
|
color: color,
|
|
3724
3724
|
components: components,
|
|
3725
3725
|
image: image,
|
|
3726
|
-
propertyName: propertyName,
|
|
3726
|
+
propertyName: propertyName$1,
|
|
3727
3727
|
time: time,
|
|
3728
3728
|
timingFunction: timingFunction,
|
|
3729
3729
|
unit: unit,
|
|
@@ -3773,7 +3773,7 @@ var canOverride = {
|
|
|
3773
3773
|
}
|
|
3774
3774
|
};
|
|
3775
3775
|
|
|
3776
|
-
var wrapSingle$
|
|
3776
|
+
var wrapSingle$1 = wrapForOptimizing$3.single;
|
|
3777
3777
|
|
|
3778
3778
|
|
|
3779
3779
|
|
|
@@ -3792,7 +3792,7 @@ function deep(property) {
|
|
|
3792
3792
|
}
|
|
3793
3793
|
|
|
3794
3794
|
function shallow(property) {
|
|
3795
|
-
var cloned = wrapSingle$
|
|
3795
|
+
var cloned = wrapSingle$1([
|
|
3796
3796
|
token.PROPERTY,
|
|
3797
3797
|
[token.PROPERTY_NAME, property.name]
|
|
3798
3798
|
]);
|
|
@@ -3807,7 +3807,7 @@ var clone = {
|
|
|
3807
3807
|
shallow: shallow
|
|
3808
3808
|
};
|
|
3809
3809
|
|
|
3810
|
-
var shallowClone = clone.shallow;
|
|
3810
|
+
var shallowClone$1 = clone.shallow;
|
|
3811
3811
|
|
|
3812
3812
|
|
|
3813
3813
|
|
|
@@ -3823,7 +3823,7 @@ function isInheritOnly(values) {
|
|
|
3823
3823
|
return true;
|
|
3824
3824
|
}
|
|
3825
3825
|
|
|
3826
|
-
function background
|
|
3826
|
+
function background(property, compactable, lastInMultiplex) {
|
|
3827
3827
|
var components = property.components;
|
|
3828
3828
|
var restored = [];
|
|
3829
3829
|
var needsOne, needsBoth;
|
|
@@ -3907,19 +3907,19 @@ function background$1(property, compactable, lastInMultiplex) {
|
|
|
3907
3907
|
return restored;
|
|
3908
3908
|
}
|
|
3909
3909
|
|
|
3910
|
-
function borderRadius
|
|
3910
|
+
function borderRadius(property, compactable) {
|
|
3911
3911
|
if (property.multiplex) {
|
|
3912
|
-
var horizontal = shallowClone(property);
|
|
3913
|
-
var vertical = shallowClone(property);
|
|
3912
|
+
var horizontal = shallowClone$1(property);
|
|
3913
|
+
var vertical = shallowClone$1(property);
|
|
3914
3914
|
|
|
3915
3915
|
for (var i = 0; i < 4; i++) {
|
|
3916
3916
|
var component = property.components[i];
|
|
3917
3917
|
|
|
3918
|
-
var horizontalComponent = shallowClone(property);
|
|
3918
|
+
var horizontalComponent = shallowClone$1(property);
|
|
3919
3919
|
horizontalComponent.value = [component.value[0]];
|
|
3920
3920
|
horizontal.components.push(horizontalComponent);
|
|
3921
3921
|
|
|
3922
|
-
var verticalComponent = shallowClone(property);
|
|
3922
|
+
var verticalComponent = shallowClone$1(property);
|
|
3923
3923
|
// FIXME: only shorthand compactor (see breakup#borderRadius) knows that border radius
|
|
3924
3924
|
// longhands have two values, whereas tokenizer does not care about populating 2nd value
|
|
3925
3925
|
// if it's missing, hence this fallback
|
|
@@ -3927,8 +3927,8 @@ function borderRadius$1(property, compactable) {
|
|
|
3927
3927
|
vertical.components.push(verticalComponent);
|
|
3928
3928
|
}
|
|
3929
3929
|
|
|
3930
|
-
var horizontalValues = fourValues
|
|
3931
|
-
var verticalValues = fourValues
|
|
3930
|
+
var horizontalValues = fourValues(horizontal);
|
|
3931
|
+
var verticalValues = fourValues(vertical);
|
|
3932
3932
|
|
|
3933
3933
|
if (horizontalValues.length == verticalValues.length &&
|
|
3934
3934
|
horizontalValues[0][1] == verticalValues[0][1] &&
|
|
@@ -3940,11 +3940,11 @@ function borderRadius$1(property, compactable) {
|
|
|
3940
3940
|
return horizontalValues.concat([[token.PROPERTY_VALUE, marker.FORWARD_SLASH]]).concat(verticalValues);
|
|
3941
3941
|
}
|
|
3942
3942
|
} else {
|
|
3943
|
-
return fourValues
|
|
3943
|
+
return fourValues(property);
|
|
3944
3944
|
}
|
|
3945
3945
|
}
|
|
3946
3946
|
|
|
3947
|
-
function font
|
|
3947
|
+
function font(property, compactable) {
|
|
3948
3948
|
var components = property.components;
|
|
3949
3949
|
var restored = [];
|
|
3950
3950
|
var component;
|
|
@@ -3997,7 +3997,7 @@ function font$1(property, compactable) {
|
|
|
3997
3997
|
return restored;
|
|
3998
3998
|
}
|
|
3999
3999
|
|
|
4000
|
-
function fourValues
|
|
4000
|
+
function fourValues(property) {
|
|
4001
4001
|
var components = property.components;
|
|
4002
4002
|
var value1 = components[0].value[0];
|
|
4003
4003
|
var value2 = components[1].value[0];
|
|
@@ -4015,7 +4015,7 @@ function fourValues$1(property) {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
4017
|
|
|
4018
|
-
function multiplex
|
|
4018
|
+
function multiplex(restoreWith) {
|
|
4019
4019
|
return function (property, compactable) {
|
|
4020
4020
|
if (!property.multiplex)
|
|
4021
4021
|
return restoreWith(property, compactable, true);
|
|
@@ -4032,12 +4032,12 @@ function multiplex$1(restoreWith) {
|
|
|
4032
4032
|
}
|
|
4033
4033
|
|
|
4034
4034
|
for (i = 0; i <= multiplexSize; i++) {
|
|
4035
|
-
var _property = shallowClone(property);
|
|
4035
|
+
var _property = shallowClone$1(property);
|
|
4036
4036
|
|
|
4037
4037
|
// We split multiplex into parts and restore them one by one
|
|
4038
4038
|
for (var j = 0, m = property.components.length; j < m; j++) {
|
|
4039
4039
|
var componentToClone = property.components[j];
|
|
4040
|
-
var _component = shallowClone(componentToClone);
|
|
4040
|
+
var _component = shallowClone$1(componentToClone);
|
|
4041
4041
|
_property.components.push(_component);
|
|
4042
4042
|
|
|
4043
4043
|
// The trick is some properties has more than one value, so we iterate over values looking for
|
|
@@ -4103,11 +4103,11 @@ function isDefault(components, compactable, propertyName) {
|
|
|
4103
4103
|
}
|
|
4104
4104
|
|
|
4105
4105
|
var restore = {
|
|
4106
|
-
background: background
|
|
4107
|
-
borderRadius: borderRadius
|
|
4108
|
-
font: font
|
|
4109
|
-
fourValues: fourValues
|
|
4110
|
-
multiplex: multiplex
|
|
4106
|
+
background: background,
|
|
4107
|
+
borderRadius: borderRadius,
|
|
4108
|
+
font: font,
|
|
4109
|
+
fourValues: fourValues,
|
|
4110
|
+
multiplex: multiplex,
|
|
4111
4111
|
withoutDefaults: withoutDefaults
|
|
4112
4112
|
};
|
|
4113
4113
|
|
|
@@ -5155,8 +5155,8 @@ function cloneDescriptor(propertyName, prefix) {
|
|
|
5155
5155
|
// generate vendor-prefixed properties
|
|
5156
5156
|
var vendorPrefixedCompactable = {};
|
|
5157
5157
|
|
|
5158
|
-
for (var propertyName
|
|
5159
|
-
var descriptor = compactable[propertyName
|
|
5158
|
+
for (var propertyName in compactable) {
|
|
5159
|
+
var descriptor = compactable[propertyName];
|
|
5160
5160
|
|
|
5161
5161
|
if (!('vendorPrefixes' in descriptor)) {
|
|
5162
5162
|
continue;
|
|
@@ -5164,10 +5164,10 @@ for (var propertyName$1 in compactable) {
|
|
|
5164
5164
|
|
|
5165
5165
|
for (var i = 0; i < descriptor.vendorPrefixes.length; i++) {
|
|
5166
5166
|
var prefix = descriptor.vendorPrefixes[i];
|
|
5167
|
-
var clonedDescriptor = cloneDescriptor(propertyName
|
|
5167
|
+
var clonedDescriptor = cloneDescriptor(propertyName, prefix);
|
|
5168
5168
|
delete clonedDescriptor.vendorPrefixes;
|
|
5169
5169
|
|
|
5170
|
-
vendorPrefixedCompactable[prefix + propertyName
|
|
5170
|
+
vendorPrefixedCompactable[prefix + propertyName] = clonedDescriptor;
|
|
5171
5171
|
}
|
|
5172
5172
|
|
|
5173
5173
|
delete descriptor.vendorPrefixes;
|
|
@@ -5227,13 +5227,13 @@ function restoreWithComponents(property) {
|
|
|
5227
5227
|
|
|
5228
5228
|
var restoreWithComponents_1 = restoreWithComponents;
|
|
5229
5229
|
|
|
5230
|
-
var deepClone = clone.deep;
|
|
5230
|
+
var deepClone$1 = clone.deep;
|
|
5231
5231
|
|
|
5232
5232
|
|
|
5233
5233
|
|
|
5234
|
-
var wrapSingle
|
|
5234
|
+
var wrapSingle = wrapForOptimizing$3.single;
|
|
5235
5235
|
|
|
5236
|
-
var serializeBody = oneTime.body;
|
|
5236
|
+
var serializeBody$5 = oneTime.body;
|
|
5237
5237
|
|
|
5238
5238
|
|
|
5239
5239
|
function mergeIntoShorthands(properties, validator) {
|
|
@@ -5364,7 +5364,7 @@ function overridable(components, shorthandName, validator) {
|
|
|
5364
5364
|
[token.PROPERTY_NAME, shorthandName],
|
|
5365
5365
|
[token.PROPERTY_VALUE, descriptor.defaultValue]
|
|
5366
5366
|
];
|
|
5367
|
-
var newProperty = wrapSingle
|
|
5367
|
+
var newProperty = wrapSingle(newValuePlaceholder);
|
|
5368
5368
|
var component;
|
|
5369
5369
|
var mayOverride;
|
|
5370
5370
|
var i, l;
|
|
@@ -5437,7 +5437,7 @@ function replaceWithInheritBestFit(properties, candidateComponents, shorthandNam
|
|
|
5437
5437
|
var viaShorthand = buildSequenceWithInheritShorthand(candidateComponents, shorthandName, validator);
|
|
5438
5438
|
var longhandTokensSequence = viaLonghands[0];
|
|
5439
5439
|
var shorthandTokensSequence = viaShorthand[0];
|
|
5440
|
-
var isLonghandsShorter = serializeBody(longhandTokensSequence).length < serializeBody(shorthandTokensSequence).length;
|
|
5440
|
+
var isLonghandsShorter = serializeBody$5(longhandTokensSequence).length < serializeBody$5(shorthandTokensSequence).length;
|
|
5441
5441
|
var newTokensSequence = isLonghandsShorter ? longhandTokensSequence : shorthandTokensSequence;
|
|
5442
5442
|
var newProperty = isLonghandsShorter ? viaLonghands[1] : viaShorthand[1];
|
|
5443
5443
|
var newComponents = isLonghandsShorter ? viaLonghands[2] : viaShorthand[2];
|
|
@@ -5482,7 +5482,7 @@ function buildSequenceWithInheritLonghands(components, shorthandName, validator)
|
|
|
5482
5482
|
[token.PROPERTY_NAME, shorthandName],
|
|
5483
5483
|
[token.PROPERTY_VALUE, descriptor.defaultValue]
|
|
5484
5484
|
];
|
|
5485
|
-
var newProperty = wrapSingle
|
|
5485
|
+
var newProperty = wrapSingle(shorthandToken);
|
|
5486
5486
|
var component;
|
|
5487
5487
|
var longhandToken;
|
|
5488
5488
|
var newComponent;
|
|
@@ -5499,13 +5499,13 @@ function buildSequenceWithInheritLonghands(components, shorthandName, validator)
|
|
|
5499
5499
|
Array.prototype.push.apply(longhandToken, component.value);
|
|
5500
5500
|
tokensSequence.push(longhandToken);
|
|
5501
5501
|
|
|
5502
|
-
newComponent = deepClone(component);
|
|
5502
|
+
newComponent = deepClone$1(component);
|
|
5503
5503
|
newComponent.value = inferComponentValue(components, newComponent.name);
|
|
5504
5504
|
|
|
5505
5505
|
newProperty.components[i] = newComponent;
|
|
5506
|
-
inheritComponents[component.name] = deepClone(component);
|
|
5506
|
+
inheritComponents[component.name] = deepClone$1(component);
|
|
5507
5507
|
} else {
|
|
5508
|
-
newComponent = deepClone(component);
|
|
5508
|
+
newComponent = deepClone$1(component);
|
|
5509
5509
|
newComponent.all = component.all;
|
|
5510
5510
|
newProperty.components[i] = newComponent;
|
|
5511
5511
|
|
|
@@ -5579,7 +5579,7 @@ function buildSequenceWithInheritShorthand(components, shorthandName, validator)
|
|
|
5579
5579
|
[token.PROPERTY_NAME, shorthandName],
|
|
5580
5580
|
[token.PROPERTY_VALUE, 'inherit']
|
|
5581
5581
|
];
|
|
5582
|
-
var newProperty = wrapSingle
|
|
5582
|
+
var newProperty = wrapSingle(shorthandToken);
|
|
5583
5583
|
var component;
|
|
5584
5584
|
var longhandToken;
|
|
5585
5585
|
var nameMetadata;
|
|
@@ -5598,7 +5598,7 @@ function buildSequenceWithInheritShorthand(components, shorthandName, validator)
|
|
|
5598
5598
|
Array.prototype.push.apply(longhandToken, component.value);
|
|
5599
5599
|
tokensSequence.push(longhandToken);
|
|
5600
5600
|
|
|
5601
|
-
nonInheritComponents[component.name] = deepClone(component);
|
|
5601
|
+
nonInheritComponents[component.name] = deepClone$1(component);
|
|
5602
5602
|
}
|
|
5603
5603
|
}
|
|
5604
5604
|
|
|
@@ -5634,7 +5634,7 @@ function replaceWithShorthand(properties, candidateComponents, shorthandName, va
|
|
|
5634
5634
|
];
|
|
5635
5635
|
var all;
|
|
5636
5636
|
|
|
5637
|
-
var newProperty = wrapSingle
|
|
5637
|
+
var newProperty = wrapSingle(newValuePlaceholder);
|
|
5638
5638
|
newProperty.shorthand = true;
|
|
5639
5639
|
newProperty.dirty = true;
|
|
5640
5640
|
|
|
@@ -5643,7 +5643,7 @@ function replaceWithShorthand(properties, candidateComponents, shorthandName, va
|
|
|
5643
5643
|
for (var i = 0, l = descriptor.components.length; i < l; i++) {
|
|
5644
5644
|
var component = candidateComponents[descriptor.components[i]];
|
|
5645
5645
|
|
|
5646
|
-
newProperty.components[i] = deepClone(component);
|
|
5646
|
+
newProperty.components[i] = deepClone$1(component);
|
|
5647
5647
|
newProperty.important = component.important;
|
|
5648
5648
|
|
|
5649
5649
|
all = component.all;
|
|
@@ -5749,9 +5749,9 @@ var overridesNonComponentShorthand_1 = overridesNonComponentShorthand;
|
|
|
5749
5749
|
var sameVendorPrefixesIn = vendorPrefixes.same;
|
|
5750
5750
|
|
|
5751
5751
|
|
|
5752
|
-
var deepClone
|
|
5752
|
+
var deepClone = clone.deep;
|
|
5753
5753
|
|
|
5754
|
-
var shallowClone
|
|
5754
|
+
var shallowClone = clone.shallow;
|
|
5755
5755
|
|
|
5756
5756
|
|
|
5757
5757
|
|
|
@@ -5766,7 +5766,7 @@ function wouldBreakCompatibility(property, validator) {
|
|
|
5766
5766
|
var descriptor = compactable_1[component.name];
|
|
5767
5767
|
var canOverride = descriptor && descriptor.canOverride || canOverride.sameValue;
|
|
5768
5768
|
|
|
5769
|
-
var _component = shallowClone
|
|
5769
|
+
var _component = shallowClone(component);
|
|
5770
5770
|
_component.value = [[token.PROPERTY_VALUE, descriptor.defaultValue]];
|
|
5771
5771
|
|
|
5772
5772
|
if (!everyValuesPair_1(canOverride.bind(null, validator), _component, component)) {
|
|
@@ -5795,7 +5795,7 @@ function overrideSimple(property, by) {
|
|
|
5795
5795
|
property.value = by.value;
|
|
5796
5796
|
}
|
|
5797
5797
|
|
|
5798
|
-
function override
|
|
5798
|
+
function override(property, by) {
|
|
5799
5799
|
if (by.multiplex)
|
|
5800
5800
|
overrideByMultiplex(property, by);
|
|
5801
5801
|
else if (property.multiplex)
|
|
@@ -5808,7 +5808,7 @@ function overrideShorthand(property, by) {
|
|
|
5808
5808
|
by.unused = true;
|
|
5809
5809
|
|
|
5810
5810
|
for (var i = 0, l = property.components.length; i < l; i++) {
|
|
5811
|
-
override
|
|
5811
|
+
override(property.components[i], by.components[i]);
|
|
5812
5812
|
}
|
|
5813
5813
|
}
|
|
5814
5814
|
|
|
@@ -5923,10 +5923,10 @@ function wouldResultInLongerValue(left, right) {
|
|
|
5923
5923
|
var simple = left.multiplex ? right : left;
|
|
5924
5924
|
var component;
|
|
5925
5925
|
|
|
5926
|
-
var multiplexClone = deepClone
|
|
5926
|
+
var multiplexClone = deepClone(multiplex);
|
|
5927
5927
|
restoreFromOptimizing_1([multiplexClone], restoreWithComponents_1);
|
|
5928
5928
|
|
|
5929
|
-
var simpleClone = deepClone
|
|
5929
|
+
var simpleClone = deepClone(simple);
|
|
5930
5930
|
restoreFromOptimizing_1([simpleClone], restoreWithComponents_1);
|
|
5931
5931
|
|
|
5932
5932
|
var lengthBefore = lengthOf(multiplexClone) + 1 + lengthOf(simpleClone);
|
|
@@ -6128,7 +6128,7 @@ function overrideProperties(properties, withMerging, compatibility, validator) {
|
|
|
6128
6128
|
if (!left.multiplex && right.multiplex)
|
|
6129
6129
|
turnIntoMultiplex(left, multiplexSize(right));
|
|
6130
6130
|
|
|
6131
|
-
override
|
|
6131
|
+
override(component, right);
|
|
6132
6132
|
left.dirty = true;
|
|
6133
6133
|
}
|
|
6134
6134
|
} else if (withMerging && left.shorthand && right.shorthand && left.name == right.name) {
|
|
@@ -6184,7 +6184,7 @@ function overrideProperties(properties, withMerging, compatibility, validator) {
|
|
|
6184
6184
|
continue;
|
|
6185
6185
|
|
|
6186
6186
|
component = findComponentIn_1(left, right);
|
|
6187
|
-
override
|
|
6187
|
+
override(component, right);
|
|
6188
6188
|
right.dirty = true;
|
|
6189
6189
|
} else if (left.name == right.name) {
|
|
6190
6190
|
// two non-shorthands should be merged based on understandability
|
|
@@ -6225,15 +6225,15 @@ function overrideProperties(properties, withMerging, compatibility, validator) {
|
|
|
6225
6225
|
|
|
6226
6226
|
var overrideProperties_1 = overrideProperties;
|
|
6227
6227
|
|
|
6228
|
-
var wrapForOptimizing$
|
|
6228
|
+
var wrapForOptimizing$1 = wrapForOptimizing$3.all;
|
|
6229
6229
|
|
|
6230
6230
|
|
|
6231
6231
|
|
|
6232
|
-
var OptimizationLevel$
|
|
6232
|
+
var OptimizationLevel$4 = optimizationLevel.OptimizationLevel;
|
|
6233
6233
|
|
|
6234
6234
|
function optimizeProperties(properties, withOverriding, withMerging, context) {
|
|
6235
|
-
var levelOptions = context.options.level[OptimizationLevel$
|
|
6236
|
-
var _properties = wrapForOptimizing$
|
|
6235
|
+
var levelOptions = context.options.level[OptimizationLevel$4.Two];
|
|
6236
|
+
var _properties = wrapForOptimizing$1(properties, false, levelOptions.skipProperties);
|
|
6237
6237
|
var _property;
|
|
6238
6238
|
var i, l;
|
|
6239
6239
|
|
|
@@ -6258,12 +6258,12 @@ function optimizeProperties(properties, withOverriding, withMerging, context) {
|
|
|
6258
6258
|
removeUnused_1(_properties);
|
|
6259
6259
|
}
|
|
6260
6260
|
|
|
6261
|
-
var optimize$
|
|
6261
|
+
var optimize$1 = optimizeProperties;
|
|
6262
6262
|
|
|
6263
6263
|
var OptimizationLevel$3 = optimizationLevel.OptimizationLevel;
|
|
6264
6264
|
|
|
6265
|
-
var serializeBody$
|
|
6266
|
-
var serializeRules$
|
|
6265
|
+
var serializeBody$4 = oneTime.body;
|
|
6266
|
+
var serializeRules$8 = oneTime.rules;
|
|
6267
6267
|
|
|
6268
6268
|
|
|
6269
6269
|
|
|
@@ -6285,13 +6285,13 @@ function mergeAdjacent(tokens, context) {
|
|
|
6285
6285
|
continue;
|
|
6286
6286
|
}
|
|
6287
6287
|
|
|
6288
|
-
if (lastToken[0] == token.RULE && serializeRules$
|
|
6288
|
+
if (lastToken[0] == token.RULE && serializeRules$8(token$1[1]) == serializeRules$8(lastToken[1])) {
|
|
6289
6289
|
Array.prototype.push.apply(lastToken[2], token$1[2]);
|
|
6290
|
-
optimize$
|
|
6290
|
+
optimize$1(lastToken[2], true, true, context);
|
|
6291
6291
|
token$1[2] = [];
|
|
6292
|
-
} else if (lastToken[0] == token.RULE && serializeBody$
|
|
6293
|
-
isMergeable_1(serializeRules$
|
|
6294
|
-
isMergeable_1(serializeRules$
|
|
6292
|
+
} else if (lastToken[0] == token.RULE && serializeBody$4(token$1[2]) == serializeBody$4(lastToken[2]) &&
|
|
6293
|
+
isMergeable_1(serializeRules$8(token$1[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
|
|
6294
|
+
isMergeable_1(serializeRules$8(lastToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
|
|
6295
6295
|
lastToken[1].length < mergeLimit) {
|
|
6296
6296
|
lastToken[1] = tidyRules_1(lastToken[1].concat(token$1[1]), false, adjacentSpace, false, context.warnings);
|
|
6297
6297
|
lastToken[1] = lastToken.length > 1 ? sortSelectors_1(lastToken[1], selectorsSortingMethod) : lastToken[1];
|
|
@@ -6450,10 +6450,10 @@ var specificitiesOverlap_1 = specificitiesOverlap;
|
|
|
6450
6450
|
var FLEX_PROPERTIES = /align\-items|box\-align|box\-pack|flex|justify/;
|
|
6451
6451
|
var BORDER_PROPERTIES = /^border\-(top|right|bottom|left|color|style|width|radius)/;
|
|
6452
6452
|
|
|
6453
|
-
function canReorder(left, right, cache) {
|
|
6453
|
+
function canReorder$2(left, right, cache) {
|
|
6454
6454
|
for (var i = right.length - 1; i >= 0; i--) {
|
|
6455
6455
|
for (var j = left.length - 1; j >= 0; j--) {
|
|
6456
|
-
if (!canReorderSingle(left[j], right[i], cache))
|
|
6456
|
+
if (!canReorderSingle$2(left[j], right[i], cache))
|
|
6457
6457
|
return false;
|
|
6458
6458
|
}
|
|
6459
6459
|
}
|
|
@@ -6461,7 +6461,7 @@ function canReorder(left, right, cache) {
|
|
|
6461
6461
|
return true;
|
|
6462
6462
|
}
|
|
6463
6463
|
|
|
6464
|
-
function canReorderSingle(left, right, cache) {
|
|
6464
|
+
function canReorderSingle$2(left, right, cache) {
|
|
6465
6465
|
var leftName = left[0];
|
|
6466
6466
|
var leftValue = left[1];
|
|
6467
6467
|
var leftNameRoot = left[2];
|
|
@@ -6532,8 +6532,8 @@ function inheritable(name) {
|
|
|
6532
6532
|
}
|
|
6533
6533
|
|
|
6534
6534
|
var reorderable = {
|
|
6535
|
-
canReorder: canReorder,
|
|
6536
|
-
canReorderSingle: canReorderSingle
|
|
6535
|
+
canReorder: canReorder$2,
|
|
6536
|
+
canReorderSingle: canReorderSingle$2
|
|
6537
6537
|
};
|
|
6538
6538
|
|
|
6539
6539
|
// This extractor is used in level 2 optimizations
|
|
@@ -6541,7 +6541,7 @@ var reorderable = {
|
|
|
6541
6541
|
// Properties will be tokenized in one step, see #429
|
|
6542
6542
|
|
|
6543
6543
|
|
|
6544
|
-
var serializeRules$
|
|
6544
|
+
var serializeRules$7 = oneTime.rules;
|
|
6545
6545
|
var serializeValue = oneTime.value;
|
|
6546
6546
|
|
|
6547
6547
|
function extractProperties(token$1) {
|
|
@@ -6553,7 +6553,7 @@ function extractProperties(token$1) {
|
|
|
6553
6553
|
var i, l;
|
|
6554
6554
|
|
|
6555
6555
|
if (token$1[0] == token.RULE) {
|
|
6556
|
-
inSpecificSelector = !/[\.\+>~]/.test(serializeRules$
|
|
6556
|
+
inSpecificSelector = !/[\.\+>~]/.test(serializeRules$7(token$1[1]));
|
|
6557
6557
|
|
|
6558
6558
|
for (i = 0, l = token$1[2].length; i < l; i++) {
|
|
6559
6559
|
property = token$1[2][i];
|
|
@@ -6615,12 +6615,12 @@ var canReorderSingle$1 = reorderable.canReorderSingle;
|
|
|
6615
6615
|
|
|
6616
6616
|
|
|
6617
6617
|
|
|
6618
|
-
var serializeRules$
|
|
6619
|
-
var OptimizationLevel$
|
|
6618
|
+
var serializeRules$6 = oneTime.rules;
|
|
6619
|
+
var OptimizationLevel$2 = optimizationLevel.OptimizationLevel;
|
|
6620
6620
|
|
|
6621
6621
|
|
|
6622
6622
|
function mergeMediaQueries(tokens, context) {
|
|
6623
|
-
var mergeSemantically = context.options.level[OptimizationLevel$
|
|
6623
|
+
var mergeSemantically = context.options.level[OptimizationLevel$2.Two].mergeSemantically;
|
|
6624
6624
|
var specificityCache = context.cache.specificity;
|
|
6625
6625
|
var candidates = {};
|
|
6626
6626
|
var reduced = [];
|
|
@@ -6631,7 +6631,7 @@ function mergeMediaQueries(tokens, context) {
|
|
|
6631
6631
|
continue;
|
|
6632
6632
|
}
|
|
6633
6633
|
|
|
6634
|
-
var key = serializeRules$
|
|
6634
|
+
var key = serializeRules$6(token$1[1]);
|
|
6635
6635
|
var candidate = candidates[key];
|
|
6636
6636
|
if (!candidate) {
|
|
6637
6637
|
candidate = [];
|
|
@@ -6714,10 +6714,10 @@ function allSameRulePropertiesCanBeReordered(movedProperties, traversedPropertie
|
|
|
6714
6714
|
|
|
6715
6715
|
var mergeMediaQueries_1 = mergeMediaQueries;
|
|
6716
6716
|
|
|
6717
|
-
var OptimizationLevel$
|
|
6717
|
+
var OptimizationLevel$1 = optimizationLevel.OptimizationLevel;
|
|
6718
6718
|
|
|
6719
|
-
var serializeBody$
|
|
6720
|
-
var serializeRules$
|
|
6719
|
+
var serializeBody$3 = oneTime.body;
|
|
6720
|
+
var serializeRules$5 = oneTime.rules;
|
|
6721
6721
|
|
|
6722
6722
|
|
|
6723
6723
|
|
|
@@ -6726,7 +6726,7 @@ function unsafeSelector(value) {
|
|
|
6726
6726
|
}
|
|
6727
6727
|
|
|
6728
6728
|
function isBemElement(token) {
|
|
6729
|
-
var asString = serializeRules$
|
|
6729
|
+
var asString = serializeRules$5(token[1]);
|
|
6730
6730
|
return asString.indexOf('__') > -1 || asString.indexOf('--') > -1;
|
|
6731
6731
|
}
|
|
6732
6732
|
|
|
@@ -6735,11 +6735,11 @@ function withoutModifier(selector) {
|
|
|
6735
6735
|
}
|
|
6736
6736
|
|
|
6737
6737
|
function removeAnyUnsafeElements(left, candidates) {
|
|
6738
|
-
var leftSelector = withoutModifier(serializeRules$
|
|
6738
|
+
var leftSelector = withoutModifier(serializeRules$5(left[1]));
|
|
6739
6739
|
|
|
6740
6740
|
for (var body in candidates) {
|
|
6741
6741
|
var right = candidates[body];
|
|
6742
|
-
var rightSelector = withoutModifier(serializeRules$
|
|
6742
|
+
var rightSelector = withoutModifier(serializeRules$5(right[1]));
|
|
6743
6743
|
|
|
6744
6744
|
if (rightSelector.indexOf(leftSelector) > -1 || leftSelector.indexOf(rightSelector) > -1)
|
|
6745
6745
|
delete candidates[body];
|
|
@@ -6748,9 +6748,9 @@ function removeAnyUnsafeElements(left, candidates) {
|
|
|
6748
6748
|
|
|
6749
6749
|
function mergeNonAdjacentByBody(tokens, context) {
|
|
6750
6750
|
var options = context.options;
|
|
6751
|
-
var mergeSemantically = options.level[OptimizationLevel$
|
|
6751
|
+
var mergeSemantically = options.level[OptimizationLevel$1.Two].mergeSemantically;
|
|
6752
6752
|
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
|
|
6753
|
-
var selectorsSortingMethod = options.level[OptimizationLevel$
|
|
6753
|
+
var selectorsSortingMethod = options.level[OptimizationLevel$1.One].selectorsSortingMethod;
|
|
6754
6754
|
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
|
|
6755
6755
|
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
|
|
6756
6756
|
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
|
|
@@ -6761,17 +6761,17 @@ function mergeNonAdjacentByBody(tokens, context) {
|
|
|
6761
6761
|
if (token$1[0] != token.RULE)
|
|
6762
6762
|
continue;
|
|
6763
6763
|
|
|
6764
|
-
if (token$1[2].length > 0 && (!mergeSemantically && unsafeSelector(serializeRules$
|
|
6764
|
+
if (token$1[2].length > 0 && (!mergeSemantically && unsafeSelector(serializeRules$5(token$1[1]))))
|
|
6765
6765
|
candidates = {};
|
|
6766
6766
|
|
|
6767
6767
|
if (token$1[2].length > 0 && mergeSemantically && isBemElement(token$1))
|
|
6768
6768
|
removeAnyUnsafeElements(token$1, candidates);
|
|
6769
6769
|
|
|
6770
|
-
var candidateBody = serializeBody$
|
|
6770
|
+
var candidateBody = serializeBody$3(token$1[2]);
|
|
6771
6771
|
var oldToken = candidates[candidateBody];
|
|
6772
6772
|
if (oldToken &&
|
|
6773
|
-
isMergeable_1(serializeRules$
|
|
6774
|
-
isMergeable_1(serializeRules$
|
|
6773
|
+
isMergeable_1(serializeRules$5(token$1[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
|
|
6774
|
+
isMergeable_1(serializeRules$5(oldToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) {
|
|
6775
6775
|
|
|
6776
6776
|
if (token$1[2].length > 0) {
|
|
6777
6777
|
token$1[1] = tidyRules_1(oldToken[1].concat(token$1[1]), false, adjacentSpace, false, context.warnings);
|
|
@@ -6784,18 +6784,18 @@ function mergeNonAdjacentByBody(tokens, context) {
|
|
|
6784
6784
|
candidates[candidateBody] = null;
|
|
6785
6785
|
}
|
|
6786
6786
|
|
|
6787
|
-
candidates[serializeBody$
|
|
6787
|
+
candidates[serializeBody$3(token$1[2])] = token$1;
|
|
6788
6788
|
}
|
|
6789
6789
|
}
|
|
6790
6790
|
|
|
6791
6791
|
var mergeNonAdjacentByBody_1 = mergeNonAdjacentByBody;
|
|
6792
6792
|
|
|
6793
|
-
var canReorder
|
|
6793
|
+
var canReorder = reorderable.canReorder;
|
|
6794
6794
|
|
|
6795
6795
|
|
|
6796
6796
|
|
|
6797
6797
|
|
|
6798
|
-
var serializeRules$
|
|
6798
|
+
var serializeRules$4 = oneTime.rules;
|
|
6799
6799
|
|
|
6800
6800
|
|
|
6801
6801
|
|
|
@@ -6811,7 +6811,7 @@ function mergeNonAdjacentBySelector(tokens, context) {
|
|
|
6811
6811
|
if (tokens[i][2].length === 0)
|
|
6812
6812
|
continue;
|
|
6813
6813
|
|
|
6814
|
-
var selector = serializeRules$
|
|
6814
|
+
var selector = serializeRules$4(tokens[i][1]);
|
|
6815
6815
|
allSelectors[selector] = [i].concat(allSelectors[selector] || []);
|
|
6816
6816
|
|
|
6817
6817
|
if (allSelectors[selector].length == 2)
|
|
@@ -6844,8 +6844,8 @@ function mergeNonAdjacentBySelector(tokens, context) {
|
|
|
6844
6844
|
|
|
6845
6845
|
// traversed then moved as we move selectors towards the start
|
|
6846
6846
|
var reorderable = topToBottom ?
|
|
6847
|
-
canReorder
|
|
6848
|
-
canReorder
|
|
6847
|
+
canReorder(movedProperties, traversedProperties, specificityCache) :
|
|
6848
|
+
canReorder(traversedProperties, movedProperties, specificityCache);
|
|
6849
6849
|
|
|
6850
6850
|
if (!reorderable && !topToBottom)
|
|
6851
6851
|
continue selectorIterator;
|
|
@@ -6860,7 +6860,7 @@ function mergeNonAdjacentBySelector(tokens, context) {
|
|
|
6860
6860
|
Array.prototype.push.apply(target[2], moved[2]);
|
|
6861
6861
|
}
|
|
6862
6862
|
|
|
6863
|
-
optimize$
|
|
6863
|
+
optimize$1(target[2], true, true, context);
|
|
6864
6864
|
moved[2] = [];
|
|
6865
6865
|
}
|
|
6866
6866
|
}
|
|
@@ -6882,8 +6882,8 @@ function cloneArray(array) {
|
|
|
6882
6882
|
|
|
6883
6883
|
var cloneArray_1 = cloneArray;
|
|
6884
6884
|
|
|
6885
|
-
var serializeBody$
|
|
6886
|
-
var serializeRules$
|
|
6885
|
+
var serializeBody$2 = oneTime.body;
|
|
6886
|
+
var serializeRules$3 = oneTime.rules;
|
|
6887
6887
|
|
|
6888
6888
|
function reduceNonAdjacent(tokens, context) {
|
|
6889
6889
|
var options = context.options;
|
|
@@ -6902,7 +6902,7 @@ function reduceNonAdjacent(tokens, context) {
|
|
|
6902
6902
|
continue;
|
|
6903
6903
|
}
|
|
6904
6904
|
|
|
6905
|
-
var selectorAsString = serializeRules$
|
|
6905
|
+
var selectorAsString = serializeRules$3(token$1[1]);
|
|
6906
6906
|
var isComplexAndNotSpecial = token$1[1].length > 1 &&
|
|
6907
6907
|
isMergeable_1(selectorAsString, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging);
|
|
6908
6908
|
var wrappedSelectors = wrappedSelectorsFrom(token$1[1]);
|
|
@@ -7008,7 +7008,7 @@ function reduceComplexNonAdjacentCases(tokens, candidates, options, context) {
|
|
|
7008
7008
|
callback: collectReducedBodies
|
|
7009
7009
|
}, options, context);
|
|
7010
7010
|
|
|
7011
|
-
if (serializeBody$
|
|
7011
|
+
if (serializeBody$2(reducedBodies[reducedBodies.length - 1]) != serializeBody$2(reducedBodies[0]))
|
|
7012
7012
|
continue allSelectors;
|
|
7013
7013
|
}
|
|
7014
7014
|
|
|
@@ -7034,7 +7034,7 @@ function reduceSelector(tokens, data, context, options, outerContext) {
|
|
|
7034
7034
|
processedTokens.push(where);
|
|
7035
7035
|
}
|
|
7036
7036
|
|
|
7037
|
-
optimize$
|
|
7037
|
+
optimize$1(bodies, true, false, outerContext);
|
|
7038
7038
|
|
|
7039
7039
|
var processedCount = processedTokens.length;
|
|
7040
7040
|
var propertyIdx = bodies.length - 1;
|
|
@@ -7055,7 +7055,7 @@ function reduceSelector(tokens, data, context, options, outerContext) {
|
|
|
7055
7055
|
|
|
7056
7056
|
var reduceNonAdjacent_1 = reduceNonAdjacent;
|
|
7057
7057
|
|
|
7058
|
-
var serializeAll = oneTime.all;
|
|
7058
|
+
var serializeAll$1 = oneTime.all;
|
|
7059
7059
|
|
|
7060
7060
|
var FONT_FACE_SCOPE = '@font-face';
|
|
7061
7061
|
|
|
@@ -7072,7 +7072,7 @@ function removeDuplicateFontAtRules(tokens) {
|
|
|
7072
7072
|
continue;
|
|
7073
7073
|
}
|
|
7074
7074
|
|
|
7075
|
-
key = serializeAll([token$1]);
|
|
7075
|
+
key = serializeAll$1([token$1]);
|
|
7076
7076
|
|
|
7077
7077
|
if (fontAtRules.indexOf(key) > -1) {
|
|
7078
7078
|
token$1[2] = [];
|
|
@@ -7084,8 +7084,8 @@ function removeDuplicateFontAtRules(tokens) {
|
|
|
7084
7084
|
|
|
7085
7085
|
var removeDuplicateFontAtRules_1 = removeDuplicateFontAtRules;
|
|
7086
7086
|
|
|
7087
|
-
var serializeAll
|
|
7088
|
-
var serializeRules$
|
|
7087
|
+
var serializeAll = oneTime.all;
|
|
7088
|
+
var serializeRules$2 = oneTime.rules;
|
|
7089
7089
|
|
|
7090
7090
|
function removeDuplicateMediaQueries(tokens) {
|
|
7091
7091
|
var candidates = {};
|
|
@@ -7100,7 +7100,7 @@ function removeDuplicateMediaQueries(tokens) {
|
|
|
7100
7100
|
continue;
|
|
7101
7101
|
}
|
|
7102
7102
|
|
|
7103
|
-
key = serializeRules$
|
|
7103
|
+
key = serializeRules$2(token$1[1]) + '%' + serializeAll(token$1[2]);
|
|
7104
7104
|
candidate = candidates[key];
|
|
7105
7105
|
|
|
7106
7106
|
if (candidate) {
|
|
@@ -7113,8 +7113,8 @@ function removeDuplicateMediaQueries(tokens) {
|
|
|
7113
7113
|
|
|
7114
7114
|
var removeDuplicateMediaQueries_1 = removeDuplicateMediaQueries;
|
|
7115
7115
|
|
|
7116
|
-
var serializeBody$
|
|
7117
|
-
var serializeRules$
|
|
7116
|
+
var serializeBody$1 = oneTime.body;
|
|
7117
|
+
var serializeRules$1 = oneTime.rules;
|
|
7118
7118
|
|
|
7119
7119
|
function removeDuplicates(tokens) {
|
|
7120
7120
|
var matched = {};
|
|
@@ -7127,7 +7127,7 @@ function removeDuplicates(tokens) {
|
|
|
7127
7127
|
if (token$1[0] != token.RULE)
|
|
7128
7128
|
continue;
|
|
7129
7129
|
|
|
7130
|
-
id = serializeRules$
|
|
7130
|
+
id = serializeRules$1(token$1[1]);
|
|
7131
7131
|
|
|
7132
7132
|
if (matched[id] && matched[id].length == 1)
|
|
7133
7133
|
moreThanOnce.push(id);
|
|
@@ -7143,7 +7143,7 @@ function removeDuplicates(tokens) {
|
|
|
7143
7143
|
|
|
7144
7144
|
for (var j = matched[id].length - 1; j >= 0; j--) {
|
|
7145
7145
|
token$1 = tokens[matched[id][j]];
|
|
7146
|
-
body = serializeBody$
|
|
7146
|
+
body = serializeBody$1(token$1[2]);
|
|
7147
7147
|
|
|
7148
7148
|
if (bodies.indexOf(body) > -1)
|
|
7149
7149
|
token$1[2] = [];
|
|
@@ -7155,7 +7155,7 @@ function removeDuplicates(tokens) {
|
|
|
7155
7155
|
|
|
7156
7156
|
var removeDuplicates_1 = removeDuplicates;
|
|
7157
7157
|
|
|
7158
|
-
var wrapForOptimizing
|
|
7158
|
+
var wrapForOptimizing = wrapForOptimizing$3.single;
|
|
7159
7159
|
|
|
7160
7160
|
|
|
7161
7161
|
|
|
@@ -7166,7 +7166,7 @@ var keyframeRegex = /^@(\-moz\-|\-o\-|\-webkit\-)?keyframes /;
|
|
|
7166
7166
|
var importantRegex = /\s{0,31}!important$/;
|
|
7167
7167
|
var optionalMatchingQuotesRegex = /^(['"]?)(.*)\1$/;
|
|
7168
7168
|
|
|
7169
|
-
function normalize(value) {
|
|
7169
|
+
function normalize$1(value) {
|
|
7170
7170
|
return value
|
|
7171
7171
|
.replace(optionalMatchingQuotesRegex, '$2')
|
|
7172
7172
|
.replace(importantRegex, '');
|
|
@@ -7243,7 +7243,7 @@ function markCounterStylesAsUsed(atRules) {
|
|
|
7243
7243
|
property = token[2][i];
|
|
7244
7244
|
|
|
7245
7245
|
if (property[1][1] == 'list-style') {
|
|
7246
|
-
wrappedProperty = wrapForOptimizing
|
|
7246
|
+
wrappedProperty = wrapForOptimizing(property);
|
|
7247
7247
|
populateComponents_1([wrappedProperty], context.validator, context.warnings);
|
|
7248
7248
|
|
|
7249
7249
|
if (wrappedProperty.components[0].value[0][1] in atRules) {
|
|
@@ -7270,7 +7270,7 @@ function matchFontFace(token$1, atRules) {
|
|
|
7270
7270
|
property = token$1[2][i];
|
|
7271
7271
|
|
|
7272
7272
|
if (property[1][1] == 'font-family') {
|
|
7273
|
-
match = normalize(property[2][1].toLowerCase());
|
|
7273
|
+
match = normalize$1(property[2][1].toLowerCase());
|
|
7274
7274
|
atRules[match] = atRules[match] || [];
|
|
7275
7275
|
atRules[match].push(token$1);
|
|
7276
7276
|
break;
|
|
@@ -7292,12 +7292,12 @@ function markFontFacesAsUsed(atRules) {
|
|
|
7292
7292
|
property = token[2][i];
|
|
7293
7293
|
|
|
7294
7294
|
if (property[1][1] == 'font') {
|
|
7295
|
-
wrappedProperty = wrapForOptimizing
|
|
7295
|
+
wrappedProperty = wrapForOptimizing(property);
|
|
7296
7296
|
populateComponents_1([wrappedProperty], context.validator, context.warnings);
|
|
7297
7297
|
component = wrappedProperty.components[6];
|
|
7298
7298
|
|
|
7299
7299
|
for (j = 0, m = component.value.length; j < m; j++) {
|
|
7300
|
-
normalizedMatch = normalize(component.value[j][1].toLowerCase());
|
|
7300
|
+
normalizedMatch = normalize$1(component.value[j][1].toLowerCase());
|
|
7301
7301
|
|
|
7302
7302
|
if (normalizedMatch in atRules) {
|
|
7303
7303
|
delete atRules[normalizedMatch];
|
|
@@ -7309,7 +7309,7 @@ function markFontFacesAsUsed(atRules) {
|
|
|
7309
7309
|
|
|
7310
7310
|
if (property[1][1] == 'font-family') {
|
|
7311
7311
|
for (j = 2, m = property.length; j < m; j++) {
|
|
7312
|
-
normalizedMatch = normalize(property[j][1].toLowerCase());
|
|
7312
|
+
normalizedMatch = normalize$1(property[j][1].toLowerCase());
|
|
7313
7313
|
|
|
7314
7314
|
if (normalizedMatch in atRules) {
|
|
7315
7315
|
delete atRules[normalizedMatch];
|
|
@@ -7342,7 +7342,7 @@ function markKeyframesAsUsed(atRules) {
|
|
|
7342
7342
|
property = token[2][i];
|
|
7343
7343
|
|
|
7344
7344
|
if (animationRegex.test(property[1][1])) {
|
|
7345
|
-
wrappedProperty = wrapForOptimizing
|
|
7345
|
+
wrappedProperty = wrapForOptimizing(property);
|
|
7346
7346
|
populateComponents_1([wrappedProperty], context.validator, context.warnings);
|
|
7347
7347
|
component = wrappedProperty.components[7];
|
|
7348
7348
|
|
|
@@ -7425,7 +7425,7 @@ function tidyRuleDuplicates(rules) {
|
|
|
7425
7425
|
|
|
7426
7426
|
var tidyRuleDuplicates_1 = tidyRuleDuplicates;
|
|
7427
7427
|
|
|
7428
|
-
var canReorderSingle
|
|
7428
|
+
var canReorderSingle = reorderable.canReorderSingle;
|
|
7429
7429
|
|
|
7430
7430
|
|
|
7431
7431
|
|
|
@@ -7434,10 +7434,10 @@ var canReorderSingle$2 = reorderable.canReorderSingle;
|
|
|
7434
7434
|
|
|
7435
7435
|
|
|
7436
7436
|
|
|
7437
|
-
var serializeBody
|
|
7438
|
-
var serializeRules
|
|
7437
|
+
var serializeBody = oneTime.body;
|
|
7438
|
+
var serializeRules = oneTime.rules;
|
|
7439
7439
|
|
|
7440
|
-
function naturalSorter
|
|
7440
|
+
function naturalSorter(a, b) {
|
|
7441
7441
|
return a > b ? 1 : -1;
|
|
7442
7442
|
}
|
|
7443
7443
|
|
|
@@ -7504,7 +7504,7 @@ function restructure(tokens, context) {
|
|
|
7504
7504
|
function cacheId(cachedTokens) {
|
|
7505
7505
|
var id = [];
|
|
7506
7506
|
for (var i = 0, l = cachedTokens.length; i < l; i++) {
|
|
7507
|
-
id.push(serializeRules
|
|
7507
|
+
id.push(serializeRules(cachedTokens[i][1]));
|
|
7508
7508
|
}
|
|
7509
7509
|
return id.join(ID_JOIN_CHARACTER);
|
|
7510
7510
|
}
|
|
@@ -7514,7 +7514,7 @@ function restructure(tokens, context) {
|
|
|
7514
7514
|
var mergeableTokens = [];
|
|
7515
7515
|
|
|
7516
7516
|
for (var i = sourceTokens.length - 1; i >= 0; i--) {
|
|
7517
|
-
if (!isMergeable_1(serializeRules
|
|
7517
|
+
if (!isMergeable_1(serializeRules(sourceTokens[i][1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) {
|
|
7518
7518
|
continue;
|
|
7519
7519
|
}
|
|
7520
7520
|
|
|
@@ -7579,7 +7579,7 @@ function restructure(tokens, context) {
|
|
|
7579
7579
|
function sizeDifference(tokensVariant, propertySize, propertiesCount) {
|
|
7580
7580
|
var allSelectorsSize = 0;
|
|
7581
7581
|
for (var i = tokensVariant.length - 1; i >= 0; i--) {
|
|
7582
|
-
allSelectorsSize += tokensVariant[i][2].length > propertiesCount ? serializeRules
|
|
7582
|
+
allSelectorsSize += tokensVariant[i][2].length > propertiesCount ? serializeRules(tokensVariant[i][1]).length : -1;
|
|
7583
7583
|
}
|
|
7584
7584
|
return allSelectorsSize - (tokensVariant.length - 1) * propertySize + 1;
|
|
7585
7585
|
}
|
|
@@ -7600,7 +7600,7 @@ function restructure(tokens, context) {
|
|
|
7600
7600
|
var mergeablePropertyName = mergeableProperty[1][1];
|
|
7601
7601
|
var propertyName = property[0];
|
|
7602
7602
|
var propertyBody = property[4];
|
|
7603
|
-
if (mergeablePropertyName == propertyName && serializeBody
|
|
7603
|
+
if (mergeablePropertyName == propertyName && serializeBody([mergeableProperty]) == propertyBody) {
|
|
7604
7604
|
mergeableToken[2].splice(j, 1);
|
|
7605
7605
|
break;
|
|
7606
7606
|
}
|
|
@@ -7738,7 +7738,7 @@ function restructure(tokens, context) {
|
|
|
7738
7738
|
var unmovableInCurrentToken = [];
|
|
7739
7739
|
for (j = properties.length - 1; j >= 0; j--) {
|
|
7740
7740
|
for (k = j - 1; k >= 0; k--) {
|
|
7741
|
-
if (!canReorderSingle
|
|
7741
|
+
if (!canReorderSingle(properties[j], properties[k], specificityCache)) {
|
|
7742
7742
|
unmovableInCurrentToken.push(j);
|
|
7743
7743
|
break;
|
|
7744
7744
|
}
|
|
@@ -7752,7 +7752,7 @@ function restructure(tokens, context) {
|
|
|
7752
7752
|
for (k = 0; k < movedCount; k++) {
|
|
7753
7753
|
var movedProperty = movedProperties[k];
|
|
7754
7754
|
|
|
7755
|
-
if (movedToBeDropped.indexOf(k) == -1 && (!canReorderSingle
|
|
7755
|
+
if (movedToBeDropped.indexOf(k) == -1 && (!canReorderSingle(property, movedProperty, specificityCache) && !boundToAnotherPropertyInCurrrentToken(property, movedProperty, token$1) ||
|
|
7756
7756
|
movableTokens[movedProperty[4]] && movableTokens[movedProperty[4]].length === mergeLimit)) {
|
|
7757
7757
|
dropPropertiesAt(i + 1, movedProperty);
|
|
7758
7758
|
|
|
@@ -7793,7 +7793,7 @@ function restructure(tokens, context) {
|
|
|
7793
7793
|
}
|
|
7794
7794
|
}
|
|
7795
7795
|
|
|
7796
|
-
movedToBeDropped = movedToBeDropped.sort(naturalSorter
|
|
7796
|
+
movedToBeDropped = movedToBeDropped.sort(naturalSorter);
|
|
7797
7797
|
for (j = 0, m = movedToBeDropped.length; j < m; j++) {
|
|
7798
7798
|
var dropAt = movedToBeDropped[j] - j;
|
|
7799
7799
|
movedProperties.splice(dropAt, 1);
|
|
@@ -7815,7 +7815,7 @@ function restructure(tokens, context) {
|
|
|
7815
7815
|
|
|
7816
7816
|
var restructure_1 = restructure;
|
|
7817
7817
|
|
|
7818
|
-
var OptimizationLevel
|
|
7818
|
+
var OptimizationLevel = optimizationLevel.OptimizationLevel;
|
|
7819
7819
|
|
|
7820
7820
|
|
|
7821
7821
|
|
|
@@ -7864,7 +7864,7 @@ function recursivelyOptimizeProperties(tokens, context) {
|
|
|
7864
7864
|
|
|
7865
7865
|
switch (token$1[0]) {
|
|
7866
7866
|
case token.RULE:
|
|
7867
|
-
optimize$
|
|
7867
|
+
optimize$1(token$1[2], true, true, context);
|
|
7868
7868
|
break;
|
|
7869
7869
|
case token.NESTED_BLOCK:
|
|
7870
7870
|
recursivelyOptimizeProperties(token$1[2], context);
|
|
@@ -7873,7 +7873,7 @@ function recursivelyOptimizeProperties(tokens, context) {
|
|
|
7873
7873
|
}
|
|
7874
7874
|
|
|
7875
7875
|
function level2Optimize(tokens, context, withRestructuring) {
|
|
7876
|
-
var levelOptions = context.options.level[OptimizationLevel
|
|
7876
|
+
var levelOptions = context.options.level[OptimizationLevel.Two];
|
|
7877
7877
|
var reduced;
|
|
7878
7878
|
var i;
|
|
7879
7879
|
|
|
@@ -7935,7 +7935,7 @@ function level2Optimize(tokens, context, withRestructuring) {
|
|
|
7935
7935
|
return tokens;
|
|
7936
7936
|
}
|
|
7937
7937
|
|
|
7938
|
-
var optimize
|
|
7938
|
+
var optimize = level2Optimize;
|
|
7939
7939
|
|
|
7940
7940
|
var functionNoVendorRegexStr = '[A-Z]+(\\-|[A-Z]|[0-9])+\\(.*?\\)';
|
|
7941
7941
|
var functionVendorRegexStr = '\\-(\\-|[A-Z]|[0-9])+\\(.*?\\)';
|
|
@@ -8319,7 +8319,7 @@ function isIdentifier(value) {
|
|
|
8319
8319
|
}
|
|
8320
8320
|
|
|
8321
8321
|
function isImage(value) {
|
|
8322
|
-
return value == 'none' || value == 'inherit' || isUrl
|
|
8322
|
+
return value == 'none' || value == 'inherit' || isUrl(value);
|
|
8323
8323
|
}
|
|
8324
8324
|
|
|
8325
8325
|
function isKeyword(propertyName) {
|
|
@@ -8377,7 +8377,7 @@ function isUnit(validUnits, value) {
|
|
|
8377
8377
|
value == 'inherit';
|
|
8378
8378
|
}
|
|
8379
8379
|
|
|
8380
|
-
function isUrl
|
|
8380
|
+
function isUrl(value) {
|
|
8381
8381
|
return urlRegex.test(value);
|
|
8382
8382
|
}
|
|
8383
8383
|
|
|
@@ -8458,7 +8458,7 @@ function validator(compatibility) {
|
|
|
8458
8458
|
isStyleKeyword: isKeyword('*-style'),
|
|
8459
8459
|
isTime: isTime,
|
|
8460
8460
|
isUnit: isUnit.bind(null, validUnits),
|
|
8461
|
-
isUrl: isUrl
|
|
8461
|
+
isUrl: isUrl,
|
|
8462
8462
|
isVariable: isVariable,
|
|
8463
8463
|
isWidth: isKeyword('width'),
|
|
8464
8464
|
isZIndex: isZIndex
|
|
@@ -8467,7 +8467,7 @@ function validator(compatibility) {
|
|
|
8467
8467
|
|
|
8468
8468
|
var validator_1 = validator;
|
|
8469
8469
|
|
|
8470
|
-
var DEFAULTS
|
|
8470
|
+
var DEFAULTS = {
|
|
8471
8471
|
'*': {
|
|
8472
8472
|
colors: {
|
|
8473
8473
|
opacity: true // rgba / hsla
|
|
@@ -8544,18 +8544,18 @@ var DEFAULTS$2 = {
|
|
|
8544
8544
|
}
|
|
8545
8545
|
};
|
|
8546
8546
|
|
|
8547
|
-
DEFAULTS
|
|
8547
|
+
DEFAULTS.ie11 = DEFAULTS['*'];
|
|
8548
8548
|
|
|
8549
|
-
DEFAULTS
|
|
8549
|
+
DEFAULTS.ie10 = DEFAULTS['*'];
|
|
8550
8550
|
|
|
8551
|
-
DEFAULTS
|
|
8551
|
+
DEFAULTS.ie9 = merge(DEFAULTS['*'], {
|
|
8552
8552
|
properties: {
|
|
8553
8553
|
ieFilters: true,
|
|
8554
8554
|
ieSuffixHack: true
|
|
8555
8555
|
}
|
|
8556
8556
|
});
|
|
8557
8557
|
|
|
8558
|
-
DEFAULTS
|
|
8558
|
+
DEFAULTS.ie8 = merge(DEFAULTS.ie9, {
|
|
8559
8559
|
colors: {
|
|
8560
8560
|
opacity: false
|
|
8561
8561
|
},
|
|
@@ -8589,7 +8589,7 @@ DEFAULTS$2.ie8 = merge(DEFAULTS$2.ie9, {
|
|
|
8589
8589
|
}
|
|
8590
8590
|
});
|
|
8591
8591
|
|
|
8592
|
-
DEFAULTS
|
|
8592
|
+
DEFAULTS.ie7 = merge(DEFAULTS.ie8, {
|
|
8593
8593
|
properties: {
|
|
8594
8594
|
ieBangHack: true
|
|
8595
8595
|
},
|
|
@@ -8605,7 +8605,7 @@ DEFAULTS$2.ie7 = merge(DEFAULTS$2.ie8, {
|
|
|
8605
8605
|
});
|
|
8606
8606
|
|
|
8607
8607
|
function compatibilityFrom(source) {
|
|
8608
|
-
return merge(DEFAULTS
|
|
8608
|
+
return merge(DEFAULTS['*'], calculateSource(source));
|
|
8609
8609
|
}
|
|
8610
8610
|
|
|
8611
8611
|
function merge(source, target) {
|
|
@@ -8627,12 +8627,12 @@ function calculateSource(source) {
|
|
|
8627
8627
|
return source;
|
|
8628
8628
|
|
|
8629
8629
|
if (!/[,\+\-]/.test(source))
|
|
8630
|
-
return DEFAULTS
|
|
8630
|
+
return DEFAULTS[source] || DEFAULTS['*'];
|
|
8631
8631
|
|
|
8632
8632
|
var parts = source.split(',');
|
|
8633
|
-
var template = parts[0] in DEFAULTS
|
|
8634
|
-
DEFAULTS
|
|
8635
|
-
DEFAULTS
|
|
8633
|
+
var template = parts[0] in DEFAULTS ?
|
|
8634
|
+
DEFAULTS[parts.shift()] :
|
|
8635
|
+
DEFAULTS['*'];
|
|
8636
8636
|
|
|
8637
8637
|
source = {};
|
|
8638
8638
|
|
|
@@ -8667,7 +8667,7 @@ function isHttpsResource(uri) {
|
|
|
8667
8667
|
|
|
8668
8668
|
var isHttpsResource_1 = isHttpsResource;
|
|
8669
8669
|
|
|
8670
|
-
var HTTP_PROTOCOL = 'http:';
|
|
8670
|
+
var HTTP_PROTOCOL$1 = 'http:';
|
|
8671
8671
|
|
|
8672
8672
|
function loadRemoteResource(uri, inlineRequest, inlineTimeout, callback) {
|
|
8673
8673
|
var proxyProtocol = inlineRequest.protocol || inlineRequest.hostname;
|
|
@@ -8682,7 +8682,7 @@ function loadRemoteResource(uri, inlineRequest, inlineTimeout, callback) {
|
|
|
8682
8682
|
|
|
8683
8683
|
if (inlineRequest.hostname !== undefined) {
|
|
8684
8684
|
// overwrite as we always expect a http proxy currently
|
|
8685
|
-
requestOptions.protocol = inlineRequest.protocol || HTTP_PROTOCOL;
|
|
8685
|
+
requestOptions.protocol = inlineRequest.protocol || HTTP_PROTOCOL$1;
|
|
8686
8686
|
requestOptions.path = requestOptions.href;
|
|
8687
8687
|
}
|
|
8688
8688
|
|
|
@@ -8754,7 +8754,7 @@ function inlineOptionsFrom(rules) {
|
|
|
8754
8754
|
rules.split(',');
|
|
8755
8755
|
}
|
|
8756
8756
|
|
|
8757
|
-
var inline = inlineOptionsFrom;
|
|
8757
|
+
var inline$1 = inlineOptionsFrom;
|
|
8758
8758
|
|
|
8759
8759
|
function inlineRequestFrom(option) {
|
|
8760
8760
|
return override_1(
|
|
@@ -8787,7 +8787,7 @@ function rebaseFrom(rebaseOption) {
|
|
|
8787
8787
|
return undefined === rebaseOption ? true : !!rebaseOption;
|
|
8788
8788
|
}
|
|
8789
8789
|
|
|
8790
|
-
var rebase = rebaseFrom;
|
|
8790
|
+
var rebase$2 = rebaseFrom;
|
|
8791
8791
|
|
|
8792
8792
|
function rebaseToFrom(option) {
|
|
8793
8793
|
return option ? path__default.resolve(option) : process.cwd();
|
|
@@ -8804,7 +8804,7 @@ function inputSourceMapTracker() {
|
|
|
8804
8804
|
all: all$2.bind(null, maps),
|
|
8805
8805
|
isTracking: isTracking.bind(null, maps),
|
|
8806
8806
|
originalPositionFor: originalPositionFor.bind(null, maps),
|
|
8807
|
-
track: track.bind(null, maps)
|
|
8807
|
+
track: track$2.bind(null, maps)
|
|
8808
8808
|
};
|
|
8809
8809
|
}
|
|
8810
8810
|
|
|
@@ -8848,7 +8848,7 @@ function toMetadata(asHash) {
|
|
|
8848
8848
|
return [asHash.line, asHash.column, asHash.source];
|
|
8849
8849
|
}
|
|
8850
8850
|
|
|
8851
|
-
function track(maps, source, data) {
|
|
8851
|
+
function track$2(maps, source, data) {
|
|
8852
8852
|
maps[source] = new SourceMapConsumer(data);
|
|
8853
8853
|
}
|
|
8854
8854
|
|
|
@@ -8870,7 +8870,7 @@ function hasProtocol(uri) {
|
|
|
8870
8870
|
|
|
8871
8871
|
var hasProtocol_1 = hasProtocol;
|
|
8872
8872
|
|
|
8873
|
-
var HTTP_PROTOCOL
|
|
8873
|
+
var HTTP_PROTOCOL = 'http:';
|
|
8874
8874
|
|
|
8875
8875
|
function isAllowedResource(uri, isRemote, rules) {
|
|
8876
8876
|
var match;
|
|
@@ -8886,7 +8886,7 @@ function isAllowedResource(uri, isRemote, rules) {
|
|
|
8886
8886
|
}
|
|
8887
8887
|
|
|
8888
8888
|
if (isRemote && !hasProtocol_1(uri)) {
|
|
8889
|
-
uri = HTTP_PROTOCOL
|
|
8889
|
+
uri = HTTP_PROTOCOL + uri;
|
|
8890
8890
|
}
|
|
8891
8891
|
|
|
8892
8892
|
match = isRemote ?
|
|
@@ -8937,15 +8937,15 @@ function isAllowedResource(uri, isRemote, rules) {
|
|
|
8937
8937
|
}
|
|
8938
8938
|
|
|
8939
8939
|
function isRemoteRule(rule) {
|
|
8940
|
-
return isRemoteResource_1(rule) || url__default.parse(HTTP_PROTOCOL
|
|
8940
|
+
return isRemoteResource_1(rule) || url__default.parse(HTTP_PROTOCOL + '//' + rule).host == rule;
|
|
8941
8941
|
}
|
|
8942
8942
|
|
|
8943
8943
|
var isAllowedResource_1 = isAllowedResource;
|
|
8944
8944
|
|
|
8945
|
-
var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
|
|
8945
|
+
var DATA_URI_PATTERN$1 = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
|
|
8946
8946
|
|
|
8947
8947
|
function matchDataUri(uri) {
|
|
8948
|
-
return DATA_URI_PATTERN.exec(uri);
|
|
8948
|
+
return DATA_URI_PATTERN$1.exec(uri);
|
|
8949
8949
|
}
|
|
8950
8950
|
|
|
8951
8951
|
var matchDataUri_1 = matchDataUri;
|
|
@@ -8976,10 +8976,10 @@ function rebaseRemoteMap(sourceMap, sourceUri) {
|
|
|
8976
8976
|
|
|
8977
8977
|
var rebaseRemoteMap_1 = rebaseRemoteMap;
|
|
8978
8978
|
|
|
8979
|
-
var DATA_URI_PATTERN
|
|
8979
|
+
var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
|
|
8980
8980
|
|
|
8981
8981
|
function isDataUriResource(uri) {
|
|
8982
|
-
return DATA_URI_PATTERN
|
|
8982
|
+
return DATA_URI_PATTERN.test(uri);
|
|
8983
8983
|
}
|
|
8984
8984
|
|
|
8985
8985
|
var isDataUriResource_1 = isDataUriResource;
|
|
@@ -9220,10 +9220,10 @@ var applySourceMaps_1 = applySourceMaps;
|
|
|
9220
9220
|
var BRACE_PREFIX = /^\(/;
|
|
9221
9221
|
var BRACE_SUFFIX = /\)$/;
|
|
9222
9222
|
var IMPORT_PREFIX_PATTERN$1 = /^@import/i;
|
|
9223
|
-
var QUOTE_PREFIX_PATTERN = /['"]\s*/;
|
|
9224
|
-
var QUOTE_SUFFIX_PATTERN = /\s*['"]/;
|
|
9223
|
+
var QUOTE_PREFIX_PATTERN$1 = /['"]\s*/;
|
|
9224
|
+
var QUOTE_SUFFIX_PATTERN$1 = /\s*['"]/;
|
|
9225
9225
|
var URL_PREFIX_PATTERN$1 = /^url\(\s*/i;
|
|
9226
|
-
var URL_SUFFIX_PATTERN = /\s*\)/i;
|
|
9226
|
+
var URL_SUFFIX_PATTERN$1 = /\s*\)/i;
|
|
9227
9227
|
|
|
9228
9228
|
function extractImportUrlAndMedia(atRuleValue) {
|
|
9229
9229
|
var uri;
|
|
@@ -9235,9 +9235,9 @@ function extractImportUrlAndMedia(atRuleValue) {
|
|
|
9235
9235
|
.replace(IMPORT_PREFIX_PATTERN$1, '')
|
|
9236
9236
|
.trim()
|
|
9237
9237
|
.replace(URL_PREFIX_PATTERN$1, '(')
|
|
9238
|
-
.replace(URL_SUFFIX_PATTERN, ')')
|
|
9239
|
-
.replace(QUOTE_PREFIX_PATTERN, '')
|
|
9240
|
-
.replace(QUOTE_SUFFIX_PATTERN, '');
|
|
9238
|
+
.replace(URL_SUFFIX_PATTERN$1, ')')
|
|
9239
|
+
.replace(QUOTE_PREFIX_PATTERN$1, '')
|
|
9240
|
+
.replace(QUOTE_SUFFIX_PATTERN$1, '');
|
|
9241
9241
|
|
|
9242
9242
|
parts = split_1(stripped, ' ');
|
|
9243
9243
|
|
|
@@ -9390,14 +9390,14 @@ var SINGLE_QUOTE = '\'';
|
|
|
9390
9390
|
var URL_PREFIX = 'url(';
|
|
9391
9391
|
var URL_SUFFIX = ')';
|
|
9392
9392
|
|
|
9393
|
-
var QUOTE_PREFIX_PATTERN
|
|
9394
|
-
var QUOTE_SUFFIX_PATTERN
|
|
9393
|
+
var QUOTE_PREFIX_PATTERN = /^["']/;
|
|
9394
|
+
var QUOTE_SUFFIX_PATTERN = /["']$/;
|
|
9395
9395
|
var ROUND_BRACKETS_PATTERN = /[\(\)]/;
|
|
9396
|
-
var URL_PREFIX_PATTERN
|
|
9397
|
-
var URL_SUFFIX_PATTERN
|
|
9398
|
-
var WHITESPACE_PATTERN
|
|
9396
|
+
var URL_PREFIX_PATTERN = /^url\(/i;
|
|
9397
|
+
var URL_SUFFIX_PATTERN = /\)$/;
|
|
9398
|
+
var WHITESPACE_PATTERN = /\s/;
|
|
9399
9399
|
|
|
9400
|
-
var isWindows = process.platform == 'win32';
|
|
9400
|
+
var isWindows$1 = process.platform == 'win32';
|
|
9401
9401
|
|
|
9402
9402
|
function rebase$1(uri, rebaseConfig) {
|
|
9403
9403
|
if (!rebaseConfig) {
|
|
@@ -9421,8 +9421,8 @@ function rebase$1(uri, rebaseConfig) {
|
|
|
9421
9421
|
}
|
|
9422
9422
|
|
|
9423
9423
|
return rebaseConfig.absolute ?
|
|
9424
|
-
normalize
|
|
9425
|
-
normalize
|
|
9424
|
+
normalize(absolute(uri, rebaseConfig)) :
|
|
9425
|
+
normalize(relative(uri, rebaseConfig));
|
|
9426
9426
|
}
|
|
9427
9427
|
|
|
9428
9428
|
function isAbsolute(uri) {
|
|
@@ -9455,8 +9455,8 @@ function relative(uri, rebaseConfig) {
|
|
|
9455
9455
|
return path__default.relative(rebaseConfig.toBase, path__default.join(rebaseConfig.fromBase || '', uri));
|
|
9456
9456
|
}
|
|
9457
9457
|
|
|
9458
|
-
function normalize
|
|
9459
|
-
return isWindows ? uri.replace(/\\/g, '/') : uri;
|
|
9458
|
+
function normalize(uri) {
|
|
9459
|
+
return isWindows$1 ? uri.replace(/\\/g, '/') : uri;
|
|
9460
9460
|
}
|
|
9461
9461
|
|
|
9462
9462
|
function quoteFor(unquotedUrl) {
|
|
@@ -9472,7 +9472,7 @@ function quoteFor(unquotedUrl) {
|
|
|
9472
9472
|
}
|
|
9473
9473
|
|
|
9474
9474
|
function hasWhitespace(url) {
|
|
9475
|
-
return WHITESPACE_PATTERN
|
|
9475
|
+
return WHITESPACE_PATTERN.test(url);
|
|
9476
9476
|
}
|
|
9477
9477
|
|
|
9478
9478
|
function hasRoundBrackets(url) {
|
|
@@ -9481,13 +9481,13 @@ function hasRoundBrackets(url) {
|
|
|
9481
9481
|
|
|
9482
9482
|
function rewriteUrl(originalUrl, rebaseConfig, pathOnly) {
|
|
9483
9483
|
var strippedUrl = originalUrl
|
|
9484
|
-
.replace(URL_PREFIX_PATTERN
|
|
9485
|
-
.replace(URL_SUFFIX_PATTERN
|
|
9484
|
+
.replace(URL_PREFIX_PATTERN, '')
|
|
9485
|
+
.replace(URL_SUFFIX_PATTERN, '')
|
|
9486
9486
|
.trim();
|
|
9487
9487
|
|
|
9488
9488
|
var unquotedUrl = strippedUrl
|
|
9489
|
-
.replace(QUOTE_PREFIX_PATTERN
|
|
9490
|
-
.replace(QUOTE_SUFFIX_PATTERN
|
|
9489
|
+
.replace(QUOTE_PREFIX_PATTERN, '')
|
|
9490
|
+
.replace(QUOTE_SUFFIX_PATTERN, '')
|
|
9491
9491
|
.trim();
|
|
9492
9492
|
|
|
9493
9493
|
var quote = strippedUrl[0] == SINGLE_QUOTE || strippedUrl[0] == DOUBLE_QUOTE ?
|
|
@@ -9501,17 +9501,17 @@ function rewriteUrl(originalUrl, rebaseConfig, pathOnly) {
|
|
|
9501
9501
|
|
|
9502
9502
|
var rewriteUrl_1 = rewriteUrl;
|
|
9503
9503
|
|
|
9504
|
-
var IMPORT_PREFIX_PATTERN
|
|
9504
|
+
var IMPORT_PREFIX_PATTERN = /^@import/i;
|
|
9505
9505
|
|
|
9506
|
-
function isImport
|
|
9507
|
-
return IMPORT_PREFIX_PATTERN
|
|
9506
|
+
function isImport(value) {
|
|
9507
|
+
return IMPORT_PREFIX_PATTERN.test(value);
|
|
9508
9508
|
}
|
|
9509
9509
|
|
|
9510
|
-
var isImport_1 = isImport
|
|
9510
|
+
var isImport_1 = isImport;
|
|
9511
9511
|
|
|
9512
9512
|
var SOURCE_MAP_COMMENT_PATTERN = /^\/\*# sourceMappingURL=(\S+) \*\/$/;
|
|
9513
9513
|
|
|
9514
|
-
function rebase
|
|
9514
|
+
function rebase(tokens, rebaseAll, validator, rebaseConfig) {
|
|
9515
9515
|
return rebaseAll ?
|
|
9516
9516
|
rebaseEverything(tokens, validator, rebaseConfig) :
|
|
9517
9517
|
rebaseAtRules(tokens, validator, rebaseConfig);
|
|
@@ -9602,9 +9602,9 @@ function rebaseProperties(properties, validator, rebaseConfig) {
|
|
|
9602
9602
|
}
|
|
9603
9603
|
}
|
|
9604
9604
|
|
|
9605
|
-
var rebase_1 = rebase
|
|
9605
|
+
var rebase_1 = rebase;
|
|
9606
9606
|
|
|
9607
|
-
var Level
|
|
9607
|
+
var Level = {
|
|
9608
9608
|
BLOCK: 'block',
|
|
9609
9609
|
COMMENT: 'comment',
|
|
9610
9610
|
DOUBLE_QUOTE: 'double-quote',
|
|
@@ -9666,7 +9666,7 @@ var TAIL_BROKEN_VALUE_PATTERN = /[\s|\}]*$/;
|
|
|
9666
9666
|
|
|
9667
9667
|
function tokenize(source, externalContext) {
|
|
9668
9668
|
var internalContext = {
|
|
9669
|
-
level: Level
|
|
9669
|
+
level: Level.BLOCK,
|
|
9670
9670
|
position: {
|
|
9671
9671
|
source: externalContext.source || undefined,
|
|
9672
9672
|
line: 1,
|
|
@@ -9715,14 +9715,14 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9715
9715
|
for (; position.index < source.length; position.index++) {
|
|
9716
9716
|
var character = source[position.index];
|
|
9717
9717
|
|
|
9718
|
-
isQuoted = level == Level
|
|
9718
|
+
isQuoted = level == Level.SINGLE_QUOTE || level == Level.DOUBLE_QUOTE;
|
|
9719
9719
|
isSpace = character == marker.SPACE || character == marker.TAB;
|
|
9720
9720
|
isNewLineNix = character == marker.NEW_LINE_NIX;
|
|
9721
9721
|
isNewLineWin = character == marker.NEW_LINE_NIX && source[position.index - 1] == marker.CARRIAGE_RETURN;
|
|
9722
9722
|
isCarriageReturn = character == marker.CARRIAGE_RETURN && source[position.index + 1] && source[position.index + 1] != marker.NEW_LINE_NIX;
|
|
9723
|
-
isCommentStart = !wasCommentEnd && level != Level
|
|
9723
|
+
isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == marker.ASTERISK && source[position.index - 1] == marker.FORWARD_SLASH;
|
|
9724
9724
|
isCommentEndMarker = !wasCommentStart && !isQuoted && character == marker.FORWARD_SLASH && source[position.index - 1] == marker.ASTERISK;
|
|
9725
|
-
isCommentEnd = level == Level
|
|
9725
|
+
isCommentEnd = level == Level.COMMENT && isCommentEndMarker;
|
|
9726
9726
|
roundBracketLevel = Math.max(roundBracketLevel, 0);
|
|
9727
9727
|
|
|
9728
9728
|
metadata = buffer.length === 0 ?
|
|
@@ -9732,11 +9732,11 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9732
9732
|
if (isEscaped) {
|
|
9733
9733
|
// previous character was a backslash
|
|
9734
9734
|
buffer.push(character);
|
|
9735
|
-
} else if (!isCommentEnd && level == Level
|
|
9735
|
+
} else if (!isCommentEnd && level == Level.COMMENT) {
|
|
9736
9736
|
buffer.push(character);
|
|
9737
9737
|
} else if (!isCommentStart && !isCommentEnd && isRaw) {
|
|
9738
9738
|
buffer.push(character);
|
|
9739
|
-
} else if (isCommentStart && (level == Level
|
|
9739
|
+
} else if (isCommentStart && (level == Level.BLOCK || level == Level.RULE) && buffer.length > 1) {
|
|
9740
9740
|
// comment start within block preceded by some content, e.g. div/*<--
|
|
9741
9741
|
metadatas.push(metadata);
|
|
9742
9742
|
buffer.push(character);
|
|
@@ -9746,11 +9746,11 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9746
9746
|
metadata = [position.line, position.column - 1, position.source];
|
|
9747
9747
|
|
|
9748
9748
|
levels.push(level);
|
|
9749
|
-
level = Level
|
|
9749
|
+
level = Level.COMMENT;
|
|
9750
9750
|
} else if (isCommentStart) {
|
|
9751
9751
|
// comment start, e.g. /*<--
|
|
9752
9752
|
levels.push(level);
|
|
9753
|
-
level = Level
|
|
9753
|
+
level = Level.COMMENT;
|
|
9754
9754
|
buffer.push(character);
|
|
9755
9755
|
} else if (isCommentEnd && isIgnoreStartComment(buffer)) {
|
|
9756
9756
|
// ignore:start comment end, e.g. /* clean-css ignore:start */<--
|
|
@@ -9794,58 +9794,58 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9794
9794
|
} else if (character == marker.SINGLE_QUOTE && !isQuoted) {
|
|
9795
9795
|
// single quotation start, e.g. a[href^='https<--
|
|
9796
9796
|
levels.push(level);
|
|
9797
|
-
level = Level
|
|
9797
|
+
level = Level.SINGLE_QUOTE;
|
|
9798
9798
|
buffer.push(character);
|
|
9799
|
-
} else if (character == marker.SINGLE_QUOTE && level == Level
|
|
9799
|
+
} else if (character == marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) {
|
|
9800
9800
|
// single quotation end, e.g. a[href^='https'<--
|
|
9801
9801
|
level = levels.pop();
|
|
9802
9802
|
buffer.push(character);
|
|
9803
9803
|
} else if (character == marker.DOUBLE_QUOTE && !isQuoted) {
|
|
9804
9804
|
// double quotation start, e.g. a[href^="<--
|
|
9805
9805
|
levels.push(level);
|
|
9806
|
-
level = Level
|
|
9806
|
+
level = Level.DOUBLE_QUOTE;
|
|
9807
9807
|
buffer.push(character);
|
|
9808
|
-
} else if (character == marker.DOUBLE_QUOTE && level == Level
|
|
9808
|
+
} else if (character == marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) {
|
|
9809
9809
|
// double quotation end, e.g. a[href^="https"<--
|
|
9810
9810
|
level = levels.pop();
|
|
9811
9811
|
buffer.push(character);
|
|
9812
|
-
} else if (!isCommentStart && !isCommentEnd && character != marker.CLOSE_ROUND_BRACKET && character != marker.OPEN_ROUND_BRACKET && level != Level
|
|
9812
|
+
} else if (!isCommentStart && !isCommentEnd && character != marker.CLOSE_ROUND_BRACKET && character != marker.OPEN_ROUND_BRACKET && level != Level.COMMENT && !isQuoted && roundBracketLevel > 0) {
|
|
9813
9813
|
// character inside any function, e.g. hsla(.<--
|
|
9814
9814
|
buffer.push(character);
|
|
9815
|
-
} else if (character == marker.OPEN_ROUND_BRACKET && !isQuoted && level != Level
|
|
9815
|
+
} else if (character == marker.OPEN_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
|
|
9816
9816
|
// round open bracket, e.g. @import url(<--
|
|
9817
9817
|
buffer.push(character);
|
|
9818
9818
|
|
|
9819
9819
|
roundBracketLevel++;
|
|
9820
|
-
} else if (character == marker.CLOSE_ROUND_BRACKET && !isQuoted && level != Level
|
|
9820
|
+
} else if (character == marker.CLOSE_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
|
|
9821
9821
|
// round open bracket, e.g. @import url(test.css)<--
|
|
9822
9822
|
buffer.push(character);
|
|
9823
9823
|
|
|
9824
9824
|
roundBracketLevel--;
|
|
9825
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9825
|
+
} else if (character == marker.SEMICOLON && level == Level.BLOCK && buffer[0] == marker.AT) {
|
|
9826
9826
|
// semicolon ending rule at block level, e.g. @import '...';<--
|
|
9827
9827
|
serializedBuffer = buffer.join('').trim();
|
|
9828
9828
|
allTokens.push([token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
9829
9829
|
|
|
9830
9830
|
buffer = [];
|
|
9831
|
-
} else if (character == marker.COMMA && level == Level
|
|
9831
|
+
} else if (character == marker.COMMA && level == Level.BLOCK && ruleToken) {
|
|
9832
9832
|
// comma separator at block level, e.g. a,div,<--
|
|
9833
9833
|
serializedBuffer = buffer.join('').trim();
|
|
9834
9834
|
ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)]]);
|
|
9835
9835
|
|
|
9836
9836
|
buffer = [];
|
|
9837
|
-
} else if (character == marker.COMMA && level == Level
|
|
9837
|
+
} else if (character == marker.COMMA && level == Level.BLOCK && tokenTypeFrom(buffer) == token.AT_RULE) {
|
|
9838
9838
|
// comma separator at block level, e.g. @import url(...) screen,<--
|
|
9839
9839
|
// keep iterating as end semicolon will create the token
|
|
9840
9840
|
buffer.push(character);
|
|
9841
|
-
} else if (character == marker.COMMA && level == Level
|
|
9841
|
+
} else if (character == marker.COMMA && level == Level.BLOCK) {
|
|
9842
9842
|
// comma separator at block level, e.g. a,<--
|
|
9843
9843
|
ruleToken = [tokenTypeFrom(buffer), [], []];
|
|
9844
9844
|
serializedBuffer = buffer.join('').trim();
|
|
9845
9845
|
ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, 0)]]);
|
|
9846
9846
|
|
|
9847
9847
|
buffer = [];
|
|
9848
|
-
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level
|
|
9848
|
+
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && ruleToken && ruleToken[0] == token.NESTED_BLOCK) {
|
|
9849
9849
|
// open brace opening at-rule at block level, e.g. @media{<--
|
|
9850
9850
|
serializedBuffer = buffer.join('').trim();
|
|
9851
9851
|
ruleToken[1].push([token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
@@ -9858,7 +9858,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9858
9858
|
|
|
9859
9859
|
ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
|
|
9860
9860
|
ruleToken = null;
|
|
9861
|
-
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level
|
|
9861
|
+
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && tokenTypeFrom(buffer) == token.NESTED_BLOCK) {
|
|
9862
9862
|
// open brace opening at-rule at block level, e.g. @media{<--
|
|
9863
9863
|
serializedBuffer = buffer.join('').trim();
|
|
9864
9864
|
ruleToken = ruleToken || [token.NESTED_BLOCK, [], []];
|
|
@@ -9872,7 +9872,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9872
9872
|
|
|
9873
9873
|
ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
|
|
9874
9874
|
ruleToken = null;
|
|
9875
|
-
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level
|
|
9875
|
+
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level.BLOCK) {
|
|
9876
9876
|
// open brace opening rule at block level, e.g. div{<--
|
|
9877
9877
|
serializedBuffer = buffer.join('').trim();
|
|
9878
9878
|
ruleToken = ruleToken || [tokenTypeFrom(buffer), [], []];
|
|
@@ -9881,9 +9881,9 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9881
9881
|
allTokens.push(ruleToken);
|
|
9882
9882
|
|
|
9883
9883
|
levels.push(level);
|
|
9884
|
-
level = Level
|
|
9884
|
+
level = Level.RULE;
|
|
9885
9885
|
buffer = [];
|
|
9886
|
-
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level
|
|
9886
|
+
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level.RULE && seekingValue) {
|
|
9887
9887
|
// open brace opening rule at rule level, e.g. div{--variable:{<--
|
|
9888
9888
|
ruleTokens.push(ruleToken);
|
|
9889
9889
|
ruleToken = [token.PROPERTY_BLOCK, []];
|
|
@@ -9891,9 +9891,9 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9891
9891
|
newTokens = ruleToken[1];
|
|
9892
9892
|
|
|
9893
9893
|
levels.push(level);
|
|
9894
|
-
level = Level
|
|
9894
|
+
level = Level.RULE;
|
|
9895
9895
|
seekingValue = false;
|
|
9896
|
-
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level
|
|
9896
|
+
} else if (character == marker.OPEN_CURLY_BRACKET && level == Level.RULE && isPageMarginBox(buffer)) {
|
|
9897
9897
|
// open brace opening page-margin box at rule level, e.g. @page{@top-center{<--
|
|
9898
9898
|
serializedBuffer = buffer.join('').trim();
|
|
9899
9899
|
ruleTokens.push(ruleToken);
|
|
@@ -9903,9 +9903,9 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9903
9903
|
newTokens = ruleToken[2];
|
|
9904
9904
|
|
|
9905
9905
|
levels.push(level);
|
|
9906
|
-
level = Level
|
|
9906
|
+
level = Level.RULE;
|
|
9907
9907
|
buffer = [];
|
|
9908
|
-
} else if (character == marker.COLON && level == Level
|
|
9908
|
+
} else if (character == marker.COLON && level == Level.RULE && !seekingValue) {
|
|
9909
9909
|
// colon at rule level, e.g. a{color:<--
|
|
9910
9910
|
serializedBuffer = buffer.join('').trim();
|
|
9911
9911
|
propertyToken = [token.PROPERTY, [token.PROPERTY_NAME, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]];
|
|
@@ -9913,13 +9913,13 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9913
9913
|
|
|
9914
9914
|
seekingValue = true;
|
|
9915
9915
|
buffer = [];
|
|
9916
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9916
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && propertyToken && ruleTokens.length > 0 && buffer.length > 0 && buffer[0] == marker.AT) {
|
|
9917
9917
|
// semicolon at rule level for at-rule, e.g. a{--color:{@apply(--other-color);<--
|
|
9918
9918
|
serializedBuffer = buffer.join('').trim();
|
|
9919
9919
|
ruleToken[1].push([token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
9920
9920
|
|
|
9921
9921
|
buffer = [];
|
|
9922
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9922
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length > 0) {
|
|
9923
9923
|
// semicolon at rule level, e.g. a{color:red;<--
|
|
9924
9924
|
serializedBuffer = buffer.join('').trim();
|
|
9925
9925
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
@@ -9927,22 +9927,22 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9927
9927
|
propertyToken = null;
|
|
9928
9928
|
seekingValue = false;
|
|
9929
9929
|
buffer = [];
|
|
9930
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9930
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length === 0) {
|
|
9931
9931
|
// semicolon after bracketed value at rule level, e.g. a{color:rgb(...);<--
|
|
9932
9932
|
propertyToken = null;
|
|
9933
9933
|
seekingValue = false;
|
|
9934
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9934
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && buffer.length > 0 && buffer[0] == marker.AT) {
|
|
9935
9935
|
// semicolon for at-rule at rule level, e.g. a{@apply(--variable);<--
|
|
9936
9936
|
serializedBuffer = buffer.join('');
|
|
9937
9937
|
newTokens.push([token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
9938
9938
|
|
|
9939
9939
|
seekingValue = false;
|
|
9940
9940
|
buffer = [];
|
|
9941
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9941
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && seekingPropertyBlockClosing) {
|
|
9942
9942
|
// close brace after a property block at rule level, e.g. a{--custom:{color:red;};<--
|
|
9943
9943
|
seekingPropertyBlockClosing = false;
|
|
9944
9944
|
buffer = [];
|
|
9945
|
-
} else if (character == marker.SEMICOLON && level == Level
|
|
9945
|
+
} else if (character == marker.SEMICOLON && level == Level.RULE && buffer.length === 0) ; else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && seekingValue && buffer.length > 0 && ruleTokens.length > 0) {
|
|
9946
9946
|
// close brace at rule level, e.g. a{--color:{color:red}<--
|
|
9947
9947
|
serializedBuffer = buffer.join('');
|
|
9948
9948
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
@@ -9953,7 +9953,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9953
9953
|
level = levels.pop();
|
|
9954
9954
|
seekingValue = false;
|
|
9955
9955
|
buffer = [];
|
|
9956
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
9956
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0 && buffer[0] == marker.AT && ruleTokens.length > 0) {
|
|
9957
9957
|
// close brace at rule level for at-rule, e.g. a{--color:{@apply(--other-color)}<--
|
|
9958
9958
|
serializedBuffer = buffer.join('');
|
|
9959
9959
|
ruleToken[1].push([token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
@@ -9964,7 +9964,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9964
9964
|
level = levels.pop();
|
|
9965
9965
|
seekingValue = false;
|
|
9966
9966
|
buffer = [];
|
|
9967
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
9967
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && ruleTokens.length > 0) {
|
|
9968
9968
|
// close brace at rule level after space, e.g. a{--color:{color:red }<--
|
|
9969
9969
|
propertyToken = null;
|
|
9970
9970
|
ruleToken = ruleTokens.pop();
|
|
@@ -9972,7 +9972,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9972
9972
|
|
|
9973
9973
|
level = levels.pop();
|
|
9974
9974
|
seekingValue = false;
|
|
9975
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
9975
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0) {
|
|
9976
9976
|
// close brace at rule level, e.g. a{color:red}<--
|
|
9977
9977
|
serializedBuffer = buffer.join('');
|
|
9978
9978
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
@@ -9983,7 +9983,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9983
9983
|
level = levels.pop();
|
|
9984
9984
|
seekingValue = false;
|
|
9985
9985
|
buffer = [];
|
|
9986
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
9986
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && buffer.length > 0 && buffer[0] == marker.AT) {
|
|
9987
9987
|
// close brace after at-rule at rule level, e.g. a{@apply(--variable)}<--
|
|
9988
9988
|
propertyToken = null;
|
|
9989
9989
|
ruleToken = null;
|
|
@@ -9994,7 +9994,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
9994
9994
|
level = levels.pop();
|
|
9995
9995
|
seekingValue = false;
|
|
9996
9996
|
buffer = [];
|
|
9997
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
9997
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE && levels[levels.length - 1] == Level.RULE) {
|
|
9998
9998
|
// close brace after a property block at rule level, e.g. a{--custom:{color:red;}<--
|
|
9999
9999
|
propertyToken = null;
|
|
10000
10000
|
ruleToken = ruleTokens.pop();
|
|
@@ -10004,7 +10004,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
10004
10004
|
seekingValue = false;
|
|
10005
10005
|
seekingPropertyBlockClosing = true;
|
|
10006
10006
|
buffer = [];
|
|
10007
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
10007
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.RULE) {
|
|
10008
10008
|
// close brace after a rule, e.g. a{color:red;}<--
|
|
10009
10009
|
propertyToken = null;
|
|
10010
10010
|
ruleToken = null;
|
|
@@ -10012,18 +10012,18 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
10012
10012
|
|
|
10013
10013
|
level = levels.pop();
|
|
10014
10014
|
seekingValue = false;
|
|
10015
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
10015
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK && !isNested && position.index <= source.length - 1) {
|
|
10016
10016
|
// stray close brace at block level, e.g. a{color:red}color:blue}<--
|
|
10017
10017
|
externalContext.warnings.push('Unexpected \'}\' at ' + formatPosition_1([position.line, position.column, position.source]) + '.');
|
|
10018
10018
|
buffer.push(character);
|
|
10019
|
-
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level
|
|
10019
|
+
} else if (character == marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK) {
|
|
10020
10020
|
// close brace at block level, e.g. @media screen {...}<--
|
|
10021
10021
|
break;
|
|
10022
|
-
} else if (character == marker.OPEN_ROUND_BRACKET && level == Level
|
|
10022
|
+
} else if (character == marker.OPEN_ROUND_BRACKET && level == Level.RULE && seekingValue) {
|
|
10023
10023
|
// round open bracket, e.g. a{color:hsla(<--
|
|
10024
10024
|
buffer.push(character);
|
|
10025
10025
|
roundBracketLevel++;
|
|
10026
|
-
} else if (character == marker.CLOSE_ROUND_BRACKET && level == Level
|
|
10026
|
+
} else if (character == marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue && roundBracketLevel == 1) {
|
|
10027
10027
|
// round close bracket, e.g. a{color:hsla(0,0%,0%)<--
|
|
10028
10028
|
buffer.push(character);
|
|
10029
10029
|
serializedBuffer = buffer.join('').trim();
|
|
@@ -10031,30 +10031,30 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
10031
10031
|
|
|
10032
10032
|
roundBracketLevel--;
|
|
10033
10033
|
buffer = [];
|
|
10034
|
-
} else if (character == marker.CLOSE_ROUND_BRACKET && level == Level
|
|
10034
|
+
} else if (character == marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue) {
|
|
10035
10035
|
// round close bracket within other brackets, e.g. a{width:calc((10rem / 2)<--
|
|
10036
10036
|
buffer.push(character);
|
|
10037
10037
|
roundBracketLevel--;
|
|
10038
|
-
} else if (character == marker.FORWARD_SLASH && source[position.index + 1] != marker.ASTERISK && level == Level
|
|
10038
|
+
} else if (character == marker.FORWARD_SLASH && source[position.index + 1] != marker.ASTERISK && level == Level.RULE && seekingValue && buffer.length > 0) {
|
|
10039
10039
|
// forward slash within a property, e.g. a{background:url(image.png) 0 0/<--
|
|
10040
10040
|
serializedBuffer = buffer.join('').trim();
|
|
10041
10041
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
10042
10042
|
propertyToken.push([token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
|
|
10043
10043
|
|
|
10044
10044
|
buffer = [];
|
|
10045
|
-
} else if (character == marker.FORWARD_SLASH && source[position.index + 1] != marker.ASTERISK && level == Level
|
|
10045
|
+
} else if (character == marker.FORWARD_SLASH && source[position.index + 1] != marker.ASTERISK && level == Level.RULE && seekingValue) {
|
|
10046
10046
|
// forward slash within a property after space, e.g. a{background:url(image.png) 0 0 /<--
|
|
10047
10047
|
propertyToken.push([token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
|
|
10048
10048
|
|
|
10049
10049
|
buffer = [];
|
|
10050
|
-
} else if (character == marker.COMMA && level == Level
|
|
10050
|
+
} else if (character == marker.COMMA && level == Level.RULE && seekingValue && buffer.length > 0) {
|
|
10051
10051
|
// comma within a property, e.g. a{background:url(image.png),<--
|
|
10052
10052
|
serializedBuffer = buffer.join('').trim();
|
|
10053
10053
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
10054
10054
|
propertyToken.push([token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
|
|
10055
10055
|
|
|
10056
10056
|
buffer = [];
|
|
10057
|
-
} else if (character == marker.COMMA && level == Level
|
|
10057
|
+
} else if (character == marker.COMMA && level == Level.RULE && seekingValue) {
|
|
10058
10058
|
// comma within a property after space, e.g. a{background:url(image.png) ,<--
|
|
10059
10059
|
propertyToken.push([token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
|
|
10060
10060
|
|
|
@@ -10065,19 +10065,19 @@ function intoTokens(source, externalContext, internalContext, isNested) {
|
|
|
10065
10065
|
propertyToken[propertyToken.length - 1][1] += serializedBuffer;
|
|
10066
10066
|
|
|
10067
10067
|
buffer = [];
|
|
10068
|
-
} else if ((isSpace || (isNewLineNix && !isNewLineWin)) && level == Level
|
|
10068
|
+
} else if ((isSpace || (isNewLineNix && !isNewLineWin)) && level == Level.RULE && seekingValue && propertyToken && buffer.length > 0) {
|
|
10069
10069
|
// space or *nix newline within property, e.g. a{margin:0 <--
|
|
10070
10070
|
serializedBuffer = buffer.join('').trim();
|
|
10071
10071
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
10072
10072
|
|
|
10073
10073
|
buffer = [];
|
|
10074
|
-
} else if (isNewLineWin && level == Level
|
|
10074
|
+
} else if (isNewLineWin && level == Level.RULE && seekingValue && propertyToken && buffer.length > 1) {
|
|
10075
10075
|
// win newline within property, e.g. a{margin:0\r\n<--
|
|
10076
10076
|
serializedBuffer = buffer.join('').trim();
|
|
10077
10077
|
propertyToken.push([token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
|
|
10078
10078
|
|
|
10079
10079
|
buffer = [];
|
|
10080
|
-
} else if (isNewLineWin && level == Level
|
|
10080
|
+
} else if (isNewLineWin && level == Level.RULE && seekingValue) {
|
|
10081
10081
|
// win newline
|
|
10082
10082
|
buffer = [];
|
|
10083
10083
|
} else if (buffer.length == 1 && isNewLineWin) {
|
|
@@ -10298,7 +10298,7 @@ function fromStyles(styles, context, parentInlinerContext, callback) {
|
|
|
10298
10298
|
tokens = rebase_1(tokens, context.options.rebase, context.validator, rebaseConfig);
|
|
10299
10299
|
|
|
10300
10300
|
return allowsAnyImports(parentInlinerContext.inline) ?
|
|
10301
|
-
inline
|
|
10301
|
+
inline(tokens, context, parentInlinerContext, callback) :
|
|
10302
10302
|
callback(tokens);
|
|
10303
10303
|
}
|
|
10304
10304
|
|
|
@@ -10306,7 +10306,7 @@ function allowsAnyImports(inline) {
|
|
|
10306
10306
|
return !(inline.length == 1 && inline[0] == 'none');
|
|
10307
10307
|
}
|
|
10308
10308
|
|
|
10309
|
-
function inline
|
|
10309
|
+
function inline(tokens, externalContext, parentInlinerContext, callback) {
|
|
10310
10310
|
var inlinerContext = {
|
|
10311
10311
|
afterContent: false,
|
|
10312
10312
|
callback: callback,
|
|
@@ -10490,7 +10490,7 @@ function wrapInMedia(tokens, mediaQuery, metadata) {
|
|
|
10490
10490
|
|
|
10491
10491
|
var readSources_1 = readSources;
|
|
10492
10492
|
|
|
10493
|
-
var all$
|
|
10493
|
+
var all$1 = helpers.all;
|
|
10494
10494
|
|
|
10495
10495
|
function store$1(serializeContext, token) {
|
|
10496
10496
|
var value = typeof token == 'string' ?
|
|
@@ -10503,7 +10503,7 @@ function store$1(serializeContext, token) {
|
|
|
10503
10503
|
serializeContext.output.push(value);
|
|
10504
10504
|
}
|
|
10505
10505
|
|
|
10506
|
-
function wrap(serializeContext, value) {
|
|
10506
|
+
function wrap$1(serializeContext, value) {
|
|
10507
10507
|
if (serializeContext.column + value.length > serializeContext.format.wrapAt) {
|
|
10508
10508
|
track$1(serializeContext, serializeContext.format.breakWith);
|
|
10509
10509
|
serializeContext.output.push(serializeContext.format.breakWith);
|
|
@@ -10528,11 +10528,11 @@ function serializeStyles(tokens, context) {
|
|
|
10528
10528
|
spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace,
|
|
10529
10529
|
store: store$1,
|
|
10530
10530
|
wrap: context.options.format.wrapAt ?
|
|
10531
|
-
wrap :
|
|
10531
|
+
wrap$1 :
|
|
10532
10532
|
function () { /* noop */ }
|
|
10533
10533
|
};
|
|
10534
10534
|
|
|
10535
|
-
all$
|
|
10535
|
+
all$1(serializeContext, tokens);
|
|
10536
10536
|
|
|
10537
10537
|
return {
|
|
10538
10538
|
styles: serializeContext.output.join('')
|
|
@@ -10542,35 +10542,35 @@ function serializeStyles(tokens, context) {
|
|
|
10542
10542
|
var simple = serializeStyles;
|
|
10543
10543
|
|
|
10544
10544
|
var SourceMapGenerator = build.sourceMap.SourceMapGenerator;
|
|
10545
|
-
var all
|
|
10545
|
+
var all = helpers.all;
|
|
10546
10546
|
|
|
10547
10547
|
|
|
10548
10548
|
|
|
10549
|
-
var isWindows
|
|
10549
|
+
var isWindows = process.platform == 'win32';
|
|
10550
10550
|
|
|
10551
10551
|
var NIX_SEPARATOR_PATTERN = /\//g;
|
|
10552
10552
|
var UNKNOWN_SOURCE = '$stdin';
|
|
10553
10553
|
var WINDOWS_SEPARATOR = '\\';
|
|
10554
10554
|
|
|
10555
|
-
function store
|
|
10555
|
+
function store(serializeContext, element) {
|
|
10556
10556
|
var fromString = typeof element == 'string';
|
|
10557
10557
|
var value = fromString ? element : element[1];
|
|
10558
10558
|
var mappings = fromString ? null : element[2];
|
|
10559
10559
|
var wrap = serializeContext.wrap;
|
|
10560
10560
|
|
|
10561
10561
|
wrap(serializeContext, value);
|
|
10562
|
-
track
|
|
10562
|
+
track(serializeContext, value, mappings);
|
|
10563
10563
|
serializeContext.output.push(value);
|
|
10564
10564
|
}
|
|
10565
10565
|
|
|
10566
|
-
function wrap
|
|
10566
|
+
function wrap(serializeContext, value) {
|
|
10567
10567
|
if (serializeContext.column + value.length > serializeContext.format.wrapAt) {
|
|
10568
|
-
track
|
|
10568
|
+
track(serializeContext, serializeContext.format.breakWith, false);
|
|
10569
10569
|
serializeContext.output.push(serializeContext.format.breakWith);
|
|
10570
10570
|
}
|
|
10571
10571
|
}
|
|
10572
10572
|
|
|
10573
|
-
function track
|
|
10573
|
+
function track(serializeContext, value, mappings) {
|
|
10574
10574
|
var parts = value.split('\n');
|
|
10575
10575
|
|
|
10576
10576
|
if (mappings) {
|
|
@@ -10594,7 +10594,7 @@ function trackMapping(serializeContext, mapping) {
|
|
|
10594
10594
|
var source = originalSource;
|
|
10595
10595
|
var storedSource = source || UNKNOWN_SOURCE;
|
|
10596
10596
|
|
|
10597
|
-
if (isWindows
|
|
10597
|
+
if (isWindows && source && !isRemoteResource_1(source)) {
|
|
10598
10598
|
storedSource = source.replace(NIX_SEPARATOR_PATTERN, WINDOWS_SEPARATOR);
|
|
10599
10599
|
}
|
|
10600
10600
|
|
|
@@ -10627,13 +10627,13 @@ function serializeStylesAndSourceMap(tokens, context) {
|
|
|
10627
10627
|
outputMap: new SourceMapGenerator(),
|
|
10628
10628
|
sourcesContent: context.sourcesContent,
|
|
10629
10629
|
spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace,
|
|
10630
|
-
store: store
|
|
10630
|
+
store: store,
|
|
10631
10631
|
wrap: context.options.format.wrapAt ?
|
|
10632
|
-
wrap
|
|
10632
|
+
wrap :
|
|
10633
10633
|
function () { /* noop */ }
|
|
10634
10634
|
};
|
|
10635
10635
|
|
|
10636
|
-
all
|
|
10636
|
+
all(serializeContext, tokens);
|
|
10637
10637
|
|
|
10638
10638
|
return {
|
|
10639
10639
|
sourceMap: serializeContext.outputMap,
|
|
@@ -10673,11 +10673,11 @@ var CleanCSS = module.exports = function CleanCSS(options) {
|
|
|
10673
10673
|
compatibility: compatibility(options.compatibility),
|
|
10674
10674
|
fetch: fetch(options.fetch),
|
|
10675
10675
|
format: formatFrom(options.format),
|
|
10676
|
-
inline: inline(options.inline),
|
|
10676
|
+
inline: inline$1(options.inline),
|
|
10677
10677
|
inlineRequest: inlineRequest(options.inlineRequest),
|
|
10678
10678
|
inlineTimeout: inlineTimeout(options.inlineTimeout),
|
|
10679
10679
|
level: optimizationLevelFrom(options.level),
|
|
10680
|
-
rebase: rebase(options.rebase),
|
|
10680
|
+
rebase: rebase$2(options.rebase),
|
|
10681
10681
|
rebaseTo: rebaseTo(options.rebaseTo),
|
|
10682
10682
|
returnPromise: !!options.returnPromise,
|
|
10683
10683
|
sourceMap: !!options.sourceMap,
|
|
@@ -10756,7 +10756,7 @@ function minify(input, options, maybeSourceMap, maybeCallback) {
|
|
|
10756
10756
|
sourceMaps :
|
|
10757
10757
|
simple;
|
|
10758
10758
|
|
|
10759
|
-
var optimizedTokens = optimize$
|
|
10759
|
+
var optimizedTokens = optimize$1(tokens, context);
|
|
10760
10760
|
var optimizedStyles = serialize(optimizedTokens, context);
|
|
10761
10761
|
var output = withMetadata(optimizedStyles, context);
|
|
10762
10762
|
|
|
@@ -10775,15 +10775,15 @@ function runner(localOnly) {
|
|
|
10775
10775
|
process.nextTick;
|
|
10776
10776
|
}
|
|
10777
10777
|
|
|
10778
|
-
function optimize$
|
|
10778
|
+
function optimize$1(tokens, context) {
|
|
10779
10779
|
var optimized;
|
|
10780
10780
|
|
|
10781
|
-
optimized = optimize(tokens);
|
|
10781
|
+
optimized = optimize$3(tokens);
|
|
10782
10782
|
optimized = OptimizationLevel.One in context.options.level ?
|
|
10783
|
-
optimize$
|
|
10783
|
+
optimize$2(tokens, context) :
|
|
10784
10784
|
tokens;
|
|
10785
10785
|
optimized = OptimizationLevel.Two in context.options.level ?
|
|
10786
|
-
optimize
|
|
10786
|
+
optimize(tokens, context, true) :
|
|
10787
10787
|
optimized;
|
|
10788
10788
|
|
|
10789
10789
|
return optimized;
|