tailwindcss 0.0.0-oxide-insiders.a7fe2fe → 0.0.0-oxide-insiders.759a8c2

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.
Files changed (108) hide show
  1. package/lib/cli/build/deps.js +34 -18
  2. package/lib/cli/build/index.js +45 -12
  3. package/lib/cli/build/plugin.js +273 -90
  4. package/lib/cli/build/utils.js +56 -24
  5. package/lib/cli/build/watching.js +156 -38
  6. package/lib/cli/help/index.js +61 -16
  7. package/lib/cli/index.js +121 -62
  8. package/lib/cli/init/index.js +47 -23
  9. package/lib/cli-peer-dependencies.js +23 -13
  10. package/lib/cli.js +5 -1
  11. package/lib/corePluginList.js +7 -4
  12. package/lib/corePlugins.js +855 -386
  13. package/lib/featureFlags.js +43 -18
  14. package/lib/lib/cacheInvalidation.js +78 -30
  15. package/lib/lib/collapseAdjacentRules.js +46 -23
  16. package/lib/lib/collapseDuplicateDeclarations.js +70 -27
  17. package/lib/lib/content.js +134 -41
  18. package/lib/lib/defaultExtractor.js +201 -96
  19. package/lib/lib/detectNesting.js +38 -12
  20. package/lib/lib/evaluateTailwindFunctions.js +192 -103
  21. package/lib/lib/expandApplyAtRules.js +488 -181
  22. package/lib/lib/expandTailwindAtRules.js +240 -70
  23. package/lib/lib/findAtConfigPath.js +34 -15
  24. package/lib/lib/generateRules.js +775 -353
  25. package/lib/lib/getModuleDependencies.js +67 -29
  26. package/lib/lib/load-config.js +27 -17
  27. package/lib/lib/normalizeTailwindDirectives.js +73 -27
  28. package/lib/lib/offsets.js +227 -62
  29. package/lib/lib/partitionApplyAtRules.js +53 -29
  30. package/lib/lib/regex.js +50 -28
  31. package/lib/lib/remap-bitfield.js +86 -9
  32. package/lib/lib/resolveDefaultsAtRules.js +123 -53
  33. package/lib/lib/setupContextUtils.js +1117 -584
  34. package/lib/lib/setupTrackingContext.js +149 -58
  35. package/lib/lib/sharedState.js +71 -23
  36. package/lib/lib/substituteScreenAtRules.js +19 -9
  37. package/lib/oxide/cli/build/deps.js +46 -23
  38. package/lib/oxide/cli/build/index.js +44 -12
  39. package/lib/oxide/cli/build/plugin.js +271 -89
  40. package/lib/oxide/cli/build/utils.js +55 -24
  41. package/lib/oxide/cli/build/watching.js +153 -36
  42. package/lib/oxide/cli/help/index.js +60 -16
  43. package/lib/oxide/cli/index.js +128 -67
  44. package/lib/oxide/cli/init/index.js +40 -19
  45. package/lib/oxide/cli.js +3 -2
  46. package/lib/plugin.js +58 -31
  47. package/lib/postcss-plugins/nesting/index.js +13 -7
  48. package/lib/postcss-plugins/nesting/plugin.js +65 -20
  49. package/lib/processTailwindFeatures.js +41 -10
  50. package/lib/public/colors.js +25 -16
  51. package/lib/public/create-plugin.js +11 -6
  52. package/lib/public/default-config.js +12 -6
  53. package/lib/public/default-theme.js +12 -6
  54. package/lib/public/load-config.js +9 -5
  55. package/lib/public/resolve-config.js +10 -6
  56. package/lib/util/applyImportantSelector.js +28 -17
  57. package/lib/util/bigSign.js +9 -6
  58. package/lib/util/buildMediaQuery.js +19 -10
  59. package/lib/util/cloneDeep.js +19 -9
  60. package/lib/util/cloneNodes.js +29 -14
  61. package/lib/util/color.js +87 -47
  62. package/lib/util/colorNames.js +752 -0
  63. package/lib/util/configurePlugins.js +18 -9
  64. package/lib/util/createPlugin.js +17 -8
  65. package/lib/util/createUtilityPlugin.js +30 -16
  66. package/lib/util/dataTypes.js +189 -38
  67. package/lib/util/defaults.js +21 -9
  68. package/lib/util/escapeClassName.js +15 -9
  69. package/lib/util/escapeCommas.js +9 -6
  70. package/lib/util/flattenColorPalette.js +11 -7
  71. package/lib/util/formatVariantSelector.js +209 -60
  72. package/lib/util/getAllConfigs.js +44 -35
  73. package/lib/util/hashConfig.js +12 -8
  74. package/lib/util/isKeyframeRule.js +10 -7
  75. package/lib/util/isPlainObject.js +14 -9
  76. package/lib/util/isSyntacticallyValidPropertyValue.js +45 -14
  77. package/lib/util/log.js +20 -9
  78. package/lib/util/nameClass.js +31 -10
  79. package/lib/util/negateValue.js +28 -10
  80. package/lib/util/normalizeConfig.js +242 -63
  81. package/lib/util/normalizeScreens.js +145 -70
  82. package/lib/util/parseAnimationValue.js +64 -14
  83. package/lib/util/parseBoxShadowValue.js +63 -14
  84. package/lib/util/parseDependency.js +39 -13
  85. package/lib/util/parseGlob.js +25 -8
  86. package/lib/util/parseObjectStyles.js +29 -18
  87. package/lib/util/pluginUtils.js +196 -77
  88. package/lib/util/prefixSelector.js +31 -12
  89. package/lib/util/pseudoElements.js +116 -34
  90. package/lib/util/removeAlphaVariables.js +23 -8
  91. package/lib/util/resolveConfig.js +224 -105
  92. package/lib/util/resolveConfigPath.js +45 -15
  93. package/lib/util/responsive.js +10 -6
  94. package/lib/util/splitAtTopLevelOnly.js +46 -10
  95. package/lib/util/tap.js +11 -7
  96. package/lib/util/toColorValue.js +10 -7
  97. package/lib/util/toPath.js +28 -8
  98. package/lib/util/transformThemeValue.js +49 -14
  99. package/lib/util/validateConfig.js +25 -15
  100. package/lib/util/validateFormalSyntax.js +14 -6
  101. package/lib/util/withAlphaVariable.js +54 -30
  102. package/package.json +18 -22
  103. package/peers/index.js +57849 -43101
  104. package/src/lib/expandTailwindAtRules.js +1 -1
  105. package/src/lib/setupTrackingContext.js +1 -1
  106. package/src/util/color.js +1 -1
  107. package/src/util/colorNames.js +150 -0
  108. package/src/util/pseudoElements.js +4 -4
