@unocss/core 0.45.12 → 0.45.13
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/dist/index.cjs +8 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -224,7 +224,7 @@ function withLayer(layer, rules) {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;
|
|
227
|
-
function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
227
|
+
function expandVariantGroup(str, seperators = ["-", ":"], depth = 5) {
|
|
228
228
|
regexClassGroup.lastIndex = 0;
|
|
229
229
|
let hasChanged = false;
|
|
230
230
|
let content = str.toString();
|
|
@@ -239,11 +239,13 @@ function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
hasChanged = content !== before;
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
depth -= 1;
|
|
243
|
+
} while (hasChanged && depth);
|
|
244
|
+
if (typeof str === "string") {
|
|
244
245
|
return content;
|
|
245
|
-
else
|
|
246
|
-
return str.overwrite(0, str.length(), content);
|
|
246
|
+
} else {
|
|
247
|
+
return str.length() ? str.overwrite(0, str.length(), content) : str;
|
|
248
|
+
}
|
|
247
249
|
}
|
|
248
250
|
|
|
249
251
|
const warned = /* @__PURE__ */ new Set();
|
|
@@ -417,7 +419,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
417
419
|
};
|
|
418
420
|
}
|
|
419
421
|
|
|
420
|
-
const version = "0.45.
|
|
422
|
+
const version = "0.45.13";
|
|
421
423
|
|
|
422
424
|
class UnoGenerator {
|
|
423
425
|
constructor(userConfig = {}, defaults = {}) {
|
package/dist/index.d.ts
CHANGED
|
@@ -133,8 +133,8 @@ declare class BetterMap<K, V> extends Map<K, V> {
|
|
|
133
133
|
declare function withLayer<T>(layer: string, rules: Rule<T>[]): Rule<T>[];
|
|
134
134
|
|
|
135
135
|
declare const regexClassGroup: RegExp;
|
|
136
|
-
declare function expandVariantGroup(str: string, seperators?:
|
|
137
|
-
declare function expandVariantGroup(str: MagicString, seperators?:
|
|
136
|
+
declare function expandVariantGroup(str: string, seperators?: string[], depth?: number): string;
|
|
137
|
+
declare function expandVariantGroup(str: MagicString, seperators?: string[], depth?: number): MagicString;
|
|
138
138
|
|
|
139
139
|
declare function warnOnce(msg: string): void;
|
|
140
140
|
|
package/dist/index.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function withLayer(layer, rules) {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
const regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;
|
|
223
|
-
function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
223
|
+
function expandVariantGroup(str, seperators = ["-", ":"], depth = 5) {
|
|
224
224
|
regexClassGroup.lastIndex = 0;
|
|
225
225
|
let hasChanged = false;
|
|
226
226
|
let content = str.toString();
|
|
@@ -235,11 +235,13 @@ function expandVariantGroup(str, seperators = ["-", ":"]) {
|
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
237
|
hasChanged = content !== before;
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
depth -= 1;
|
|
239
|
+
} while (hasChanged && depth);
|
|
240
|
+
if (typeof str === "string") {
|
|
240
241
|
return content;
|
|
241
|
-
else
|
|
242
|
-
return str.overwrite(0, str.length(), content);
|
|
242
|
+
} else {
|
|
243
|
+
return str.length() ? str.overwrite(0, str.length(), content) : str;
|
|
244
|
+
}
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
const warned = /* @__PURE__ */ new Set();
|
|
@@ -413,7 +415,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
413
415
|
};
|
|
414
416
|
}
|
|
415
417
|
|
|
416
|
-
const version = "0.45.
|
|
418
|
+
const version = "0.45.13";
|
|
417
419
|
|
|
418
420
|
class UnoGenerator {
|
|
419
421
|
constructor(userConfig = {}, defaults = {}) {
|