tailwindcss 3.1.6 → 3.1.7
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 +18 -2
- package/lib/cli-peer-dependencies.js +12 -4
- package/lib/cli.js +78 -75
- package/lib/constants.js +19 -12
- package/lib/corePluginList.js +5 -3
- package/lib/corePlugins.js +194 -187
- package/lib/featureFlags.js +14 -7
- package/lib/index.js +9 -6
- package/lib/lib/cacheInvalidation.js +18 -15
- package/lib/lib/collapseAdjacentRules.js +14 -11
- package/lib/lib/collapseDuplicateDeclarations.js +11 -8
- package/lib/lib/defaultExtractor.js +38 -35
- package/lib/lib/detectNesting.js +4 -1
- package/lib/lib/evaluateTailwindFunctions.js +37 -34
- package/lib/lib/expandApplyAtRules.js +45 -42
- package/lib/lib/expandTailwindAtRules.js +153 -150
- package/lib/lib/generateRules.js +80 -70
- package/lib/lib/getModuleDependencies.js +21 -18
- package/lib/lib/normalizeTailwindDirectives.js +10 -7
- package/lib/lib/partitionApplyAtRules.js +14 -11
- package/lib/lib/regex.js +15 -7
- package/lib/lib/resolveDefaultsAtRules.js +92 -85
- package/lib/lib/setupContextUtils.js +109 -97
- package/lib/lib/setupTrackingContext.js +82 -75
- package/lib/lib/sharedState.js +15 -8
- package/lib/lib/substituteScreenAtRules.js +8 -5
- package/lib/postcss-plugins/nesting/index.js +7 -5
- package/lib/postcss-plugins/nesting/plugin.js +7 -4
- package/lib/processTailwindFeatures.js +34 -31
- package/lib/public/colors.js +6 -4
- package/lib/public/create-plugin.js +6 -4
- package/lib/public/default-config.js +7 -5
- package/lib/public/default-theme.js +7 -5
- package/lib/public/resolve-config.js +13 -10
- package/lib/util/bigSign.js +4 -1
- package/lib/util/buildMediaQuery.js +5 -2
- package/lib/util/cloneDeep.js +4 -1
- package/lib/util/cloneNodes.js +9 -2
- package/lib/util/color.js +11 -3
- package/lib/util/configurePlugins.js +4 -1
- package/lib/util/createPlugin.js +5 -3
- package/lib/util/createUtilityPlugin.js +13 -10
- package/lib/util/dataTypes.js +27 -19
- package/lib/util/defaults.js +4 -1
- package/lib/util/escapeClassName.js +12 -9
- package/lib/util/escapeCommas.js +4 -1
- package/lib/util/flattenColorPalette.js +5 -3
- package/lib/util/formatVariantSelector.js +21 -14
- package/lib/util/getAllConfigs.js +12 -9
- package/lib/util/hashConfig.js +10 -7
- package/lib/util/isKeyframeRule.js +4 -1
- package/lib/util/isPlainObject.js +4 -1
- package/lib/util/isValidArbitraryValue.js +33 -24
- package/lib/util/log.js +12 -5
- package/lib/util/nameClass.js +16 -8
- package/lib/util/negateValue.js +4 -1
- package/lib/util/normalizeConfig.js +26 -23
- package/lib/util/normalizeScreens.js +17 -2
- package/lib/util/parseAnimationValue.js +42 -39
- package/lib/util/parseBoxShadowValue.js +12 -4
- package/lib/util/parseDependency.js +35 -32
- package/lib/util/parseObjectStyles.js +14 -11
- package/lib/util/pluginUtils.js +28 -20
- package/lib/util/prefixSelector.js +6 -3
- package/lib/util/removeAlphaVariables.js +13 -2
- package/lib/util/resolveConfig.js +55 -52
- package/lib/util/resolveConfigPath.js +20 -17
- package/lib/util/responsive.js +12 -9
- package/lib/util/splitAtTopLevelOnly.js +16 -13
- package/lib/util/tap.js +4 -1
- package/lib/util/toColorValue.js +4 -1
- package/lib/util/toPath.js +18 -2
- package/lib/util/transformThemeValue.js +10 -7
- package/lib/util/validateConfig.js +5 -2
- package/lib/util/withAlphaVariable.js +30 -22
- package/package.json +8 -8
- package/peers/index.js +13 -4
- package/resolveConfig.d.ts +3 -0
- package/src/lib/generateRules.js +5 -1
- package/src/lib/setupContextUtils.js +4 -2
- package/src/util/cloneNodes.js +5 -1
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
selectorFunctions: ()=>selectorFunctions,
|
|
13
|
+
formatVariantSelector: ()=>formatVariantSelector,
|
|
14
|
+
finalizeSelector: ()=>finalizeSelector
|
|
15
|
+
});
|
|
16
|
+
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
|
17
|
+
const _unesc = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc"));
|
|
18
|
+
const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("../util/escapeClassName"));
|
|
19
|
+
const _prefixSelector = /*#__PURE__*/ _interopRequireDefault(require("../util/prefixSelector"));
|
|
12
20
|
function _interopRequireDefault(obj) {
|
|
13
21
|
return obj && obj.__esModule ? obj : {
|
|
14
22
|
default: obj
|
|
@@ -20,7 +28,6 @@ let PARENT = "&";
|
|
|
20
28
|
let selectorFunctions = new Set([
|
|
21
29
|
MERGE
|
|
22
30
|
]);
|
|
23
|
-
exports.selectorFunctions = selectorFunctions;
|
|
24
31
|
function formatVariantSelector(current, ...others) {
|
|
25
32
|
for (let other of others){
|
|
26
33
|
let incomingValue = resolveFunctionArgument(other, MERGE);
|
|
@@ -39,7 +46,7 @@ function formatVariantSelector(current, ...others) {
|
|
|
39
46
|
return current;
|
|
40
47
|
}
|
|
41
48
|
var ref1;
|
|
42
|
-
function finalizeSelector(format, { selector
|
|
49
|
+
function finalizeSelector(format, { selector , candidate , context , isArbitraryVariant , // Split by the separator, but ignore the separator inside square brackets:
|
|
43
50
|
//
|
|
44
51
|
// E.g.: dark:lg:hover:[paint-order:markers]
|
|
45
52
|
// ┬ ┬ ┬ ┬
|
|
@@ -48,13 +55,13 @@ function finalizeSelector(format, { selector: selector1 , candidate , context ,
|
|
|
48
55
|
//
|
|
49
56
|
base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === void 0 ? void 0 : (ref = context.tailwindConfig) === null || ref === void 0 ? void 0 : ref.separator) !== null && ref1 !== void 0 ? ref1 : ":"}(?![^[]*\\])`)).pop() , }) {
|
|
50
57
|
var ref2;
|
|
51
|
-
let ast = (0, _postcssSelectorParser
|
|
58
|
+
let ast = (0, _postcssSelectorParser.default)().astSync(selector);
|
|
52
59
|
// We explicitly DO NOT prefix classes in arbitrary variants
|
|
53
60
|
if ((context === null || context === void 0 ? void 0 : (ref2 = context.tailwindConfig) === null || ref2 === void 0 ? void 0 : ref2.prefix) && !isArbitraryVariant) {
|
|
54
|
-
format = (0, _prefixSelector
|
|
61
|
+
format = (0, _prefixSelector.default)(context.tailwindConfig.prefix, format);
|
|
55
62
|
}
|
|
56
|
-
format = format.replace(PARENT, `.${(0, _escapeClassName
|
|
57
|
-
let formatAst = (0, _postcssSelectorParser
|
|
63
|
+
format = format.replace(PARENT, `.${(0, _escapeClassName.default)(candidate)}`);
|
|
64
|
+
let formatAst = (0, _postcssSelectorParser.default)().astSync(format);
|
|
58
65
|
// Remove extraneous selectors that do not include the base class/candidate being matched against
|
|
59
66
|
// For example if we have a utility defined `.a, .b { color: red}`
|
|
60
67
|
// And the formatted variant is sm:b then we want the final selector to be `.sm\:b` and not `.a, .sm\:b`
|
|
@@ -77,7 +84,7 @@ base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === vo
|
|
|
77
84
|
//
|
|
78
85
|
ast.walkClasses((node)=>{
|
|
79
86
|
if (node.raws && node.value.includes(base)) {
|
|
80
|
-
node.raws.value = (0, _escapeClassName
|
|
87
|
+
node.raws.value = (0, _escapeClassName.default)((0, _unesc.default)(node.raws.value));
|
|
81
88
|
}
|
|
82
89
|
});
|
|
83
90
|
// We can safely replace the escaped base now, since the `base` section is
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>getAllConfigs
|
|
8
|
+
});
|
|
9
|
+
const _defaultConfigStubJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
|
|
10
|
+
const _featureFlags = require("../featureFlags");
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
8
16
|
function getAllConfigs(config) {
|
|
9
17
|
var ref;
|
|
10
18
|
const configs = ((ref = config === null || config === void 0 ? void 0 : config.presets) !== null && ref !== void 0 ? ref : [
|
|
@@ -20,15 +28,10 @@ function getAllConfigs(config) {
|
|
|
20
28
|
}
|
|
21
29
|
}
|
|
22
30
|
};
|
|
23
|
-
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags
|
|
31
|
+
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
|
|
24
32
|
return [
|
|
25
33
|
config,
|
|
26
34
|
...experimentals,
|
|
27
35
|
...configs
|
|
28
36
|
];
|
|
29
37
|
}
|
|
30
|
-
function _interopRequireDefault(obj) {
|
|
31
|
-
return obj && obj.__esModule ? obj : {
|
|
32
|
-
default: obj
|
|
33
|
-
};
|
|
34
|
-
}
|
package/lib/util/hashConfig.js
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
}
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>hashConfig
|
|
8
|
+
});
|
|
9
|
+
const _objectHash = /*#__PURE__*/ _interopRequireDefault(require("object-hash"));
|
|
12
10
|
function _interopRequireDefault(obj) {
|
|
13
11
|
return obj && obj.__esModule ? obj : {
|
|
14
12
|
default: obj
|
|
15
13
|
};
|
|
16
14
|
}
|
|
15
|
+
function hashConfig(config) {
|
|
16
|
+
return (0, _objectHash.default)(config, {
|
|
17
|
+
ignoreUnknown: true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>isKeyframeRule
|
|
8
|
+
});
|
|
6
9
|
function isKeyframeRule(rule) {
|
|
7
10
|
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
|
8
11
|
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>isPlainObject
|
|
8
|
+
});
|
|
6
9
|
function isPlainObject(value) {
|
|
7
10
|
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
|
8
11
|
return false;
|
|
@@ -2,7 +2,39 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
Object.defineProperty(exports, // Arbitrary values must contain balanced brackets (), [] and {}. Escaped
|
|
6
|
+
// values don't count, and brackets inside quotes also don't count.
|
|
7
|
+
//
|
|
8
|
+
// E.g.: w-[this-is]w-[weird-and-invalid]
|
|
9
|
+
// E.g.: w-[this-is\\]w-\\[weird-but-valid]
|
|
10
|
+
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
|
11
|
+
"default", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: ()=>isValidArbitraryValue
|
|
14
|
+
});
|
|
15
|
+
let matchingBrackets = new Map([
|
|
16
|
+
[
|
|
17
|
+
"{",
|
|
18
|
+
"}"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"[",
|
|
22
|
+
"]"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"(",
|
|
26
|
+
")"
|
|
27
|
+
],
|
|
28
|
+
]);
|
|
29
|
+
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
|
30
|
+
v,
|
|
31
|
+
k
|
|
32
|
+
]));
|
|
33
|
+
let quotes = new Set([
|
|
34
|
+
'"',
|
|
35
|
+
"'",
|
|
36
|
+
"`"
|
|
37
|
+
]);
|
|
6
38
|
function isValidArbitraryValue(value) {
|
|
7
39
|
let stack = [];
|
|
8
40
|
let inQuotes = false;
|
|
@@ -38,26 +70,3 @@ function isValidArbitraryValue(value) {
|
|
|
38
70
|
// All good, totally balanced!
|
|
39
71
|
return true;
|
|
40
72
|
}
|
|
41
|
-
let matchingBrackets = new Map([
|
|
42
|
-
[
|
|
43
|
-
"{",
|
|
44
|
-
"}"
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"[",
|
|
48
|
-
"]"
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
"(",
|
|
52
|
-
")"
|
|
53
|
-
],
|
|
54
|
-
]);
|
|
55
|
-
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
|
56
|
-
v,
|
|
57
|
-
k
|
|
58
|
-
]));
|
|
59
|
-
let quotes = new Set([
|
|
60
|
-
'"',
|
|
61
|
-
"'",
|
|
62
|
-
"`"
|
|
63
|
-
]);
|
package/lib/util/log.js
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
dim: ()=>dim,
|
|
13
|
+
default: ()=>_default
|
|
14
|
+
});
|
|
15
|
+
const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
|
|
8
16
|
function _interopRequireDefault(obj) {
|
|
9
17
|
return obj && obj.__esModule ? obj : {
|
|
10
18
|
default: obj
|
|
@@ -21,7 +29,7 @@ function log(type, messages, key) {
|
|
|
21
29
|
function dim(input) {
|
|
22
30
|
return _picocolors.default.dim(input);
|
|
23
31
|
}
|
|
24
|
-
|
|
32
|
+
const _default = {
|
|
25
33
|
info (key, messages) {
|
|
26
34
|
log(_picocolors.default.bold(_picocolors.default.cyan("info")), ...Array.isArray(key) ? [
|
|
27
35
|
key
|
|
@@ -47,4 +55,3 @@ var _default = {
|
|
|
47
55
|
]);
|
|
48
56
|
}
|
|
49
57
|
};
|
|
50
|
-
exports.default = _default;
|
package/lib/util/nameClass.js
CHANGED
|
@@ -2,21 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function nameClass(classPrefix, key) {
|
|
11
|
-
return asClass(formatClass(classPrefix, key));
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
12
10
|
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
asClass: ()=>asClass,
|
|
13
|
+
default: ()=>nameClass,
|
|
14
|
+
formatClass: ()=>formatClass
|
|
15
|
+
});
|
|
16
|
+
const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("./escapeClassName"));
|
|
17
|
+
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
|
13
18
|
function _interopRequireDefault(obj) {
|
|
14
19
|
return obj && obj.__esModule ? obj : {
|
|
15
20
|
default: obj
|
|
16
21
|
};
|
|
17
22
|
}
|
|
18
23
|
function asClass(name) {
|
|
19
|
-
return (0, _escapeCommas
|
|
24
|
+
return (0, _escapeCommas.default)(`.${(0, _escapeClassName.default)(name)}`);
|
|
25
|
+
}
|
|
26
|
+
function nameClass(classPrefix, key) {
|
|
27
|
+
return asClass(formatClass(classPrefix, key));
|
|
20
28
|
}
|
|
21
29
|
function formatClass(classPrefix, key) {
|
|
22
30
|
if (key === "DEFAULT") {
|
package/lib/util/negateValue.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>_default
|
|
8
|
+
});
|
|
6
9
|
function _default(value) {
|
|
7
10
|
value = `${value}`;
|
|
8
11
|
if (value === "0") {
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "normalizeConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>normalizeConfig
|
|
8
|
+
});
|
|
9
|
+
const _log = /*#__PURE__*/ _interopRequireWildcard(require("./log"));
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
8
11
|
if (typeof WeakMap !== "function") return null;
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
var cacheBabelInterop = new WeakMap();
|
|
13
|
+
var cacheNodeInterop = new WeakMap();
|
|
14
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
15
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
16
|
+
})(nodeInterop);
|
|
14
17
|
}
|
|
15
|
-
function _interopRequireWildcard(obj) {
|
|
16
|
-
if (obj && obj.__esModule) {
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
19
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
17
20
|
return obj;
|
|
18
21
|
}
|
|
19
22
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
@@ -21,14 +24,14 @@ function _interopRequireWildcard(obj) {
|
|
|
21
24
|
default: obj
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
|
-
var cache = _getRequireWildcardCache();
|
|
27
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
25
28
|
if (cache && cache.has(obj)) {
|
|
26
29
|
return cache.get(obj);
|
|
27
30
|
}
|
|
28
31
|
var newObj = {};
|
|
29
32
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
30
33
|
for(var key in obj){
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
34
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
32
35
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
33
36
|
if (desc && (desc.get || desc.set)) {
|
|
34
37
|
Object.defineProperty(newObj, key, desc);
|
|
@@ -124,8 +127,8 @@ function normalizeConfig(config) {
|
|
|
124
127
|
}
|
|
125
128
|
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
|
126
129
|
if (typeof config.content.transform === "object") {
|
|
127
|
-
for (let
|
|
128
|
-
if (typeof
|
|
130
|
+
for (let value1 of Object.values(config.content.transform)){
|
|
131
|
+
if (typeof value1 !== "function") {
|
|
129
132
|
return false;
|
|
130
133
|
}
|
|
131
134
|
}
|
|
@@ -190,11 +193,11 @@ function normalizeConfig(config) {
|
|
|
190
193
|
})();
|
|
191
194
|
let extractors = {};
|
|
192
195
|
let defaultExtractor = (()=>{
|
|
193
|
-
var ref,
|
|
194
|
-
if ((ref = config.purge) === null || ref === void 0 ? void 0 : (
|
|
196
|
+
var ref, ref1, ref2, ref3;
|
|
197
|
+
if ((ref = config.purge) === null || ref === void 0 ? void 0 : (ref1 = ref.options) === null || ref1 === void 0 ? void 0 : ref1.defaultExtractor) {
|
|
195
198
|
return config.purge.options.defaultExtractor;
|
|
196
199
|
}
|
|
197
|
-
if ((
|
|
200
|
+
if ((ref2 = config.content) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.options) === null || ref3 === void 0 ? void 0 : ref3.defaultExtractor) {
|
|
198
201
|
return config.content.options.defaultExtractor;
|
|
199
202
|
}
|
|
200
203
|
return undefined;
|
|
@@ -218,11 +221,11 @@ function normalizeConfig(config) {
|
|
|
218
221
|
})(),
|
|
219
222
|
transform: (()=>{
|
|
220
223
|
let transform = (()=>{
|
|
221
|
-
var ref,
|
|
224
|
+
var ref, ref1, ref2, ref3, ref4, ref5;
|
|
222
225
|
if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.transform) return config.purge.transform;
|
|
223
|
-
if ((
|
|
224
|
-
if ((
|
|
225
|
-
if ((
|
|
226
|
+
if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.transform) return config.content.transform;
|
|
227
|
+
if ((ref2 = config.purge) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.transform) === null || ref3 === void 0 ? void 0 : ref3.DEFAULT) return config.purge.transform.DEFAULT;
|
|
228
|
+
if ((ref4 = config.content) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.transform) === null || ref5 === void 0 ? void 0 : ref5.DEFAULT) return config.content.transform.DEFAULT;
|
|
226
229
|
return {};
|
|
227
230
|
})();
|
|
228
231
|
let transformers = {};
|
|
@@ -240,8 +243,8 @@ function normalizeConfig(config) {
|
|
|
240
243
|
for (let file of config.content.files){
|
|
241
244
|
if (typeof file === "string" && /{([^,]*?)}/g.test(file)) {
|
|
242
245
|
_log.default.warn("invalid-glob-braces", [
|
|
243
|
-
`The glob pattern ${(0, _log
|
|
244
|
-
`Update it to ${(0, _log
|
|
246
|
+
`The glob pattern ${(0, _log.dim)(file)} in your Tailwind CSS configuration is invalid.`,
|
|
247
|
+
`Update it to ${(0, _log.dim)(file.replace(/{([^,]*?)}/g, "$1"))} to silence this warning.`
|
|
245
248
|
]);
|
|
246
249
|
break;
|
|
247
250
|
}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A function that normalizes the various forms that the screens object can be
|
|
3
|
+
* provided in.
|
|
4
|
+
*
|
|
5
|
+
* Input(s):
|
|
6
|
+
* - ['100px', '200px'] // Raw strings
|
|
7
|
+
* - { sm: '100px', md: '200px' } // Object with string values
|
|
8
|
+
* - { sm: { min: '100px' }, md: { max: '100px' } } // Object with object values
|
|
9
|
+
* - { sm: [{ min: '100px' }, { max: '200px' }] } // Object with object array (multiple values)
|
|
10
|
+
*
|
|
11
|
+
* Output(s):
|
|
12
|
+
* - [{ name: 'sm', values: [{ min: '100px', max: '200px' }] }] // List of objects, that contains multiple values
|
|
13
|
+
*/ "use strict";
|
|
2
14
|
Object.defineProperty(exports, "__esModule", {
|
|
3
15
|
value: true
|
|
4
16
|
});
|
|
5
|
-
exports
|
|
17
|
+
Object.defineProperty(exports, "normalizeScreens", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>normalizeScreens
|
|
20
|
+
});
|
|
6
21
|
function normalizeScreens(screens, root = true) {
|
|
7
22
|
if (Array.isArray(screens)) {
|
|
8
23
|
return screens.map((screen)=>{
|
|
@@ -2,7 +2,48 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>parseAnimationValue
|
|
8
|
+
});
|
|
9
|
+
const DIRECTIONS = new Set([
|
|
10
|
+
"normal",
|
|
11
|
+
"reverse",
|
|
12
|
+
"alternate",
|
|
13
|
+
"alternate-reverse"
|
|
14
|
+
]);
|
|
15
|
+
const PLAY_STATES = new Set([
|
|
16
|
+
"running",
|
|
17
|
+
"paused"
|
|
18
|
+
]);
|
|
19
|
+
const FILL_MODES = new Set([
|
|
20
|
+
"none",
|
|
21
|
+
"forwards",
|
|
22
|
+
"backwards",
|
|
23
|
+
"both"
|
|
24
|
+
]);
|
|
25
|
+
const ITERATION_COUNTS = new Set([
|
|
26
|
+
"infinite"
|
|
27
|
+
]);
|
|
28
|
+
const TIMINGS = new Set([
|
|
29
|
+
"linear",
|
|
30
|
+
"ease",
|
|
31
|
+
"ease-in",
|
|
32
|
+
"ease-out",
|
|
33
|
+
"ease-in-out",
|
|
34
|
+
"step-start",
|
|
35
|
+
"step-end",
|
|
36
|
+
]);
|
|
37
|
+
const TIMING_FNS = [
|
|
38
|
+
"cubic-bezier",
|
|
39
|
+
"steps"
|
|
40
|
+
];
|
|
41
|
+
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
|
|
42
|
+
;
|
|
43
|
+
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
|
|
44
|
+
;
|
|
45
|
+
const TIME = /^(-?[\d.]+m?s)$/;
|
|
46
|
+
const DIGIT = /^(\d+)$/;
|
|
6
47
|
function parseAnimationValue(input) {
|
|
7
48
|
let animations = input.split(COMMA);
|
|
8
49
|
return animations.map((animation)=>{
|
|
@@ -48,41 +89,3 @@ function parseAnimationValue(input) {
|
|
|
48
89
|
return result;
|
|
49
90
|
});
|
|
50
91
|
}
|
|
51
|
-
const DIRECTIONS = new Set([
|
|
52
|
-
"normal",
|
|
53
|
-
"reverse",
|
|
54
|
-
"alternate",
|
|
55
|
-
"alternate-reverse"
|
|
56
|
-
]);
|
|
57
|
-
const PLAY_STATES = new Set([
|
|
58
|
-
"running",
|
|
59
|
-
"paused"
|
|
60
|
-
]);
|
|
61
|
-
const FILL_MODES = new Set([
|
|
62
|
-
"none",
|
|
63
|
-
"forwards",
|
|
64
|
-
"backwards",
|
|
65
|
-
"both"
|
|
66
|
-
]);
|
|
67
|
-
const ITERATION_COUNTS = new Set([
|
|
68
|
-
"infinite"
|
|
69
|
-
]);
|
|
70
|
-
const TIMINGS = new Set([
|
|
71
|
-
"linear",
|
|
72
|
-
"ease",
|
|
73
|
-
"ease-in",
|
|
74
|
-
"ease-out",
|
|
75
|
-
"ease-in-out",
|
|
76
|
-
"step-start",
|
|
77
|
-
"step-end",
|
|
78
|
-
]);
|
|
79
|
-
const TIMING_FNS = [
|
|
80
|
-
"cubic-bezier",
|
|
81
|
-
"steps"
|
|
82
|
-
];
|
|
83
|
-
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
|
|
84
|
-
;
|
|
85
|
-
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
|
|
86
|
-
;
|
|
87
|
-
const TIME = /^(-?[\d.]+m?s)$/;
|
|
88
|
-
const DIGIT = /^(\d+)$/;
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
parseBoxShadowValue: ()=>parseBoxShadowValue,
|
|
13
|
+
formatBoxShadowValue: ()=>formatBoxShadowValue
|
|
14
|
+
});
|
|
15
|
+
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
8
16
|
let KEYWORDS = new Set([
|
|
9
17
|
"inset",
|
|
10
18
|
"inherit",
|
|
@@ -16,7 +24,7 @@ let SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces inste
|
|
|
16
24
|
;
|
|
17
25
|
let LENGTH = /^-?(\d+|\.\d+)(.*?)$/g;
|
|
18
26
|
function parseBoxShadowValue(input) {
|
|
19
|
-
let shadows = Array.from((0, _splitAtTopLevelOnly
|
|
27
|
+
let shadows = Array.from((0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(input, ","));
|
|
20
28
|
return shadows.map((shadow)=>{
|
|
21
29
|
let value = shadow.trim();
|
|
22
30
|
let result = {
|
|
@@ -2,16 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>parseDependency
|
|
8
|
+
});
|
|
9
|
+
const _isGlob = /*#__PURE__*/ _interopRequireDefault(require("is-glob"));
|
|
10
|
+
const _globParent = /*#__PURE__*/ _interopRequireDefault(require("glob-parent"));
|
|
11
|
+
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// Based on `glob-base`
|
|
18
|
+
// https://github.com/micromatch/glob-base/blob/master/index.js
|
|
19
|
+
function parseGlob(pattern) {
|
|
20
|
+
let glob = pattern;
|
|
21
|
+
let base = (0, _globParent.default)(pattern);
|
|
22
|
+
if (base !== ".") {
|
|
23
|
+
glob = pattern.substr(base.length);
|
|
24
|
+
if (glob.charAt(0) === "/") {
|
|
25
|
+
glob = glob.substr(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (glob.substr(0, 2) === "./") {
|
|
29
|
+
glob = glob.substr(2);
|
|
30
|
+
}
|
|
31
|
+
if (glob.charAt(0) === "/") {
|
|
32
|
+
glob = glob.substr(1);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
base,
|
|
36
|
+
glob
|
|
37
|
+
};
|
|
38
|
+
}
|
|
9
39
|
function parseDependency(normalizedFileOrGlob) {
|
|
10
40
|
if (normalizedFileOrGlob.startsWith("!")) {
|
|
11
41
|
return null;
|
|
12
42
|
}
|
|
13
43
|
let message;
|
|
14
|
-
if ((0, _isGlob
|
|
44
|
+
if ((0, _isGlob.default)(normalizedFileOrGlob)) {
|
|
15
45
|
let { base , glob } = parseGlob(normalizedFileOrGlob);
|
|
16
46
|
message = {
|
|
17
47
|
type: "dir-dependency",
|
|
@@ -34,30 +64,3 @@ function parseDependency(normalizedFileOrGlob) {
|
|
|
34
64
|
}
|
|
35
65
|
return message;
|
|
36
66
|
}
|
|
37
|
-
function _interopRequireDefault(obj) {
|
|
38
|
-
return obj && obj.__esModule ? obj : {
|
|
39
|
-
default: obj
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Based on `glob-base`
|
|
43
|
-
// https://github.com/micromatch/glob-base/blob/master/index.js
|
|
44
|
-
function parseGlob(pattern) {
|
|
45
|
-
let glob = pattern;
|
|
46
|
-
let base = (0, _globParent).default(pattern);
|
|
47
|
-
if (base !== ".") {
|
|
48
|
-
glob = pattern.substr(base.length);
|
|
49
|
-
if (glob.charAt(0) === "/") {
|
|
50
|
-
glob = glob.substr(1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (glob.substr(0, 2) === "./") {
|
|
54
|
-
glob = glob.substr(2);
|
|
55
|
-
}
|
|
56
|
-
if (glob.charAt(0) === "/") {
|
|
57
|
-
glob = glob.substr(1);
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
base,
|
|
61
|
-
glob
|
|
62
|
-
};
|
|
63
|
-
}
|