@@ -1,18 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), function(target, all) {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
5
6
  for(var name in all)Object.defineProperty(target, name, {
6
- enumerable: !0,
7
+ enumerable: true,
7
8
  get: all[name]
8
9
  });
9
- }(exports, {
10
- asClass: ()=>asClass,
11
- default: ()=>nameClass,
12
- formatClass: ()=>formatClass
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
+ }
13
21
  });
14
- const _escapeClassName = _interopRequireDefault(require("./escapeClassName")), _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
15
- function _interopRequireDefault(obj) {
22
+ const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
23
+ const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
24
+ function _interop_require_default(obj) {
16
25
  return obj && obj.__esModule ? obj : {
17
26
  default: obj
18
27
  };
@@ -24,5 +33,17 @@ function nameClass(classPrefix, key) {
24
33
  return asClass(formatClass(classPrefix, key));
25
34
  }
26
35
  function formatClass(classPrefix, key) {
27
- return "DEFAULT" === key ? classPrefix : "-" === key || "-DEFAULT" === key ? `-${classPrefix}` : key.startsWith("-") ? `-${classPrefix}${key}` : key.startsWith("/") ? `${classPrefix}${key}` : `${classPrefix}-${key}`;
36
+ if (key === "DEFAULT") {
37
+ return classPrefix;
38
+ }
39
+ if (key === "-" || key === "-DEFAULT") {
40
+ return `-${classPrefix}`;
41
+ }
42
+ if (key.startsWith("-")) {
43
+ return `-${classPrefix}${key}`;
44
+ }
45
+ if (key.startsWith("/")) {
46
+ return `${classPrefix}${key}`;
47
+ }
48
+ return `${classPrefix}-${key}`;
28
49
  }
@@ -1,18 +1,36 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return negateValue;
9
+ }
10
+ });
2
11
  function negateValue(value) {
3
- if ("0" == (value = `${value}`)) return "0";
4
- if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) return value.replace(/^[+-]?/, (sign)=>"-" === sign ? "" : "-");
5
- for (let fn of [
12
+ value = `${value}`;
13
+ if (value === "0") {
14
+ return "0";
15
+ }
16
+ // Flip sign of numbers
17
+ if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
18
+ return value.replace(/^[+-]?/, (sign)=>sign === "-" ? "" : "-");
19
+ }
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 = [
6
25
  "var",
7
26
  "calc",
8
27
  "min",
9
28
  "max",
10
29
  "clamp"
11
- ])if (value.includes(`${fn}(`)) return `calc(${value} * -1)`;
30
+ ];
31
+ for (const fn of numericFunctions){
32
+ if (value.includes(`${fn}(`)) {
33
+ return `calc(${value} * -1)`;
34
+ }
35
+ }
12
36
  }
