transform-to-unocss-core 0.0.66 → 0.0.67
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 +50 -14
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.iife.js +50 -14
- package/dist/index.js +50 -14
- package/dist/index.umd.js +50 -14
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1736,26 +1736,62 @@ function transformStyleToUnocssPre(styles) {
|
|
|
1736
1736
|
|
|
1737
1737
|
//#endregion
|
|
1738
1738
|
//#region src/transformStyleToUnocss.ts
|
|
1739
|
-
function transformStyleToUnocss(styles, isRem) {
|
|
1739
|
+
function transformStyleToUnocss(styles, isRem, debug) {
|
|
1740
|
+
if (debug) {
|
|
1741
|
+
console.log("🚀 [transformStyleToUnocss] Input styles:", styles);
|
|
1742
|
+
console.log("🚀 [transformStyleToUnocss] isRem:", isRem);
|
|
1743
|
+
}
|
|
1740
1744
|
const noTransfer = [];
|
|
1741
1745
|
const cache = new Set();
|
|
1742
1746
|
const { newStyle, transformedResult } = transformStyleToUnocssPre(styles);
|
|
1743
|
-
if (
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1747
|
+
if (debug) console.log("🔄 [transformStyleToUnocss] Pre-transformed:", {
|
|
1748
|
+
newStyle,
|
|
1749
|
+
transformedResult
|
|
1750
|
+
});
|
|
1751
|
+
if (transformedResult) {
|
|
1752
|
+
const result$1 = [transformedResult, newStyle.split(";").filter(Boolean).reduce((result$2, cur) => {
|
|
1753
|
+
const key = cur.replaceAll(browserReg, "").trim();
|
|
1754
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style:", cur, "-> key:", key);
|
|
1755
|
+
if (cache.has(key)) {
|
|
1756
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1757
|
+
return result$2;
|
|
1758
|
+
}
|
|
1759
|
+
cache.add(key);
|
|
1760
|
+
const val = toUnocss(cur, isRem) || "";
|
|
1761
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", cur, "->", val || "FAILED");
|
|
1762
|
+
if (!val) {
|
|
1763
|
+
noTransfer.push(cur);
|
|
1764
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1765
|
+
}
|
|
1766
|
+
return result$2 += `${val} `;
|
|
1767
|
+
}, "").trim().replace(/\s+/g, " ")].filter(Boolean).join(" ");
|
|
1768
|
+
if (debug) {
|
|
1769
|
+
console.log("✅ [transformStyleToUnocss] Final result (with pre-transform):", result$1);
|
|
1770
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1771
|
+
}
|
|
1772
|
+
return [result$1, noTransfer];
|
|
1773
|
+
}
|
|
1774
|
+
const result = styles.split(";").filter(Boolean).reduce((result$1, cur) => {
|
|
1752
1775
|
const key = cur.replaceAll(browserReg, "").trim();
|
|
1753
|
-
if (
|
|
1776
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style (no pre-transform):", cur, "-> key:", key);
|
|
1777
|
+
if (cache.has(key)) {
|
|
1778
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1779
|
+
return result$1;
|
|
1780
|
+
}
|
|
1754
1781
|
cache.add(key);
|
|
1755
1782
|
const val = toUnocss(key, isRem) || "";
|
|
1756
|
-
if (
|
|
1757
|
-
|
|
1758
|
-
|
|
1783
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", key, "->", val || "FAILED");
|
|
1784
|
+
if (!val) {
|
|
1785
|
+
noTransfer.push(cur);
|
|
1786
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1787
|
+
}
|
|
1788
|
+
return result$1 += `${val} `;
|
|
1789
|
+
}, "").trim().replace(/\s+/g, " ");
|
|
1790
|
+
if (debug) {
|
|
1791
|
+
console.log("✅ [transformStyleToUnocss] Final result (no pre-transform):", result);
|
|
1792
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1793
|
+
}
|
|
1794
|
+
return [result, noTransfer];
|
|
1759
1795
|
}
|
|
1760
1796
|
|
|
1761
1797
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ declare function transformStyleToUnocssPre(styles: string): {
|
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/transformStyleToUnocss.d.ts
|
|
17
|
-
declare function transformStyleToUnocss(styles: string, isRem?: boolean): [string, string[]];
|
|
17
|
+
declare function transformStyleToUnocss(styles: string, isRem?: boolean, debug?: boolean): [string, string[]];
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/utils.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare function transformStyleToUnocssPre(styles: string): {
|
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/transformStyleToUnocss.d.ts
|
|
17
|
-
declare function transformStyleToUnocss(styles: string, isRem?: boolean): [string, string[]];
|
|
17
|
+
declare function transformStyleToUnocss(styles: string, isRem?: boolean, debug?: boolean): [string, string[]];
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/utils.d.ts
|
package/dist/index.iife.js
CHANGED
|
@@ -1738,26 +1738,62 @@ function transformStyleToUnocssPre(styles) {
|
|
|
1738
1738
|
|
|
1739
1739
|
//#endregion
|
|
1740
1740
|
//#region src/transformStyleToUnocss.ts
|
|
1741
|
-
function transformStyleToUnocss(styles, isRem) {
|
|
1741
|
+
function transformStyleToUnocss(styles, isRem, debug) {
|
|
1742
|
+
if (debug) {
|
|
1743
|
+
console.log("🚀 [transformStyleToUnocss] Input styles:", styles);
|
|
1744
|
+
console.log("🚀 [transformStyleToUnocss] isRem:", isRem);
|
|
1745
|
+
}
|
|
1742
1746
|
const noTransfer = [];
|
|
1743
1747
|
const cache = new Set();
|
|
1744
1748
|
const { newStyle, transformedResult } = transformStyleToUnocssPre(styles);
|
|
1745
|
-
if (
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1749
|
+
if (debug) console.log("🔄 [transformStyleToUnocss] Pre-transformed:", {
|
|
1750
|
+
newStyle,
|
|
1751
|
+
transformedResult
|
|
1752
|
+
});
|
|
1753
|
+
if (transformedResult) {
|
|
1754
|
+
const result$1 = [transformedResult, newStyle.split(";").filter(Boolean).reduce((result$2, cur) => {
|
|
1755
|
+
const key = cur.replaceAll(browserReg, "").trim();
|
|
1756
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style:", cur, "-> key:", key);
|
|
1757
|
+
if (cache.has(key)) {
|
|
1758
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1759
|
+
return result$2;
|
|
1760
|
+
}
|
|
1761
|
+
cache.add(key);
|
|
1762
|
+
const val = toUnocss(cur, isRem) || "";
|
|
1763
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", cur, "->", val || "FAILED");
|
|
1764
|
+
if (!val) {
|
|
1765
|
+
noTransfer.push(cur);
|
|
1766
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1767
|
+
}
|
|
1768
|
+
return result$2 += `${val} `;
|
|
1769
|
+
}, "").trim().replace(/\s+/g, " ")].filter(Boolean).join(" ");
|
|
1770
|
+
if (debug) {
|
|
1771
|
+
console.log("✅ [transformStyleToUnocss] Final result (with pre-transform):", result$1);
|
|
1772
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1773
|
+
}
|
|
1774
|
+
return [result$1, noTransfer];
|
|
1775
|
+
}
|
|
1776
|
+
const result = styles.split(";").filter(Boolean).reduce((result$1, cur) => {
|
|
1754
1777
|
const key = cur.replaceAll(browserReg, "").trim();
|
|
1755
|
-
if (
|
|
1778
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style (no pre-transform):", cur, "-> key:", key);
|
|
1779
|
+
if (cache.has(key)) {
|
|
1780
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1781
|
+
return result$1;
|
|
1782
|
+
}
|
|
1756
1783
|
cache.add(key);
|
|
1757
1784
|
const val = toUnocss(key, isRem) || "";
|
|
1758
|
-
if (
|
|
1759
|
-
|
|
1760
|
-
|
|
1785
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", key, "->", val || "FAILED");
|
|
1786
|
+
if (!val) {
|
|
1787
|
+
noTransfer.push(cur);
|
|
1788
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1789
|
+
}
|
|
1790
|
+
return result$1 += `${val} `;
|
|
1791
|
+
}, "").trim().replace(/\s+/g, " ");
|
|
1792
|
+
if (debug) {
|
|
1793
|
+
console.log("✅ [transformStyleToUnocss] Final result (no pre-transform):", result);
|
|
1794
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1795
|
+
}
|
|
1796
|
+
return [result, noTransfer];
|
|
1761
1797
|
}
|
|
1762
1798
|
|
|
1763
1799
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1734,26 +1734,62 @@ function transformStyleToUnocssPre(styles) {
|
|
|
1734
1734
|
|
|
1735
1735
|
//#endregion
|
|
1736
1736
|
//#region src/transformStyleToUnocss.ts
|
|
1737
|
-
function transformStyleToUnocss(styles, isRem) {
|
|
1737
|
+
function transformStyleToUnocss(styles, isRem, debug) {
|
|
1738
|
+
if (debug) {
|
|
1739
|
+
console.log("🚀 [transformStyleToUnocss] Input styles:", styles);
|
|
1740
|
+
console.log("🚀 [transformStyleToUnocss] isRem:", isRem);
|
|
1741
|
+
}
|
|
1738
1742
|
const noTransfer = [];
|
|
1739
1743
|
const cache = new Set();
|
|
1740
1744
|
const { newStyle, transformedResult } = transformStyleToUnocssPre(styles);
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1745
|
+
if (debug) console.log("🔄 [transformStyleToUnocss] Pre-transformed:", {
|
|
1746
|
+
newStyle,
|
|
1747
|
+
transformedResult
|
|
1748
|
+
});
|
|
1749
|
+
if (transformedResult) {
|
|
1750
|
+
const result$1 = [transformedResult, newStyle.split(";").filter(Boolean).reduce((result$2, cur) => {
|
|
1751
|
+
const key = cur.replaceAll(browserReg, "").trim();
|
|
1752
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style:", cur, "-> key:", key);
|
|
1753
|
+
if (cache.has(key)) {
|
|
1754
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1755
|
+
return result$2;
|
|
1756
|
+
}
|
|
1757
|
+
cache.add(key);
|
|
1758
|
+
const val = toUnocss(cur, isRem) || "";
|
|
1759
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", cur, "->", val || "FAILED");
|
|
1760
|
+
if (!val) {
|
|
1761
|
+
noTransfer.push(cur);
|
|
1762
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1763
|
+
}
|
|
1764
|
+
return result$2 += `${val} `;
|
|
1765
|
+
}, "").trim().replace(/\s+/g, " ")].filter(Boolean).join(" ");
|
|
1766
|
+
if (debug) {
|
|
1767
|
+
console.log("✅ [transformStyleToUnocss] Final result (with pre-transform):", result$1);
|
|
1768
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1769
|
+
}
|
|
1770
|
+
return [result$1, noTransfer];
|
|
1771
|
+
}
|
|
1772
|
+
const result = styles.split(";").filter(Boolean).reduce((result$1, cur) => {
|
|
1750
1773
|
const key = cur.replaceAll(browserReg, "").trim();
|
|
1751
|
-
if (
|
|
1774
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style (no pre-transform):", cur, "-> key:", key);
|
|
1775
|
+
if (cache.has(key)) {
|
|
1776
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1777
|
+
return result$1;
|
|
1778
|
+
}
|
|
1752
1779
|
cache.add(key);
|
|
1753
1780
|
const val = toUnocss(key, isRem) || "";
|
|
1754
|
-
if (
|
|
1755
|
-
|
|
1756
|
-
|
|
1781
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", key, "->", val || "FAILED");
|
|
1782
|
+
if (!val) {
|
|
1783
|
+
noTransfer.push(cur);
|
|
1784
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1785
|
+
}
|
|
1786
|
+
return result$1 += `${val} `;
|
|
1787
|
+
}, "").trim().replace(/\s+/g, " ");
|
|
1788
|
+
if (debug) {
|
|
1789
|
+
console.log("✅ [transformStyleToUnocss] Final result (no pre-transform):", result);
|
|
1790
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1791
|
+
}
|
|
1792
|
+
return [result, noTransfer];
|
|
1757
1793
|
}
|
|
1758
1794
|
|
|
1759
1795
|
//#endregion
|
package/dist/index.umd.js
CHANGED
|
@@ -1741,26 +1741,62 @@ function transformStyleToUnocssPre(styles) {
|
|
|
1741
1741
|
|
|
1742
1742
|
//#endregion
|
|
1743
1743
|
//#region src/transformStyleToUnocss.ts
|
|
1744
|
-
function transformStyleToUnocss(styles, isRem) {
|
|
1744
|
+
function transformStyleToUnocss(styles, isRem, debug) {
|
|
1745
|
+
if (debug) {
|
|
1746
|
+
console.log("🚀 [transformStyleToUnocss] Input styles:", styles);
|
|
1747
|
+
console.log("🚀 [transformStyleToUnocss] isRem:", isRem);
|
|
1748
|
+
}
|
|
1745
1749
|
const noTransfer = [];
|
|
1746
1750
|
const cache = new Set();
|
|
1747
1751
|
const { newStyle, transformedResult } = transformStyleToUnocssPre(styles);
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1752
|
+
if (debug) console.log("🔄 [transformStyleToUnocss] Pre-transformed:", {
|
|
1753
|
+
newStyle,
|
|
1754
|
+
transformedResult
|
|
1755
|
+
});
|
|
1756
|
+
if (transformedResult) {
|
|
1757
|
+
const result$1 = [transformedResult, newStyle.split(";").filter(Boolean).reduce((result$2, cur) => {
|
|
1758
|
+
const key = cur.replaceAll(browserReg, "").trim();
|
|
1759
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style:", cur, "-> key:", key);
|
|
1760
|
+
if (cache.has(key)) {
|
|
1761
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1762
|
+
return result$2;
|
|
1763
|
+
}
|
|
1764
|
+
cache.add(key);
|
|
1765
|
+
const val = toUnocss(cur, isRem) || "";
|
|
1766
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", cur, "->", val || "FAILED");
|
|
1767
|
+
if (!val) {
|
|
1768
|
+
noTransfer.push(cur);
|
|
1769
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1770
|
+
}
|
|
1771
|
+
return result$2 += `${val} `;
|
|
1772
|
+
}, "").trim().replace(/\s+/g, " ")].filter(Boolean).join(" ");
|
|
1773
|
+
if (debug) {
|
|
1774
|
+
console.log("✅ [transformStyleToUnocss] Final result (with pre-transform):", result$1);
|
|
1775
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1776
|
+
}
|
|
1777
|
+
return [result$1, noTransfer];
|
|
1778
|
+
}
|
|
1779
|
+
const result = styles.split(";").filter(Boolean).reduce((result$1, cur) => {
|
|
1757
1780
|
const key = cur.replaceAll(browserReg, "").trim();
|
|
1758
|
-
if (
|
|
1781
|
+
if (debug) console.log("🔍 [transformStyleToUnocss] Processing style (no pre-transform):", cur, "-> key:", key);
|
|
1782
|
+
if (cache.has(key)) {
|
|
1783
|
+
if (debug) console.log("⏭️ [transformStyleToUnocss] Skipping cached key:", key);
|
|
1784
|
+
return result$1;
|
|
1785
|
+
}
|
|
1759
1786
|
cache.add(key);
|
|
1760
1787
|
const val = toUnocss(key, isRem) || "";
|
|
1761
|
-
if (
|
|
1762
|
-
|
|
1763
|
-
|
|
1788
|
+
if (debug) console.log("🎯 [transformStyleToUnocss] Converted:", key, "->", val || "FAILED");
|
|
1789
|
+
if (!val) {
|
|
1790
|
+
noTransfer.push(cur);
|
|
1791
|
+
if (debug) console.log("❌ [transformStyleToUnocss] Failed to convert:", cur);
|
|
1792
|
+
}
|
|
1793
|
+
return result$1 += `${val} `;
|
|
1794
|
+
}, "").trim().replace(/\s+/g, " ");
|
|
1795
|
+
if (debug) {
|
|
1796
|
+
console.log("✅ [transformStyleToUnocss] Final result (no pre-transform):", result);
|
|
1797
|
+
console.log("❌ [transformStyleToUnocss] Failed conversions:", noTransfer);
|
|
1798
|
+
}
|
|
1799
|
+
return [result, noTransfer];
|
|
1764
1800
|
}
|
|
1765
1801
|
|
|
1766
1802
|
//#endregion
|
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.67",
|
|
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",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"typecheck": "tsc --noEmit"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@antfu/eslint-config": "^4.
|
|
65
|
-
"@types/node": "^18.19.
|
|
64
|
+
"@antfu/eslint-config": "^4.16.1",
|
|
65
|
+
"@types/node": "^18.19.112",
|
|
66
66
|
"bumpp": "^8.2.1",
|
|
67
|
-
"eslint": "^9.
|
|
67
|
+
"eslint": "^9.29.0",
|
|
68
68
|
"esno": "^0.16.3",
|
|
69
69
|
"picocolors": "^1.1.1",
|
|
70
70
|
"prettier": "^2.8.8",
|