tailwindcss 0.0.0-insiders.fda68f7 → 0.0.0-oxide.6bf5e56

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 (195) hide show
  1. package/CHANGELOG.md +603 -2
  2. package/LICENSE +1 -2
  3. package/README.md +14 -6
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -304
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -4
  8. package/defaultTheme.d.ts +4 -0
  9. package/defaultTheme.js +2 -4
  10. package/lib/cli/build/deps.js +54 -0
  11. package/lib/cli/build/index.js +48 -0
  12. package/lib/cli/build/plugin.js +367 -0
  13. package/lib/cli/build/utils.js +78 -0
  14. package/lib/cli/build/watching.js +178 -0
  15. package/lib/cli/help/index.js +71 -0
  16. package/lib/cli/index.js +18 -0
  17. package/lib/cli/init/index.js +46 -0
  18. package/lib/cli/shared.js +13 -0
  19. package/lib/cli-peer-dependencies.js +22 -14
  20. package/lib/cli.js +217 -743
  21. package/lib/constants.js +41 -34
  22. package/lib/corePluginList.js +178 -5
  23. package/lib/corePlugins.js +3879 -2941
  24. package/lib/css/preflight.css +22 -9
  25. package/lib/featureFlags.js +61 -50
  26. package/lib/index.js +45 -28
  27. package/lib/lib/cacheInvalidation.js +90 -0
  28. package/lib/lib/collapseAdjacentRules.js +52 -36
  29. package/lib/lib/collapseDuplicateDeclarations.js +83 -0
  30. package/lib/lib/content.js +176 -0
  31. package/lib/lib/defaultExtractor.js +236 -0
  32. package/lib/lib/detectNesting.js +37 -0
  33. package/lib/lib/evaluateTailwindFunctions.js +203 -161
  34. package/lib/lib/expandApplyAtRules.js +502 -221
  35. package/lib/lib/expandTailwindAtRules.js +258 -243
  36. package/lib/lib/findAtConfigPath.js +44 -0
  37. package/lib/lib/generateRules.js +775 -320
  38. package/lib/lib/getModuleDependencies.js +44 -46
  39. package/lib/lib/normalizeTailwindDirectives.js +79 -60
  40. package/lib/lib/offsets.js +217 -0
  41. package/lib/lib/partitionApplyAtRules.js +56 -0
  42. package/lib/lib/regex.js +60 -0
  43. package/lib/lib/resolveDefaultsAtRules.js +150 -94
  44. package/lib/lib/setupContextUtils.js +1146 -599
  45. package/lib/lib/setupTrackingContext.js +129 -177
  46. package/lib/lib/sharedState.js +53 -21
  47. package/lib/lib/substituteScreenAtRules.js +26 -28
  48. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  49. package/lib/postcss-plugins/nesting/index.js +19 -0
  50. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  51. package/lib/processTailwindFeatures.js +58 -53
  52. package/lib/public/colors.js +331 -0
  53. package/lib/public/create-plugin.js +15 -0
  54. package/lib/public/default-config.js +16 -0
  55. package/lib/public/default-theme.js +16 -0
  56. package/lib/public/resolve-config.js +22 -0
  57. package/lib/util/bigSign.js +7 -6
  58. package/lib/util/buildMediaQuery.js +21 -32
  59. package/lib/util/cloneDeep.js +16 -14
  60. package/lib/util/cloneNodes.js +29 -15
  61. package/lib/util/color.js +90 -66
  62. package/lib/util/configurePlugins.js +17 -15
  63. package/lib/util/createPlugin.js +23 -26
  64. package/lib/util/createUtilityPlugin.js +46 -46
  65. package/lib/util/dataTypes.js +242 -0
  66. package/lib/util/defaults.js +20 -15
  67. package/lib/util/escapeClassName.js +18 -17
  68. package/lib/util/escapeCommas.js +7 -6
  69. package/lib/util/flattenColorPalette.js +13 -12
  70. package/lib/util/formatVariantSelector.js +285 -0
  71. package/lib/util/getAllConfigs.js +44 -18
  72. package/lib/util/hashConfig.js +15 -12
  73. package/lib/util/isKeyframeRule.js +7 -6
  74. package/lib/util/isPlainObject.js +11 -11
  75. package/lib/util/isSyntacticallyValidPropertyValue.js +72 -0
  76. package/lib/util/log.js +52 -33
  77. package/lib/util/nameClass.js +37 -26
  78. package/lib/util/negateValue.js +31 -17
  79. package/lib/util/normalizeConfig.js +281 -0
  80. package/lib/util/normalizeScreens.js +170 -0
  81. package/lib/util/parseAnimationValue.js +85 -54
  82. package/lib/util/parseBoxShadowValue.js +84 -0
  83. package/lib/util/parseDependency.js +41 -70
  84. package/lib/util/parseGlob.js +34 -0
  85. package/lib/util/parseObjectStyles.js +30 -24
  86. package/lib/util/pluginUtils.js +252 -287
  87. package/lib/util/prefixSelector.js +20 -20
  88. package/lib/util/removeAlphaVariables.js +29 -0
  89. package/lib/util/resolveConfig.js +221 -256
  90. package/lib/util/resolveConfigPath.js +43 -48
  91. package/lib/util/responsive.js +18 -14
  92. package/lib/util/splitAtTopLevelOnly.js +43 -0
  93. package/lib/util/tap.js +8 -7
  94. package/lib/util/toColorValue.js +7 -6
  95. package/lib/util/toPath.js +27 -8
  96. package/lib/util/transformThemeValue.js +67 -28
  97. package/lib/util/validateConfig.js +24 -0
  98. package/lib/util/validateFormalSyntax.js +24 -0
  99. package/lib/util/withAlphaVariable.js +67 -57
  100. package/nesting/index.js +2 -12
  101. package/package.json +60 -65
  102. package/peers/index.js +76445 -84221
  103. package/plugin.d.ts +11 -0
  104. package/plugin.js +1 -2
  105. package/resolveConfig.d.ts +12 -0
  106. package/resolveConfig.js +2 -7
  107. package/scripts/create-plugin-list.js +2 -2
  108. package/scripts/generate-types.js +105 -0
  109. package/scripts/release-channel.js +18 -0
  110. package/scripts/release-notes.js +21 -0
  111. package/scripts/type-utils.js +27 -0
  112. package/src/cli/build/deps.js +56 -0
  113. package/src/cli/build/index.js +49 -0
  114. package/src/cli/build/plugin.js +439 -0
  115. package/src/cli/build/utils.js +76 -0
  116. package/src/cli/build/watching.js +227 -0
  117. package/src/cli/help/index.js +70 -0
  118. package/src/cli/index.js +3 -0
  119. package/src/cli/init/index.js +50 -0
  120. package/src/cli/shared.js +6 -0
  121. package/src/cli-peer-dependencies.js +7 -1
  122. package/src/cli.js +50 -575
  123. package/src/corePluginList.js +1 -1
  124. package/src/corePlugins.js +2405 -1948
  125. package/src/css/preflight.css +22 -9
  126. package/src/featureFlags.js +26 -10
  127. package/src/index.js +19 -6
  128. package/src/lib/cacheInvalidation.js +52 -0
  129. package/src/lib/collapseAdjacentRules.js +21 -2
  130. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  131. package/src/lib/content.js +212 -0
  132. package/src/lib/defaultExtractor.js +211 -0
  133. package/src/lib/detectNesting.js +39 -0
  134. package/src/lib/evaluateTailwindFunctions.js +84 -10
  135. package/src/lib/expandApplyAtRules.js +508 -153
  136. package/src/lib/expandTailwindAtRules.js +130 -104
  137. package/src/lib/findAtConfigPath.js +48 -0
  138. package/src/lib/generateRules.js +596 -70
  139. package/src/lib/normalizeTailwindDirectives.js +10 -3
  140. package/src/lib/offsets.js +270 -0
  141. package/src/lib/partitionApplyAtRules.js +52 -0
  142. package/src/lib/regex.js +74 -0
  143. package/src/lib/resolveDefaultsAtRules.js +105 -47
  144. package/src/lib/setupContextUtils.js +828 -196
  145. package/src/lib/setupTrackingContext.js +19 -54
  146. package/src/lib/sharedState.js +45 -7
  147. package/src/lib/substituteScreenAtRules.js +6 -3
  148. package/src/postcss-plugins/nesting/README.md +42 -0
  149. package/src/postcss-plugins/nesting/index.js +13 -0
  150. package/src/postcss-plugins/nesting/plugin.js +80 -0
  151. package/src/processTailwindFeatures.js +19 -2
  152. package/src/public/colors.js +300 -0
  153. package/src/public/create-plugin.js +2 -0
  154. package/src/public/default-config.js +4 -0
  155. package/src/public/default-theme.js +4 -0
  156. package/src/public/resolve-config.js +7 -0
  157. package/src/util/buildMediaQuery.js +14 -16
  158. package/src/util/cloneNodes.js +19 -2
  159. package/src/util/color.js +31 -14
  160. package/src/util/createUtilityPlugin.js +2 -11
  161. package/src/util/dataTypes.js +256 -0
  162. package/src/util/defaults.js +6 -0
  163. package/src/util/formatVariantSelector.js +319 -0
  164. package/src/util/getAllConfigs.js +19 -0
  165. package/src/util/isSyntacticallyValidPropertyValue.js +61 -0
  166. package/src/util/log.js +23 -22
  167. package/src/util/nameClass.js +14 -6
  168. package/src/util/negateValue.js +15 -5
  169. package/src/util/normalizeConfig.js +300 -0
  170. package/src/util/normalizeScreens.js +140 -0
  171. package/src/util/parseAnimationValue.js +7 -1
  172. package/src/util/parseBoxShadowValue.js +72 -0
  173. package/src/util/parseDependency.js +37 -38
  174. package/src/util/parseGlob.js +24 -0
  175. package/src/util/pluginUtils.js +216 -197
  176. package/src/util/prefixSelector.js +7 -8
  177. package/src/util/removeAlphaVariables.js +24 -0
  178. package/src/util/resolveConfig.js +86 -91
  179. package/src/util/splitAtTopLevelOnly.js +45 -0
  180. package/src/util/toPath.js +23 -1
  181. package/src/util/transformThemeValue.js +33 -8
  182. package/src/util/validateConfig.js +13 -0
  183. package/src/util/validateFormalSyntax.js +34 -0
  184. package/src/util/withAlphaVariable.js +14 -9
  185. package/stubs/defaultConfig.stub.js +186 -117
  186. package/stubs/simpleConfig.stub.js +1 -1
  187. package/types/config.d.ts +362 -0
  188. package/types/generated/.gitkeep +0 -0
  189. package/types/generated/colors.d.ts +276 -0
  190. package/types/generated/corePluginList.d.ts +1 -0
  191. package/types/generated/default-theme.d.ts +342 -0
  192. package/types/index.d.ts +7 -0
  193. package/lib/lib/setupWatchingContext.js +0 -331
  194. package/nesting/plugin.js +0 -41
  195. package/src/lib/setupWatchingContext.js +0 -306