13
- Object.defineProperty(exports, "__esModule", {
14
- value: !0
15
- }), Object.defineProperty(exports, "default", {
16
- enumerable: !0,
17
- get: ()=>negateValue
18
- });
@@ -1,103 +1,282 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "normalizeConfig", {
5
- enumerable: !0,
6
- get: ()=>normalizeConfig
3
+ value: true
7
4
  });
8
- const _featureFlags = require("../featureFlags"), _log = function(obj, nodeInterop) {
9
- if (!nodeInterop && obj && obj.__esModule) return obj;
10
- if (null === obj || "object" != typeof obj && "function" != typeof obj) return {
11
- default: obj
12
- };
13
- var cache = _getRequireWildcardCache(nodeInterop);
14
- if (cache && cache.has(obj)) return cache.get(obj);
15
- var newObj = {}, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
16
- for(var key in obj)if ("default" !== key && Object.prototype.hasOwnProperty.call(obj, key)) {
17
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
18
- desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key];
5
+ Object.defineProperty(exports, "normalizeConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return normalizeConfig;
19
9
  }
20
- return newObj.default = obj, cache && cache.set(obj, newObj), newObj;
21
- }(require("./log"));
10
+ });
11
+ const _featureFlags = require("../featureFlags");
12
+ const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
22
13
  function _getRequireWildcardCache(nodeInterop) {
23
- if ("function" != typeof WeakMap) return null;
24
- var cacheBabelInterop = new WeakMap(), cacheNodeInterop = new WeakMap();
14
+ if (typeof WeakMap !== "function") return null;
15
+ var cacheBabelInterop = new WeakMap();
16
+ var cacheNodeInterop = new WeakMap();
25
17
  return (_getRequireWildcardCache = function(nodeInterop) {
26
18
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
27
19
  })(nodeInterop);
28
20
  }
