tailwindcss 0.0.0-oxide-insiders.dddaded → 0.0.0-oxide-insiders.b2e3cf2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/build/deps.js +10 -18
- package/lib/cli/build/index.js +10 -41
- package/lib/cli/build/plugin.js +87 -268
- package/lib/cli/build/utils.js +18 -40
- package/lib/cli/build/watching.js +35 -151
- package/lib/cli/help/index.js +15 -58
- package/lib/cli/index.js +61 -120
- package/lib/cli/init/index.js +21 -43
- package/lib/cli-peer-dependencies.js +13 -15
- package/lib/cli.js +1 -5
- package/lib/corePluginList.js +3 -4
- package/lib/corePlugins.js +394 -857
- package/lib/featureFlags.js +14 -34
- package/lib/index.js +1 -5
- package/lib/lib/cacheInvalidation.js +29 -75
- package/lib/lib/collapseAdjacentRules.js +22 -43
- package/lib/lib/collapseDuplicateDeclarations.js +27 -68
- package/lib/lib/content.js +37 -126
- package/lib/lib/defaultExtractor.js +96 -199
- package/lib/lib/detectNesting.js +12 -36
- package/lib/lib/evaluateTailwindFunctions.js +101 -188
- package/lib/lib/expandApplyAtRules.js +177 -482
- package/lib/lib/expandTailwindAtRules.js +69 -237
- package/lib/lib/findAtConfigPath.js +13 -30
- package/lib/lib/generateRules.js +349 -765
- package/lib/lib/getModuleDependencies.js +27 -63
- package/lib/lib/load-config.js +16 -24
- package/lib/lib/normalizeTailwindDirectives.js +26 -70
- package/lib/lib/offsets.js +61 -224
- package/lib/lib/partitionApplyAtRules.js +29 -51
- package/lib/lib/regex.js +22 -30
- package/lib/lib/remap-bitfield.js +9 -84
- package/lib/lib/resolveDefaultsAtRules.js +50 -116
- package/lib/lib/setupContextUtils.js +576 -1099
- package/lib/lib/setupTrackingContext.js +54 -143
- package/lib/lib/sharedState.js +15 -59
- package/lib/lib/substituteScreenAtRules.js +8 -16
- package/lib/oxide/cli/build/deps.js +17 -32
- package/lib/oxide/cli/build/index.js +10 -40
- package/lib/oxide/cli/build/plugin.js +87 -267
- package/lib/oxide/cli/build/utils.js +18 -39
- package/lib/oxide/cli/build/watching.js +34 -149
- package/lib/oxide/cli/help/index.js +15 -57
- package/lib/oxide/cli/index.js +66 -127
- package/lib/oxide/cli/init/index.js +17 -36
- package/lib/oxide/cli.js +2 -3
- package/lib/plugin.js +30 -57
- package/lib/postcss-plugins/nesting/index.js +6 -10
- package/lib/postcss-plugins/nesting/plugin.js +17 -60
- package/lib/processTailwindFeatures.js +8 -37
- package/lib/public/colors.js +15 -22
- package/lib/public/create-plugin.js +5 -8
- package/lib/public/default-config.js +5 -9
- package/lib/public/default-theme.js +5 -9
- package/lib/public/load-config.js +4 -6
- package/lib/public/resolve-config.js +4 -6
- package/lib/util/applyImportantSelector.js +15 -24
- package/lib/util/bigSign.js +6 -7
- package/lib/util/buildMediaQuery.js +10 -17
- package/lib/util/cloneDeep.js +9 -17
- package/lib/util/cloneNodes.js +14 -27
- package/lib/util/color.js +45 -81
- package/lib/util/configurePlugins.js +9 -16
- package/lib/util/createPlugin.js +8 -15
- package/lib/util/createUtilityPlugin.js +15 -27
- package/lib/util/dataTypes.js +23 -144
- package/lib/util/defaults.js +9 -19
- package/lib/util/escapeClassName.js +6 -10
- package/lib/util/escapeCommas.js +6 -7
- package/lib/util/flattenColorPalette.js +6 -8
- package/lib/util/formatVariantSelector.js +49 -190
- package/lib/util/getAllConfigs.js +35 -42
- package/lib/util/hashConfig.js +6 -8
- package/lib/util/isKeyframeRule.js +6 -7
- package/lib/util/isPlainObject.js +8 -11
- package/lib/util/isSyntacticallyValidPropertyValue.js +13 -42
- package/lib/util/log.js +7 -14
- package/lib/util/nameClass.js +6 -21
- package/lib/util/negateValue.js +10 -26
- package/lib/util/normalizeConfig.js +63 -240
- package/lib/util/normalizeScreens.js +70 -137
- package/lib/util/parseAnimationValue.js +13 -61
- package/lib/util/parseBoxShadowValue.js +12 -57
- package/lib/util/parseDependency.js +13 -37
- package/lib/util/parseGlob.js +7 -22
- package/lib/util/parseObjectStyles.js +17 -26
- package/lib/util/pluginUtils.js +69 -176
- package/lib/util/prefixSelector.js +11 -28
- package/lib/util/pseudoElements.js +29 -105
- package/lib/util/removeAlphaVariables.js +8 -21
- package/lib/util/resolveConfig.js +103 -220
- package/lib/util/resolveConfigPath.js +12 -38
- package/lib/util/responsive.js +4 -6
- package/lib/util/splitAtTopLevelOnly.js +10 -44
- package/lib/util/tap.js +6 -8
- package/lib/util/toColorValue.js +6 -7
- package/lib/util/toPath.js +8 -26
- package/lib/util/transformThemeValue.js +12 -45
- package/lib/util/validateConfig.js +14 -22
- package/lib/util/validateFormalSyntax.js +5 -11
- package/lib/util/withAlphaVariable.js +28 -48
- package/package.json +3 -3
- package/peers/index.js +14 -16
- package/src/cli/build/plugin.js +1 -1
- package/src/cli.js +1 -1
- package/src/corePlugins.js +16 -17
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/expandTailwindAtRules.js +2 -2
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +1 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
7
6
|
get: ()=>_default
|
|
8
7
|
});
|
|
9
|
-
const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(
|
|
10
|
-
[color + (
|
|
8
|
+
const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(null != colors ? colors : {}).flatMap(([color, values])=>"object" == typeof values ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
|
|
9
|
+
[color + ("DEFAULT" === number ? "" : `-${number}`)]: hex
|
|
11
10
|
})) : [
|
|
12
11
|
{
|
|
13
12
|
[`${color}`]: values
|
|
14
13
|
}
|
|
15
|
-
]));
|
|
16
|
-
const _default = flattenColorPalette;
|
|
14
|
+
])), _default = flattenColorPalette;
|
|
@@ -1,43 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
function _export(target, all) {
|
|
3
|
+
value: !0
|
|
4
|
+
}), function(target, all) {
|
|
6
5
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable:
|
|
6
|
+
enumerable: !0,
|
|
8
7
|
get: all[name]
|
|
9
8
|
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
9
|
+
}(exports, {
|
|
12
10
|
formatVariantSelector: ()=>formatVariantSelector,
|
|
13
11
|
eliminateIrrelevantSelectors: ()=>eliminateIrrelevantSelectors,
|
|
14
12
|
finalizeSelector: ()=>finalizeSelector,
|
|
15
13
|
handleMergePseudo: ()=>handleMergePseudo
|
|
16
14
|
});
|
|
17
|
-
const _postcssSelectorParser =
|
|
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"));
|
|
21
|
-
const _pseudoElements = require("./pseudoElements");
|
|
15
|
+
const _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser")), _unesc = _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc")), _escapeClassName = _interopRequireDefault(require("../util/escapeClassName")), _prefixSelector = _interopRequireDefault(require("../util/prefixSelector")), _pseudoElements = require("./pseudoElements");
|
|
22
16
|
function _interopRequireDefault(obj) {
|
|
23
17
|
return obj && obj.__esModule ? obj : {
|
|
24
18
|
default: obj
|
|
25
19
|
};
|
|
26
20
|
}
|
|
27
|
-
|
|
21
|
+
let MERGE = ":merge";
|
|
28
22
|
function formatVariantSelector(formats, { context , candidate }) {
|
|
29
23
|
var _context_tailwindConfig_prefix;
|
|
30
|
-
let prefix = (_context_tailwindConfig_prefix =
|
|
31
|
-
// Parse the format selector into an AST
|
|
32
|
-
let parsedFormats = formats.map((format)=>{
|
|
24
|
+
let prefix = null !== (_context_tailwindConfig_prefix = null == context ? void 0 : context.tailwindConfig.prefix) && void 0 !== _context_tailwindConfig_prefix ? _context_tailwindConfig_prefix : "", parsedFormats = formats.map((format)=>{
|
|
33
25
|
let ast = (0, _postcssSelectorParser.default)().astSync(format.format);
|
|
34
26
|
return {
|
|
35
27
|
...format,
|
|
36
28
|
ast: format.isArbitraryVariant ? ast : (0, _prefixSelector.default)(prefix, ast)
|
|
37
29
|
};
|
|
38
|
-
})
|
|
39
|
-
// We start with the candidate selector
|
|
40
|
-
let formatAst = _postcssSelectorParser.default.root({
|
|
30
|
+
}), formatAst = _postcssSelectorParser.default.root({
|
|
41
31
|
nodes: [
|
|
42
32
|
_postcssSelectorParser.default.selector({
|
|
43
33
|
nodes: [
|
|
@@ -48,207 +38,76 @@ function formatVariantSelector(formats, { context , candidate }) {
|
|
|
48
38
|
})
|
|
49
39
|
]
|
|
50
40
|
});
|
|
51
|
-
|
|
52
|
-
for (let { ast } of parsedFormats){
|
|
53
|
-
[formatAst, ast] = handleMergePseudo(formatAst, ast);
|
|
54
|
-
// 2. Merge the format selector into the current selector AST
|
|
55
|
-
ast.walkNesting((nesting)=>nesting.replaceWith(...formatAst.nodes[0].nodes));
|
|
56
|
-
// 3. Keep going!
|
|
57
|
-
formatAst = ast;
|
|
58
|
-
}
|
|
41
|
+
for (let { ast } of parsedFormats)[formatAst, ast] = handleMergePseudo(formatAst, ast), ast.walkNesting((nesting)=>nesting.replaceWith(...formatAst.nodes[0].nodes)), formatAst = ast;
|
|
59
42
|
return formatAst;
|
|
60
43
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* inside the relevant node and won't be picked up so they're fine to ignore
|
|
66
|
-
*
|
|
67
|
-
* @param {Node} node
|
|
68
|
-
* @returns {Node[]}
|
|
69
|
-
**/ function simpleSelectorForNode(node) {
|
|
70
|
-
/** @type {Node[]} */ let nodes = [];
|
|
71
|
-
// Walk backwards until we hit a combinator node (or the start)
|
|
72
|
-
while(node.prev() && node.prev().type !== "combinator"){
|
|
73
|
-
node = node.prev();
|
|
74
|
-
}
|
|
75
|
-
// Now record all non-combinator nodes until we hit one (or the end)
|
|
76
|
-
while(node && node.type !== "combinator"){
|
|
77
|
-
nodes.push(node);
|
|
78
|
-
node = node.next();
|
|
79
|
-
}
|
|
44
|
+
function simpleSelectorForNode(node) {
|
|
45
|
+
let nodes = [];
|
|
46
|
+
for(; node.prev() && "combinator" !== node.prev().type;)node = node.prev();
|
|
47
|
+
for(; node && "combinator" !== node.type;)nodes.push(node), node = node.next();
|
|
80
48
|
return nodes;
|
|
81
49
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Resorts the nodes in a selector to ensure they're in the correct order
|
|
84
|
-
* Tags go before classes, and pseudo classes go after classes
|
|
85
|
-
*
|
|
86
|
-
* @param {Selector} sel
|
|
87
|
-
* @returns {Selector}
|
|
88
|
-
**/ function resortSelector(sel) {
|
|
89
|
-
sel.sort((a, b)=>{
|
|
90
|
-
if (a.type === "tag" && b.type === "class") {
|
|
91
|
-
return -1;
|
|
92
|
-
} else if (a.type === "class" && b.type === "tag") {
|
|
93
|
-
return 1;
|
|
94
|
-
} else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) {
|
|
95
|
-
return -1;
|
|
96
|
-
} else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") {
|
|
97
|
-
return 1;
|
|
98
|
-
}
|
|
99
|
-
return sel.index(a) - sel.index(b);
|
|
100
|
-
});
|
|
101
|
-
return sel;
|
|
102
|
-
}
|
|
103
50
|
function eliminateIrrelevantSelectors(sel, base) {
|
|
104
|
-
let hasClassesMatchingCandidate =
|
|
51
|
+
let hasClassesMatchingCandidate = !1;
|
|
105
52
|
sel.walk((child)=>{
|
|
106
|
-
if (child.type
|
|
107
|
-
|
|
108
|
-
return false // Stop walking
|
|
109
|
-
;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
if (!hasClassesMatchingCandidate) {
|
|
113
|
-
sel.remove();
|
|
114
|
-
}
|
|
115
|
-
// We do NOT recursively eliminate sub selectors that don't have the base class
|
|
116
|
-
// as this is NOT a safe operation. For example, if we have:
|
|
117
|
-
// `.space-x-2 > :not([hidden]) ~ :not([hidden])`
|
|
118
|
-
// We cannot remove the [hidden] from the :not() because it would change the
|
|
119
|
-
// meaning of the selector.
|
|
120
|
-
// TODO: Can we do this for :matches, :is, and :where?
|
|
53
|
+
if ("class" === child.type && child.value === base) return hasClassesMatchingCandidate = !0, !1;
|
|
54
|
+
}), hasClassesMatchingCandidate || sel.remove();
|
|
121
55
|
}
|
|
122
56
|
function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
123
|
-
var _context_tailwindConfig;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// Split by the separator, but ignore the separator inside square brackets:
|
|
127
|
-
//
|
|
128
|
-
// E.g.: dark:lg:hover:[paint-order:markers]
|
|
129
|
-
// ┬ ┬ ┬ ┬
|
|
130
|
-
// │ │ │ ╰── We will not split here
|
|
131
|
-
// ╰──┴─────┴─────────────── We will split here
|
|
132
|
-
//
|
|
133
|
-
base = base !== null && base !== void 0 ? base : candidate.split(new RegExp(`\\${separator}(?![^[]*\\])`)).pop();
|
|
134
|
-
// Parse the selector into an AST
|
|
57
|
+
var _context_tailwindConfig, _context_tailwindConfig_separator;
|
|
58
|
+
let separator = null !== (_context_tailwindConfig_separator = null == context ? void 0 : null === (_context_tailwindConfig = context.tailwindConfig) || void 0 === _context_tailwindConfig ? void 0 : _context_tailwindConfig.separator) && void 0 !== _context_tailwindConfig_separator ? _context_tailwindConfig_separator : ":";
|
|
59
|
+
base = null != base ? base : candidate.split(RegExp(`\\${separator}(?![^[]*\\])`)).pop();
|
|
135
60
|
let selector = (0, _postcssSelectorParser.default)().astSync(current);
|
|
136
|
-
// Normalize escaped classes, e.g.:
|
|
137
|
-
//
|
|
138
|
-
// The idea would be to replace the escaped `base` in the selector with the
|
|
139
|
-
// `format`. However, in css you can escape the same selector in a few
|
|
140
|
-
// different ways. This would result in different strings and therefore we
|
|
141
|
-
// can't replace it properly.
|
|
142
|
-
//
|
|
143
|
-
// base: bg-[rgb(255,0,0)]
|
|
144
|
-
// base in selector: bg-\\[rgb\\(255\\,0\\,0\\)\\]
|
|
145
|
-
// escaped base: bg-\\[rgb\\(255\\2c 0\\2c 0\\)\\]
|
|
146
|
-
//
|
|
147
61
|
selector.walkClasses((node)=>{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
// Remove extraneous selectors that do not include the base candidate
|
|
153
|
-
selector.each((sel)=>eliminateIrrelevantSelectors(sel, base));
|
|
154
|
-
// If there are no formats that means there were no variants added to the candidate
|
|
155
|
-
// so we can just return the selector as-is
|
|
62
|
+
node.raws && node.value.includes(base) && (node.raws.value = (0, _escapeClassName.default)((0, _unesc.default)(node.raws.value)));
|
|
63
|
+
}), selector.each((sel)=>eliminateIrrelevantSelectors(sel, base));
|
|
156
64
|
let formatAst = Array.isArray(formats) ? formatVariantSelector(formats, {
|
|
157
65
|
context,
|
|
158
66
|
candidate
|
|
159
67
|
}) : formats;
|
|
160
|
-
if (
|
|
161
|
-
return selector.toString();
|
|
162
|
-
}
|
|
68
|
+
if (null === formatAst) return selector.toString();
|
|
163
69
|
let simpleStart = _postcssSelectorParser.default.comment({
|
|
164
70
|
value: "/*__simple__*/"
|
|
165
|
-
})
|
|
166
|
-
let simpleEnd = _postcssSelectorParser.default.comment({
|
|
71
|
+
}), simpleEnd = _postcssSelectorParser.default.comment({
|
|
167
72
|
value: "/*__simple__*/"
|
|
168
73
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
let parent = node.parent;
|
|
176
|
-
let formatNodes = formatAst.nodes[0].nodes;
|
|
177
|
-
// Perf optimization: if the parent is a single class we can just replace it and be done
|
|
178
|
-
if (parent.nodes.length === 1) {
|
|
74
|
+
return selector.walkClasses((node)=>{
|
|
75
|
+
var sel;
|
|
76
|
+
if (node.value !== base) return;
|
|
77
|
+
let parent = node.parent, formatNodes = formatAst.nodes[0].nodes;
|
|
78
|
+
if (1 === parent.nodes.length) {
|
|
179
79
|
node.replaceWith(...formatNodes);
|
|
180
80
|
return;
|
|
181
81
|
}
|
|
182
82
|
let simpleSelector = simpleSelectorForNode(node);
|
|
183
|
-
parent.insertBefore(simpleSelector[0], simpleStart);
|
|
184
|
-
|
|
185
|
-
for (let child of formatNodes){
|
|
186
|
-
parent.insertBefore(simpleSelector[0], child.clone());
|
|
187
|
-
}
|
|
188
|
-
node.remove();
|
|
189
|
-
// Re-sort the simple selector to ensure it's in the correct order
|
|
190
|
-
simpleSelector = simpleSelectorForNode(simpleStart);
|
|
83
|
+
for (let child of (parent.insertBefore(simpleSelector[0], simpleStart), parent.insertAfter(simpleSelector[simpleSelector.length - 1], simpleEnd), formatNodes))parent.insertBefore(simpleSelector[0], child.clone());
|
|
84
|
+
node.remove(), simpleSelector = simpleSelectorForNode(simpleStart);
|
|
191
85
|
let firstNode = parent.index(simpleStart);
|
|
192
|
-
parent.nodes.splice(firstNode, simpleSelector.length, ...
|
|
86
|
+
parent.nodes.splice(firstNode, simpleSelector.length, ...((sel = _postcssSelectorParser.default.selector({
|
|
193
87
|
nodes: simpleSelector
|
|
194
|
-
})).nodes);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
});
|
|
198
|
-
// Remove unnecessary pseudo selectors that we used as placeholders
|
|
199
|
-
selector.walkPseudos((p)=>{
|
|
200
|
-
if (p.value === MERGE) {
|
|
201
|
-
p.replaceWith(p.nodes);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
// Move pseudo elements to the end of the selector (if necessary)
|
|
205
|
-
selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
|
|
206
|
-
return selector.toString();
|
|
88
|
+
})).sort((a, b)=>"tag" === a.type && "class" === b.type ? -1 : "class" === a.type && "tag" === b.type ? 1 : "class" === a.type && "pseudo" === b.type && b.value.startsWith("::") ? -1 : "pseudo" === a.type && a.value.startsWith("::") && "class" === b.type ? 1 : sel.index(a) - sel.index(b)), sel).nodes), simpleStart.remove(), simpleEnd.remove();
|
|
89
|
+
}), selector.walkPseudos((p)=>{
|
|
90
|
+
p.value === MERGE && p.replaceWith(p.nodes);
|
|
91
|
+
}), selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel)), selector.toString();
|
|
207
92
|
}
|
|
208
93
|
function handleMergePseudo(selector, format) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (pseudo.value !== MERGE) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
let value = pseudo.nodes[0].toString();
|
|
225
|
-
// Does `selector` contain a :merge() pseudo-class with the same value?
|
|
226
|
-
let existing = merges.find((merge)=>merge.value === value);
|
|
227
|
-
// Nope so there's nothing to do
|
|
228
|
-
if (!existing) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
// Everything after `:merge()` up to the next combinator is what is attached to the merged selector
|
|
232
|
-
let attachments = [];
|
|
233
|
-
let next = pseudo.next();
|
|
234
|
-
while(next && next.type !== "combinator"){
|
|
235
|
-
attachments.push(next);
|
|
236
|
-
next = next.next();
|
|
237
|
-
}
|
|
94
|
+
let merges = [];
|
|
95
|
+
return selector.walkPseudos((pseudo)=>{
|
|
96
|
+
pseudo.value === MERGE && merges.push({
|
|
97
|
+
pseudo,
|
|
98
|
+
value: pseudo.nodes[0].toString()
|
|
99
|
+
});
|
|
100
|
+
}), format.walkPseudos((pseudo)=>{
|
|
101
|
+
if (pseudo.value !== MERGE) return;
|
|
102
|
+
let value = pseudo.nodes[0].toString(), existing = merges.find((merge)=>merge.value === value);
|
|
103
|
+
if (!existing) return;
|
|
104
|
+
let attachments = [], next = pseudo.next();
|
|
105
|
+
for(; next && "combinator" !== next.type;)attachments.push(next), next = next.next();
|
|
238
106
|
let combinator = next;
|
|
239
107
|
existing.pseudo.parent.insertAfter(existing.pseudo, _postcssSelectorParser.default.selector({
|
|
240
108
|
nodes: attachments.map((node)=>node.clone())
|
|
241
|
-
}));
|
|
242
|
-
|
|
243
|
-
attachments.forEach((node)=>node.remove());
|
|
244
|
-
// What about this case:
|
|
245
|
-
// :merge(.group):focus > &
|
|
246
|
-
// :merge(.group):hover &
|
|
247
|
-
if (combinator && combinator.type === "combinator") {
|
|
248
|
-
combinator.remove();
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
return [
|
|
109
|
+
})), pseudo.remove(), attachments.forEach((node)=>node.remove()), combinator && "combinator" === combinator.type && combinator.remove();
|
|
110
|
+
}), [
|
|
252
111
|
selector,
|
|
253
112
|
format
|
|
254
113
|
];
|
|
@@ -1,48 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
6
|
+
get: ()=>function getAllConfigs(config) {
|
|
7
|
+
var _config_presets;
|
|
8
|
+
let configs = (null !== (_config_presets = null == config ? void 0 : config.presets) && void 0 !== _config_presets ? _config_presets : [
|
|
9
|
+
_configFullJs.default
|
|
10
|
+
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset)), features = {
|
|
11
|
+
respectDefaultRingColorOpacity: {
|
|
12
|
+
theme: {
|
|
13
|
+
ringColor: ({ theme })=>({
|
|
14
|
+
DEFAULT: "#3b82f67f",
|
|
15
|
+
...theme("colors")
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
disableColorOpacityUtilitiesByDefault: {
|
|
20
|
+
corePlugins: {
|
|
21
|
+
backgroundOpacity: !1,
|
|
22
|
+
borderOpacity: !1,
|
|
23
|
+
divideOpacity: !1,
|
|
24
|
+
placeholderOpacity: !1,
|
|
25
|
+
ringOpacity: !1,
|
|
26
|
+
textOpacity: !1
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
|
|
30
|
+
return [
|
|
31
|
+
config,
|
|
32
|
+
...experimentals,
|
|
33
|
+
...configs
|
|
34
|
+
];
|
|
35
|
+
}
|
|
8
36
|
});
|
|
9
|
-
const _configFullJs =
|
|
10
|
-
const _featureFlags = require("../featureFlags");
|
|
11
|
-
function _interopRequireDefault(obj) {
|
|
37
|
+
const _configFullJs = function(obj) {
|
|
12
38
|
return obj && obj.__esModule ? obj : {
|
|
13
39
|
default: obj
|
|
14
40
|
};
|
|
15
|
-
}
|
|
16
|
-
function getAllConfigs(config) {
|
|
17
|
-
var _config_presets;
|
|
18
|
-
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
|
|
19
|
-
_configFullJs.default
|
|
20
|
-
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
|
21
|
-
const features = {
|
|
22
|
-
// Add experimental configs here...
|
|
23
|
-
respectDefaultRingColorOpacity: {
|
|
24
|
-
theme: {
|
|
25
|
-
ringColor: ({ theme })=>({
|
|
26
|
-
DEFAULT: "#3b82f67f",
|
|
27
|
-
...theme("colors")
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
disableColorOpacityUtilitiesByDefault: {
|
|
32
|
-
corePlugins: {
|
|
33
|
-
backgroundOpacity: false,
|
|
34
|
-
borderOpacity: false,
|
|
35
|
-
divideOpacity: false,
|
|
36
|
-
placeholderOpacity: false,
|
|
37
|
-
ringOpacity: false,
|
|
38
|
-
textOpacity: false
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
|
|
43
|
-
return [
|
|
44
|
-
config,
|
|
45
|
-
...experimentals,
|
|
46
|
-
...configs
|
|
47
|
-
];
|
|
48
|
-
}
|
|
41
|
+
}(require("../../stubs/config.full.js")), _featureFlags = require("../featureFlags");
|
package/lib/util/hashConfig.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
7
6
|
get: ()=>hashConfig
|
|
8
7
|
});
|
|
9
|
-
const _objectHash =
|
|
10
|
-
function _interopRequireDefault(obj) {
|
|
8
|
+
const _objectHash = function(obj) {
|
|
11
9
|
return obj && obj.__esModule ? obj : {
|
|
12
10
|
default: obj
|
|
13
11
|
};
|
|
14
|
-
}
|
|
12
|
+
}(require("object-hash"));
|
|
15
13
|
function hashConfig(config) {
|
|
16
14
|
return (0, _objectHash.default)(config, {
|
|
17
|
-
ignoreUnknown:
|
|
15
|
+
ignoreUnknown: !0
|
|
18
16
|
});
|
|
19
17
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
function isKeyframeRule(rule) {
|
|
3
|
+
return rule.parent && "atrule" === rule.parent.type && /keyframes$/.test(rule.parent.name);
|
|
4
|
+
}
|
|
2
5
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
6
|
+
value: !0
|
|
7
|
+
}), Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: !0,
|
|
7
9
|
get: ()=>isKeyframeRule
|
|
8
10
|
});
|
|
9
|
-
function isKeyframeRule(rule) {
|
|
10
|
-
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
|
11
|
-
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if ("[object Object]" !== Object.prototype.toString.call(value)) return !1;
|
|
4
|
+
let prototype = Object.getPrototypeOf(value);
|
|
5
|
+
return null === prototype || prototype === Object.prototype;
|
|
6
|
+
}
|
|
2
7
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
8
|
+
value: !0
|
|
9
|
+
}), Object.defineProperty(exports, "default", {
|
|
10
|
+
enumerable: !0,
|
|
7
11
|
get: ()=>isPlainObject
|
|
8
12
|
});
|
|
9
|
-
function isPlainObject(value) {
|
|
10
|
-
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
const prototype = Object.getPrototypeOf(value);
|
|
14
|
-
return prototype === null || prototype === Object.prototype;
|
|
15
|
-
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
// values don't count, and brackets inside quotes also don't count.
|
|
7
|
-
//
|
|
8
|
-
// E.g.: w-[this-is]w-[weird-and-invalid]
|
|
9
|
-
// E.g.: w-[this-is\\]w-\\[weird-but-valid]
|
|
10
|
-
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
|
11
|
-
"default", {
|
|
12
|
-
enumerable: true,
|
|
3
|
+
value: !0
|
|
4
|
+
}), Object.defineProperty(exports, "default", {
|
|
5
|
+
enumerable: !0,
|
|
13
6
|
get: ()=>isSyntacticallyValidPropertyValue
|
|
14
7
|
});
|
|
15
8
|
let matchingBrackets = new Map([
|
|
@@ -25,48 +18,26 @@ let matchingBrackets = new Map([
|
|
|
25
18
|
"(",
|
|
26
19
|
")"
|
|
27
20
|
]
|
|
28
|
-
])
|
|
29
|
-
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
|
21
|
+
]), inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
|
30
22
|
v,
|
|
31
23
|
k
|
|
32
|
-
]))
|
|
33
|
-
let quotes = new Set([
|
|
24
|
+
])), quotes = new Set([
|
|
34
25
|
'"',
|
|
35
26
|
"'",
|
|
36
27
|
"`"
|
|
37
28
|
]);
|
|
38
29
|
function isSyntacticallyValidPropertyValue(value) {
|
|
39
|
-
let stack = [];
|
|
40
|
-
let inQuotes = false;
|
|
30
|
+
let stack = [], inQuotes = !1;
|
|
41
31
|
for(let i = 0; i < value.length; i++){
|
|
42
32
|
let char = value[i];
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
if (inQuotes) continue;
|
|
51
|
-
if (value[i - 1] === "\\") continue; // Escaped
|
|
52
|
-
if (matchingBrackets.has(char)) {
|
|
53
|
-
stack.push(char);
|
|
54
|
-
} else if (inverseMatchingBrackets.has(char)) {
|
|
55
|
-
let inverse = inverseMatchingBrackets.get(char);
|
|
56
|
-
// Nothing to pop from, therefore it is unbalanced
|
|
57
|
-
if (stack.length <= 0) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
// Popped value must match the inverse value, otherwise it is unbalanced
|
|
61
|
-
if (stack.pop() !== inverse) {
|
|
62
|
-
return false;
|
|
33
|
+
if (":" === char && !inQuotes && 0 === stack.length) return !1;
|
|
34
|
+
if (quotes.has(char) && "\\" !== value[i - 1] && (inQuotes = !inQuotes), !inQuotes && "\\" !== value[i - 1]) {
|
|
35
|
+
if (matchingBrackets.has(char)) stack.push(char);
|
|
36
|
+
else if (inverseMatchingBrackets.has(char)) {
|
|
37
|
+
let inverse = inverseMatchingBrackets.get(char);
|
|
38
|
+
if (stack.length <= 0 || stack.pop() !== inverse) return !1;
|
|
63
39
|
}
|
|
64
40
|
}
|
|
65
41
|
}
|
|
66
|
-
|
|
67
|
-
if (stack.length > 0) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
// All good, totally balanced!
|
|
71
|
-
return true;
|
|
42
|
+
return !(stack.length > 0);
|
|
72
43
|
}
|
package/lib/util/log.js
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
function _export(target, all) {
|
|
3
|
+
value: !0
|
|
4
|
+
}), function(target, all) {
|
|
6
5
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable:
|
|
6
|
+
enumerable: !0,
|
|
8
7
|
get: all[name]
|
|
9
8
|
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
9
|
+
}(exports, {
|
|
12
10
|
dim: ()=>dim,
|
|
13
11
|
default: ()=>_default
|
|
14
12
|
});
|
|
15
|
-
const _picocolors =
|
|
16
|
-
function _interopRequireDefault(obj) {
|
|
13
|
+
const _picocolors = function(obj) {
|
|
17
14
|
return obj && obj.__esModule ? obj : {
|
|
18
15
|
default: obj
|
|
19
16
|
};
|
|
20
|
-
}
|
|
17
|
+
}(require("picocolors"));
|
|
21
18
|
let alreadyShown = new Set();
|
|
22
19
|
function log(type, messages, key) {
|
|
23
|
-
|
|
24
|
-
if (key && alreadyShown.has(key)) return;
|
|
25
|
-
if (key) alreadyShown.add(key);
|
|
26
|
-
console.warn("");
|
|
27
|
-
messages.forEach((message)=>console.warn(type, "-", message));
|
|
20
|
+
("undefined" == typeof process || !process.env.JEST_WORKER_ID) && (key && alreadyShown.has(key) || (key && alreadyShown.add(key), console.warn(""), messages.forEach((message)=>console.warn(type, "-", message))));
|
|
28
21
|
}
|
|
29
22
|
function dim(input) {
|
|
30
23
|
return _picocolors.default.dim(input);
|
package/lib/util/nameClass.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value:
|
|
4
|
-
})
|
|
5
|
-
function _export(target, all) {
|
|
3
|
+
value: !0
|
|
4
|
+
}), function(target, all) {
|
|
6
5
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable:
|
|
6
|
+
enumerable: !0,
|
|
8
7
|
get: all[name]
|
|
9
8
|
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
9
|
+
}(exports, {
|
|
12
10
|
asClass: ()=>asClass,
|
|
13
11
|
default: ()=>nameClass,
|
|
14
12
|
formatClass: ()=>formatClass
|
|
15
13
|
});
|
|
16
|
-
const _escapeClassName =
|
|
17
|
-
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
|
14
|
+
const _escapeClassName = _interopRequireDefault(require("./escapeClassName")), _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
|
|
18
15
|
function _interopRequireDefault(obj) {
|
|
19
16
|
return obj && obj.__esModule ? obj : {
|
|
20
17
|
default: obj
|
|
@@ -27,17 +24,5 @@ function nameClass(classPrefix, key) {
|
|
|
27
24
|
return asClass(formatClass(classPrefix, key));
|
|
28
25
|
}
|
|
29
26
|
function formatClass(classPrefix, key) {
|
|
30
|
-
|
|
31
|
-
return classPrefix;
|
|
32
|
-
}
|
|
33
|
-
if (key === "-" || key === "-DEFAULT") {
|
|
34
|
-
return `-${classPrefix}`;
|
|
35
|
-
}
|
|
36
|
-
if (key.startsWith("-")) {
|
|
37
|
-
return `-${classPrefix}${key}`;
|
|
38
|
-
}
|
|
39
|
-
if (key.startsWith("/")) {
|
|
40
|
-
return `${classPrefix}${key}`;
|
|
41
|
-
}
|
|
42
|
-
return `${classPrefix}-${key}`;
|
|
27
|
+
return "DEFAULT" === key ? classPrefix : "-" === key || "-DEFAULT" === key ? `-${classPrefix}` : key.startsWith("-") ? `-${classPrefix}${key}` : key.startsWith("/") ? `${classPrefix}${key}` : `${classPrefix}-${key}`;
|
|
43
28
|
}
|