@@ -1,289 +1,254 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.default = resolveConfig;
7
-
8
- var _negateValue = _interopRequireDefault(require("./negateValue"));
9
-
10
- var _corePluginList = _interopRequireDefault(require("../corePluginList"));
11
-
12
- var _configurePlugins = _interopRequireDefault(require("./configurePlugins"));
13
-
14
- var _defaultConfig = _interopRequireDefault(require("../../stubs/defaultConfig.stub"));
15
-
16
- var _colors = _interopRequireDefault(require("../../colors"));
17
-
18
- var _log = _interopRequireDefault(require("./log"));
19
-
20
- var _defaults = require("./defaults");
21
-
22
- var _toPath = require("./toPath");
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- function isFunction(input) {
27
- return typeof input === 'function';
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>resolveConfig
8
+ });
9
+ const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
10
+ const _corePluginList = /*#__PURE__*/ _interopRequireDefault(require("../corePluginList"));
11
+ const _configurePlugins = /*#__PURE__*/ _interopRequireDefault(require("./configurePlugins"));
12
+ const _colors = /*#__PURE__*/ _interopRequireDefault(require("../public/colors"));
13
+ const _defaults = require("./defaults");
14
+ const _toPath = require("./toPath");
15
+ const _normalizeConfig = require("./normalizeConfig");
16
+ const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
17
+ const _cloneDeep = require("./cloneDeep");
18
+ const _pluginUtils = require("./pluginUtils");
19
+ const _withAlphaVariable = require("./withAlphaVariable");
20
+ const _toColorValue = /*#__PURE__*/ _interopRequireDefault(require("./toColorValue"));
21
+ function _interopRequireDefault(obj) {
22
+ return obj && obj.__esModule ? obj : {
23
+ default: obj
24
+ };
28
25
  }