21
+ function _interop_require_wildcard(obj, nodeInterop) {
22
+ if (!nodeInterop && obj && obj.__esModule) {
23
+ return obj;
24
+ }
25
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
26
+ return {
27
+ default: obj
28
+ };
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];
43
+ }
44
+ }
45
+ }
46
+ newObj.default = obj;
47
+ if (cache) {
48
+ cache.set(obj, newObj);
49
+ }
50
+ return newObj;
51
+ }
29
52
  function normalizeConfig(config) {
30
- var _config_prefix, _config_purge, _config_content, _config_purge1, _config_purge_transform, _config_content1, _config_content_transform;
31
- let transform, transformers;
32
- for (let file of (((()=>{
33
- if (config.purge || !config.content || !Array.isArray(config.content) && !("object" == typeof config.content && null !== config.content)) return !1;
34
- if (Array.isArray(config.content)) return config.content.every((path)=>"string" == typeof path || "string" == typeof (null == path ? void 0 : path.raw) && (null == path || !path.extension || "string" == typeof (null == path ? void 0 : path.extension)));
35
- if ("object" == typeof config.content && null !== config.content) {
53
+ // Quick structure validation
54
+ /**
55
+ * type FilePath = string
56
+ * type RawFile = { raw: string, extension?: string }
57
+ * type ExtractorFn = (content: string) => Array<string>
58
+ * type TransformerFn = (content: string) => string
59
+ *
60
+ * type Content =
61
+ * | Array<FilePath | RawFile>
62
+ * | {
63
+ * files: Array<FilePath | RawFile>,
64
+ * extract?: ExtractorFn | { [extension: string]: ExtractorFn }
65
+ * transform?: TransformerFn | { [extension: string]: TransformerFn }
66
+ * }
67
+ */ let valid = (()=>{
68
+ // `config.purge` should not exist anymore
69
+ if (config.purge) {
70
+ return false;
71
+ }
72
+ // `config.content` should exist
73
+ if (!config.content) {
74
+ return false;
75
+ }
76
+ // `config.content` should be an object or an array
77
+ if (!Array.isArray(config.content) && !(typeof config.content === "object" && config.content !== null)) {
78
+ return false;
79
+ }
80
+ // When `config.content` is an array, it should consist of FilePaths or RawFiles
81
+ if (Array.isArray(config.content)) {
82
+ return config.content.every((path)=>{
83
+ // `path` can be a string
84
+ if (typeof path === "string") return true;
85
+ // `path` can be an object { raw: string, extension?: string }
86
+ // `raw` must be a string
87
+ if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
88
+ // `extension` (if provided) should also be a string
89
+ if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
90
+ return false;
91
+ }
92
+ return true;
93
+ });
94
+ }
95
+ // When `config.content` is an object
96
+ if (typeof config.content === "object" && config.content !== null) {
97
+ // Only `files`, `relative`, `extract`, and `transform` can exist in `config.content`
36
98
  if (Object.keys(config.content).some((key)=>![
37
99
  "files",
38
100
  "relative",
39
101
  "extract",
40
102
  "transform"
41
- ].includes(key))) return !1;
103
+ ].includes(key))) {
104
+ return false;
105
+ }
106
+ // `config.content.files` should exist of FilePaths or RawFiles
42
107
  if (Array.isArray(config.content.files)) {
43
- if (!config.content.files.every((path)=>"string" == typeof path || "string" == typeof (null == path ? void 0 : path.raw) && (null == path || !path.extension || "string" == typeof (null == path ? void 0 : path.extension)))) return !1;
44
- if ("object" == typeof config.content.extract) {
45
- for (let value of Object.values(config.content.extract))if ("function" != typeof value) return !1;
46
- } else if (!(void 0 === config.content.extract || "function" == typeof config.content.extract)) return !1;
47
- if ("object" == typeof config.content.transform) {
48
- for (let value of Object.values(config.content.transform))if ("function" != typeof value) return !1;
49
- } else if (!(void 0 === config.content.transform || "function" == typeof config.content.transform)) return !1;
50
- if ("boolean" != typeof config.content.relative && void 0 !== config.content.relative) return !1;
108
+ if (!config.content.files.every((path)=>{
109
+ // `path` can be a string
110
+ if (typeof path === "string") return true;
111
+ // `path` can be an object { raw: string, extension?: string }
112
+ // `raw` must be a string
113
+ if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
114
+ // `extension` (if provided) should also be a string
115
+ if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
116
+ return false;
117
+ }
118
+ return true;
119
+ })) {
120
+ return false;
121
+ }
122
+ // `config.content.extract` is optional, and can be a Function or a Record<String, Function>
123
+ if (typeof config.content.extract === "object") {
124
+ for (let value of Object.values(config.content.extract)){
125
+ if (typeof value !== "function") {
126
+ return false;
127
+ }
128
+ }
129
+ } else if (!(config.content.extract === undefined || typeof config.content.extract === "function")) {
130
+ return false;
131
+ }
132
+ // `config.content.transform` is optional, and can be a Function or a Record<String, Function>
133
+ if (typeof config.content.transform === "object") {
134
+ for (let value of Object.values(config.content.transform)){
135
+ if (typeof value !== "function") {
136
+ return false;
137
+ }
138
+ }
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") {
144
+ return false;
145
+ }
51
146
  }
52
- return !0;
147
+ return true;
53
148
  }
54
- return !1;
55
- })() || _log.default.warn("purge-deprecation", [
56
- "The `purge`/`content` options have changed in Tailwind CSS v3.0.",
57
- "Update your configuration file to eliminate this warning.",
58
- "https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"
59
- ]), config.safelist = (()=>{
149
+ return false;
150
+ })();
151
+ if (!valid) {
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"
156
+ ]);
157
+ }
158
+ // Normalize the `safelist`
159
+ config.safelist = (()=>{
60
160
  var _purge_options;
61
161
  let { content , purge , safelist } = config;
62
- return Array.isArray(safelist) ? safelist : Array.isArray(null == content ? void 0 : content.safelist) ? content.safelist : Array.isArray(null == purge ? void 0 : purge.safelist) ? purge.safelist : Array.isArray(null == purge ? void 0 : null === (_purge_options = purge.options) || void 0 === _purge_options ? void 0 : _purge_options.safelist) ? purge.options.safelist : [];
63
- })(), config.blocklist = (()=>{
162
+ if (Array.isArray(safelist)) return safelist;
163
+ if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
164
+ if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return purge.safelist;
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 = (()=>{
64
170
  let { blocklist } = config;
65
171
  if (Array.isArray(blocklist)) {
66
- if (blocklist.every((item)=>"string" == typeof item)) return blocklist;
172
+ if (blocklist.every((item)=>typeof item === "string")) {
173
+ return blocklist;
174
+ }
67
175
  _log.default.warn("blocklist-invalid", [
68
176
  "The `blocklist` option must be an array of strings.",
69
177
  "https://tailwindcss.com/docs/content-configuration#discarding-classes"
70
178
  ]);
71
179
  }
72
180
  return [];
73
- })(), "function" == typeof config.prefix) ? (_log.default.warn("prefix-function", [
74
- "As of Tailwind CSS v3.0, `prefix` cannot be a function.",
75
- "Update `prefix` in your configuration to be a string to eliminate this warning.",
76
- "https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"
77
- ]), config.prefix = "") : config.prefix = null !== (_config_prefix = config.prefix) && void 0 !== _config_prefix ? _config_prefix : "", config.content = {
181
+ })();
182
+ // Normalize prefix option
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"
188
+ ]);
189
+ config.prefix = "";
190
+ } else {
191
+ var _config_prefix;
192
+ config.prefix = (_config_prefix = config.prefix) !== null && _config_prefix !== void 0 ? _config_prefix : "";
193
+ }
194
+ // Normalize the `content`
195
+ config.content = {
78
196
  relative: (()=>{
79
197
  let { content } = config;
80
- return (null == content ? void 0 : content.relative) ? content.relative : (0, _featureFlags.flagEnabled)(config, "relativeContentPathsByDefault");
198
+ if (content === null || content === void 0 ? void 0 : content.relative) {
199
+ return content.relative;
200
+ }
201
+ return (0, _featureFlags.flagEnabled)(config, "relativeContentPathsByDefault");
81
202
  })(),
82
203
  files: (()=>{
83
204
  let { content , purge } = config;
84
- return Array.isArray(purge) ? purge : Array.isArray(null == purge ? void 0 : purge.content) ? purge.content : Array.isArray(content) ? content : Array.isArray(null == content ? void 0 : content.content) ? content.content : Array.isArray(null == content ? void 0 : content.files) ? content.files : [];
205
+ if (Array.isArray(purge)) return purge;
206
+ if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.content)) return purge.content;
207
+ if (Array.isArray(content)) return content;
208
+ if (Array.isArray(content === null || content === void 0 ? void 0 : content.content)) return content.content;
209
+ if (Array.isArray(content === null || content === void 0 ? void 0 : content.files)) return content.files;
210
+ return [];
85
211
  })(),
