@vinicunca/unocss-preset 1.45.0 → 1.47.0
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/{akar-BG7oGPRI.mjs → akar-DW0k-RQw.mjs} +2 -7
- package/dist/{animation-DqL0WQgX.mjs → animation-CW3bNe3I.mjs} +4 -12
- package/dist/chunk-z9aeyW2b.mjs +15 -0
- package/dist/{constants-D0-2LDV-.mjs → constants-X7mmwX-F.mjs} +39 -14
- package/dist/dist-BSedd5SE.mjs +110 -0
- package/dist/dist-Bd570nH8.mjs +1224 -0
- package/dist/dist-C9X3OQLP.mjs +1743 -0
- package/dist/dist-CZcIarKL.mjs +357 -0
- package/dist/dist-CfzVMiRr.mjs +459 -0
- package/dist/{fluid-3hh6B64T.mjs → fluid-vyZzun_V.mjs} +1 -9
- package/dist/index.d.mts +2294 -11
- package/dist/index.mjs +12 -19
- package/dist/loader-w_QTsl1j.mjs +476 -0
- package/dist/{magic-css-CRIcABfg.mjs → magic-css-DVWebgFO.mjs} +1 -3
- package/dist/{meta-C6h3diDY.mjs → meta-BWU-BFPZ.mjs} +1 -2
- package/dist/multipart-parser-BfE-2pJ1.mjs +166 -0
- package/dist/node-BoMp354b.mjs +470 -0
- package/dist/node-CmhetNN9.mjs +3975 -0
- package/dist/node-loader-DOgc4ALB.mjs +2202 -0
- package/dist/{scrollbar-CL2RfoWc.mjs → scrollbar-gf2hXs4h.mjs} +3 -5
- package/dist/{transformer-alias-DPt4rdJP.mjs → transformer-alias-CUUXiUed.mjs} +1 -3
- package/dist/utils-BtCNpQqm-BMsPT3mH.mjs +644 -0
- package/package.json +28 -30
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { i as compressCSS, t as DEFAULT_AKAR_OPTIONS } from "./constants-
|
|
2
|
-
import { defu } from "defu";
|
|
1
|
+
import { i as compressCSS, s as defu, t as DEFAULT_AKAR_OPTIONS } from "./constants-X7mmwX-F.mjs";
|
|
3
2
|
import { isObjectType, isString } from "@vinicunca/perkakas";
|
|
4
3
|
import { theme } from "unocss/preset-wind4";
|
|
5
|
-
|
|
6
4
|
//#region src/presets/akar/akar.drawer-preflights.ts
|
|
7
5
|
const drawerAkarCss = `
|
|
8
6
|
[data-akar-drawer] {
|
|
@@ -190,7 +188,6 @@ const drawerPreflight = {
|
|
|
190
188
|
layer: "preflights",
|
|
191
189
|
getCSS: () => compressCSS(drawerAkarCss)
|
|
192
190
|
};
|
|
193
|
-
|
|
194
191
|
//#endregion
|
|
195
192
|
//#region src/presets/akar/akar.theme.ts
|
|
196
193
|
const SHADES = [
|
|
@@ -259,7 +256,6 @@ function generateDynamicShades(brandKey) {
|
|
|
259
256
|
function isHexColor(value) {
|
|
260
257
|
return /^#([A-F0-9]{6}|[A-F0-9]{3})$/i.test(value);
|
|
261
258
|
}
|
|
262
|
-
|
|
263
259
|
//#endregion
|
|
264
260
|
//#region src/presets/akar/index.ts
|
|
265
261
|
function presetAkar(options) {
|
|
@@ -271,6 +267,5 @@ function presetAkar(options) {
|
|
|
271
267
|
theme: { colors: resolveAkarThemeColors(options) }
|
|
272
268
|
};
|
|
273
269
|
}
|
|
274
|
-
|
|
275
270
|
//#endregion
|
|
276
|
-
export { presetAkar };
|
|
271
|
+
export { presetAkar };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { n as layerMeta } from "./meta-
|
|
2
|
-
import { h } from "
|
|
3
|
-
|
|
1
|
+
import { n as layerMeta } from "./meta-BWU-BFPZ.mjs";
|
|
2
|
+
import { n as h } from "./utils-BtCNpQqm-BMsPT3mH.mjs";
|
|
4
3
|
//#region src/presets/animation/animation.entity.ts
|
|
5
4
|
const CSS_VARIABLE_PREFIX = "--vin";
|
|
6
5
|
const ENTER_ANIMATION_NAME = "vin-in";
|
|
7
6
|
const EXIT_ANIMATION_NAME = "vin-out";
|
|
8
|
-
|
|
9
7
|
//#endregion
|
|
10
8
|
//#region src/presets/animation/animation.util.ts
|
|
11
9
|
function handleSlide(val, dir) {
|
|
12
|
-
let value = h.cssvar.fraction.rem(val ||
|
|
10
|
+
let value = h.cssvar.fraction.rem(val || "100%");
|
|
13
11
|
if (!value) return [];
|
|
14
12
|
if (!value.startsWith("var(--") && ["left", "top"].includes(dir ?? "")) {
|
|
15
13
|
if (value.startsWith("-")) value = value.slice(1);
|
|
@@ -17,13 +15,11 @@ function handleSlide(val, dir) {
|
|
|
17
15
|
}
|
|
18
16
|
return [value, dir];
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
//#endregion
|
|
22
19
|
//#region src/presets/animation/animation.rule.ts
|
|
23
20
|
const DEFAULT_FADE_OPACITY = "0";
|
|
24
21
|
const DEFAULT_ZOOM_SCALE = "0";
|
|
25
22
|
const DEFAULT_SPIN_DEGREE = "30deg";
|
|
26
|
-
const DEFAULT_SLIDE_TRANSLATE = "100%";
|
|
27
23
|
const DIRECTIONS_AUTOCOMPLETE = "(t|b|l|r|top|bottom|left|right)";
|
|
28
24
|
const fadeRules = [[
|
|
29
25
|
/^fade-in(?:-(.+))?$/,
|
|
@@ -86,7 +82,6 @@ const animationRules = [
|
|
|
86
82
|
* So we need to run this immediately.
|
|
87
83
|
*/
|
|
88
84
|
for (const rule of animationRules) rule[2] = Object.assign(rule[2] || {}, layerMeta);
|
|
89
|
-
|
|
90
85
|
//#endregion
|
|
91
86
|
//#region src/presets/animation/animation.shortcut.ts
|
|
92
87
|
function animationShortcuts(options) {
|
|
@@ -127,14 +122,12 @@ function animationShortcuts(options) {
|
|
|
127
122
|
{ autocomplete: "animate-out" }
|
|
128
123
|
]];
|
|
129
124
|
}
|
|
130
|
-
|
|
131
125
|
//#endregion
|
|
132
126
|
//#region src/presets/animation/animation.theme.ts
|
|
133
127
|
const animationTheme = { keyframes: {
|
|
134
128
|
[ENTER_ANIMATION_NAME]: `{from{opacity:var(${CSS_VARIABLE_PREFIX}-enter-opacity,1);transform:translate3d(var(${CSS_VARIABLE_PREFIX}-enter-translate-x,0),var(${CSS_VARIABLE_PREFIX}-enter-translate-y,0),0) scale3d(var(${CSS_VARIABLE_PREFIX}-enter-scale,1),var(${CSS_VARIABLE_PREFIX}-enter-scale,1),var(${CSS_VARIABLE_PREFIX}-enter-scale,1)) rotate(var(${CSS_VARIABLE_PREFIX}-enter-rotate,0))}}`,
|
|
135
129
|
[EXIT_ANIMATION_NAME]: `{to{opacity:var(${CSS_VARIABLE_PREFIX}-exit-opacity,1);transform:translate3d(var(${CSS_VARIABLE_PREFIX}-exit-translate-x,0),var(${CSS_VARIABLE_PREFIX}-exit-translate-y,0),0) scale3d(var(${CSS_VARIABLE_PREFIX}-exit-scale,1),var(${CSS_VARIABLE_PREFIX}-exit-scale,1),var(${CSS_VARIABLE_PREFIX}-exit-scale,1)) rotate(var(${CSS_VARIABLE_PREFIX}-exit-rotate,0))}}`
|
|
136
130
|
} };
|
|
137
|
-
|
|
138
131
|
//#endregion
|
|
139
132
|
//#region src/presets/animation/index.ts
|
|
140
133
|
function presetAnimation(options) {
|
|
@@ -145,6 +138,5 @@ function presetAnimation(options) {
|
|
|
145
138
|
rules: [...animationRules]
|
|
146
139
|
};
|
|
147
140
|
}
|
|
148
|
-
|
|
149
141
|
//#endregion
|
|
150
|
-
export { presetAnimation };
|
|
142
|
+
export { presetAnimation };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __exportAll = (all, no_symbols) => {
|
|
5
|
+
let target = {};
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __require as n, __exportAll as t };
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if (value === null || typeof value !== "object") return false;
|
|
4
|
+
const prototype = Object.getPrototypeOf(value);
|
|
5
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
6
|
+
if (Symbol.iterator in value) return false;
|
|
7
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
11
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
12
|
+
const object = { ...defaults };
|
|
13
|
+
for (const key of Object.keys(baseObject)) {
|
|
14
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
15
|
+
const value = baseObject[key];
|
|
16
|
+
if (value === null || value === void 0) continue;
|
|
17
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
18
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
19
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
20
|
+
else object[key] = value;
|
|
21
|
+
}
|
|
22
|
+
return object;
|
|
23
|
+
}
|
|
24
|
+
function createDefu(merger) {
|
|
25
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
26
|
+
}
|
|
27
|
+
const defu = createDefu();
|
|
28
|
+
//#endregion
|
|
1
29
|
//#region src/utils.ts
|
|
2
30
|
const RE_ANIMATION = /^([a-z-]+)\s+([0-9.]+m?s?|var\([^)]+\)|[*+])?\s?([a-z-]+(?:\([^)]+\))?|[*+])?\s*([a-z0-9-]+|var\([^)]+\)|[*+])?$/i;
|
|
3
31
|
/**
|
|
@@ -84,7 +112,6 @@ function camelToHyphen(str) {
|
|
|
84
112
|
function compressCSS(css) {
|
|
85
113
|
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
86
114
|
}
|
|
87
|
-
|
|
88
115
|
//#endregion
|
|
89
116
|
//#region src/constants.ts
|
|
90
117
|
const DEFAULT_OPTIONS = {
|
|
@@ -269,21 +296,19 @@ const DEFAULT_AKAR_OPTIONS = {
|
|
|
269
296
|
enableDrawer: true,
|
|
270
297
|
enableDynamicBrands: false
|
|
271
298
|
};
|
|
272
|
-
const DEFAULT_FLUID_OPTIONS = {
|
|
273
|
-
maxWidth: 1440,
|
|
274
|
-
minWidth: 375,
|
|
275
|
-
remBase: 16,
|
|
276
|
-
useRemByDefault: false,
|
|
277
|
-
extendMaxWidth: null,
|
|
278
|
-
extendMinWidth: null,
|
|
279
|
-
ranges: null,
|
|
280
|
-
commentHelpers: false
|
|
281
|
-
};
|
|
282
299
|
const DEFAULT_PRESET_OPTIONS = {
|
|
283
|
-
fluid:
|
|
300
|
+
fluid: {
|
|
301
|
+
maxWidth: 1440,
|
|
302
|
+
minWidth: 375,
|
|
303
|
+
remBase: 16,
|
|
304
|
+
useRemByDefault: false,
|
|
305
|
+
extendMaxWidth: null,
|
|
306
|
+
extendMinWidth: null,
|
|
307
|
+
ranges: null,
|
|
308
|
+
commentHelpers: false
|
|
309
|
+
},
|
|
284
310
|
animation: { unit: "ms" },
|
|
285
311
|
akar: DEFAULT_AKAR_OPTIONS
|
|
286
312
|
};
|
|
287
|
-
|
|
288
313
|
//#endregion
|
|
289
|
-
export { cssObj2StrSync as a, compressCSS as i, DEFAULT_OPTIONS as n, resolveAnimation as o, DEFAULT_PRESET_OPTIONS as r, DEFAULT_AKAR_OPTIONS as t };
|
|
314
|
+
export { cssObj2StrSync as a, compressCSS as i, DEFAULT_OPTIONS as n, resolveAnimation as o, DEFAULT_PRESET_OPTIONS as r, defu as s, DEFAULT_AKAR_OPTIONS as t };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/@unocss+core@66.7.0/node_modules/@unocss/core/dist/index.mjs
|
|
2
|
+
const LAYER_IMPORTS = "imports";
|
|
3
|
+
function toArray(value = []) {
|
|
4
|
+
return Array.isArray(value) ? value : [value];
|
|
5
|
+
}
|
|
6
|
+
function isString(s) {
|
|
7
|
+
return typeof s === "string";
|
|
8
|
+
}
|
|
9
|
+
function escapeRegExp(string) {
|
|
10
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* CSS Selector Escape
|
|
14
|
+
*/
|
|
15
|
+
function escapeSelector(str) {
|
|
16
|
+
const length = str.length;
|
|
17
|
+
let index = -1;
|
|
18
|
+
let codeUnit;
|
|
19
|
+
let result = "";
|
|
20
|
+
const firstCodeUnit = str.charCodeAt(0);
|
|
21
|
+
while (++index < length) {
|
|
22
|
+
codeUnit = str.charCodeAt(index);
|
|
23
|
+
if (codeUnit === 0) {
|
|
24
|
+
result += "�";
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (codeUnit === 37) {
|
|
28
|
+
result += "\\%";
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (codeUnit === 44) {
|
|
32
|
+
result += "\\,";
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit === 45) {
|
|
36
|
+
result += `\\${codeUnit.toString(16)} `;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (index === 0 && length === 1 && codeUnit === 45) {
|
|
40
|
+
result += `\\${str.charAt(index)}`;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
|
|
44
|
+
result += str.charAt(index);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
result += `\\${str.charAt(index)}`;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
function isObject(item) {
|
|
52
|
+
return item && typeof item === "object" && !Array.isArray(item);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deep merge two objects
|
|
56
|
+
*/
|
|
57
|
+
function mergeDeep(original, patch, mergeArray = false) {
|
|
58
|
+
const o = original;
|
|
59
|
+
const p = patch;
|
|
60
|
+
if (Array.isArray(p)) if (mergeArray && Array.isArray(p)) return [...o, ...p];
|
|
61
|
+
else return [...p];
|
|
62
|
+
const output = { ...o };
|
|
63
|
+
if (isObject(o) && isObject(p)) Object.keys(p).forEach((key) => {
|
|
64
|
+
if (isObject(o[key]) && isObject(p[key]) || Array.isArray(o[key]) && Array.isArray(p[key])) output[key] = mergeDeep(o[key], p[key], mergeArray);
|
|
65
|
+
else Object.assign(output, { [key]: p[key] });
|
|
66
|
+
});
|
|
67
|
+
return output;
|
|
68
|
+
}
|
|
69
|
+
function clone(val) {
|
|
70
|
+
let k, out, tmp;
|
|
71
|
+
if (Array.isArray(val)) {
|
|
72
|
+
out = Array.from({ length: k = val.length });
|
|
73
|
+
while (k--) out[k] = (tmp = val[k]) && typeof tmp === "object" ? clone(tmp) : tmp;
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
if (Object.prototype.toString.call(val) === "[object Object]") {
|
|
77
|
+
out = {};
|
|
78
|
+
for (k in val) if (k === "__proto__") Object.defineProperty(out, k, {
|
|
79
|
+
value: clone(val[k]),
|
|
80
|
+
configurable: true,
|
|
81
|
+
enumerable: true,
|
|
82
|
+
writable: true
|
|
83
|
+
});
|
|
84
|
+
else out[k] = (tmp = val[k]) && typeof tmp === "object" ? clone(tmp) : tmp;
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
return val;
|
|
88
|
+
}
|
|
89
|
+
const warned = /* @__PURE__ */ new Set();
|
|
90
|
+
function warnOnce(msg) {
|
|
91
|
+
if (warned.has(msg)) return;
|
|
92
|
+
console.warn("[unocss]", msg);
|
|
93
|
+
warned.add(msg);
|
|
94
|
+
}
|
|
95
|
+
function definePreset(preset) {
|
|
96
|
+
return preset;
|
|
97
|
+
}
|
|
98
|
+
const symbols = {
|
|
99
|
+
shortcutsNoMerge: "$$symbol-shortcut-no-merge",
|
|
100
|
+
noMerge: "$$symbol-no-merge",
|
|
101
|
+
noScope: "$$symbol-no-scope",
|
|
102
|
+
variants: "$$symbol-variants",
|
|
103
|
+
parent: "$$symbol-parent",
|
|
104
|
+
selector: "$$symbol-selector",
|
|
105
|
+
layer: "$$symbol-layer",
|
|
106
|
+
sort: "$$symbol-sort",
|
|
107
|
+
body: "$$symbol-body"
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { escapeSelector as a, symbols as c, escapeRegExp as i, toArray as l, clone as n, isString as o, definePreset as r, mergeDeep as s, LAYER_IMPORTS as t, warnOnce as u };
|