29
-
30
- function isObject(input) {
31
- return typeof input === 'object' && input !== null;
26
+ function isFunction(input) {
27
+ return typeof input === "function";
32
28
  }
33
-
34
29
  function mergeWith(target, ...sources) {
35
- let customizer = sources.pop();
36
-
37
- for (let source of sources) {
38
- for (let k in source) {
39
- let merged = customizer(target[k], source[k]);
40
-
41
- if (merged === undefined) {
42
- if (isObject(target[k]) && isObject(source[k])) {
43
- target[k] = mergeWith(target[k], source[k], customizer);
44
- } else {
45
- target[k] = source[k];
30
+ let customizer = sources.pop();
31
+ for (let source of sources){
32
+ for(let k in source){
33
+ let merged = customizer(target[k], source[k]);
34
+ if (merged === undefined) {
35
+ if ((0, _isPlainObject.default)(target[k]) && (0, _isPlainObject.default)(source[k])) {
36
+ target[k] = mergeWith({}, target[k], source[k], customizer);
37
+ } else {
38
+ target[k] = source[k];
39
+ }
40
+ } else {
41
+ target[k] = merged;
42
+ }
46
43
  }
47
- } else {
48
- target[k] = merged;
49
- }
50
44
  }
51
- }
52
-
53
- return target;
45
+ return target;
54
46
  }
55
-
56
47
  const configUtils = {
57
- colors: _colors.default,
58
-
59
- negative(scale) {
60
- return Object.keys(scale).filter(key => scale[key] !== '0').reduce((negativeScale, key) => ({ ...negativeScale,
61
- [`-${key}`]: (0, _negateValue.default)(scale[key])
62
- }), {});
63
- },
64
-
65
- breakpoints(screens) {
66
- return Object.keys(screens).filter(key => typeof screens[key] === 'string').reduce((breakpoints, key) => ({ ...breakpoints,
67
- [`screen-${key}`]: screens[key]
68
- }), {});
69
- }
70
-
48
+ colors: _colors.default,
49
+ negative (scale) {
50
+ // TODO: Log that this function isn't really needed anymore?
51
+ return Object.keys(scale).filter((key)=>scale[key] !== "0").reduce((negativeScale, key)=>{
52
+ let negativeValue = (0, _negateValue.default)(scale[key]);
53
+ if (negativeValue !== undefined) {
54
+ negativeScale[`-${key}`] = negativeValue;
55
+ }
56
+ return negativeScale;
57
+ }, {});
58
+ },
59
+ breakpoints (screens) {
60
+ return Object.keys(screens).filter((key)=>typeof screens[key] === "string").reduce((breakpoints, key)=>({
61
+ ...breakpoints,
62
+ [`screen-${key}`]: screens[key]
63
+ }), {});
64
+ }
71
65
  };
72
-
73
66
  function value(valueToResolve, ...args) {
74
- return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
67
+ return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
75
68
  }
76
-
77
69
  function collectExtends(items) {
78
- return items.reduce((merged, {
79
- extend
80
- }) => {
81
- return mergeWith(merged, extend, (mergedValue, extendValue) => {
82
- if (mergedValue === undefined) {
83
- return [extendValue];
84
- }
85
-
86
- if (Array.isArray(mergedValue)) {
87
- return [extendValue, ...mergedValue];
88
- }
89
-
90
- return [extendValue, mergedValue];
91
- });
92
- }, {});
70
+ return items.reduce((merged, { extend })=>{
71
+ return mergeWith(merged, extend, (mergedValue, extendValue)=>{
72
+ if (mergedValue === undefined) {
73
+ return [
74
+ extendValue
75
+ ];
76
+ }
77
+ if (Array.isArray(mergedValue)) {
78
+ return [
79
+ extendValue,
80
+ ...mergedValue
81
+ ];
82
+ }
83
+ return [
84
+ extendValue,
85
+ mergedValue
86
+ ];
87
+ });
88
+ }, {});
93
89
  }
94
-
95
90
  function mergeThemes(themes) {
96
- return { ...themes.reduce((merged, theme) => (0, _defaults.defaults)(merged, theme), {}),
97
- // In order to resolve n config objects, we combine all of their `extend` properties
98
- // into arrays instead of objects so they aren't overridden.
99
- extend: collectExtends(themes)
100
- };
91
+ return {
92
+ ...themes.reduce((merged, theme)=>(0, _defaults.defaults)(merged, theme), {}),
93
+ // In order to resolve n config objects, we combine all of their `extend` properties
94
+ // into arrays instead of objects so they aren't overridden.
95
+ extend: collectExtends(themes)
96
+ };
101
97
  }
102
-
103
98
  function mergeExtensionCustomizer(merged, value) {
104
- // When we have an array of objects, we do want to merge it
105
- if (Array.isArray(merged) && isObject(merged[0])) {
106
- return merged.concat(value);
107
- } // When the incoming value is an array, and the existing config is an object, prepend the existing object
108
-
109
-
110
- if (Array.isArray(value) && isObject(value[0]) && isObject(merged)) {
111
- return [merged, ...value];
112
- } // Override arrays (for example for font-families, box-shadows, ...)
113
-
114
-
115
- if (Array.isArray(value)) {
116
- return value;
117
- } // Execute default behaviour
118
-
119
-
120
- return undefined;
99
+ // When we have an array of objects, we do want to merge it
100
+ if (Array.isArray(merged) && (0, _isPlainObject.default)(merged[0])) {
101
+ return merged.concat(value);
102
+ }
103
+ // When the incoming value is an array, and the existing config is an object, prepend the existing object
104
+ if (Array.isArray(value) && (0, _isPlainObject.default)(value[0]) && (0, _isPlainObject.default)(merged)) {
105
+ return [
106
+ merged,
107
+ ...value
108
+ ];
109
+ }
110
+ // Override arrays (for example for font-families, box-shadows, ...)
111
+ if (Array.isArray(value)) {
112
+ return value;
113
+ }
114
+ // Execute default behaviour
115
+ return undefined;
116
+ }
117
+ function mergeExtensions({ extend , ...theme }) {
118
+ return mergeWith(theme, extend, (themeValue, extensions)=>{
119
+ // The `extend` property is an array, so we need to check if it contains any functions
120
+ if (!isFunction(themeValue) && !extensions.some(isFunction)) {
121
+ return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
122
+ }
123
+ return (resolveThemePath, utils)=>mergeWith({}, ...[
124
+ themeValue,
125
+ ...extensions
126
+ ].map((e)=>value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
127
+ });
121
128
  }
122
-
123
- function mergeExtensions({
124
- extend,
125
- ...theme
126
- }) {
127
- return mergeWith(theme, extend, (themeValue, extensions) => {
128
- // The `extend` property is an array, so we need to check if it contains any functions
129
- if (!isFunction(themeValue) && !extensions.some(isFunction)) {
130
- return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
129
+ /**
130
+ *
131
+ * @param {string} key
132
+ * @return {Iterable<string[] & {alpha: string | undefined}>}
133
+ */ function* toPaths(key) {
134
+ let path = (0, _toPath.toPath)(key);
135
+ if (path.length === 0) {
136
+ return;
137
+ }
138
+ yield path;
139
+ if (Array.isArray(key)) {
140
+ return;
141
+ }
142
+ let pattern = /^(.*?)\s*\/\s*([^/]+)$/;
143
+ let matches = key.match(pattern);
144
+ if (matches !== null) {
145
+ let [, prefix, alpha] = matches;
146
+ let newPath = (0, _toPath.toPath)(prefix);
147
+ newPath.alpha = alpha;
148
+ yield newPath;
131
149
  }
132
-
133
- return (resolveThemePath, utils) => mergeWith({}, ...[themeValue, ...extensions].map(e => value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
134
- });
135
150
  }
136
-
137
151
  function resolveFunctionKeys(object) {
138
- const resolvePath = (key, defaultValue) => {
139
- const path = (0, _toPath.toPath)(key);
140
- let index = 0;
141
- let val = object;
142
-
143
- while (val !== undefined && val !== null && index < path.length) {
144
- val = val[path[index++]];
145
- val = isFunction(val) ? val(resolvePath, configUtils) : val;
146
- }
147
-
148
- return val === undefined ? defaultValue : val;
149
- };
150
-
151
- resolvePath.theme = resolvePath;
152
-
153
- for (let key in configUtils) {
154
- resolvePath[key] = configUtils[key];
155
- }
156
-
157
- return Object.keys(object).reduce((resolved, key) => {
158
- return { ...resolved,
159
- [key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key]
152
+ // theme('colors.red.500 / 0.5') -> ['colors', 'red', '500 / 0', '5]
153
+ const resolvePath = (key, defaultValue)=>{
154
+ for (const path of toPaths(key)){
155
+ let index = 0;
156
+ let val = object;
157
+ while(val !== undefined && val !== null && index < path.length){
158
+ val = val[path[index++]];
159
+ let shouldResolveAsFn = isFunction(val) && (path.alpha === undefined || index <= path.length - 1);
160
+ val = shouldResolveAsFn ? val(resolvePath, configUtils) : val;
161
+ }
162
+ if (val !== undefined) {
163
+ if (path.alpha !== undefined) {
164
+ let normalized = (0, _pluginUtils.parseColorFormat)(val);
165
+ return (0, _withAlphaVariable.withAlphaValue)(normalized, path.alpha, (0, _toColorValue.default)(normalized));
166
+ }
167
+ if ((0, _isPlainObject.default)(val)) {
168
+ return (0, _cloneDeep.cloneDeep)(val);
169
+ }
170
+ return val;
171
+ }
172
+ }
173
+ return defaultValue;
160
174
  };
161
- }, {});
175
+ Object.assign(resolvePath, {
176
+ theme: resolvePath,
177
+ ...configUtils
178
+ });
179
+ return Object.keys(object).reduce((resolved, key)=>{
180
+ resolved[key] = isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key];
181
+ return resolved;
182
+ }, {});
162
183
  }
163
-
164
184
  function extractPluginConfigs(configs) {
165
- let allConfigs = [];
166
- configs.forEach(config => {
167
- var _config$plugins;
168
-
169
- allConfigs = [...allConfigs, config];
170
- const plugins = (_config$plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config$plugins !== void 0 ? _config$plugins : [];
171
-
172
- if (plugins.length === 0) {
173
- return;
174
- }
175
-
176
- plugins.forEach(plugin => {
177
- var _plugin$config, _plugin;
178
-
179
- if (plugin.__isOptionsFunction) {
180
- plugin = plugin();
181
- }
182
-
183
- allConfigs = [...allConfigs, ...extractPluginConfigs([(_plugin$config = (_plugin = plugin) === null || _plugin === void 0 ? void 0 : _plugin.config) !== null && _plugin$config !== void 0 ? _plugin$config : {}])];
185
+ let allConfigs = [];
186
+ configs.forEach((config)=>{
187
+ allConfigs = [
188
+ ...allConfigs,
189
+ config
190
+ ];
191
+ var ref;
192
+ const plugins = (ref = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref !== void 0 ? ref : [];
193
+ if (plugins.length === 0) {
194
+ return;
195
+ }
196
+ plugins.forEach((plugin)=>{
197
+ if (plugin.__isOptionsFunction) {
198
+ plugin = plugin();
199
+ }
200
+ var ref;
201
+ allConfigs = [
202
+ ...allConfigs,
203
+ ...extractPluginConfigs([
204
+ (ref = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && ref !== void 0 ? ref : {}
205
+ ])
206
+ ];
207
+ });
184
208
  });
185
- });
186
- return allConfigs;
209
+ return allConfigs;
187
210
  }
188
-
189
211
  function resolveCorePlugins(corePluginConfigs) {
190
- const result = [...corePluginConfigs].reduceRight((resolved, corePluginConfig) => {
191
- if (isFunction(corePluginConfig)) {
192
- return corePluginConfig({
193
- corePlugins: resolved
194
- });
195
- }
196
-
197
- return (0, _configurePlugins.default)(corePluginConfig, resolved);
198
- }, _corePluginList.default);
199
- return result;
212
+ const result = [
213
+ ...corePluginConfigs
214
+ ].reduceRight((resolved, corePluginConfig)=>{
215
+ if (isFunction(corePluginConfig)) {
216
+ return corePluginConfig({
217
+ corePlugins: resolved
218
+ });
219
+ }
220
+ return (0, _configurePlugins.default)(corePluginConfig, resolved);
221
+ }, _corePluginList.default);
222
+ return result;
200
223
  }
201
-
202
224
  function resolvePluginLists(pluginLists) {
203
- const result = [...pluginLists].reduceRight((resolved, pluginList) => {
204
- return [...resolved, ...pluginList];
205
- }, []);
206
- return result;
225
+ const result = [
226
+ ...pluginLists
227
+ ].reduceRight((resolved, pluginList)=>{
228
+ return [
229
+ ...resolved,
230
+ ...pluginList
231
+ ];
232
+ }, []);
233
+ return result;
207
234
  }
208
-
209
235
  function resolveConfig(configs) {
210
- let allConfigs = [...extractPluginConfigs(configs), {
211
- prefix: '',
212
- important: false,
213
- separator: ':',
214
- variantOrder: _defaultConfig.default.variantOrder
215
- }];
216
- return normalizeConfig((0, _defaults.defaults)({
217
- theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map(t => {
218
- var _t$theme;
219
-
220
- return (_t$theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t$theme !== void 0 ? _t$theme : {};
221
- })))),
222
- corePlugins: resolveCorePlugins(allConfigs.map(c => c.corePlugins)),
223
- plugins: resolvePluginLists(configs.map(c => {
224
- var _c$plugins;
225
-
226
- return (_c$plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c$plugins !== void 0 ? _c$plugins : [];
227
- }))
228
- }, ...allConfigs));
229
- }
230
-
231
- let warnedAbout = new Set();
232
-
233
- function normalizeConfig(config) {
234
- var _config$content, _config$purge, _config$content2, _config$purge2, _config$content3, _config$purge3;
235
-
236
- if (!warnedAbout.has('purge-deprecation') && config.hasOwnProperty('purge')) {
237
- _log.default.warn(['The `purge` option in your tailwind.config.js file has been deprecated.', 'Please rename this to `content` instead.']);
238
-
239
- warnedAbout.add('purge-deprecation');
240
- }
241
-
242
- config.content = {
243
- content: (() => {
244
- let {
245
- content,
246
- purge
247
- } = config;
248
- if (Array.isArray(purge)) return purge;
249
- if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.content)) return purge.content;
250
- if (Array.isArray(content)) return content;
251
- if (Array.isArray(content === null || content === void 0 ? void 0 : content.content)) return content.content;
252
- return [];
253
- })(),
254
- safelist: (() => {
255
- let {
256
- content,
257
- purge
258
- } = config;
259
-
260
- let [safelistKey, safelistPaths] = (() => {
261
- var _purge$options;
262
-
263
- if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return ['content.safelist', content.safelist];
264
- if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return ['purge.safelist', purge.safelist];
265
- 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', purge.options.safelist];
266
- return [null, []];
267
- })();
268
-
269
- return safelistPaths.map(content => {
270
- if (typeof content === 'string') {
271
- return {
272
- raw: content,
273
- extension: 'html'
274
- };
275
- }
276
-
277
- if (content instanceof RegExp) {
278
- throw new Error(`Values inside '${safelistKey}' can only be of type 'string', found 'regex'.`);
236
+ let allConfigs = [
237
+ ...extractPluginConfigs(configs),
238
+ {
239
+ prefix: "",
240
+ important: false,
241
+ separator: ":"
279
242
  }
280
-
281
- throw new Error(`Values inside '${safelistKey}' can only be of type 'string', found '${typeof content}'.`);
282
- });
283
- })(),
284
- extract: ((_config$content = config.content) === null || _config$content === void 0 ? void 0 : _config$content.extract) || ((_config$purge = config.purge) === null || _config$purge === void 0 ? void 0 : _config$purge.extract) || {},
285
- options: ((_config$content2 = config.content) === null || _config$content2 === void 0 ? void 0 : _config$content2.options) || ((_config$purge2 = config.purge) === null || _config$purge2 === void 0 ? void 0 : _config$purge2.options) || {},
286
- transform: ((_config$content3 = config.content) === null || _config$content3 === void 0 ? void 0 : _config$content3.transform) || ((_config$purge3 = config.purge) === null || _config$purge3 === void 0 ? void 0 : _config$purge3.transform) || {}
287
- };
288
- return config;
289
- }
243
+ ];
244
+ var ref, ref1;
245
+ return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
246
+ theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
247
+ return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
248
+ })))),
249
+ corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
250
+ plugins: resolvePluginLists(configs.map((c)=>{
251
+ return (ref1 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref1 !== void 0 ? ref1 : [];
252
+ }))
253
+ }, ...allConfigs));
254
+ }
@@ -1,59 +1,54 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.default = resolveConfigPath;
7
-
8
- var _fs = _interopRequireDefault(require("fs"));
9
-
10
- var _path = _interopRequireDefault(require("path"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>resolveConfigPath
8
+ });
9
+ const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
+ function _interopRequireDefault(obj) {
12
+ return obj && obj.__esModule ? obj : {
13
+ default: obj
14
+ };
15
+ }
14
16
  function isObject(value) {
15
- return typeof value === 'object' && value !== null;
17
+ return typeof value === "object" && value !== null;
16
18
  }
17
-
18
19
  function isEmpty(obj) {
19
- return Object.keys(obj).length === 0;
20
+ return Object.keys(obj).length === 0;
20
21
  }
21
-
22
22
  function isString(value) {
23
- return typeof value === 'string' || value instanceof String;
23
+ return typeof value === "string" || value instanceof String;
24
24
  }
25
-
26
25
  function resolveConfigPath(pathOrConfig) {
27
- // require('tailwindcss')({ theme: ..., variants: ... })
28
- if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
26
+ // require('tailwindcss')({ theme: ..., variants: ... })
27
+ if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
28
+ return null;
29
+ }
30
+ // require('tailwindcss')({ config: 'custom-config.js' })
31
+ if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isString(pathOrConfig.config)) {
32
+ return _path.default.resolve(pathOrConfig.config);
33
+ }
34
+ // require('tailwindcss')({ config: { theme: ..., variants: ... } })
35
+ if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isObject(pathOrConfig.config)) {
36
+ return null;
37
+ }
38
+ // require('tailwindcss')('custom-config.js')
39
+ if (isString(pathOrConfig)) {
40
+ return _path.default.resolve(pathOrConfig);
41
+ }
42
+ // require('tailwindcss')
43
+ for (const configFile of [
44
+ "./tailwind.config.js",
45
+ "./tailwind.config.cjs"
46
+ ]){
47
+ try {
48
+ const configPath = _path.default.resolve(configFile);
49
+ _fs.default.accessSync(configPath);
50
+ return configPath;
51
+ } catch (err) {}
52
+ }
29
53
  return null;
30
- } // require('tailwindcss')({ config: 'custom-config.js' })
31
-
32
-
33
- if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isString(pathOrConfig.config)) {
34
- return _path.default.resolve(pathOrConfig.config);
35
- } // require('tailwindcss')({ config: { theme: ..., variants: ... } })
36
-
37
-
38
- if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isObject(pathOrConfig.config)) {
39
- return null;
40
- } // require('tailwindcss')('custom-config.js')
41
-
42
-
43
- if (isString(pathOrConfig)) {
44
- return _path.default.resolve(pathOrConfig);
45
- } // require('tailwindcss')
46
-
47
-
48
- for (const configFile of ['./tailwind.config.js', './tailwind.config.cjs']) {
49
- try {
50
- const configPath = _path.default.resolve(configFile);
51
-
52
- _fs.default.accessSync(configPath);
53
-
54
- return configPath;
55
- } catch (err) {}
56
- }
57
-
58
- return null;
59
- }
54
+ }
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.default = responsive;
7
-
8
- var _postcss = _interopRequireDefault(require("postcss"));
9
-
10
- var _cloneNodes = _interopRequireDefault(require("./cloneNodes"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>responsive
8
+ });
9
+ const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
+ const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("./cloneNodes"));
11
+ function _interopRequireDefault(obj) {
12
+ return obj && obj.__esModule ? obj : {
13
+ default: obj
14
+ };
15
+ }
14
16
  function responsive(rules) {
15
- return _postcss.default.atRule({
16
- name: 'responsive'
17
- }).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [rules]));
18
- }
17
+ return _postcss.default.atRule({
18
+ name: "responsive"
19
+ }).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [
20
+ rules
21
+ ]));
22
+ }