tailwindcss 3.0.6 → 3.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -2
- package/README.md +8 -4
- package/lib/cli.js +49 -12
- package/lib/css/preflight.css +1 -1
- package/lib/index.js +1 -3
- package/lib/lib/collapseDuplicateDeclarations.js +52 -1
- package/lib/lib/defaultExtractor.js +42 -0
- package/lib/lib/expandApplyAtRules.js +87 -15
- package/lib/lib/expandTailwindAtRules.js +19 -32
- package/lib/lib/generateRules.js +4 -0
- package/lib/lib/normalizeTailwindDirectives.js +8 -1
- package/lib/lib/setupTrackingContext.js +11 -10
- package/lib/lib/sharedState.js +33 -4
- package/lib/processTailwindFeatures.js +2 -1
- package/lib/util/color.js +23 -8
- package/lib/util/resolveConfig.js +9 -1
- package/package.json +9 -10
- package/peers/index.js +72 -86
- package/src/cli.js +57 -12
- package/src/css/preflight.css +1 -1
- package/src/index.js +1 -7
- package/src/lib/collapseDuplicateDeclarations.js +66 -1
- package/src/lib/defaultExtractor.js +48 -0
- package/src/lib/expandApplyAtRules.js +90 -19
- package/src/lib/expandTailwindAtRules.js +21 -31
- package/src/lib/generateRules.js +5 -0
- package/src/lib/normalizeTailwindDirectives.js +6 -1
- package/src/lib/setupTrackingContext.js +11 -10
- package/src/lib/sharedState.js +40 -4
- package/src/processTailwindFeatures.js +2 -1
- package/src/util/color.js +20 -7
- package/src/util/resolveConfig.js +11 -1
- package/lib/lib/setupWatchingContext.js +0 -288
- package/src/lib/setupWatchingContext.js +0 -311
package/lib/lib/sharedState.js
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
exports.resolveDebug = resolveDebug;
|
|
5
6
|
exports.contextSourcesMap = exports.configContextMap = exports.contextMap = exports.env = void 0;
|
|
6
7
|
const env = {
|
|
7
|
-
TAILWIND_MODE: process.env.TAILWIND_MODE,
|
|
8
8
|
NODE_ENV: process.env.NODE_ENV,
|
|
9
|
-
DEBUG: process.env.DEBUG
|
|
10
|
-
TAILWIND_DISABLE_TOUCH: process.env.TAILWIND_DISABLE_TOUCH !== undefined,
|
|
11
|
-
TAILWIND_TOUCH_DIR: process.env.TAILWIND_TOUCH_DIR
|
|
9
|
+
DEBUG: resolveDebug(process.env.DEBUG)
|
|
12
10
|
};
|
|
13
11
|
exports.env = env;
|
|
14
12
|
const contextMap = new Map();
|
|
@@ -17,3 +15,34 @@ const configContextMap = new Map();
|
|
|
17
15
|
exports.configContextMap = configContextMap;
|
|
18
16
|
const contextSourcesMap = new Map();
|
|
19
17
|
exports.contextSourcesMap = contextSourcesMap;
|
|
18
|
+
function resolveDebug(debug) {
|
|
19
|
+
if (debug === undefined) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
// Environment variables are strings, so convert to boolean
|
|
23
|
+
if (debug === 'true' || debug === '1') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (debug === 'false' || debug === '0') {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// Keep the debug convention into account:
|
|
30
|
+
// DEBUG=* -> This enables all debug modes
|
|
31
|
+
// DEBUG=projectA,projectB,projectC -> This enables debug for projectA, projectB and projectC
|
|
32
|
+
// DEBUG=projectA:* -> This enables all debug modes for projectA (if you have sub-types)
|
|
33
|
+
// DEBUG=projectA,-projectB -> This enables debug for projectA and explicitly disables it for projectB
|
|
34
|
+
if (debug === '*') {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
let debuggers = debug.split(',').map((d)=>d.split(':')[0]
|
|
38
|
+
);
|
|
39
|
+
// Ignoring tailwindcss
|
|
40
|
+
if (debuggers.includes('-tailwindcss')) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
// Including tailwindcss
|
|
44
|
+
if (debuggers.includes('tailwindcss')) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
@@ -21,9 +21,10 @@ function _interopRequireDefault(obj) {
|
|
|
21
21
|
}
|
|
22
22
|
function processTailwindFeatures(setupContext) {
|
|
23
23
|
return function(root, result) {
|
|
24
|
-
let tailwindDirectives = (0, _normalizeTailwindDirectives).default(root);
|
|
24
|
+
let { tailwindDirectives , applyDirectives } = (0, _normalizeTailwindDirectives).default(root);
|
|
25
25
|
let context = setupContext({
|
|
26
26
|
tailwindDirectives,
|
|
27
|
+
applyDirectives,
|
|
27
28
|
registerDependency (dependency) {
|
|
28
29
|
result.messages.push({
|
|
29
30
|
plugin: 'tailwindcss',
|
package/lib/util/color.js
CHANGED
|
@@ -15,7 +15,8 @@ let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
|
|
|
15
15
|
let VALUE = `(?:\\d+|\\d*\\.\\d+)%?`;
|
|
16
16
|
let SEP = `(?:\\s*,\\s*|\\s+)`;
|
|
17
17
|
let ALPHA_SEP = `\\s*[,/]\\s*`;
|
|
18
|
-
let
|
|
18
|
+
let RGB = new RegExp(`^rgba?\\(\\s*(${VALUE})${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
|
|
19
|
+
let HSL = new RegExp(`^hsla?\\(\\s*((?:${VALUE})(?:deg|rad|grad|turn)?)${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
|
|
19
20
|
function parseColor(value) {
|
|
20
21
|
if (typeof value !== 'string') {
|
|
21
22
|
return null;
|
|
@@ -62,18 +63,32 @@ function parseColor(value) {
|
|
|
62
63
|
alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
|
-
let
|
|
66
|
-
if (
|
|
66
|
+
let rgbMatch = value.match(RGB);
|
|
67
|
+
if (rgbMatch !== null) {
|
|
67
68
|
var ref, ref1;
|
|
68
69
|
return {
|
|
69
|
-
mode:
|
|
70
|
+
mode: 'rgb',
|
|
71
|
+
color: [
|
|
72
|
+
rgbMatch[1],
|
|
73
|
+
rgbMatch[2],
|
|
74
|
+
rgbMatch[3]
|
|
75
|
+
].map((v)=>v.toString()
|
|
76
|
+
),
|
|
77
|
+
alpha: (ref = rgbMatch[4]) === null || ref === void 0 ? void 0 : (ref1 = ref.toString) === null || ref1 === void 0 ? void 0 : ref1.call(ref)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
let hslMatch = value.match(HSL);
|
|
81
|
+
if (hslMatch !== null) {
|
|
82
|
+
var ref2, ref3;
|
|
83
|
+
return {
|
|
84
|
+
mode: 'hsl',
|
|
70
85
|
color: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
hslMatch[1],
|
|
87
|
+
hslMatch[2],
|
|
88
|
+
hslMatch[3]
|
|
74
89
|
].map((v)=>v.toString()
|
|
75
90
|
),
|
|
76
|
-
alpha: (
|
|
91
|
+
alpha: (ref2 = hslMatch[4]) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.toString) === null || ref3 === void 0 ? void 0 : ref3.call(ref2)
|
|
77
92
|
};
|
|
78
93
|
}
|
|
79
94
|
return null;
|
|
@@ -11,6 +11,8 @@ var _colors = _interopRequireDefault(require("../public/colors"));
|
|
|
11
11
|
var _defaults = require("./defaults");
|
|
12
12
|
var _toPath = require("./toPath");
|
|
13
13
|
var _normalizeConfig = require("./normalizeConfig");
|
|
14
|
+
var _isPlainObject = _interopRequireDefault(require("./isPlainObject"));
|
|
15
|
+
var _cloneDeep = require("./cloneDeep");
|
|
14
16
|
function _interopRequireDefault(obj) {
|
|
15
17
|
return obj && obj.__esModule ? obj : {
|
|
16
18
|
default: obj
|
|
@@ -143,7 +145,13 @@ function resolveFunctionKeys(object) {
|
|
|
143
145
|
val = val[path[index++]];
|
|
144
146
|
val = isFunction(val) ? val(resolvePath, configUtils) : val;
|
|
145
147
|
}
|
|
146
|
-
|
|
148
|
+
if (val === undefined) {
|
|
149
|
+
return defaultValue;
|
|
150
|
+
}
|
|
151
|
+
if ((0, _isPlainObject).default(val)) {
|
|
152
|
+
return (0, _cloneDeep).cloneDeep(val);
|
|
153
|
+
}
|
|
154
|
+
return val;
|
|
147
155
|
};
|
|
148
156
|
resolvePath.theme = resolvePath;
|
|
149
157
|
for(let key1 in configUtils){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prepublishOnly": "npm install --force && npm run swcify",
|
|
26
26
|
"style": "eslint .",
|
|
27
27
|
"pretest": "npm run generate:plugin-list",
|
|
28
|
-
"test": "
|
|
28
|
+
"test": "jest",
|
|
29
29
|
"test:integrations": "npm run test --prefix ./integrations",
|
|
30
30
|
"install:integrations": "node scripts/install-integrations.js",
|
|
31
31
|
"posttest": "npm run style",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"*.js"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@swc/cli": "^0.1.
|
|
46
|
+
"@swc/cli": "^0.1.55",
|
|
47
47
|
"@swc/core": "^1.2.118",
|
|
48
|
-
"@swc/jest": "^0.2.
|
|
48
|
+
"@swc/jest": "^0.2.15",
|
|
49
49
|
"@swc/register": "^0.1.7",
|
|
50
50
|
"autoprefixer": "^10.4.0",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
52
|
-
"cssnano": "^5.0.
|
|
52
|
+
"cssnano": "^5.0.14",
|
|
53
53
|
"esbuild": "^0.14.2",
|
|
54
54
|
"eslint": "^8.4.1",
|
|
55
55
|
"eslint-config-prettier": "^8.3.0",
|
|
56
56
|
"eslint-plugin-prettier": "^4.0.0",
|
|
57
|
-
"jest": "^27.4.
|
|
57
|
+
"jest": "^27.4.5",
|
|
58
58
|
"jest-diff": "^27.4.2",
|
|
59
|
-
"postcss": "^8.4.
|
|
59
|
+
"postcss": "^8.4.5",
|
|
60
60
|
"postcss-cli": "^8.3.1",
|
|
61
|
-
"prettier": "^2.5.
|
|
61
|
+
"prettier": "^2.5.1",
|
|
62
62
|
"rimraf": "^3.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
@@ -85,8 +85,7 @@
|
|
|
85
85
|
"postcss-selector-parser": "^6.0.7",
|
|
86
86
|
"postcss-value-parser": "^4.2.0",
|
|
87
87
|
"quick-lru": "^5.1.1",
|
|
88
|
-
"resolve": "^1.20.0"
|
|
89
|
-
"tmp": "^0.2.1"
|
|
88
|
+
"resolve": "^1.20.0"
|
|
90
89
|
},
|
|
91
90
|
"browserslist": [
|
|
92
91
|
"> 1%",
|
package/peers/index.js
CHANGED
|
@@ -5406,7 +5406,7 @@ var require_processor = __commonJS({
|
|
|
5406
5406
|
var Root = require_root();
|
|
5407
5407
|
var Processor = class {
|
|
5408
5408
|
constructor(plugins = []) {
|
|
5409
|
-
this.version = "8.4.
|
|
5409
|
+
this.version = "8.4.5";
|
|
5410
5410
|
this.plugins = this.normalize(plugins);
|
|
5411
5411
|
}
|
|
5412
5412
|
use(plugin) {
|
|
@@ -23880,25 +23880,6 @@ var require_dist2 = __commonJS({
|
|
|
23880
23880
|
}
|
|
23881
23881
|
});
|
|
23882
23882
|
|
|
23883
|
-
// node_modules/is-resolvable/index.js
|
|
23884
|
-
var require_is_resolvable = __commonJS({
|
|
23885
|
-
"node_modules/is-resolvable/index.js"(exports2, module2) {
|
|
23886
|
-
"use strict";
|
|
23887
|
-
var inspect = require("util").inspect;
|
|
23888
|
-
module2.exports = function isResolvable(moduleId, options) {
|
|
23889
|
-
if (typeof moduleId !== "string") {
|
|
23890
|
-
throw new TypeError(inspect(moduleId) + " is not a string. Expected a valid Node.js module identifier (<string>), for example 'eslint', './index.js', './lib'.");
|
|
23891
|
-
}
|
|
23892
|
-
try {
|
|
23893
|
-
require.resolve(moduleId, options);
|
|
23894
|
-
return true;
|
|
23895
|
-
} catch (err) {
|
|
23896
|
-
return false;
|
|
23897
|
-
}
|
|
23898
|
-
};
|
|
23899
|
-
}
|
|
23900
|
-
});
|
|
23901
|
-
|
|
23902
23883
|
// node_modules/timsort/build/timsort.js
|
|
23903
23884
|
var require_timsort = __commonJS({
|
|
23904
23885
|
"node_modules/timsort/build/timsort.js"(exports2) {
|
|
@@ -29271,7 +29252,7 @@ var require_attributes = __commonJS({
|
|
|
29271
29252
|
if (/\s/.test(value)) {
|
|
29272
29253
|
return boolbase_1.falseFunc;
|
|
29273
29254
|
}
|
|
29274
|
-
var regex = new RegExp("(?:^|\\s)"
|
|
29255
|
+
var regex = new RegExp("(?:^|\\s)".concat(escapeRegex(value), "(?:$|\\s)"), ignoreCase ? "i" : "");
|
|
29275
29256
|
return function element(elem) {
|
|
29276
29257
|
var attr = adapter.getAttributeValue(elem, name);
|
|
29277
29258
|
return attr != null && attr.length >= value.length && regex.test(attr) && next(elem);
|
|
@@ -29520,7 +29501,7 @@ var require_filters = __commonJS({
|
|
|
29520
29501
|
},
|
|
29521
29502
|
"nth-child": function(next, rule, _a) {
|
|
29522
29503
|
var adapter = _a.adapter, equals = _a.equals;
|
|
29523
|
-
var func = nth_check_1.default(rule);
|
|
29504
|
+
var func = (0, nth_check_1.default)(rule);
|
|
29524
29505
|
if (func === boolbase_1.falseFunc)
|
|
29525
29506
|
return boolbase_1.falseFunc;
|
|
29526
29507
|
if (func === boolbase_1.trueFunc)
|
|
@@ -29540,7 +29521,7 @@ var require_filters = __commonJS({
|
|
|
29540
29521
|
},
|
|
29541
29522
|
"nth-last-child": function(next, rule, _a) {
|
|
29542
29523
|
var adapter = _a.adapter, equals = _a.equals;
|
|
29543
|
-
var func = nth_check_1.default(rule);
|
|
29524
|
+
var func = (0, nth_check_1.default)(rule);
|
|
29544
29525
|
if (func === boolbase_1.falseFunc)
|
|
29545
29526
|
return boolbase_1.falseFunc;
|
|
29546
29527
|
if (func === boolbase_1.trueFunc)
|
|
@@ -29560,7 +29541,7 @@ var require_filters = __commonJS({
|
|
|
29560
29541
|
},
|
|
29561
29542
|
"nth-of-type": function(next, rule, _a) {
|
|
29562
29543
|
var adapter = _a.adapter, equals = _a.equals;
|
|
29563
|
-
var func = nth_check_1.default(rule);
|
|
29544
|
+
var func = (0, nth_check_1.default)(rule);
|
|
29564
29545
|
if (func === boolbase_1.falseFunc)
|
|
29565
29546
|
return boolbase_1.falseFunc;
|
|
29566
29547
|
if (func === boolbase_1.trueFunc)
|
|
@@ -29581,7 +29562,7 @@ var require_filters = __commonJS({
|
|
|
29581
29562
|
},
|
|
29582
29563
|
"nth-last-of-type": function(next, rule, _a) {
|
|
29583
29564
|
var adapter = _a.adapter, equals = _a.equals;
|
|
29584
|
-
var func = nth_check_1.default(rule);
|
|
29565
|
+
var func = (0, nth_check_1.default)(rule);
|
|
29585
29566
|
if (func === boolbase_1.falseFunc)
|
|
29586
29567
|
return boolbase_1.falseFunc;
|
|
29587
29568
|
if (func === boolbase_1.trueFunc)
|
|
@@ -29716,10 +29697,10 @@ var require_pseudos = __commonJS({
|
|
|
29716
29697
|
function verifyPseudoArgs(func, name, subselect) {
|
|
29717
29698
|
if (subselect === null) {
|
|
29718
29699
|
if (func.length > 2) {
|
|
29719
|
-
throw new Error("pseudo-selector :"
|
|
29700
|
+
throw new Error("pseudo-selector :".concat(name, " requires an argument"));
|
|
29720
29701
|
}
|
|
29721
29702
|
} else if (func.length === 2) {
|
|
29722
|
-
throw new Error("pseudo-selector :"
|
|
29703
|
+
throw new Error("pseudo-selector :".concat(name, " doesn't have any arguments"));
|
|
29723
29704
|
}
|
|
29724
29705
|
}
|
|
29725
29706
|
exports2.verifyPseudoArgs = verifyPseudoArgs;
|
|
@@ -29761,10 +29742,16 @@ var require_aliases = __commonJS({
|
|
|
29761
29742
|
var require_subselects = __commonJS({
|
|
29762
29743
|
"node_modules/css-select/lib/pseudo-selectors/subselects.js"(exports2) {
|
|
29763
29744
|
"use strict";
|
|
29764
|
-
var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
|
|
29765
|
-
|
|
29766
|
-
|
|
29767
|
-
|
|
29745
|
+
var __spreadArray = exports2 && exports2.__spreadArray || function(to, from, pack) {
|
|
29746
|
+
if (pack || arguments.length === 2)
|
|
29747
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
29748
|
+
if (ar || !(i in from)) {
|
|
29749
|
+
if (!ar)
|
|
29750
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
29751
|
+
ar[i] = from[i];
|
|
29752
|
+
}
|
|
29753
|
+
}
|
|
29754
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
29768
29755
|
};
|
|
29769
29756
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
29770
29757
|
exports2.subselects = exports2.getNextSiblings = exports2.ensureIsTag = exports2.PLACEHOLDER_ELEMENT = void 0;
|
|
@@ -29803,6 +29790,7 @@ var require_subselects = __commonJS({
|
|
|
29803
29790
|
exports2.subselects = {
|
|
29804
29791
|
is,
|
|
29805
29792
|
matches: is,
|
|
29793
|
+
where: is,
|
|
29806
29794
|
not: function(next, token, options, context, compileToken) {
|
|
29807
29795
|
var opts = {
|
|
29808
29796
|
xmlMode: !!options.xmlMode,
|
|
@@ -29842,7 +29830,7 @@ var require_subselects = __commonJS({
|
|
|
29842
29830
|
return function(elem) {
|
|
29843
29831
|
context[0] = elem;
|
|
29844
29832
|
var childs = adapter.getChildren(elem);
|
|
29845
|
-
var nextElements = shouldTestNextSiblings ? __spreadArray(__spreadArray([], childs), getNextSiblings(elem, adapter)) : childs;
|
|
29833
|
+
var nextElements = shouldTestNextSiblings ? __spreadArray(__spreadArray([], childs, true), getNextSiblings(elem, adapter), true) : childs;
|
|
29846
29834
|
return next(elem) && adapter.existsOne(hasElement, nextElements);
|
|
29847
29835
|
};
|
|
29848
29836
|
}
|
|
@@ -29882,9 +29870,9 @@ var require_pseudo_selectors = __commonJS({
|
|
|
29882
29870
|
}
|
|
29883
29871
|
if (name in aliases_1.aliases) {
|
|
29884
29872
|
if (data != null) {
|
|
29885
|
-
throw new Error("Pseudo "
|
|
29873
|
+
throw new Error("Pseudo ".concat(name, " doesn't have any arguments"));
|
|
29886
29874
|
}
|
|
29887
|
-
var alias = css_what_1.parse(aliases_1.aliases[name], options);
|
|
29875
|
+
var alias = (0, css_what_1.parse)(aliases_1.aliases[name], options);
|
|
29888
29876
|
return subselects_1.subselects.is(next, alias, options, context, compileToken);
|
|
29889
29877
|
}
|
|
29890
29878
|
if (name in filters_1.filters) {
|
|
@@ -29892,14 +29880,14 @@ var require_pseudo_selectors = __commonJS({
|
|
|
29892
29880
|
}
|
|
29893
29881
|
if (name in pseudos_1.pseudos) {
|
|
29894
29882
|
var pseudo_1 = pseudos_1.pseudos[name];
|
|
29895
|
-
pseudos_1.verifyPseudoArgs(pseudo_1, name, data);
|
|
29883
|
+
(0, pseudos_1.verifyPseudoArgs)(pseudo_1, name, data);
|
|
29896
29884
|
return pseudo_1 === boolbase_1.falseFunc ? boolbase_1.falseFunc : next === boolbase_1.trueFunc ? function(elem) {
|
|
29897
29885
|
return pseudo_1(elem, options, data);
|
|
29898
29886
|
} : function(elem) {
|
|
29899
29887
|
return pseudo_1(elem, options, data) && next(elem);
|
|
29900
29888
|
};
|
|
29901
29889
|
}
|
|
29902
|
-
throw new Error("unmatched pseudo-class :"
|
|
29890
|
+
throw new Error("unmatched pseudo-class :".concat(name));
|
|
29903
29891
|
}
|
|
29904
29892
|
exports2.compilePseudoSelector = compilePseudoSelector;
|
|
29905
29893
|
}
|
|
@@ -29921,7 +29909,7 @@ var require_general = __commonJS({
|
|
|
29921
29909
|
case "attribute":
|
|
29922
29910
|
return attributes_1.attributeRules[selector.action](next, selector, options);
|
|
29923
29911
|
case "pseudo":
|
|
29924
|
-
return pseudo_selectors_1.compilePseudoSelector(next, selector, options, context, compileToken);
|
|
29912
|
+
return (0, pseudo_selectors_1.compilePseudoSelector)(next, selector, options, context, compileToken);
|
|
29925
29913
|
case "tag":
|
|
29926
29914
|
return function tag(elem) {
|
|
29927
29915
|
return adapter.getName(elem) === selector.name && next(elem);
|
|
@@ -30023,11 +30011,11 @@ var require_compile2 = __commonJS({
|
|
|
30023
30011
|
var subselects_1 = require_subselects();
|
|
30024
30012
|
function compile(selector, options, context) {
|
|
30025
30013
|
var next = compileUnsafe(selector, options, context);
|
|
30026
|
-
return subselects_1.ensureIsTag(next, options.adapter);
|
|
30014
|
+
return (0, subselects_1.ensureIsTag)(next, options.adapter);
|
|
30027
30015
|
}
|
|
30028
30016
|
exports2.compile = compile;
|
|
30029
30017
|
function compileUnsafe(selector, options, context) {
|
|
30030
|
-
var token = typeof selector === "string" ? css_what_1.parse(selector, options) : selector;
|
|
30018
|
+
var token = typeof selector === "string" ? (0, css_what_1.parse)(selector, options) : selector;
|
|
30031
30019
|
return compileToken(token, options, context);
|
|
30032
30020
|
}
|
|
30033
30021
|
exports2.compileUnsafe = compileUnsafe;
|
|
@@ -30049,7 +30037,7 @@ var require_compile2 = __commonJS({
|
|
|
30049
30037
|
}));
|
|
30050
30038
|
for (var _i = 0, token_1 = token; _i < token_1.length; _i++) {
|
|
30051
30039
|
var t = token_1[_i];
|
|
30052
|
-
if (t.length > 0 && procedure_1.isTraversal(t[0]) && t[0].type !== "descendant") {
|
|
30040
|
+
if (t.length > 0 && (0, procedure_1.isTraversal)(t[0]) && t[0].type !== "descendant") {
|
|
30053
30041
|
} else if (hasContext && !t.some(includesScopePseudo)) {
|
|
30054
30042
|
t.unshift(DESCENDANT_TOKEN);
|
|
30055
30043
|
} else {
|
|
@@ -30088,7 +30076,7 @@ var require_compile2 = __commonJS({
|
|
|
30088
30076
|
function compileRules(rules, options, context) {
|
|
30089
30077
|
var _a;
|
|
30090
30078
|
return rules.reduce(function(previous, rule) {
|
|
30091
|
-
return previous === boolbase_1.falseFunc ? boolbase_1.falseFunc : general_1.compileGeneralSelector(previous, rule, options, context, compileToken);
|
|
30079
|
+
return previous === boolbase_1.falseFunc ? boolbase_1.falseFunc : (0, general_1.compileGeneralSelector)(previous, rule, options, context, compileToken);
|
|
30092
30080
|
}, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc);
|
|
30093
30081
|
}
|
|
30094
30082
|
function reduceRules(a, b) {
|
|
@@ -30170,7 +30158,7 @@ var require_lib9 = __commonJS({
|
|
|
30170
30158
|
return function select(query, elements, options) {
|
|
30171
30159
|
var opts = convertOptionFormats(options);
|
|
30172
30160
|
if (typeof query !== "function") {
|
|
30173
|
-
query = compile_1.compileUnsafe(query, opts, elements);
|
|
30161
|
+
query = (0, compile_1.compileUnsafe)(query, opts, elements);
|
|
30174
30162
|
}
|
|
30175
30163
|
var filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings);
|
|
30176
30164
|
return searchFunc(query, filteredElements, opts);
|
|
@@ -30188,8 +30176,9 @@ var require_lib9 = __commonJS({
|
|
|
30188
30176
|
exports2.prepareContext = prepareContext;
|
|
30189
30177
|
function appendNextSiblings(elem, adapter) {
|
|
30190
30178
|
var elems = Array.isArray(elem) ? elem.slice(0) : [elem];
|
|
30191
|
-
|
|
30192
|
-
|
|
30179
|
+
var elemsLength = elems.length;
|
|
30180
|
+
for (var i = 0; i < elemsLength; i++) {
|
|
30181
|
+
var nextSiblings = (0, subselects_1.getNextSiblings)(elems[i], adapter);
|
|
30193
30182
|
elems.push.apply(elems, nextSiblings);
|
|
30194
30183
|
}
|
|
30195
30184
|
return elems;
|
|
@@ -30202,7 +30191,7 @@ var require_lib9 = __commonJS({
|
|
|
30202
30191
|
});
|
|
30203
30192
|
function is(elem, query, options) {
|
|
30204
30193
|
var opts = convertOptionFormats(options);
|
|
30205
|
-
return (typeof query === "function" ? query : compile_1.compile(query, opts))(elem);
|
|
30194
|
+
return (typeof query === "function" ? query : (0, compile_1.compile)(query, opts))(elem);
|
|
30206
30195
|
}
|
|
30207
30196
|
exports2.is = is;
|
|
30208
30197
|
exports2.default = exports2.selectAll;
|
|
@@ -70088,18 +70077,9 @@ var require_minifyColor = __commonJS({
|
|
|
70088
70077
|
}
|
|
70089
70078
|
(0, _colord.extend)([_names.default, _minify.default]);
|
|
70090
70079
|
function minifyColor(input, options = {}) {
|
|
70091
|
-
const settings = {
|
|
70092
|
-
supportsAlphaHex: false,
|
|
70093
|
-
supportsTransparent: true,
|
|
70094
|
-
...options
|
|
70095
|
-
};
|
|
70096
70080
|
const instance = (0, _colord.colord)(input);
|
|
70097
70081
|
if (instance.isValid()) {
|
|
70098
|
-
const minified = instance.minify(
|
|
70099
|
-
alphaHex: settings.supportsAlphaHex,
|
|
70100
|
-
transparent: settings.supportsTransparent,
|
|
70101
|
-
name: true
|
|
70102
|
-
});
|
|
70082
|
+
const minified = instance.minify(options);
|
|
70103
70083
|
return minified.length < input.length ? minified : input.toLowerCase();
|
|
70104
70084
|
} else {
|
|
70105
70085
|
return input;
|
|
@@ -70205,21 +70185,29 @@ var require_dist13 = __commonJS({
|
|
|
70205
70185
|
});
|
|
70206
70186
|
return parsed.toString();
|
|
70207
70187
|
}
|
|
70208
|
-
function
|
|
70188
|
+
function addPluginDefaults(options, browsers) {
|
|
70189
|
+
const defaults = {
|
|
70190
|
+
transparent: browsers.some(hasTransparentBug) === false,
|
|
70191
|
+
alphaHex: (0, _caniuseApi.isSupported)("css-rrggbbaa", browsers),
|
|
70192
|
+
name: true
|
|
70193
|
+
};
|
|
70194
|
+
return {
|
|
70195
|
+
...defaults,
|
|
70196
|
+
...options
|
|
70197
|
+
};
|
|
70198
|
+
}
|
|
70199
|
+
function pluginCreator(config = {}) {
|
|
70209
70200
|
return {
|
|
70210
70201
|
postcssPlugin: "postcss-colormin",
|
|
70211
70202
|
prepare(result) {
|
|
70212
|
-
const
|
|
70203
|
+
const resultOptions = result.opts || {};
|
|
70213
70204
|
const browsers = (0, _browserslist.default)(null, {
|
|
70214
|
-
stats:
|
|
70205
|
+
stats: resultOptions.stats,
|
|
70215
70206
|
path: __dirname,
|
|
70216
|
-
env:
|
|
70207
|
+
env: resultOptions.env
|
|
70217
70208
|
});
|
|
70218
|
-
const options = {
|
|
70219
|
-
supportsTransparent: browsers.some(hasTransparentBug) === false,
|
|
70220
|
-
supportsAlphaHex: (0, _caniuseApi.isSupported)("css-rrggbbaa", browsers)
|
|
70221
|
-
};
|
|
70222
70209
|
const cache = {};
|
|
70210
|
+
const options = addPluginDefaults(config, browsers);
|
|
70223
70211
|
return {
|
|
70224
70212
|
OnceExit(css) {
|
|
70225
70213
|
css.walkDecls((decl) => {
|
|
@@ -72142,22 +72130,6 @@ var require_normalize_url = __commonJS({
|
|
|
72142
72130
|
}
|
|
72143
72131
|
});
|
|
72144
72132
|
|
|
72145
|
-
// node_modules/is-absolute-url/index.js
|
|
72146
|
-
var require_is_absolute_url = __commonJS({
|
|
72147
|
-
"node_modules/is-absolute-url/index.js"(exports2, module2) {
|
|
72148
|
-
"use strict";
|
|
72149
|
-
module2.exports = (url) => {
|
|
72150
|
-
if (typeof url !== "string") {
|
|
72151
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);
|
|
72152
|
-
}
|
|
72153
|
-
if (/^[a-zA-Z]:\\/.test(url)) {
|
|
72154
|
-
return false;
|
|
72155
|
-
}
|
|
72156
|
-
return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
|
|
72157
|
-
};
|
|
72158
|
-
}
|
|
72159
|
-
});
|
|
72160
|
-
|
|
72161
72133
|
// node_modules/postcss-normalize-url/dist/index.js
|
|
72162
72134
|
var require_dist19 = __commonJS({
|
|
72163
72135
|
"node_modules/postcss-normalize-url/dist/index.js"(exports2, module2) {
|
|
@@ -72169,14 +72141,21 @@ var require_dist19 = __commonJS({
|
|
|
72169
72141
|
var _path = _interopRequireDefault(require("path"));
|
|
72170
72142
|
var _postcssValueParser = _interopRequireDefault(require_lib());
|
|
72171
72143
|
var _normalizeUrl = _interopRequireDefault(require_normalize_url());
|
|
72172
|
-
var _isAbsoluteUrl = _interopRequireDefault(require_is_absolute_url());
|
|
72173
72144
|
function _interopRequireDefault(obj) {
|
|
72174
72145
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
72175
72146
|
}
|
|
72176
72147
|
var multiline = /\\[\r\n]/;
|
|
72177
72148
|
var escapeChars = /([\s\(\)"'])/g;
|
|
72149
|
+
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
72150
|
+
var WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
|
|
72151
|
+
function isAbsolute(url) {
|
|
72152
|
+
if (WINDOWS_PATH_REGEX.test(url)) {
|
|
72153
|
+
return false;
|
|
72154
|
+
}
|
|
72155
|
+
return ABSOLUTE_URL_REGEX.test(url);
|
|
72156
|
+
}
|
|
72178
72157
|
function convert(url, options) {
|
|
72179
|
-
if ((
|
|
72158
|
+
if (isAbsolute(url) || url.startsWith("//")) {
|
|
72180
72159
|
let normalizedURL = null;
|
|
72181
72160
|
try {
|
|
72182
72161
|
normalizedURL = (0, _normalizeUrl.default)(url, options);
|
|
@@ -75970,11 +75949,18 @@ var require_dist35 = __commonJS({
|
|
|
75970
75949
|
var _postcss = _interopRequireDefault(require_postcss());
|
|
75971
75950
|
var _yaml = _interopRequireDefault(require_yaml());
|
|
75972
75951
|
var _lilconfig = require_dist2();
|
|
75973
|
-
var _isResolvable = _interopRequireDefault(require_is_resolvable());
|
|
75974
75952
|
function _interopRequireDefault(obj) {
|
|
75975
75953
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
75976
75954
|
}
|
|
75977
75955
|
var cssnano = "cssnano";
|
|
75956
|
+
function isResolvable(moduleId) {
|
|
75957
|
+
try {
|
|
75958
|
+
require.resolve(moduleId);
|
|
75959
|
+
return true;
|
|
75960
|
+
} catch (e) {
|
|
75961
|
+
return false;
|
|
75962
|
+
}
|
|
75963
|
+
}
|
|
75978
75964
|
function resolvePreset(preset) {
|
|
75979
75965
|
let fn, options;
|
|
75980
75966
|
if (Array.isArray(preset)) {
|
|
@@ -75993,11 +75979,11 @@ var require_dist35 = __commonJS({
|
|
|
75993
75979
|
if (typeof fn === "function") {
|
|
75994
75980
|
return fn(options).plugins;
|
|
75995
75981
|
}
|
|
75996
|
-
if ((
|
|
75982
|
+
if (isResolvable(fn)) {
|
|
75997
75983
|
return require(fn)(options).plugins;
|
|
75998
75984
|
}
|
|
75999
75985
|
const sugar = `cssnano-preset-${fn}`;
|
|
76000
|
-
if ((
|
|
75986
|
+
if (isResolvable(sugar)) {
|
|
76001
75987
|
return require(sugar)(options).plugins;
|
|
76002
75988
|
}
|
|
76003
75989
|
throw new Error(`Cannot load preset "${fn}". Please check your configuration for errors and try again.`);
|
|
@@ -76035,12 +76021,12 @@ var require_dist35 = __commonJS({
|
|
|
76035
76021
|
options.plugins.forEach((plugin) => {
|
|
76036
76022
|
if (Array.isArray(plugin)) {
|
|
76037
76023
|
const [pluginDef, opts = {}] = plugin;
|
|
76038
|
-
if (typeof pluginDef === "string" && (
|
|
76024
|
+
if (typeof pluginDef === "string" && isResolvable(pluginDef)) {
|
|
76039
76025
|
options.preset.plugins.push([require(pluginDef), opts]);
|
|
76040
76026
|
} else {
|
|
76041
76027
|
options.preset.plugins.push([pluginDef, opts]);
|
|
76042
76028
|
}
|
|
76043
|
-
} else if (typeof plugin === "string" && (
|
|
76029
|
+
} else if (typeof plugin === "string" && isResolvable(plugin)) {
|
|
76044
76030
|
options.preset.plugins.push([require(plugin), {}]);
|
|
76045
76031
|
} else {
|
|
76046
76032
|
options.preset.plugins.push([plugin, {}]);
|