86
212
  extract: (()=>{
87
- 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, _config_purge3, _config_purge_options1, _config_content3, _config_content_options1;
88
- let extract = (null === (_config_purge = config.purge) || void 0 === _config_purge ? void 0 : _config_purge.extract) ? config.purge.extract : (null === (_config_content = config.content) || void 0 === _config_content ? void 0 : _config_content.extract) ? config.content.extract : (null === (_config_purge1 = config.purge) || void 0 === _config_purge1 ? void 0 : null === (_config_purge_extract = _config_purge1.extract) || void 0 === _config_purge_extract ? void 0 : _config_purge_extract.DEFAULT) ? config.purge.extract.DEFAULT : (null === (_config_content1 = config.content) || void 0 === _config_content1 ? void 0 : null === (_config_content_extract = _config_content1.extract) || void 0 === _config_content_extract ? void 0 : _config_content_extract.DEFAULT) ? config.content.extract.DEFAULT : (null === (_config_purge2 = config.purge) || void 0 === _config_purge2 ? void 0 : null === (_config_purge_options = _config_purge2.options) || void 0 === _config_purge_options ? void 0 : _config_purge_options.extractors) ? config.purge.options.extractors : (null === (_config_content2 = config.content) || void 0 === _config_content2 ? void 0 : null === (_config_content_options = _config_content2.options) || void 0 === _config_content_options ? void 0 : _config_content_options.extractors) ? config.content.options.extractors : {}, extractors = {}, defaultExtractor = (null === (_config_purge3 = config.purge) || void 0 === _config_purge3 ? void 0 : null === (_config_purge_options1 = _config_purge3.options) || void 0 === _config_purge_options1 ? void 0 : _config_purge_options1.defaultExtractor) ? config.purge.options.defaultExtractor : (null === (_config_content3 = config.content) || void 0 === _config_content3 ? void 0 : null === (_config_content_options1 = _config_content3.options) || void 0 === _config_content_options1 ? void 0 : _config_content_options1.defaultExtractor) ? config.content.options.defaultExtractor : void 0;
89
- if (void 0 !== defaultExtractor && (extractors.DEFAULT = defaultExtractor), "function" == typeof extract) extractors.DEFAULT = extract;
90
- else if (Array.isArray(extract)) for (let { extensions , extractor } of null != extract ? extract : [])for (let extension of extensions)extractors[extension] = extractor;
91
- else "object" == typeof extract && null !== extract && Object.assign(extractors, extract);
213
+ let extract = (()=>{
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 {};
222
+ })();
223
+ let extractors = {};
224
+ let defaultExtractor = (()=>{
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) {
227
+ return config.purge.options.defaultExtractor;
228
+ }
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) {
230
+ return config.content.options.defaultExtractor;
231
+ }
232
+ return undefined;
233
+ })();
234
+ if (defaultExtractor !== undefined) {
235
+ extractors.DEFAULT = defaultExtractor;
236
+ }
237
+ // Functions
238
+ if (typeof extract === "function") {
239
+ extractors.DEFAULT = extract;
240
+ } else if (Array.isArray(extract)) {
241
+ for (let { extensions , extractor } of extract !== null && extract !== void 0 ? extract : []){
242
+ for (let extension of extensions){
243
+ extractors[extension] = extractor;
244
+ }
245
+ }
246
+ } else if (typeof extract === "object" && extract !== null) {
247
+ Object.assign(extractors, extract);
248
+ }
92
249
  return extractors;
