tailwindcss 0.0.0-insiders.bd4dddd → 0.0.0-insiders.bda8421
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/LICENSE +1 -2
- package/README.md +13 -10
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +4 -0
- package/lib/cli/build/deps.js +62 -0
- package/lib/cli/build/index.js +54 -0
- package/lib/cli/build/plugin.js +371 -0
- package/lib/cli/build/utils.js +88 -0
- package/lib/cli/build/watching.js +182 -0
- package/lib/cli/help/index.js +73 -0
- package/lib/cli/index.js +230 -0
- package/lib/cli/init/index.js +63 -0
- package/lib/cli-peer-dependencies.js +28 -7
- package/lib/cli.js +1 -741
- package/lib/corePluginList.js +17 -4
- package/lib/corePlugins.js +2503 -1839
- package/lib/css/preflight.css +32 -13
- package/lib/featureFlags.js +45 -28
- package/lib/index.js +1 -29
- package/lib/lib/cacheInvalidation.js +92 -0
- package/lib/lib/collapseAdjacentRules.js +30 -10
- package/lib/lib/collapseDuplicateDeclarations.js +13 -8
- package/lib/lib/content.js +214 -0
- package/lib/lib/defaultExtractor.js +240 -31
- package/lib/lib/evaluateTailwindFunctions.js +117 -50
- package/lib/lib/expandApplyAtRules.js +466 -230
- package/lib/lib/expandTailwindAtRules.js +156 -135
- package/lib/lib/findAtConfigPath.js +46 -0
- package/lib/lib/generateRules.js +554 -200
- package/lib/lib/getModuleDependencies.js +88 -37
- package/lib/lib/load-config.js +57 -0
- package/lib/lib/normalizeTailwindDirectives.js +39 -33
- package/lib/lib/offsets.js +355 -0
- package/lib/lib/partitionApplyAtRules.js +58 -0
- package/lib/lib/regex.js +74 -0
- package/lib/lib/remap-bitfield.js +89 -0
- package/lib/lib/resolveDefaultsAtRules.js +97 -69
- package/lib/lib/setupContextUtils.js +796 -341
- package/lib/lib/setupTrackingContext.js +66 -71
- package/lib/lib/sharedState.js +45 -14
- package/lib/lib/substituteScreenAtRules.js +14 -10
- package/lib/plugin.js +48 -0
- package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
- package/lib/postcss-plugins/nesting/index.js +21 -0
- package/lib/postcss-plugins/nesting/plugin.js +89 -0
- package/lib/processTailwindFeatures.js +37 -27
- package/lib/public/colors.js +272 -246
- package/lib/public/create-plugin.js +9 -5
- package/lib/public/default-config.js +10 -6
- package/lib/public/default-theme.js +10 -6
- package/lib/public/load-config.js +12 -0
- package/lib/public/resolve-config.js +11 -6
- package/lib/util/applyImportantSelector.js +36 -0
- package/lib/util/bigSign.js +6 -1
- package/lib/util/buildMediaQuery.js +13 -6
- package/lib/util/cloneDeep.js +9 -6
- package/lib/util/cloneNodes.js +44 -4
- package/lib/util/color.js +70 -53
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +7 -2
- package/lib/util/createPlugin.js +8 -6
- package/lib/util/createUtilityPlugin.js +16 -16
- package/lib/util/dataTypes.js +295 -113
- package/lib/util/defaults.js +12 -7
- package/lib/util/escapeClassName.js +13 -8
- package/lib/util/escapeCommas.js +7 -2
- package/lib/util/flattenColorPalette.js +11 -12
- package/lib/util/formatVariantSelector.js +235 -151
- package/lib/util/getAllConfigs.js +33 -12
- package/lib/util/hashConfig.js +9 -4
- package/lib/util/isKeyframeRule.js +7 -2
- package/lib/util/isPlainObject.js +8 -3
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
- package/lib/util/log.js +25 -15
- package/lib/util/nameClass.js +27 -10
- package/lib/util/negateValue.js +25 -8
- package/lib/util/normalizeConfig.js +127 -82
- package/lib/util/normalizeScreens.js +128 -11
- package/lib/util/parseAnimationValue.js +44 -40
- package/lib/util/parseBoxShadowValue.js +34 -23
- package/lib/util/parseDependency.js +39 -55
- package/lib/util/parseGlob.js +36 -0
- package/lib/util/parseObjectStyles.js +15 -10
- package/lib/util/pluginUtils.js +172 -69
- package/lib/util/prefixSelector.js +30 -12
- package/lib/util/pseudoElements.js +212 -0
- package/lib/util/removeAlphaVariables.js +31 -0
- package/lib/util/resolveConfig.js +101 -87
- package/lib/util/resolveConfigPath.js +30 -12
- package/lib/util/responsive.js +11 -6
- package/lib/util/splitAtTopLevelOnly.js +51 -0
- package/lib/util/tap.js +6 -1
- package/lib/util/toColorValue.js +7 -3
- package/lib/util/toPath.js +22 -4
- package/lib/util/transformThemeValue.js +40 -30
- package/lib/util/validateConfig.js +37 -0
- package/lib/util/validateFormalSyntax.js +26 -0
- package/lib/util/withAlphaVariable.js +27 -15
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/nesting/index.d.ts +4 -0
- package/nesting/index.js +2 -12
- package/package.json +60 -55
- package/peers/index.js +75503 -55095
- package/plugin.d.ts +11 -0
- package/resolveConfig.d.ts +31 -0
- package/scripts/generate-types.js +104 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli/build/deps.js +56 -0
- package/src/cli/build/index.js +49 -0
- package/src/cli/build/plugin.js +437 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +229 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +216 -0
- package/src/cli/init/index.js +79 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +1 -811
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +849 -243
- package/src/css/preflight.css +32 -13
- package/src/featureFlags.js +13 -9
- package/src/index.js +1 -28
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/content.js +249 -0
- package/src/lib/defaultExtractor.js +215 -33
- package/src/lib/evaluateTailwindFunctions.js +82 -8
- package/src/lib/expandApplyAtRules.js +512 -224
- package/src/lib/expandTailwindAtRules.js +102 -87
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +541 -146
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +44 -0
- package/src/lib/normalizeTailwindDirectives.js +1 -0
- package/src/lib/offsets.js +432 -0
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/remap-bitfield.js +82 -0
- package/src/lib/resolveDefaultsAtRules.js +55 -30
- package/src/lib/setupContextUtils.js +720 -190
- package/src/lib/setupTrackingContext.js +47 -61
- package/src/lib/sharedState.js +15 -4
- package/src/plugin.js +47 -0
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/src/postcss-plugins/nesting/plugin.js +80 -0
- package/src/processTailwindFeatures.js +11 -4
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +27 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +40 -2
- package/src/util/color.js +39 -20
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +184 -26
- package/src/util/formatVariantSelector.js +272 -144
- package/src/util/getAllConfigs.js +21 -2
- package/src/util/isPlainObject.js +1 -1
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +8 -8
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +45 -6
- package/src/util/normalizeScreens.js +99 -4
- package/src/util/parseBoxShadowValue.js +4 -3
- package/src/util/parseDependency.js +37 -42
- package/src/util/parseGlob.js +24 -0
- package/src/util/pluginUtils.js +139 -24
- package/src/util/prefixSelector.js +31 -10
- package/src/util/pseudoElements.js +171 -0
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -32
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +52 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +26 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +290 -178
- package/stubs/postcss.config.js +6 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +376 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +298 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/generated/default-theme.d.ts +397 -0
- package/types/index.d.ts +11 -0
- package/CHANGELOG.md +0 -1959
- package/lib/constants.js +0 -37
- package/lib/lib/detectNesting.js +0 -34
- package/nesting/plugin.js +0 -41
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/constants.js +0 -17
- package/src/lib/detectNesting.js +0 -39
- /package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -0
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
|
@@ -2,45 +2,55 @@
|
|
|
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: function() {
|
|
14
|
+
return isSyntacticallyValidPropertyValue;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
6
17
|
let matchingBrackets = new Map([
|
|
7
18
|
[
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
"{",
|
|
20
|
+
"}"
|
|
10
21
|
],
|
|
11
22
|
[
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
"[",
|
|
24
|
+
"]"
|
|
14
25
|
],
|
|
15
26
|
[
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
]
|
|
27
|
+
"(",
|
|
28
|
+
")"
|
|
29
|
+
]
|
|
19
30
|
]);
|
|
20
31
|
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
|
21
32
|
v,
|
|
22
33
|
k
|
|
23
|
-
]
|
|
24
|
-
));
|
|
34
|
+
]));
|
|
25
35
|
let quotes = new Set([
|
|
26
36
|
'"',
|
|
27
37
|
"'",
|
|
28
|
-
|
|
38
|
+
"`"
|
|
29
39
|
]);
|
|
30
|
-
function
|
|
40
|
+
function isSyntacticallyValidPropertyValue(value) {
|
|
31
41
|
let stack = [];
|
|
32
42
|
let inQuotes = false;
|
|
33
43
|
for(let i = 0; i < value.length; i++){
|
|
34
44
|
let char = value[i];
|
|
35
|
-
if (char ===
|
|
45
|
+
if (char === ":" && !inQuotes && stack.length === 0) {
|
|
36
46
|
return false;
|
|
37
47
|
}
|
|
38
48
|
// Non-escaped quotes allow us to "allow" anything in between
|
|
39
|
-
if (quotes.has(char) && value[i - 1] !==
|
|
49
|
+
if (quotes.has(char) && value[i - 1] !== "\\") {
|
|
40
50
|
inQuotes = !inQuotes;
|
|
41
51
|
}
|
|
42
52
|
if (inQuotes) continue;
|
|
43
|
-
if (value[i - 1] ===
|
|
53
|
+
if (value[i - 1] === "\\") continue; // Escaped
|
|
44
54
|
if (matchingBrackets.has(char)) {
|
|
45
55
|
stack.push(char);
|
|
46
56
|
} else if (inverseMatchingBrackets.has(char)) {
|
package/lib/util/log.js
CHANGED
|
@@ -2,29 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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: function() {
|
|
13
|
+
return dim;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
20
|
+
function _interop_require_default(obj) {
|
|
9
21
|
return obj && obj.__esModule ? obj : {
|
|
10
22
|
default: obj
|
|
11
23
|
};
|
|
12
24
|
}
|
|
13
25
|
let alreadyShown = new Set();
|
|
14
|
-
function log(
|
|
15
|
-
if (process.env.JEST_WORKER_ID
|
|
26
|
+
function log(type, messages, key) {
|
|
27
|
+
if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) return;
|
|
16
28
|
if (key && alreadyShown.has(key)) return;
|
|
17
29
|
if (key) alreadyShown.add(key);
|
|
18
|
-
console.warn(
|
|
19
|
-
messages.forEach((message)=>console.warn(
|
|
20
|
-
);
|
|
30
|
+
console.warn("");
|
|
31
|
+
messages.forEach((message)=>console.warn(type, "-", message));
|
|
21
32
|
}
|
|
22
33
|
function dim(input) {
|
|
23
|
-
return
|
|
34
|
+
return _picocolors.default.dim(input);
|
|
24
35
|
}
|
|
25
|
-
|
|
36
|
+
const _default = {
|
|
26
37
|
info (key, messages) {
|
|
27
|
-
log(
|
|
38
|
+
log(_picocolors.default.bold(_picocolors.default.cyan("info")), ...Array.isArray(key) ? [
|
|
28
39
|
key
|
|
29
40
|
] : [
|
|
30
41
|
messages,
|
|
@@ -32,7 +43,7 @@ var _default = {
|
|
|
32
43
|
]);
|
|
33
44
|
},
|
|
34
45
|
warn (key, messages) {
|
|
35
|
-
log(
|
|
46
|
+
log(_picocolors.default.bold(_picocolors.default.yellow("warn")), ...Array.isArray(key) ? [
|
|
36
47
|
key
|
|
37
48
|
] : [
|
|
38
49
|
messages,
|
|
@@ -40,7 +51,7 @@ var _default = {
|
|
|
40
51
|
]);
|
|
41
52
|
},
|
|
42
53
|
risk (key, messages) {
|
|
43
|
-
log(
|
|
54
|
+
log(_picocolors.default.bold(_picocolors.default.magenta("risk")), ...Array.isArray(key) ? [
|
|
44
55
|
key
|
|
45
56
|
] : [
|
|
46
57
|
messages,
|
|
@@ -48,4 +59,3 @@ var _default = {
|
|
|
48
59
|
]);
|
|
49
60
|
}
|
|
50
61
|
};
|
|
51
|
-
exports.default = _default;
|
package/lib/util/nameClass.js
CHANGED
|
@@ -2,31 +2,48 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
asClass: function() {
|
|
13
|
+
return asClass;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return nameClass;
|
|
17
|
+
},
|
|
18
|
+
formatClass: function() {
|
|
19
|
+
return formatClass;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
|
|
23
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
11
25
|
return obj && obj.__esModule ? obj : {
|
|
12
26
|
default: obj
|
|
13
27
|
};
|
|
14
28
|
}
|
|
15
29
|
function asClass(name) {
|
|
16
|
-
return (0, _escapeCommas
|
|
30
|
+
return (0, _escapeCommas.default)(`.${(0, _escapeClassName.default)(name)}`);
|
|
17
31
|
}
|
|
18
32
|
function nameClass(classPrefix, key) {
|
|
19
33
|
return asClass(formatClass(classPrefix, key));
|
|
20
34
|
}
|
|
21
35
|
function formatClass(classPrefix, key) {
|
|
22
|
-
if (key ===
|
|
36
|
+
if (key === "DEFAULT") {
|
|
23
37
|
return classPrefix;
|
|
24
38
|
}
|
|
25
|
-
if (key ===
|
|
39
|
+
if (key === "-" || key === "-DEFAULT") {
|
|
26
40
|
return `-${classPrefix}`;
|
|
27
41
|
}
|
|
28
|
-
if (key.startsWith(
|
|
42
|
+
if (key.startsWith("-")) {
|
|
29
43
|
return `-${classPrefix}${key}`;
|
|
30
44
|
}
|
|
45
|
+
if (key.startsWith("/")) {
|
|
46
|
+
return `${classPrefix}${key}`;
|
|
47
|
+
}
|
|
31
48
|
return `${classPrefix}-${key}`;
|
|
32
49
|
}
|
package/lib/util/negateValue.js
CHANGED
|
@@ -2,18 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return negateValue;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function negateValue(value) {
|
|
7
12
|
value = `${value}`;
|
|
8
|
-
if (value ===
|
|
9
|
-
return
|
|
13
|
+
if (value === "0") {
|
|
14
|
+
return "0";
|
|
10
15
|
}
|
|
11
16
|
// Flip sign of numbers
|
|
12
17
|
if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
|
|
13
|
-
return value.replace(/^[+-]?/, (sign)=>sign ===
|
|
14
|
-
);
|
|
18
|
+
return value.replace(/^[+-]?/, (sign)=>sign === "-" ? "" : "-");
|
|
15
19
|
}
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
// What functions we support negating numeric values for
|
|
21
|
+
// var() isn't inherently a numeric function but we support it anyway
|
|
22
|
+
// The trigonometric functions are omitted because you'll need to use calc(…) with them _anyway_
|
|
23
|
+
// to produce generally useful results and that will be covered already
|
|
24
|
+
let numericFunctions = [
|
|
25
|
+
"var",
|
|
26
|
+
"calc",
|
|
27
|
+
"min",
|
|
28
|
+
"max",
|
|
29
|
+
"clamp"
|
|
30
|
+
];
|
|
31
|
+
for (const fn of numericFunctions){
|
|
32
|
+
if (value.includes(`${fn}(`)) {
|
|
33
|
+
return `calc(${value} * -1)`;
|
|
34
|
+
}
|
|
18
35
|
}
|
|
19
36
|
}
|
|
@@ -2,30 +2,52 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
5
|
+
Object.defineProperty(exports, "normalizeConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return normalizeConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _featureFlags = require("../featureFlags");
|
|
12
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
14
|
+
if (typeof WeakMap !== "function") return null;
|
|
15
|
+
var cacheBabelInterop = new WeakMap();
|
|
16
|
+
var cacheNodeInterop = new WeakMap();
|
|
17
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
18
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
19
|
+
})(nodeInterop);
|
|
20
|
+
}
|
|
21
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
22
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
9
23
|
return obj;
|
|
10
|
-
}
|
|
11
|
-
|
|
24
|
+
}
|
|
25
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
26
|
+
return {
|
|
27
|
+
default: obj
|
|
12
28
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
}
|
|
30
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
31
|
+
if (cache && cache.has(obj)) {
|
|
32
|
+
return cache.get(obj);
|
|
33
|
+
}
|
|
34
|
+
var newObj = {};
|
|
35
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
36
|
+
for(var key in obj){
|
|
37
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
38
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
39
|
+
if (desc && (desc.get || desc.set)) {
|
|
40
|
+
Object.defineProperty(newObj, key, desc);
|
|
41
|
+
} else {
|
|
42
|
+
newObj[key] = obj[key];
|
|
24
43
|
}
|
|
25
44
|
}
|
|
26
|
-
newObj.default = obj;
|
|
27
|
-
return newObj;
|
|
28
45
|
}
|
|
46
|
+
newObj.default = obj;
|
|
47
|
+
if (cache) {
|
|
48
|
+
cache.set(obj, newObj);
|
|
49
|
+
}
|
|
50
|
+
return newObj;
|
|
29
51
|
}
|
|
30
52
|
function normalizeConfig(config) {
|
|
31
53
|
// Quick structure validation
|
|
@@ -52,45 +74,45 @@ function normalizeConfig(config) {
|
|
|
52
74
|
return false;
|
|
53
75
|
}
|
|
54
76
|
// `config.content` should be an object or an array
|
|
55
|
-
if (!Array.isArray(config.content) && !(typeof config.content ===
|
|
77
|
+
if (!Array.isArray(config.content) && !(typeof config.content === "object" && config.content !== null)) {
|
|
56
78
|
return false;
|
|
57
79
|
}
|
|
58
80
|
// When `config.content` is an array, it should consist of FilePaths or RawFiles
|
|
59
81
|
if (Array.isArray(config.content)) {
|
|
60
82
|
return config.content.every((path)=>{
|
|
61
83
|
// `path` can be a string
|
|
62
|
-
if (typeof path ===
|
|
84
|
+
if (typeof path === "string") return true;
|
|
63
85
|
// `path` can be an object { raw: string, extension?: string }
|
|
64
86
|
// `raw` must be a string
|
|
65
|
-
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !==
|
|
87
|
+
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
|
|
66
88
|
// `extension` (if provided) should also be a string
|
|
67
|
-
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !==
|
|
89
|
+
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
|
|
68
90
|
return false;
|
|
69
91
|
}
|
|
70
92
|
return true;
|
|
71
93
|
});
|
|
72
94
|
}
|
|
73
95
|
// When `config.content` is an object
|
|
74
|
-
if (typeof config.content ===
|
|
75
|
-
// Only `files`, `extract
|
|
96
|
+
if (typeof config.content === "object" && config.content !== null) {
|
|
97
|
+
// Only `files`, `relative`, `extract`, and `transform` can exist in `config.content`
|
|
76
98
|
if (Object.keys(config.content).some((key)=>![
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
"files",
|
|
100
|
+
"relative",
|
|
101
|
+
"extract",
|
|
102
|
+
"transform"
|
|
103
|
+
].includes(key))) {
|
|
82
104
|
return false;
|
|
83
105
|
}
|
|
84
106
|
// `config.content.files` should exist of FilePaths or RawFiles
|
|
85
107
|
if (Array.isArray(config.content.files)) {
|
|
86
108
|
if (!config.content.files.every((path)=>{
|
|
87
109
|
// `path` can be a string
|
|
88
|
-
if (typeof path ===
|
|
110
|
+
if (typeof path === "string") return true;
|
|
89
111
|
// `path` can be an object { raw: string, extension?: string }
|
|
90
112
|
// `raw` must be a string
|
|
91
|
-
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !==
|
|
113
|
+
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
|
|
92
114
|
// `extension` (if provided) should also be a string
|
|
93
|
-
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !==
|
|
115
|
+
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
|
|
94
116
|
return false;
|
|
95
117
|
}
|
|
96
118
|
return true;
|
|
@@ -98,23 +120,27 @@ function normalizeConfig(config) {
|
|
|
98
120
|
return false;
|
|
99
121
|
}
|
|
100
122
|
// `config.content.extract` is optional, and can be a Function or a Record<String, Function>
|
|
101
|
-
if (typeof config.content.extract ===
|
|
123
|
+
if (typeof config.content.extract === "object") {
|
|
102
124
|
for (let value of Object.values(config.content.extract)){
|
|
103
|
-
if (typeof value !==
|
|
125
|
+
if (typeof value !== "function") {
|
|
104
126
|
return false;
|
|
105
127
|
}
|
|
106
128
|
}
|
|
107
|
-
} else if (!(config.content.extract === undefined || typeof config.content.extract ===
|
|
129
|
+
} else if (!(config.content.extract === undefined || typeof config.content.extract === "function")) {
|
|
108
130
|
return false;
|
|
109
131
|
}
|
|
110
132
|
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
|
111
|
-
if (typeof config.content.transform ===
|
|
133
|
+
if (typeof config.content.transform === "object") {
|
|
112
134
|
for (let value of Object.values(config.content.transform)){
|
|
113
|
-
if (typeof value !==
|
|
135
|
+
if (typeof value !== "function") {
|
|
114
136
|
return false;
|
|
115
137
|
}
|
|
116
138
|
}
|
|
117
|
-
} else if (!(config.content.transform === undefined || typeof config.content.transform ===
|
|
139
|
+
} else if (!(config.content.transform === undefined || typeof config.content.transform === "function")) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
// `config.content.relative` is optional and can be a boolean
|
|
143
|
+
if (typeof config.content.relative !== "boolean" && typeof config.content.relative !== "undefined") {
|
|
118
144
|
return false;
|
|
119
145
|
}
|
|
120
146
|
}
|
|
@@ -123,34 +149,57 @@ function normalizeConfig(config) {
|
|
|
123
149
|
return false;
|
|
124
150
|
})();
|
|
125
151
|
if (!valid) {
|
|
126
|
-
_log.default.warn(
|
|
127
|
-
|
|
128
|
-
|
|
152
|
+
_log.default.warn("purge-deprecation", [
|
|
153
|
+
"The `purge`/`content` options have changed in Tailwind CSS v3.0.",
|
|
154
|
+
"Update your configuration file to eliminate this warning.",
|
|
155
|
+
"https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"
|
|
129
156
|
]);
|
|
130
157
|
}
|
|
131
158
|
// Normalize the `safelist`
|
|
132
159
|
config.safelist = (()=>{
|
|
133
|
-
var
|
|
160
|
+
var _purge_options;
|
|
134
161
|
let { content , purge , safelist } = config;
|
|
135
162
|
if (Array.isArray(safelist)) return safelist;
|
|
136
163
|
if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
|
|
137
164
|
if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return purge.safelist;
|
|
138
|
-
if (Array.isArray(purge === null || purge === void 0 ? void 0 : (
|
|
165
|
+
if (Array.isArray(purge === null || purge === void 0 ? void 0 : (_purge_options = purge.options) === null || _purge_options === void 0 ? void 0 : _purge_options.safelist)) return purge.options.safelist;
|
|
166
|
+
return [];
|
|
167
|
+
})();
|
|
168
|
+
// Normalize the `blocklist`
|
|
169
|
+
config.blocklist = (()=>{
|
|
170
|
+
let { blocklist } = config;
|
|
171
|
+
if (Array.isArray(blocklist)) {
|
|
172
|
+
if (blocklist.every((item)=>typeof item === "string")) {
|
|
173
|
+
return blocklist;
|
|
174
|
+
}
|
|
175
|
+
_log.default.warn("blocklist-invalid", [
|
|
176
|
+
"The `blocklist` option must be an array of strings.",
|
|
177
|
+
"https://tailwindcss.com/docs/content-configuration#discarding-classes"
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
139
180
|
return [];
|
|
140
181
|
})();
|
|
141
182
|
// Normalize prefix option
|
|
142
|
-
if (typeof config.prefix ===
|
|
143
|
-
_log.default.warn(
|
|
144
|
-
|
|
145
|
-
|
|
183
|
+
if (typeof config.prefix === "function") {
|
|
184
|
+
_log.default.warn("prefix-function", [
|
|
185
|
+
"As of Tailwind CSS v3.0, `prefix` cannot be a function.",
|
|
186
|
+
"Update `prefix` in your configuration to be a string to eliminate this warning.",
|
|
187
|
+
"https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"
|
|
146
188
|
]);
|
|
147
|
-
config.prefix =
|
|
189
|
+
config.prefix = "";
|
|
148
190
|
} else {
|
|
149
|
-
var
|
|
150
|
-
config.prefix = (
|
|
191
|
+
var _config_prefix;
|
|
192
|
+
config.prefix = (_config_prefix = config.prefix) !== null && _config_prefix !== void 0 ? _config_prefix : "";
|
|
151
193
|
}
|
|
152
194
|
// Normalize the `content`
|
|
153
195
|
config.content = {
|
|
196
|
+
relative: (()=>{
|
|
197
|
+
let { content } = config;
|
|
198
|
+
if (content === null || content === void 0 ? void 0 : content.relative) {
|
|
199
|
+
return content.relative;
|
|
200
|
+
}
|
|
201
|
+
return (0, _featureFlags.flagEnabled)(config, "relativeContentPathsByDefault");
|
|
202
|
+
})(),
|
|
154
203
|
files: (()=>{
|
|
155
204
|
let { content , purge } = config;
|
|
156
205
|
if (Array.isArray(purge)) return purge;
|
|
@@ -162,24 +211,22 @@ function normalizeConfig(config) {
|
|
|
162
211
|
})(),
|
|
163
212
|
extract: (()=>{
|
|
164
213
|
let extract = (()=>{
|
|
165
|
-
var
|
|
166
|
-
if ((
|
|
167
|
-
if ((
|
|
168
|
-
if ((
|
|
169
|
-
if ((
|
|
170
|
-
if ((
|
|
171
|
-
if ((
|
|
172
|
-
return {
|
|
173
|
-
};
|
|
214
|
+
var _config_purge, _config_content, _config_purge1, _config_purge_extract, _config_content1, _config_content_extract, _config_purge2, _config_purge_options, _config_content2, _config_content_options;
|
|
215
|
+
if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.extract) return config.purge.extract;
|
|
216
|
+
if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.extract) return config.content.extract;
|
|
217
|
+
if ((_config_purge1 = config.purge) === null || _config_purge1 === void 0 ? void 0 : (_config_purge_extract = _config_purge1.extract) === null || _config_purge_extract === void 0 ? void 0 : _config_purge_extract.DEFAULT) return config.purge.extract.DEFAULT;
|
|
218
|
+
if ((_config_content1 = config.content) === null || _config_content1 === void 0 ? void 0 : (_config_content_extract = _config_content1.extract) === null || _config_content_extract === void 0 ? void 0 : _config_content_extract.DEFAULT) return config.content.extract.DEFAULT;
|
|
219
|
+
if ((_config_purge2 = config.purge) === null || _config_purge2 === void 0 ? void 0 : (_config_purge_options = _config_purge2.options) === null || _config_purge_options === void 0 ? void 0 : _config_purge_options.extractors) return config.purge.options.extractors;
|
|
220
|
+
if ((_config_content2 = config.content) === null || _config_content2 === void 0 ? void 0 : (_config_content_options = _config_content2.options) === null || _config_content_options === void 0 ? void 0 : _config_content_options.extractors) return config.content.options.extractors;
|
|
221
|
+
return {};
|
|
174
222
|
})();
|
|
175
|
-
let extractors = {
|
|
176
|
-
};
|
|
223
|
+
let extractors = {};
|
|
177
224
|
let defaultExtractor = (()=>{
|
|
178
|
-
var
|
|
179
|
-
if ((
|
|
225
|
+
var _config_purge, _config_purge_options, _config_content, _config_content_options;
|
|
226
|
+
if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : (_config_purge_options = _config_purge.options) === null || _config_purge_options === void 0 ? void 0 : _config_purge_options.defaultExtractor) {
|
|
180
227
|
return config.purge.options.defaultExtractor;
|
|
181
228
|
}
|
|
182
|
-
if ((
|
|
229
|
+
if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : (_config_content_options = _config_content.options) === null || _config_content_options === void 0 ? void 0 : _config_content_options.defaultExtractor) {
|
|
183
230
|
return config.content.options.defaultExtractor;
|
|
184
231
|
}
|
|
185
232
|
return undefined;
|
|
@@ -188,7 +235,7 @@ function normalizeConfig(config) {
|
|
|
188
235
|
extractors.DEFAULT = defaultExtractor;
|
|
189
236
|
}
|
|
190
237
|
// Functions
|
|
191
|
-
if (typeof extract ===
|
|
238
|
+
if (typeof extract === "function") {
|
|
192
239
|
extractors.DEFAULT = extract;
|
|
193
240
|
} else if (Array.isArray(extract)) {
|
|
194
241
|
for (let { extensions , extractor } of extract !== null && extract !== void 0 ? extract : []){
|
|
@@ -196,27 +243,25 @@ function normalizeConfig(config) {
|
|
|
196
243
|
extractors[extension] = extractor;
|
|
197
244
|
}
|
|
198
245
|
}
|
|
199
|
-
} else if (typeof extract ===
|
|
246
|
+
} else if (typeof extract === "object" && extract !== null) {
|
|
200
247
|
Object.assign(extractors, extract);
|
|
201
248
|
}
|
|
202
249
|
return extractors;
|
|
203
250
|
})(),
|
|
204
251
|
transform: (()=>{
|
|
205
252
|
let transform = (()=>{
|
|
206
|
-
var
|
|
207
|
-
if ((
|
|
208
|
-
if ((
|
|
209
|
-
if ((
|
|
210
|
-
if ((
|
|
211
|
-
return {
|
|
212
|
-
};
|
|
253
|
+
var _config_purge, _config_content, _config_purge1, _config_purge_transform, _config_content1, _config_content_transform;
|
|
254
|
+
if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.transform) return config.purge.transform;
|
|
255
|
+
if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.transform) return config.content.transform;
|
|
256
|
+
if ((_config_purge1 = config.purge) === null || _config_purge1 === void 0 ? void 0 : (_config_purge_transform = _config_purge1.transform) === null || _config_purge_transform === void 0 ? void 0 : _config_purge_transform.DEFAULT) return config.purge.transform.DEFAULT;
|
|
257
|
+
if ((_config_content1 = config.content) === null || _config_content1 === void 0 ? void 0 : (_config_content_transform = _config_content1.transform) === null || _config_content_transform === void 0 ? void 0 : _config_content_transform.DEFAULT) return config.content.transform.DEFAULT;
|
|
258
|
+
return {};
|
|
213
259
|
})();
|
|
214
|
-
let transformers = {
|
|
215
|
-
|
|
216
|
-
if (typeof transform === 'function') {
|
|
260
|
+
let transformers = {};
|
|
261
|
+
if (typeof transform === "function") {
|
|
217
262
|
transformers.DEFAULT = transform;
|
|
218
263
|
}
|
|
219
|
-
if (typeof transform ===
|
|
264
|
+
if (typeof transform === "object" && transform !== null) {
|
|
220
265
|
Object.assign(transformers, transform);
|
|
221
266
|
}
|
|
222
267
|
return transformers;
|
|
@@ -225,10 +270,10 @@ function normalizeConfig(config) {
|
|
|
225
270
|
// Validate globs to prevent bogus globs.
|
|
226
271
|
// E.g.: `./src/*.{html}` is invalid, the `{html}` should just be `html`
|
|
227
272
|
for (let file of config.content.files){
|
|
228
|
-
if (typeof file ===
|
|
229
|
-
_log.default.warn(
|
|
230
|
-
`The glob pattern ${(0, _log
|
|
231
|
-
`
|
|
273
|
+
if (typeof file === "string" && /{([^,]*?)}/g.test(file)) {
|
|
274
|
+
_log.default.warn("invalid-glob-braces", [
|
|
275
|
+
`The glob pattern ${(0, _log.dim)(file)} in your Tailwind CSS configuration is invalid.`,
|
|
276
|
+
`Update it to ${(0, _log.dim)(file.replace(/{([^,]*?)}/g, "$1"))} to silence this warning.`
|
|
232
277
|
]);
|
|
233
278
|
break;
|
|
234
279
|
}
|