transform-to-unocss-core 0.0.74 → 0.0.75
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 +5 -4
- package/dist/index.iife.js +5 -4
- package/dist/index.js +5 -4
- package/dist/index.umd.js +5 -4
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -196,10 +196,11 @@ function animation(key, val) {
|
|
|
196
196
|
let timeValuesFound = 0;
|
|
197
197
|
for (let i = 0; i < parts.length; i++) {
|
|
198
198
|
const part = parts[i];
|
|
199
|
-
if (/^\d+(?:\.\d+)?s?$/.test(part)) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
else result.push(`animate-
|
|
199
|
+
if (/^\d+(?:\.\d+)?(?:ms|s)?$/.test(part)) {
|
|
200
|
+
const cleanPart = part.endsWith("ms") ? part.slice(0, -2) : part;
|
|
201
|
+
if (timeValuesFound === 0) result.push(`animate-duration${getVal(cleanPart)}`);
|
|
202
|
+
else if (timeValuesFound === 1) result.push(`animate-delay${getVal(cleanPart)}`);
|
|
203
|
+
else result.push(`animate-[${cleanPart}]`);
|
|
203
204
|
timeValuesFound++;
|
|
204
205
|
} else if (/^(?:linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/.test(part)) result.push(`animate-ease-[${part}]`);
|
|
205
206
|
else if (part.startsWith("cubic-bezier") || part.startsWith("steps")) result.push(`animate-ease-[${part}]`);
|
package/dist/index.iife.js
CHANGED
|
@@ -198,10 +198,11 @@ function animation(key, val) {
|
|
|
198
198
|
let timeValuesFound = 0;
|
|
199
199
|
for (let i = 0; i < parts.length; i++) {
|
|
200
200
|
const part = parts[i];
|
|
201
|
-
if (/^\d+(?:\.\d+)?s?$/.test(part)) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
else result.push(`animate-
|
|
201
|
+
if (/^\d+(?:\.\d+)?(?:ms|s)?$/.test(part)) {
|
|
202
|
+
const cleanPart = part.endsWith("ms") ? part.slice(0, -2) : part;
|
|
203
|
+
if (timeValuesFound === 0) result.push(`animate-duration${getVal(cleanPart)}`);
|
|
204
|
+
else if (timeValuesFound === 1) result.push(`animate-delay${getVal(cleanPart)}`);
|
|
205
|
+
else result.push(`animate-[${cleanPart}]`);
|
|
205
206
|
timeValuesFound++;
|
|
206
207
|
} else if (/^(?:linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/.test(part)) result.push(`animate-ease-[${part}]`);
|
|
207
208
|
else if (part.startsWith("cubic-bezier") || part.startsWith("steps")) result.push(`animate-ease-[${part}]`);
|
package/dist/index.js
CHANGED
|
@@ -194,10 +194,11 @@ function animation(key, val) {
|
|
|
194
194
|
let timeValuesFound = 0;
|
|
195
195
|
for (let i = 0; i < parts.length; i++) {
|
|
196
196
|
const part = parts[i];
|
|
197
|
-
if (/^\d+(?:\.\d+)?s?$/.test(part)) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
else result.push(`animate-
|
|
197
|
+
if (/^\d+(?:\.\d+)?(?:ms|s)?$/.test(part)) {
|
|
198
|
+
const cleanPart = part.endsWith("ms") ? part.slice(0, -2) : part;
|
|
199
|
+
if (timeValuesFound === 0) result.push(`animate-duration${getVal(cleanPart)}`);
|
|
200
|
+
else if (timeValuesFound === 1) result.push(`animate-delay${getVal(cleanPart)}`);
|
|
201
|
+
else result.push(`animate-[${cleanPart}]`);
|
|
201
202
|
timeValuesFound++;
|
|
202
203
|
} else if (/^(?:linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/.test(part)) result.push(`animate-ease-[${part}]`);
|
|
203
204
|
else if (part.startsWith("cubic-bezier") || part.startsWith("steps")) result.push(`animate-ease-[${part}]`);
|
package/dist/index.umd.js
CHANGED
|
@@ -201,10 +201,11 @@ function animation(key, val) {
|
|
|
201
201
|
let timeValuesFound = 0;
|
|
202
202
|
for (let i = 0; i < parts.length; i++) {
|
|
203
203
|
const part = parts[i];
|
|
204
|
-
if (/^\d+(?:\.\d+)?s?$/.test(part)) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
else result.push(`animate-
|
|
204
|
+
if (/^\d+(?:\.\d+)?(?:ms|s)?$/.test(part)) {
|
|
205
|
+
const cleanPart = part.endsWith("ms") ? part.slice(0, -2) : part;
|
|
206
|
+
if (timeValuesFound === 0) result.push(`animate-duration${getVal(cleanPart)}`);
|
|
207
|
+
else if (timeValuesFound === 1) result.push(`animate-delay${getVal(cleanPart)}`);
|
|
208
|
+
else result.push(`animate-[${cleanPart}]`);
|
|
208
209
|
timeValuesFound++;
|
|
209
210
|
} else if (/^(?:linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/.test(part)) result.push(`animate-ease-[${part}]`);
|
|
210
211
|
else if (part.startsWith("cubic-bezier") || part.startsWith("steps")) result.push(`animate-ease-[${part}]`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "transform-to-unocss-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.75",
|
|
5
5
|
"description": "A utility to transform CSS to UnoCSS syntax. Supports various CSS properties and custom parsing.",
|
|
6
6
|
"author": "Simon He",
|
|
7
7
|
"license": "MIT",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"lint": "eslint . --cache",
|
|
56
56
|
"lint:fix": "pnpm run lint --fix",
|
|
57
57
|
"prepublishOnly": "npm run build",
|
|
58
|
-
"publish": "npm publish",
|
|
59
58
|
"release": "bumpp && npm publish",
|
|
60
59
|
"start": "esno src/index.ts",
|
|
61
60
|
"test": "vitest",
|