tailwindcss 0.0.0-insiders.ea10bb9 → 0.0.0-insiders.ea4e1cd
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/README.md +1 -1
- package/lib/cli/build/deps.js +17 -9
- package/lib/cli/build/index.js +20 -10
- package/lib/cli/build/plugin.js +86 -70
- package/lib/cli/build/utils.js +18 -8
- package/lib/cli/build/watching.js +16 -12
- package/lib/cli/help/index.js +6 -4
- package/lib/cli/index.js +222 -10
- package/lib/cli/init/index.js +29 -12
- package/lib/cli-peer-dependencies.js +12 -4
- package/lib/cli.js +4 -226
- package/lib/corePluginList.js +7 -1
- package/lib/corePlugins.js +348 -75
- package/lib/css/preflight.css +2 -0
- package/lib/featureFlags.js +27 -15
- package/lib/index.js +1 -47
- package/lib/lib/cacheInvalidation.js +7 -5
- package/lib/lib/collapseAdjacentRules.js +5 -3
- package/lib/lib/collapseDuplicateDeclarations.js +12 -10
- package/lib/lib/content.js +34 -30
- package/lib/lib/defaultExtractor.js +15 -8
- package/lib/lib/detectNesting.js +10 -2
- package/lib/lib/evaluateTailwindFunctions.js +22 -20
- package/lib/lib/expandApplyAtRules.js +43 -35
- package/lib/lib/expandTailwindAtRules.js +46 -19
- package/lib/lib/findAtConfigPath.js +9 -7
- package/lib/lib/generateRules.js +157 -92
- package/lib/lib/getModuleDependencies.js +85 -37
- package/lib/lib/load-config.js +42 -0
- package/lib/lib/normalizeTailwindDirectives.js +5 -3
- package/lib/lib/offsets.js +93 -4
- package/lib/lib/partitionApplyAtRules.js +3 -1
- package/lib/lib/regex.js +21 -7
- package/lib/lib/remap-bitfield.js +89 -0
- package/lib/lib/resolveDefaultsAtRules.js +28 -24
- package/lib/lib/setupContextUtils.js +190 -131
- package/lib/lib/setupTrackingContext.js +49 -26
- package/lib/lib/sharedState.js +37 -10
- package/lib/lib/substituteScreenAtRules.js +5 -3
- package/lib/oxide/cli/build/deps.js +89 -0
- package/lib/oxide/cli/build/index.js +53 -0
- package/lib/oxide/cli/build/plugin.js +375 -0
- package/lib/oxide/cli/build/utils.js +87 -0
- package/lib/oxide/cli/build/watching.js +179 -0
- package/lib/oxide/cli/help/index.js +72 -0
- package/lib/oxide/cli/index.js +214 -0
- package/lib/oxide/cli/init/index.js +52 -0
- package/lib/oxide/cli.js +5 -0
- package/lib/oxide/postcss-plugin.js +2 -0
- package/lib/plugin.js +98 -0
- package/lib/postcss-plugins/nesting/index.js +3 -1
- package/lib/postcss-plugins/nesting/plugin.js +10 -8
- package/lib/processTailwindFeatures.js +14 -12
- package/lib/public/colors.js +49 -25
- package/lib/public/create-plugin.js +5 -3
- package/lib/public/default-config.js +6 -4
- package/lib/public/default-theme.js +6 -4
- package/lib/public/load-config.js +12 -0
- package/lib/public/resolve-config.js +6 -4
- package/lib/util/applyImportantSelector.js +36 -0
- package/lib/util/bigSign.js +3 -1
- package/lib/util/buildMediaQuery.js +3 -1
- package/lib/util/cloneDeep.js +3 -1
- package/lib/util/cloneNodes.js +5 -3
- package/lib/util/color.js +30 -12
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +3 -1
- package/lib/util/createPlugin.js +3 -1
- package/lib/util/createUtilityPlugin.js +7 -5
- package/lib/util/dataTypes.js +74 -17
- package/lib/util/defaults.js +9 -7
- package/lib/util/escapeClassName.js +10 -8
- package/lib/util/escapeCommas.js +3 -1
- package/lib/util/flattenColorPalette.js +3 -1
- package/lib/util/formatVariantSelector.js +138 -160
- package/lib/util/getAllConfigs.js +8 -6
- package/lib/util/hashConfig.js +6 -4
- package/lib/util/isKeyframeRule.js +3 -1
- package/lib/util/isPlainObject.js +3 -1
- package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
- package/lib/util/log.js +8 -4
- package/lib/util/nameClass.js +12 -6
- package/lib/util/negateValue.js +4 -2
- package/lib/util/normalizeConfig.js +28 -27
- package/lib/util/normalizeScreens.js +12 -4
- package/lib/util/parseAnimationValue.js +3 -1
- package/lib/util/parseBoxShadowValue.js +6 -2
- package/lib/util/parseDependency.js +3 -1
- package/lib/util/parseGlob.js +6 -4
- package/lib/util/parseObjectStyles.js +9 -7
- package/lib/util/pluginUtils.js +54 -54
- package/lib/util/prefixSelector.js +27 -11
- package/lib/util/pseudoElements.js +229 -0
- package/lib/util/removeAlphaVariables.js +3 -1
- package/lib/util/resolveConfig.js +17 -15
- package/lib/util/resolveConfigPath.js +26 -10
- package/lib/util/responsive.js +6 -4
- package/lib/util/splitAtTopLevelOnly.js +10 -2
- package/lib/util/tap.js +3 -1
- package/lib/util/toColorValue.js +3 -1
- package/lib/util/toPath.js +3 -1
- package/lib/util/transformThemeValue.js +6 -4
- package/lib/util/validateConfig.js +16 -3
- package/lib/util/validateFormalSyntax.js +3 -1
- package/lib/util/withAlphaVariable.js +6 -2
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/package.json +45 -37
- package/peers/index.js +63324 -46417
- package/resolveConfig.d.ts +11 -2
- package/scripts/swap-engines.js +40 -0
- package/src/cli/build/index.js +13 -9
- package/src/cli/build/plugin.js +42 -32
- package/src/cli/build/watching.js +4 -2
- package/src/cli/index.js +216 -3
- package/src/cli/init/index.js +37 -8
- package/src/cli.js +4 -220
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +207 -32
- package/src/css/preflight.css +2 -0
- package/src/featureFlags.js +6 -0
- package/src/index.js +1 -47
- package/src/lib/content.js +12 -17
- package/src/lib/defaultExtractor.js +9 -3
- package/src/lib/detectNesting.js +9 -1
- package/src/lib/expandApplyAtRules.js +8 -1
- package/src/lib/expandTailwindAtRules.js +36 -7
- package/src/lib/generateRules.js +124 -42
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +31 -0
- package/src/lib/offsets.js +104 -1
- package/src/lib/remap-bitfield.js +82 -0
- package/src/lib/setupContextUtils.js +103 -54
- package/src/lib/setupTrackingContext.js +36 -11
- package/src/lib/sharedState.js +15 -4
- package/src/oxide/cli/build/deps.ts +91 -0
- package/src/oxide/cli/build/index.ts +47 -0
- package/src/oxide/cli/build/plugin.ts +442 -0
- package/src/oxide/cli/build/utils.ts +74 -0
- package/src/oxide/cli/build/watching.ts +225 -0
- package/src/oxide/cli/help/index.ts +69 -0
- package/src/oxide/cli/index.ts +204 -0
- package/src/oxide/cli/init/index.ts +59 -0
- package/src/oxide/cli.ts +1 -0
- package/src/oxide/postcss-plugin.ts +1 -0
- package/src/plugin.js +107 -0
- 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/color.js +18 -3
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +33 -4
- package/src/util/formatVariantSelector.js +160 -163
- package/src/util/getAllConfigs.js +2 -2
- package/src/util/negateValue.js +1 -1
- package/src/util/normalizeConfig.js +2 -1
- package/src/util/pluginUtils.js +16 -31
- package/src/util/prefixSelector.js +28 -10
- package/src/util/pseudoElements.js +170 -0
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +8 -1
- package/src/util/validateConfig.js +13 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +183 -146
- package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
- 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 +15 -9
- package/types/generated/colors.d.ts +22 -0
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +108 -79
- package/CHANGELOG.md +0 -2336
- package/lib/cli/shared.js +0 -12
- package/lib/constants.js +0 -44
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/cli/shared.js +0 -5
- package/src/constants.js +0 -17
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
|
@@ -4,19 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getAllConfigs;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
|
|
10
12
|
const _featureFlags = require("../featureFlags");
|
|
11
|
-
function
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
function getAllConfigs(config) {
|
|
17
|
-
var
|
|
18
|
-
const configs = ((
|
|
19
|
-
|
|
19
|
+
var _config_presets;
|
|
20
|
+
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
|
|
21
|
+
_configfull.default
|
|
20
22
|
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
|
21
23
|
const features = {
|
|
22
24
|
// Add experimental configs here...
|
package/lib/util/hashConfig.js
CHANGED
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return hashConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
+
const _objecthash = /*#__PURE__*/ _interop_require_default(require("object-hash"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function hashConfig(config) {
|
|
16
|
-
return (0,
|
|
18
|
+
return (0, _objecthash.default)(config, {
|
|
17
19
|
ignoreUnknown: true
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return isKeyframeRule;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isKeyframeRule(rule) {
|
|
10
12
|
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return isPlainObject;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isPlainObject(value) {
|
|
10
12
|
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
|
@@ -10,7 +10,9 @@ Object.defineProperty(exports, // Arbitrary values must contain balanced bracket
|
|
|
10
10
|
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
|
11
11
|
"default", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: ()
|
|
13
|
+
get: function() {
|
|
14
|
+
return isSyntacticallyValidPropertyValue;
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
let matchingBrackets = new Map([
|
|
16
18
|
[
|
package/lib/util/log.js
CHANGED
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
dim: ()
|
|
13
|
-
|
|
12
|
+
dim: function() {
|
|
13
|
+
return dim;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const _picocolors = /*#__PURE__*/
|
|
16
|
-
function
|
|
19
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
20
|
+
function _interop_require_default(obj) {
|
|
17
21
|
return obj && obj.__esModule ? obj : {
|
|
18
22
|
default: obj
|
|
19
23
|
};
|
package/lib/util/nameClass.js
CHANGED
|
@@ -9,13 +9,19 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
asClass: ()
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
asClass: function() {
|
|
13
|
+
return asClass;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return nameClass;
|
|
17
|
+
},
|
|
18
|
+
formatClass: function() {
|
|
19
|
+
return formatClass;
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
|
-
const _escapeClassName = /*#__PURE__*/
|
|
17
|
-
const _escapeCommas = /*#__PURE__*/
|
|
18
|
-
function
|
|
22
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
|
|
23
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
19
25
|
return obj && obj.__esModule ? obj : {
|
|
20
26
|
default: obj
|
|
21
27
|
};
|
package/lib/util/negateValue.js
CHANGED
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return negateValue;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
function
|
|
11
|
+
function negateValue(value) {
|
|
10
12
|
value = `${value}`;
|
|
11
13
|
if (value === "0") {
|
|
12
14
|
return "0";
|
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "normalizeConfig", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return normalizeConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _featureFlags = require("../featureFlags");
|
|
12
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
|
10
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
11
14
|
if (typeof WeakMap !== "function") return null;
|
|
12
15
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -15,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
15
18
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
16
19
|
})(nodeInterop);
|
|
17
20
|
}
|
|
18
|
-
function
|
|
21
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
19
22
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
20
23
|
return obj;
|
|
21
24
|
}
|
|
@@ -128,8 +131,8 @@ function normalizeConfig(config) {
|
|
|
128
131
|
}
|
|
129
132
|
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
|
130
133
|
if (typeof config.content.transform === "object") {
|
|
131
|
-
for (let
|
|
132
|
-
if (typeof
|
|
134
|
+
for (let value of Object.values(config.content.transform)){
|
|
135
|
+
if (typeof value !== "function") {
|
|
133
136
|
return false;
|
|
134
137
|
}
|
|
135
138
|
}
|
|
@@ -154,12 +157,12 @@ function normalizeConfig(config) {
|
|
|
154
157
|
}
|
|
155
158
|
// Normalize the `safelist`
|
|
156
159
|
config.safelist = (()=>{
|
|
157
|
-
var
|
|
160
|
+
var _purge_options;
|
|
158
161
|
let { content , purge , safelist } = config;
|
|
159
162
|
if (Array.isArray(safelist)) return safelist;
|
|
160
163
|
if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
|
|
161
164
|
if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return purge.safelist;
|
|
162
|
-
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;
|
|
163
166
|
return [];
|
|
164
167
|
})();
|
|
165
168
|
// Normalize the `blocklist`
|
|
@@ -185,19 +188,17 @@ function normalizeConfig(config) {
|
|
|
185
188
|
]);
|
|
186
189
|
config.prefix = "";
|
|
187
190
|
} else {
|
|
188
|
-
var
|
|
189
|
-
config.prefix = (
|
|
191
|
+
var _config_prefix;
|
|
192
|
+
config.prefix = (_config_prefix = config.prefix) !== null && _config_prefix !== void 0 ? _config_prefix : "";
|
|
190
193
|
}
|
|
191
194
|
// Normalize the `content`
|
|
192
195
|
config.content = {
|
|
193
196
|
relative: (()=>{
|
|
194
|
-
var ref;
|
|
195
197
|
let { content } = config;
|
|
196
198
|
if (content === null || content === void 0 ? void 0 : content.relative) {
|
|
197
199
|
return content.relative;
|
|
198
200
|
}
|
|
199
|
-
|
|
200
|
-
return (ref1 = (ref = config.future) === null || ref === void 0 ? void 0 : ref.relativeContentPathsByDefault) !== null && ref1 !== void 0 ? ref1 : false;
|
|
201
|
+
return (0, _featureFlags.flagEnabled)(config, "relativeContentPathsByDefault");
|
|
201
202
|
})(),
|
|
202
203
|
files: (()=>{
|
|
203
204
|
let { content , purge } = config;
|
|
@@ -210,22 +211,22 @@ function normalizeConfig(config) {
|
|
|
210
211
|
})(),
|
|
211
212
|
extract: (()=>{
|
|
212
213
|
let extract = (()=>{
|
|
213
|
-
var
|
|
214
|
-
if ((
|
|
215
|
-
if ((
|
|
216
|
-
if ((
|
|
217
|
-
if ((
|
|
218
|
-
if ((
|
|
219
|
-
if ((
|
|
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;
|
|
220
221
|
return {};
|
|
221
222
|
})();
|
|
222
223
|
let extractors = {};
|
|
223
224
|
let defaultExtractor = (()=>{
|
|
224
|
-
var
|
|
225
|
-
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) {
|
|
226
227
|
return config.purge.options.defaultExtractor;
|
|
227
228
|
}
|
|
228
|
-
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) {
|
|
229
230
|
return config.content.options.defaultExtractor;
|
|
230
231
|
}
|
|
231
232
|
return undefined;
|
|
@@ -249,11 +250,11 @@ function normalizeConfig(config) {
|
|
|
249
250
|
})(),
|
|
250
251
|
transform: (()=>{
|
|
251
252
|
let transform = (()=>{
|
|
252
|
-
var
|
|
253
|
-
if ((
|
|
254
|
-
if ((
|
|
255
|
-
if ((
|
|
256
|
-
if ((
|
|
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;
|
|
257
258
|
return {};
|
|
258
259
|
})();
|
|
259
260
|
let transformers = {};
|
|
@@ -33,10 +33,18 @@ function _export(target, all) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
_export(exports, {
|
|
36
|
-
normalizeScreens: ()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
normalizeScreens: function() {
|
|
37
|
+
return normalizeScreens;
|
|
38
|
+
},
|
|
39
|
+
isScreenSortable: function() {
|
|
40
|
+
return isScreenSortable;
|
|
41
|
+
},
|
|
42
|
+
compareScreens: function() {
|
|
43
|
+
return compareScreens;
|
|
44
|
+
},
|
|
45
|
+
toScreen: function() {
|
|
46
|
+
return toScreen;
|
|
47
|
+
}
|
|
40
48
|
});
|
|
41
49
|
function normalizeScreens(screens, root = true) {
|
|
42
50
|
if (Array.isArray(screens)) {
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
parseBoxShadowValue: ()
|
|
13
|
-
|
|
12
|
+
parseBoxShadowValue: function() {
|
|
13
|
+
return parseBoxShadowValue;
|
|
14
|
+
},
|
|
15
|
+
formatBoxShadowValue: function() {
|
|
16
|
+
return formatBoxShadowValue;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
16
20
|
let KEYWORDS = new Set([
|
|
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "default", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: ()
|
|
14
|
+
get: function() {
|
|
15
|
+
return parseDependency;
|
|
16
|
+
}
|
|
15
17
|
});
|
|
16
18
|
function parseDependency(contentPath) {
|
|
17
19
|
if (contentPath.ignore) {
|
package/lib/util/parseGlob.js
CHANGED
|
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "parseGlob", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return parseGlob;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
+
const _globparent = /*#__PURE__*/ _interop_require_default(require("glob-parent"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function parseGlob(pattern) {
|
|
16
18
|
let glob = pattern;
|
|
17
|
-
let base = (0,
|
|
19
|
+
let base = (0, _globparent.default)(pattern);
|
|
18
20
|
if (base !== ".") {
|
|
19
21
|
glob = pattern.substr(base.length);
|
|
20
22
|
if (glob.charAt(0) === "/") {
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return parseObjectStyles;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _postcss = /*#__PURE__*/
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
function
|
|
11
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
12
|
+
const _postcssnested = /*#__PURE__*/ _interop_require_default(require("postcss-nested"));
|
|
13
|
+
const _postcssjs = /*#__PURE__*/ _interop_require_default(require("postcss-js"));
|
|
14
|
+
function _interop_require_default(obj) {
|
|
13
15
|
return obj && obj.__esModule ? obj : {
|
|
14
16
|
default: obj
|
|
15
17
|
};
|
|
@@ -22,13 +24,13 @@ function parseObjectStyles(styles) {
|
|
|
22
24
|
}
|
|
23
25
|
return styles.flatMap((style)=>{
|
|
24
26
|
return (0, _postcss.default)([
|
|
25
|
-
(0,
|
|
27
|
+
(0, _postcssnested.default)({
|
|
26
28
|
bubble: [
|
|
27
29
|
"screen"
|
|
28
30
|
]
|
|
29
31
|
})
|
|
30
32
|
]).process(style, {
|
|
31
|
-
parser:
|
|
33
|
+
parser: _postcssjs.default
|
|
32
34
|
}).root.nodes;
|
|
33
35
|
});
|
|
34
36
|
}
|
package/lib/util/pluginUtils.js
CHANGED
|
@@ -9,52 +9,49 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
updateAllClasses: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
updateAllClasses: function() {
|
|
13
|
+
return updateAllClasses;
|
|
14
|
+
},
|
|
15
|
+
asValue: function() {
|
|
16
|
+
return asValue;
|
|
17
|
+
},
|
|
18
|
+
parseColorFormat: function() {
|
|
19
|
+
return parseColorFormat;
|
|
20
|
+
},
|
|
21
|
+
asColor: function() {
|
|
22
|
+
return asColor;
|
|
23
|
+
},
|
|
24
|
+
asLookupValue: function() {
|
|
25
|
+
return asLookupValue;
|
|
26
|
+
},
|
|
27
|
+
typeMap: function() {
|
|
28
|
+
return typeMap;
|
|
29
|
+
},
|
|
30
|
+
coerceValue: function() {
|
|
31
|
+
return coerceValue;
|
|
32
|
+
},
|
|
33
|
+
getMatchingTypes: function() {
|
|
34
|
+
return getMatchingTypes;
|
|
35
|
+
}
|
|
21
36
|
});
|
|
22
|
-
const
|
|
23
|
-
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
|
37
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
24
38
|
const _withAlphaVariable = require("./withAlphaVariable");
|
|
25
39
|
const _dataTypes = require("./dataTypes");
|
|
26
|
-
const _negateValue = /*#__PURE__*/
|
|
40
|
+
const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
|
|
27
41
|
const _validateFormalSyntax = require("./validateFormalSyntax");
|
|
28
|
-
const
|
|
29
|
-
function
|
|
42
|
+
const _featureFlags = require("../featureFlags.js");
|
|
43
|
+
function _interop_require_default(obj) {
|
|
30
44
|
return obj && obj.__esModule ? obj : {
|
|
31
45
|
default: obj
|
|
32
46
|
};
|
|
33
47
|
}
|
|
34
48
|
function updateAllClasses(selectors, updateClass) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
sel.value =
|
|
39
|
-
|
|
40
|
-
sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
let result = parser.processSync(selectors);
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
function filterSelectorsForClass(selectors, classCandidate) {
|
|
48
|
-
let parser = (0, _postcssSelectorParser.default)((selectors)=>{
|
|
49
|
-
selectors.each((sel)=>{
|
|
50
|
-
const containsClass = sel.nodes.some((node)=>node.type === "class" && node.value === classCandidate);
|
|
51
|
-
if (!containsClass) {
|
|
52
|
-
sel.remove();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
49
|
+
selectors.walkClasses((sel)=>{
|
|
50
|
+
sel.value = updateClass(sel.value);
|
|
51
|
+
if (sel.raws && sel.raws.value) {
|
|
52
|
+
sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
|
|
53
|
+
}
|
|
55
54
|
});
|
|
56
|
-
let result = parser.processSync(selectors);
|
|
57
|
-
return result;
|
|
58
55
|
}
|
|
59
56
|
function resolveArbitraryValue(modifier, validate) {
|
|
60
57
|
if (!isArbitraryValue(modifier)) {
|
|
@@ -80,8 +77,8 @@ function asNegativeValue(modifier, lookup = {}, validate) {
|
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
function asValue(modifier, options = {}, { validate =()=>true } = {}) {
|
|
83
|
-
var
|
|
84
|
-
let value = (
|
|
80
|
+
var _options_values;
|
|
81
|
+
let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
|
|
85
82
|
if (value !== undefined) {
|
|
86
83
|
return value;
|
|
87
84
|
}
|
|
@@ -123,27 +120,30 @@ function parseColorFormat(value) {
|
|
|
123
120
|
}
|
|
124
121
|
return value;
|
|
125
122
|
}
|
|
123
|
+
function unwrapArbitraryModifier(modifier) {
|
|
124
|
+
return (0, _dataTypes.normalize)(modifier.slice(1, -1));
|
|
125
|
+
}
|
|
126
126
|
function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
|
|
127
|
-
var
|
|
128
|
-
if (((
|
|
129
|
-
var
|
|
130
|
-
return parseColorFormat((
|
|
127
|
+
var _options_values;
|
|
128
|
+
if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
|
|
129
|
+
var _options_values1;
|
|
130
|
+
return parseColorFormat((_options_values1 = options.values) === null || _options_values1 === void 0 ? void 0 : _options_values1[modifier]);
|
|
131
131
|
}
|
|
132
132
|
// TODO: Hoist this up to getMatchingTypes or something
|
|
133
133
|
// We do this here because we need the alpha value (if any)
|
|
134
134
|
let [color, alpha] = splitUtilityModifier(modifier);
|
|
135
135
|
if (alpha !== undefined) {
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
let normalizedColor = (
|
|
136
|
+
var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
|
|
137
|
+
var _options_values_color;
|
|
138
|
+
let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
|
|
139
139
|
if (normalizedColor === undefined) {
|
|
140
140
|
return undefined;
|
|
141
141
|
}
|
|
142
142
|
normalizedColor = parseColorFormat(normalizedColor);
|
|
143
143
|
if (isArbitraryValue(alpha)) {
|
|
144
|
-
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, alpha
|
|
144
|
+
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, unwrapArbitraryModifier(alpha));
|
|
145
145
|
}
|
|
146
|
-
if (((
|
|
146
|
+
if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
|
|
147
147
|
return undefined;
|
|
148
148
|
}
|
|
149
149
|
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
|
|
@@ -153,8 +153,8 @@ function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
|
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
function asLookupValue(modifier, options = {}) {
|
|
156
|
-
var
|
|
157
|
-
return (
|
|
156
|
+
var _options_values;
|
|
157
|
+
return (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
|
|
158
158
|
}
|
|
159
159
|
function guess(validate) {
|
|
160
160
|
return (modifier, options)=>{
|
|
@@ -236,7 +236,7 @@ function coerceValue(types, modifier, options, tailwindConfig) {
|
|
|
236
236
|
return [];
|
|
237
237
|
}
|
|
238
238
|
function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
|
|
239
|
-
let modifiersEnabled = (0,
|
|
239
|
+
let modifiersEnabled = (0, _featureFlags.flagEnabled)(tailwindConfig, "generalizedModifiers");
|
|
240
240
|
let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
|
|
241
241
|
let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
|
|
242
242
|
if (!canUseUtilityModifier) {
|
|
@@ -250,13 +250,13 @@ function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
|
|
|
250
250
|
// TODO: Move to asValue… somehow
|
|
251
251
|
if (utilityModifier !== undefined) {
|
|
252
252
|
if (typeof options.modifiers === "object") {
|
|
253
|
-
var
|
|
254
|
-
var
|
|
255
|
-
let configValue = (
|
|
253
|
+
var _options_modifiers;
|
|
254
|
+
var _options_modifiers_utilityModifier;
|
|
255
|
+
let configValue = (_options_modifiers_utilityModifier = (_options_modifiers = options.modifiers) === null || _options_modifiers === void 0 ? void 0 : _options_modifiers[utilityModifier]) !== null && _options_modifiers_utilityModifier !== void 0 ? _options_modifiers_utilityModifier : null;
|
|
256
256
|
if (configValue !== null) {
|
|
257
257
|
utilityModifier = configValue;
|
|
258
258
|
} else if (isArbitraryValue(utilityModifier)) {
|
|
259
|
-
utilityModifier = utilityModifier
|
|
259
|
+
utilityModifier = unwrapArbitraryModifier(utilityModifier);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -2,22 +2,38 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports,
|
|
5
|
+
Object.defineProperty(exports, /**
|
|
6
|
+
* @template {string | import('postcss-selector-parser').Root} T
|
|
7
|
+
*
|
|
8
|
+
* Prefix all classes in the selector with the given prefix
|
|
9
|
+
*
|
|
10
|
+
* It can take either a string or a selector AST and will return the same type
|
|
11
|
+
*
|
|
12
|
+
* @param {string} prefix
|
|
13
|
+
* @param {T} selector
|
|
14
|
+
* @param {boolean} prependNegative
|
|
15
|
+
* @returns {T}
|
|
16
|
+
*/ "default", {
|
|
6
17
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
18
|
+
get: function() {
|
|
19
|
+
return _default;
|
|
20
|
+
}
|
|
8
21
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
22
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
23
|
+
function _interop_require_default(obj) {
|
|
11
24
|
return obj && obj.__esModule ? obj : {
|
|
12
25
|
default: obj
|
|
13
26
|
};
|
|
14
27
|
}
|
|
15
28
|
function _default(prefix, selector, prependNegative = false) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
if (prefix === "") {
|
|
30
|
+
return selector;
|
|
31
|
+
}
|
|
32
|
+
let ast = typeof selector === "string" ? (0, _postcssselectorparser.default)().astSync(selector) : selector;
|
|
33
|
+
ast.walkClasses((classSelector)=>{
|
|
34
|
+
let baseClass = classSelector.value;
|
|
35
|
+
let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
|
|
36
|
+
classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
|
|
37
|
+
});
|
|
38
|
+
return typeof selector === "string" ? ast.toString() : ast;
|
|
23
39
|
}
|