93
250
  })(),
94
- transform: (transform = (null === (_config_purge = config.purge) || void 0 === _config_purge ? void 0 : _config_purge.transform) ? config.purge.transform : (null === (_config_content = config.content) || void 0 === _config_content ? void 0 : _config_content.transform) ? config.content.transform : (null === (_config_purge1 = config.purge) || void 0 === _config_purge1 ? void 0 : null === (_config_purge_transform = _config_purge1.transform) || void 0 === _config_purge_transform ? void 0 : _config_purge_transform.DEFAULT) ? config.purge.transform.DEFAULT : (null === (_config_content1 = config.content) || void 0 === _config_content1 ? void 0 : null === (_config_content_transform = _config_content1.transform) || void 0 === _config_content_transform ? void 0 : _config_content_transform.DEFAULT) ? config.content.transform.DEFAULT : {}, transformers = {}, "function" == typeof transform && (transformers.DEFAULT = transform), "object" == typeof transform && null !== transform && Object.assign(transformers, transform), transformers)
95
- }, config.content.files))if ("string" == typeof file && /{([^,]*?)}/g.test(file)) {
96
- _log.default.warn("invalid-glob-braces", [
97
- `The glob pattern ${(0, _log.dim)(file)} in your Tailwind CSS configuration is invalid.`,
98
- `Update it to ${(0, _log.dim)(file.replace(/{([^,]*?)}/g, "$1"))} to silence this warning.`
99
- ]);
100
- break;
251
+ transform: (()=>{
252
+ let transform = (()=>{
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 {};
259
+ })();
260
+ let transformers = {};
261
+ if (typeof transform === "function") {
262
+ transformers.DEFAULT = transform;
263
+ }
264
+ if (typeof transform === "object" && transform !== null) {
265
+ Object.assign(transformers, transform);
266
+ }
267
+ return transformers;
268
+ })()
269
+ };
270
+ // Validate globs to prevent bogus globs.
271
+ // E.g.: `./src/*.{html}` is invalid, the `{html}` should just be `html`
272
+ for (let file of config.content.files){
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.`
277
+ ]);
278
+ break;
279
+ }
101
280
  }
102
281
  return config;
103
282
  }