tailwindcss 0.0.0-insiders.dddaded → 0.0.0-insiders.de00a62

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 (160) hide show
  1. package/lib/cli/build/deps.js +17 -9
  2. package/lib/cli/build/index.js +10 -8
  3. package/lib/cli/build/plugin.js +31 -29
  4. package/lib/cli/build/utils.js +18 -8
  5. package/lib/cli/build/watching.js +13 -11
  6. package/lib/cli/help/index.js +6 -4
  7. package/lib/cli/index.js +4 -4
  8. package/lib/cli/init/index.js +8 -6
  9. package/lib/cli-peer-dependencies.js +12 -4
  10. package/lib/cli.js +1 -1
  11. package/lib/corePluginList.js +8 -2
  12. package/lib/corePlugins.js +211 -48
  13. package/lib/css/preflight.css +24 -8
  14. package/lib/featureFlags.js +14 -9
  15. package/lib/index.js +1 -5
  16. package/lib/lib/cacheInvalidation.js +7 -5
  17. package/lib/lib/collapseAdjacentRules.js +3 -1
  18. package/lib/lib/collapseDuplicateDeclarations.js +10 -8
  19. package/lib/lib/content.js +51 -14
  20. package/lib/lib/defaultExtractor.js +38 -28
  21. package/lib/lib/detectNesting.js +3 -1
  22. package/lib/lib/evaluateTailwindFunctions.js +20 -16
  23. package/lib/lib/expandApplyAtRules.js +41 -33
  24. package/lib/lib/expandTailwindAtRules.js +38 -19
  25. package/lib/lib/findAtConfigPath.js +6 -4
  26. package/lib/lib/generateRules.js +83 -55
  27. package/lib/lib/getModuleDependencies.js +10 -8
  28. package/lib/lib/load-config.js +18 -5
  29. package/lib/lib/normalizeTailwindDirectives.js +5 -3
  30. package/lib/lib/offsets.js +58 -7
  31. package/lib/lib/partitionApplyAtRules.js +3 -1
  32. package/lib/lib/regex.js +21 -7
  33. package/lib/lib/remap-bitfield.js +3 -1
  34. package/lib/lib/resolveDefaultsAtRules.js +27 -21
  35. package/lib/lib/setupContextUtils.js +143 -94
  36. package/lib/lib/setupTrackingContext.js +27 -24
  37. package/lib/lib/sharedState.js +28 -24
  38. package/lib/lib/substituteScreenAtRules.js +5 -3
  39. package/lib/oxide/cli/build/deps.js +16 -8
  40. package/lib/oxide/cli/build/index.js +6 -4
  41. package/lib/oxide/cli/build/plugin.js +25 -23
  42. package/lib/oxide/cli/build/utils.js +18 -8
  43. package/lib/oxide/cli/build/watching.js +10 -8
  44. package/lib/oxide/cli/help/index.js +6 -4
  45. package/lib/oxide/cli/index.js +4 -4
  46. package/lib/oxide/cli/init/index.js +6 -4
  47. package/lib/plugin.js +9 -9
  48. package/lib/postcss-plugins/nesting/index.js +3 -1
  49. package/lib/postcss-plugins/nesting/plugin.js +8 -6
  50. package/lib/processTailwindFeatures.js +16 -14
  51. package/lib/public/colors.js +5 -3
  52. package/lib/public/create-plugin.js +5 -3
  53. package/lib/public/default-config.js +6 -4
  54. package/lib/public/default-theme.js +6 -4
  55. package/lib/public/load-config.js +5 -3
  56. package/lib/public/resolve-config.js +6 -4
  57. package/lib/util/applyImportantSelector.js +7 -5
  58. package/lib/util/bigSign.js +3 -1
  59. package/lib/util/buildMediaQuery.js +3 -1
  60. package/lib/util/cloneDeep.js +3 -1
  61. package/lib/util/cloneNodes.js +36 -14
  62. package/lib/util/color.js +11 -7
  63. package/lib/util/colorNames.js +752 -0
  64. package/lib/util/configurePlugins.js +3 -1
  65. package/lib/util/createPlugin.js +3 -1
  66. package/lib/util/createUtilityPlugin.js +5 -3
  67. package/lib/util/dataTypes.js +180 -31
  68. package/lib/util/defaults.js +6 -4
  69. package/lib/util/escapeClassName.js +7 -5
  70. package/lib/util/escapeCommas.js +3 -1
  71. package/lib/util/flattenColorPalette.js +3 -1
  72. package/lib/util/formatVariantSelector.js +36 -21
  73. package/lib/util/getAllConfigs.js +6 -4
  74. package/lib/util/hashConfig.js +6 -4
  75. package/lib/util/isKeyframeRule.js +3 -1
  76. package/lib/util/isPlainObject.js +4 -2
  77. package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
  78. package/lib/util/log.js +8 -4
  79. package/lib/util/nameClass.js +12 -6
  80. package/lib/util/negateValue.js +3 -1
  81. package/lib/util/normalizeConfig.js +7 -5
  82. package/lib/util/normalizeScreens.js +12 -4
  83. package/lib/util/parseAnimationValue.js +3 -1
  84. package/lib/util/parseBoxShadowValue.js +6 -2
  85. package/lib/util/parseDependency.js +3 -1
  86. package/lib/util/parseGlob.js +6 -4
  87. package/lib/util/parseObjectStyles.js +9 -7
  88. package/lib/util/pluginUtils.js +43 -18
  89. package/lib/util/prefixSelector.js +6 -4
  90. package/lib/util/pseudoElements.js +24 -35
  91. package/lib/util/removeAlphaVariables.js +3 -1
  92. package/lib/util/resolveConfig.js +10 -8
  93. package/lib/util/resolveConfigPath.js +9 -5
  94. package/lib/util/responsive.js +6 -4
  95. package/lib/util/splitAtTopLevelOnly.js +3 -1
  96. package/lib/util/tap.js +3 -1
  97. package/lib/util/toColorValue.js +3 -1
  98. package/lib/util/toPath.js +3 -1
  99. package/lib/util/transformThemeValue.js +6 -4
  100. package/lib/util/validateConfig.js +5 -3
  101. package/lib/util/validateFormalSyntax.js +3 -1
  102. package/lib/util/withAlphaVariable.js +6 -2
  103. package/lib/value-parser/LICENSE +22 -0
  104. package/lib/value-parser/README.md +3 -0
  105. package/lib/value-parser/index.d.js +2 -0
  106. package/lib/value-parser/index.js +22 -0
  107. package/lib/value-parser/parse.js +259 -0
  108. package/lib/value-parser/stringify.js +38 -0
  109. package/lib/value-parser/unit.js +86 -0
  110. package/lib/value-parser/walk.js +16 -0
  111. package/nesting/index.d.ts +4 -0
  112. package/package.json +31 -36
  113. package/peers/index.js +65266 -48224
  114. package/resolveConfig.d.ts +22 -3
  115. package/scripts/generate-types.js +1 -2
  116. package/src/cli/build/plugin.js +7 -7
  117. package/src/cli/build/watching.js +1 -1
  118. package/src/cli.js +1 -1
  119. package/src/corePluginList.js +1 -1
  120. package/src/corePlugins.js +165 -29
  121. package/src/css/preflight.css +24 -8
  122. package/src/featureFlags.js +3 -8
  123. package/src/index.js +1 -5
  124. package/src/lib/content.js +42 -1
  125. package/src/lib/defaultExtractor.js +30 -17
  126. package/src/lib/evaluateTailwindFunctions.js +4 -1
  127. package/src/lib/expandApplyAtRules.js +7 -0
  128. package/src/lib/expandTailwindAtRules.js +26 -9
  129. package/src/lib/generateRules.js +50 -26
  130. package/src/lib/load-config.ts +8 -0
  131. package/src/lib/offsets.js +61 -2
  132. package/src/lib/resolveDefaultsAtRules.js +5 -1
  133. package/src/lib/setupContextUtils.js +77 -38
  134. package/src/lib/setupTrackingContext.js +2 -4
  135. package/src/lib/sharedState.js +0 -15
  136. package/src/oxide/cli/build/plugin.ts +7 -7
  137. package/src/plugin.js +4 -4
  138. package/src/processTailwindFeatures.js +3 -2
  139. package/src/util/cloneNodes.js +35 -14
  140. package/src/util/color.js +2 -2
  141. package/src/util/colorNames.js +150 -0
  142. package/src/util/dataTypes.js +143 -18
  143. package/src/util/formatVariantSelector.js +11 -3
  144. package/src/util/isPlainObject.js +1 -1
  145. package/src/util/pluginUtils.js +17 -5
  146. package/src/util/prefixSelector.js +1 -0
  147. package/src/util/pseudoElements.js +18 -17
  148. package/src/value-parser/LICENSE +22 -0
  149. package/src/value-parser/README.md +3 -0
  150. package/src/value-parser/index.d.ts +177 -0
  151. package/src/value-parser/index.js +28 -0
  152. package/src/value-parser/parse.js +303 -0
  153. package/src/value-parser/stringify.js +41 -0
  154. package/src/value-parser/unit.js +118 -0
  155. package/src/value-parser/walk.js +18 -0
  156. package/stubs/config.full.js +86 -14
  157. package/types/config.d.ts +17 -9
  158. package/types/generated/corePluginList.d.ts +1 -1
  159. package/types/generated/default-theme.d.ts +35 -9
  160. package/types/index.d.ts +7 -3
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  function createPlugin(plugin, config) {
10
12
  return {
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>createUtilityPlugin
7
+ get: function() {
8
+ return createUtilityPlugin;
9
+ }
8
10
  });
