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