@unocss/preset-mini 0.55.0 → 0.55.2
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/colors.cjs +360 -6
- package/dist/{colors-dabdd21f.d.ts → colors.d.cts} +3 -2
- package/dist/colors.d.mts +354 -0
- package/dist/colors.d.ts +353 -2
- package/dist/colors.mjs +361 -1
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +69 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +9 -10
- package/dist/rules.cjs +928 -48
- package/dist/rules.d.cts +133 -0
- package/dist/rules.d.mts +133 -0
- package/dist/rules.d.ts +1 -1
- package/dist/rules.mjs +891 -4
- package/dist/{default-1f25a0ae.d.ts → shared/preset-mini.024bdcea.d.ts} +1 -1
- package/dist/shared/preset-mini.0a9763df.d.mts +721 -0
- package/dist/shared/preset-mini.0fac4963.mjs +320 -0
- package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
- package/dist/shared/preset-mini.5f54784f.d.mts +71 -0
- package/dist/shared/preset-mini.5f54784f.d.ts +71 -0
- package/dist/shared/preset-mini.aa3a264b.d.cts +67 -0
- package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
- package/dist/shared/preset-mini.d69a12a5.d.cts +721 -0
- package/dist/{utilities-d496540e.d.ts → shared/preset-mini.e93c20db.d.ts} +1 -1
- package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
- package/dist/shared/preset-mini.fc26b619.d.mts +67 -0
- package/dist/theme.cjs +308 -34
- package/dist/theme.d.cts +264 -0
- package/dist/theme.d.mts +264 -0
- package/dist/theme.d.ts +5 -5
- package/dist/theme.mjs +284 -4
- package/dist/utils.cjs +81 -10
- package/dist/utils.d.cts +83 -0
- package/dist/utils.d.mts +83 -0
- package/dist/utils.d.ts +18 -18
- package/dist/utils.mjs +81 -3
- package/dist/variants.cjs +737 -33
- package/dist/variants.d.cts +46 -0
- package/dist/variants.d.mts +46 -0
- package/dist/variants.d.ts +4 -4
- package/dist/variants.mjs +714 -4
- package/package.json +3 -3
- package/dist/shared/preset-mini.0131b915.mjs +0 -704
- package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
- package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
- package/dist/shared/preset-mini.811eb23d.mjs +0 -681
- package/dist/shared/preset-mini.8dd73081.mjs +0 -452
- package/dist/shared/preset-mini.9d93761b.cjs +0 -729
- package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
- package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
- package/dist/shared/preset-mini.d778b487.cjs +0 -85
- package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
- package/dist/shared/preset-mini.e078d7da.cjs +0 -313
- package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
- /package/dist/{types-d991ba46.d.ts → shared/preset-mini.5f54784f.d.cts} +0 -0
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import '@unocss/core';
|
|
1
|
+
import { e as getBracket } from './shared/preset-mini.f1fe435e.mjs';
|
|
2
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, j as colorOpacityToString, c as colorResolver, k as colorToString, b as colorableShadows, o as cornerMap, l as directionMap, r as directionSize, w as getComponent, y as getComponents, g as globalKeywords, h, q as handler, a as hasParseableColor, f as hex2rgba, n as insetMap, m as makeGlobalStaticRules, p as parseColor, i as parseCssColor, d as positionMap, t as resolveBreakpoints, u as resolveVerticalBreakpoints, s as splitShorthand, v as valueHandlers, x as xyzMap } from './shared/preset-mini.f1fe435e.mjs';
|
|
3
|
+
import { escapeRegExp } from '@unocss/core';
|
|
4
|
+
|
|
5
|
+
function variantMatcher(name, handler) {
|
|
6
|
+
let re;
|
|
7
|
+
return {
|
|
8
|
+
name,
|
|
9
|
+
match(input, ctx) {
|
|
10
|
+
if (!re)
|
|
11
|
+
re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
12
|
+
const match = input.match(re);
|
|
13
|
+
if (match) {
|
|
14
|
+
return {
|
|
15
|
+
matcher: input.slice(match[0].length),
|
|
16
|
+
handle: (input2, next) => next({
|
|
17
|
+
...input2,
|
|
18
|
+
...handler(input2)
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
autocomplete: `${name}:`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function variantParentMatcher(name, parent) {
|
|
27
|
+
let re;
|
|
28
|
+
return {
|
|
29
|
+
name,
|
|
30
|
+
match(input, ctx) {
|
|
31
|
+
if (!re)
|
|
32
|
+
re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
|
|
33
|
+
const match = input.match(re);
|
|
34
|
+
if (match) {
|
|
35
|
+
return {
|
|
36
|
+
matcher: input.slice(match[0].length),
|
|
37
|
+
handle: (input2, next) => next({
|
|
38
|
+
...input2,
|
|
39
|
+
parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
autocomplete: `${name}:`
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function variantGetBracket(prefix, matcher, separators) {
|
|
48
|
+
if (matcher.startsWith(`${prefix}[`)) {
|
|
49
|
+
const [match, rest] = getBracket(matcher.slice(prefix.length), "[", "]") ?? [];
|
|
50
|
+
if (match && rest) {
|
|
51
|
+
for (const separator of separators) {
|
|
52
|
+
if (rest.startsWith(separator))
|
|
53
|
+
return [match, rest.slice(separator.length), separator];
|
|
54
|
+
}
|
|
55
|
+
return [match, rest, ""];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function variantGetParameter(prefix, matcher, separators) {
|
|
60
|
+
if (matcher.startsWith(prefix)) {
|
|
61
|
+
const body = variantGetBracket(prefix, matcher, separators);
|
|
62
|
+
if (body) {
|
|
63
|
+
const [label = "", rest = body[1]] = variantGetParameter("/", body[1], separators) ?? [];
|
|
64
|
+
return [body[0], rest, label];
|
|
65
|
+
}
|
|
66
|
+
for (const separator of separators.filter((x) => x !== "/")) {
|
|
67
|
+
const pos = matcher.indexOf(separator, prefix.length);
|
|
68
|
+
if (pos !== -1) {
|
|
69
|
+
const labelPos = matcher.indexOf("/", prefix.length);
|
|
70
|
+
const unlabelled = labelPos === -1 || pos <= labelPos;
|
|
71
|
+
return [
|
|
72
|
+
matcher.slice(prefix.length, unlabelled ? pos : labelPos),
|
|
73
|
+
matcher.slice(pos + separator.length),
|
|
74
|
+
unlabelled ? "" : matcher.slice(labelPos + 1, pos)
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { getBracket, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|