9
- const _transformThemeValue = /*#__PURE__*/ _interopRequireDefault(require("./transformThemeValue"));
10
- function _interopRequireDefault(obj) {
11
+ const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./transformThemeValue"));
12
+ function _interop_require_default(obj) {
11
13
  return obj && obj.__esModule ? obj : {
12
14
  default: obj
13
15
  };
@@ -9,21 +9,51 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- normalize: ()=>normalize,
13
- url: ()=>url,
14
- number: ()=>number,
15
- percentage: ()=>percentage,
16
- length: ()=>length,
17
- lineWidth: ()=>lineWidth,
18
- shadow: ()=>shadow,
19
- color: ()=>color,
20
- image: ()=>image,
21
- gradient: ()=>gradient,
22
- position: ()=>position,
23
- familyName: ()=>familyName,
24
- genericName: ()=>genericName,
25
- absoluteSize: ()=>absoluteSize,
26
- relativeSize: ()=>relativeSize
12
+ normalize: function() {
13
+ return normalize;
14
+ },
15
+ url: function() {
16
+ return url;
17
+ },
18
+ number: function() {
19
+ return number;
20
+ },
21
+ percentage: function() {
22
+ return percentage;
23
+ },
24
+ length: function() {
25
+ return length;
26
+ },
27
+ lineWidth: function() {
28
+ return lineWidth;
29
+ },
30
+ shadow: function() {
31
+ return shadow;
32
+ },
33
+ color: function() {
34
+ return color;
35
+ },
36
+ image: function() {
37
+ return image;
38
+ },
39
+ gradient: function() {
40
+ return gradient;
41
+ },
42
+ position: function() {
43
+ return position;
44
+ },
45
+ familyName: function() {
46
+ return familyName;
47
+ },
48
+ genericName: function() {
49
+ return genericName;
50
+ },
51
+ absoluteSize: function() {
52
+ return absoluteSize;
53
+ },
54
+ relativeSize: function() {
55
+ return relativeSize;
56
+ }
27
57
  });
28
58
  const _color = require("./color");
29
59
  const _parseBoxShadowValue = require("./parseBoxShadowValue");
@@ -38,10 +68,30 @@ let cssFunctions = [
38
68
  function isCSSFunction(value) {
39
69
  return cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.*\\)`).test(value));
40
70
  }
41
- const placeholder = "--tw-placeholder";
42
- const placeholderRe = new RegExp(placeholder, "g");
43
- function normalize(value, isRoot = true) {
44
- if (value.startsWith("--")) {
71
+ // These properties accept a `<dashed-ident>` as one of the values. This means that you can use them
72
+ // as: `timeline-scope: --tl;`
73
+ //
74
+ // Without the `var(--tl)`, in these cases we don't want to normalize the value, and you should add
75
+ // the `var()` yourself.
76
+ //
77
+ // More info:
78
+ // - https://drafts.csswg.org/scroll-animations/#propdef-timeline-scope
79
+ // - https://developer.mozilla.org/en-US/docs/Web/CSS/timeline-scope#dashed-ident
80
+ //
81
+ const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([
82
+ // Concrete properties
83
+ "scroll-timeline-name",
84
+ "timeline-scope",
85
+ "view-timeline-name",
86
+ "font-palette",
87
+ // Shorthand properties
88
+ "scroll-timeline",
89
+ "animation-timeline",
90
+ "view-timeline"
91
+ ]);
92
+ function normalize(value, context = null, isRoot = true) {
93
+ let isVarException = context && AUTO_VAR_INJECTION_EXCEPTIONS.has(context.property);
94
+ if (value.startsWith("--") && !isVarException) {
45
95
  return `var(${value})`;
46
96
  }
47
97
  // Keep raw strings if it starts with `url(`
@@ -50,7 +100,7 @@ function normalize(value, isRoot = true) {
50
100
  if (/^url\(.*?\)$/.test(part)) {
51
101
  return part;
52
102
  }
53
- return normalize(part, false);
103
+ return normalize(part, context, false);
54
104
  }).join("");
55
105
  }
56
106
  // Convert `_` to ` `, except for escaped underscores `\_`
@@ -59,17 +109,115 @@ function normalize(value, isRoot = true) {
59
109
  if (isRoot) {
60
110
  value = value.trim();
61
111
  }
62
- // Add spaces around operators inside math functions like calc() that do not follow an operator
63
- // or '('.
64
- value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
65
- let vars = [];
66
- return match.replace(/var\((--.+?)[,)]/g, (match, g1)=>{
67
- vars.push(g1);
68
- return match.replace(g1, placeholder);
69
- }).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(placeholderRe, ()=>vars.shift());
70
- });
112
+ value = normalizeMathOperatorSpacing(value);
71
113
  return value;
72
114
  }
115
+ /**
116
+ * Add spaces around operators inside math functions
117
+ * like calc() that do not follow an operator, '(', or `,`.
118
+ *
119
+ * @param {string} value
120
+ * @returns {string}
121
+ */ function normalizeMathOperatorSpacing(value) {
122
+ let preventFormattingInFunctions = [
123
+ "theme"
124
+ ];
125
+ let preventFormattingKeywords = [
126
+ "min-content",
127
+ "max-content",
128
+ "fit-content",
129
+ // Env
130
+ "safe-area-inset-top",
131
+ "safe-area-inset-right",
132
+ "safe-area-inset-bottom",
133
+ "safe-area-inset-left",
134
+ "titlebar-area-x",
135
+ "titlebar-area-y",
136
+ "titlebar-area-width",
137
+ "titlebar-area-height",
138
+ "keyboard-inset-top",
139
+ "keyboard-inset-right",
140
+ "keyboard-inset-bottom",
141
+ "keyboard-inset-left",
142
+ "keyboard-inset-width",
143
+ "keyboard-inset-height",
144
+ "radial-gradient",
145
+ "linear-gradient",
146
+ "conic-gradient",
147
+ "repeating-radial-gradient",
148
+ "repeating-linear-gradient",
149
+ "repeating-conic-gradient"
150
+ ];
151
+ return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
152
+ let result = "";
153
+ function lastChar() {
154
+ let char = result.trimEnd();
155
+ return char[char.length - 1];
156
+ }
157
+ for(let i = 0; i < match.length; i++){
158
+ function peek(word) {
159
+ return word.split("").every((char, j)=>match[i + j] === char);
160
+ }
161
+ function consumeUntil(chars) {
162
+ let minIndex = Infinity;
163
+ for (let char of chars){
164
+ let index = match.indexOf(char, i);
165
+ if (index !== -1 && index < minIndex) {
166
+ minIndex = index;
167
+ }
168
+ }
169
+ let result = match.slice(i, minIndex);
170
+ i += result.length - 1;
171
+ return result;
172
+ }
173
+ let char = match[i];
174
+ // Handle `var(--variable)`
175
+ if (peek("var")) {
176
+ // When we consume until `)`, then we are dealing with this scenario:
177
+ // `var(--example)`
178
+ //
179
+ // When we consume until `,`, then we are dealing with this scenario:
180
+ // `var(--example, 1rem)`
181
+ //
182
+ // In this case we do want to "format", the default value as well
183
+ result += consumeUntil([
184
+ ")",
185
+ ","
186
+ ]);
187
+ } else if (preventFormattingKeywords.some((keyword)=>peek(keyword))) {
188
+ let keyword = preventFormattingKeywords.find((keyword)=>peek(keyword));
189
+ result += keyword;
190
+ i += keyword.length - 1;
191
+ } else if (preventFormattingInFunctions.some((fn)=>peek(fn))) {
192
+ result += consumeUntil([
193
+ ")"
194
+ ]);
195
+ } else if (peek("[")) {
196
+ result += consumeUntil([
197
+ "]"
198
+ ]);
199
+ } else if ([
200
+ "+",
201
+ "-",
202
+ "*",
203
+ "/"
204
+ ].includes(char) && ![
205
+ "(",
206
+ "+",
207
+ "-",
208
+ "*",
209
+ "/",
210
+ ","
211
+ ].includes(lastChar())) {
212
+ result += ` ${char} `;
213
+ } else {
214
+ result += char;
215
+ }
216
+ }
217
+ // Simplify multiple spaces
218
+ return result.replace(/\s+/g, " ");
219
+ });
220
+ }
73
221
  function url(value) {
74
222
  return value.startsWith("url(");
75
223
  }
@@ -169,11 +317,12 @@ function image(value) {
169
317
  return images > 0;
170
318
  }
171
319
  let gradientTypes = new Set([
320
+ "conic-gradient",
172
321
  "linear-gradient",
173
322
  "radial-gradient",
323
+ "repeating-conic-gradient",
174
324
  "repeating-linear-gradient",
175
- "repeating-radial-gradient",
176
- "conic-gradient"
325
+ "repeating-radial-gradient"
177
326
  ]);
178
327
  function gradient(value) {
179
328
  value = normalize(value);
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "defaults", {
6
6
  enumerable: true,
7
- get: ()=>defaults
7
+ get: function() {
8
+ return defaults;
9
+ }
8
10
  });
9
11
  function defaults(target, ...sources) {
10
12
  for (let source of sources){
@@ -14,10 +16,10 @@ function defaults(target, ...sources) {
14
16
  target[k] = source[k];
15
17
  }
16
18
  }
17
- for (let k1 of Object.getOwnPropertySymbols(source)){
19
+ for (let k of Object.getOwnPropertySymbols(source)){
18
20
  var _target_hasOwnProperty1;
19
- if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k1))) {
20
- target[k1] = source[k1];
21
+ if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
22
+ target[k] = source[k];
21
23
  }
22
24
  }
23
25
  }
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>escapeClassName
7
+ get: function() {
8
+ return escapeClassName;
9
+ }
8
10
  });
9
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
10
- const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
11
- function _interopRequireDefault(obj) {
11
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
12
+ const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
15
17
  }
16
18
  function escapeClassName(className) {
17
19
  var _node_raws;
18
- let node = _postcssSelectorParser.default.className();
20
+ let node = _postcssselectorparser.default.className();
19
21
  node.value = className;
20
22
  var _node_raws_value;
21
23
  return (0, _escapeCommas.default)((_node_raws_value = node === null || node === void 0 ? void 0 : (_node_raws = node.raws) === null || _node_raws === void 0 ? void 0 : _node_raws.value) !== null && _node_raws_value !== void 0 ? _node_raws_value : node.value);
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>escapeCommas
7
+ get: function() {
8
+ return escapeCommas;
9
+ }
8
10
  });
9
11
  function escapeCommas(className) {
10
12
  return className.replace(/\\,/g, "\\2c ");
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
10
12
  [color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
@@ -9,39 +9,48 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- formatVariantSelector: ()=>formatVariantSelector,
13
- eliminateIrrelevantSelectors: ()=>eliminateIrrelevantSelectors,
14
- finalizeSelector: ()=>finalizeSelector,
15
- handleMergePseudo: ()=>handleMergePseudo
12
+ formatVariantSelector: function() {
13
+ return formatVariantSelector;
14
+ },
15
+ eliminateIrrelevantSelectors: function() {
16
+ return eliminateIrrelevantSelectors;
17
+ },
18
+ finalizeSelector: function() {
19
+ return finalizeSelector;
20
+ },
21
+ handleMergePseudo: function() {
22
+ return handleMergePseudo;
23
+ }
16
24
  });
17
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
18
- const _unesc = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc"));
19
- const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("../util/escapeClassName"));
20
- const _prefixSelector = /*#__PURE__*/ _interopRequireDefault(require("../util/prefixSelector"));
25
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
26
+ const _unesc = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser/dist/util/unesc"));
27
+ const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
28
+ const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
21
29
  const _pseudoElements = require("./pseudoElements");
22
- function _interopRequireDefault(obj) {
30
+ const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
31
+ function _interop_require_default(obj) {
23
32
  return obj && obj.__esModule ? obj : {
24
33
  default: obj
25
34
  };
26
35
  }
27
- /** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ /** @typedef {{format: string, isArbitraryVariant: boolean}[]} RawFormats */ /** @typedef {import('postcss-selector-parser').Root} ParsedFormats */ /** @typedef {RawFormats | ParsedFormats} AcceptedFormats */ let MERGE = ":merge";
36
+ /** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ /** @typedef {{format: string, respectPrefix: boolean}[]} RawFormats */ /** @typedef {import('postcss-selector-parser').Root} ParsedFormats */ /** @typedef {RawFormats | ParsedFormats} AcceptedFormats */ let MERGE = ":merge";
28
37
  function formatVariantSelector(formats, { context , candidate }) {
29
38
  var _context_tailwindConfig_prefix;
30
39
  let prefix = (_context_tailwindConfig_prefix = context === null || context === void 0 ? void 0 : context.tailwindConfig.prefix) !== null && _context_tailwindConfig_prefix !== void 0 ? _context_tailwindConfig_prefix : "";
31
40
  // Parse the format selector into an AST
32
41
  let parsedFormats = formats.map((format)=>{
33
- let ast = (0, _postcssSelectorParser.default)().astSync(format.format);
42
+ let ast = (0, _postcssselectorparser.default)().astSync(format.format);
34
43
  return {
35
44
  ...format,
36
- ast: format.isArbitraryVariant ? ast : (0, _prefixSelector.default)(prefix, ast)
45
+ ast: format.respectPrefix ? (0, _prefixSelector.default)(prefix, ast) : ast
37
46
  };
38
47
  });
39
48
  // We start with the candidate selector
40
- let formatAst = _postcssSelectorParser.default.root({
49
+ let formatAst = _postcssselectorparser.default.root({
41
50
  nodes: [
42
- _postcssSelectorParser.default.selector({
51
+ _postcssselectorparser.default.selector({
43
52
  nodes: [
44
- _postcssSelectorParser.default.className({
53
+ _postcssselectorparser.default.className({
45
54
  value: (0, _escapeClassName.default)(candidate)
46
55
  })
47
56
  ]
@@ -130,9 +139,9 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
130
139
  // │ │ │ ╰── We will not split here
131
140
  // ╰──┴─────┴─────────────── We will split here
132
141
  //
133
- base = base !== null && base !== void 0 ? base : candidate.split(new RegExp(`\\${separator}(?![^[]*\\])`)).pop();
142
+ base = base !== null && base !== void 0 ? base : (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(candidate, separator).pop();
134
143
  // Parse the selector into an AST
135
- let selector = (0, _postcssSelectorParser.default)().astSync(current);
144
+ let selector = (0, _postcssselectorparser.default)().astSync(current);
136
145
  // Normalize escaped classes, e.g.:
137
146
  //
138
147
  // The idea would be to replace the escaped `base` in the selector with the
@@ -151,6 +160,12 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
151
160
  });
152
161
  // Remove extraneous selectors that do not include the base candidate
153
162
  selector.each((sel)=>eliminateIrrelevantSelectors(sel, base));
163
+ // If ffter eliminating irrelevant selectors, we end up with nothing
164
+ // Then the whole "rule" this is associated with does not need to exist
165
+ // We use `null` as a marker value for that case
166
+ if (selector.length === 0) {
167
+ return null;
168
+ }
154
169
  // If there are no formats that means there were no variants added to the candidate
155
170
  // so we can just return the selector as-is
156
171
  let formatAst = Array.isArray(formats) ? formatVariantSelector(formats, {
@@ -160,10 +175,10 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
160
175
  if (formatAst === null) {
161
176
  return selector.toString();
162
177
  }
163
- let simpleStart = _postcssSelectorParser.default.comment({
178
+ let simpleStart = _postcssselectorparser.default.comment({
164
179
  value: "/*__simple__*/"
165
180
  });
166
- let simpleEnd = _postcssSelectorParser.default.comment({
181
+ let simpleEnd = _postcssselectorparser.default.comment({
167
182
  value: "/*__simple__*/"
168
183
  });
169
184
  // We can safely replace the escaped base now, since the `base` section is
@@ -189,7 +204,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
189
204
  // Re-sort the simple selector to ensure it's in the correct order
190
205
  simpleSelector = simpleSelectorForNode(simpleStart);
191
206
  let firstNode = parent.index(simpleStart);
192
- parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(_postcssSelectorParser.default.selector({
207
+ parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(_postcssselectorparser.default.selector({
193
208
  nodes: simpleSelector
194
209
  })).nodes);
195
210
  simpleStart.remove();
@@ -236,7 +251,7 @@ function handleMergePseudo(selector, format) {
236
251
  next = next.next();
237
252
  }
238
253
  let combinator = next;
239
- existing.pseudo.parent.insertAfter(existing.pseudo, _postcssSelectorParser.default.selector({
254
+ existing.pseudo.parent.insertAfter(existing.pseudo, _postcssselectorparser.default.selector({
240
255
  nodes: attachments.map((node)=>node.clone())
241
256
  }));
242
257
  pseudo.remove();
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>getAllConfigs
7
+ get: function() {
8
+ return getAllConfigs;
9
+ }
8
10
  });
9
- const _configFullJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/config.full.js"));
11
+ const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
10
12
  const _featureFlags = require("../featureFlags");
11
- function _interopRequireDefault(obj) {
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -16,7 +18,7 @@ function _interopRequireDefault(obj) {
16
18
  function getAllConfigs(config) {
17
19
  var _config_presets;
18
20
  const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
19
- _configFullJs.default
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...
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>hashConfig
7
+ get: function() {
8
+ return hashConfig;
9
+ }
8
10
  });
9
- const _objectHash = /*#__PURE__*/ _interopRequireDefault(require("object-hash"));
10
- function _interopRequireDefault(obj) {
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, _objectHash.default)(config, {
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: ()=>isKeyframeRule
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,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>isPlainObject
7
+ get: function() {
8
+ return isPlainObject;
9
+ }
8
10
  });
9
11
  function isPlainObject(value) {
10
12
  if (Object.prototype.toString.call(value) !== "[object Object]") {
11
13
  return false;
12
14
  }
13
15
  const prototype = Object.getPrototypeOf(value);
14
- return prototype === null || prototype === Object.prototype;
16
+ return prototype === null || Object.getPrototypeOf(prototype) === null;
15
17
  }
@@ -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: ()=>isSyntacticallyValidPropertyValue
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: ()=>dim,
13
- default: ()=>_default
12
+ dim: function() {
13
+ return dim;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
14
18
  });
15
- const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
16
- function _interopRequireDefault(obj) {
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
  };
@@ -9,13 +9,19 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- asClass: ()=>asClass,
13
- default: ()=>nameClass,
14
- formatClass: ()=>formatClass
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__*/ _interopRequireDefault(require("./escapeClassName"));
17
- const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
18
- 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) {
19
25
  return obj && obj.__esModule ? obj : {
20
26
  default: obj
21
27
  };
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>negateValue
7
+ get: function() {
8
+ return negateValue;
9
+ }
8
10
  });
9
11
  function negateValue(value) {
10
12
  value = `${value}`;
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "normalizeConfig", {
6
6
  enumerable: true,
7
- get: ()=>normalizeConfig
7
+ get: function() {
8
+ return normalizeConfig;
9
+ }
8
10
  });
9
11
  const _featureFlags = require("../featureFlags");
10
- const _log = /*#__PURE__*/ _interopRequireWildcard(require("./log"));
12
+ const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
11
13
  function _getRequireWildcardCache(nodeInterop) {
12
14
  if (typeof WeakMap !== "function") return null;
13
15
  var cacheBabelInterop = new WeakMap();
@@ -16,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) {
16
18
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
17
19
  })(nodeInterop);
18
20
  }
19
- function _interopRequireWildcard(obj, nodeInterop) {
21
+ function _interop_require_wildcard(obj, nodeInterop) {
20
22
  if (!nodeInterop && obj && obj.__esModule) {
21
23
  return obj;
22
24
  }
@@ -129,8 +131,8 @@ function normalizeConfig(config) {
129
131
  }
130
132
  // `config.content.transform` is optional, and can be a Function or a Record<String, Function>
131
133
  if (typeof config.content.transform === "object") {
132
- for (let value1 of Object.values(config.content.transform)){
133
- if (typeof value1 !== "function") {
134
+ for (let value of Object.values(config.content.transform)){
135
+ if (typeof value !== "function") {
134
136
  return false;
135
137
  }
136
138
  }