@animus-ui/vite-plugin 0.1.0-next.17 → 0.1.0-next.21
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.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAM3C,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAwUD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAM3C,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAwUD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAo6BnE;AAED,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvE,eAAe,aAAa,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -384,7 +384,7 @@ function animusExtract(options) {
|
|
|
384
384
|
let storedSheets = null;
|
|
385
385
|
let storedSystemPropMapJson = "{}";
|
|
386
386
|
let storedDynamicPropsJson = "{}";
|
|
387
|
-
let storedTransformsSource = "";
|
|
387
|
+
let storedTransformsSource = "{}";
|
|
388
388
|
let layerDeclaration = "";
|
|
389
389
|
const fileCache = /* @__PURE__ */ new Map();
|
|
390
390
|
let packageMap = {};
|
|
@@ -730,8 +730,8 @@ if (import.meta.hot) {
|
|
|
730
730
|
...meta.scale_values && Object.keys(meta.scale_values).length > 0 ? { scaleValues: meta.scale_values } : {}
|
|
731
731
|
};
|
|
732
732
|
moduleSource += `\nexport const dynamicPropConfig = ${JSON.stringify(configEntries)};`;
|
|
733
|
-
|
|
734
|
-
}
|
|
733
|
+
} else moduleSource += `\nexport const dynamicPropConfig = {};`;
|
|
734
|
+
moduleSource += `\nexport const transforms = ${storedTransformsSource};`;
|
|
735
735
|
return moduleSource;
|
|
736
736
|
}
|
|
737
737
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-global-styles.d.ts","sourceRoot":"","sources":["../src/resolve-global-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"resolve-global-styles.d.ts","sourceRoot":"","sources":["../src/resolve-global-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsLH,OAAO,EAAE,CAAC"}
|
|
@@ -31,19 +31,6 @@ function camelToKebab(s) {
|
|
|
31
31
|
return s.replace(/[A-Z]/g, (m, i) => (i > 0 ? "-" : "") + m.toLowerCase());
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Serialize a raw nested block (e.g. @keyframes) without prop resolution.
|
|
35
|
-
* Just camelToKebab on property names — no scale lookups, no transforms.
|
|
36
|
-
*/
|
|
37
|
-
function serializeRawBlock(obj, indent) {
|
|
38
|
-
const lines = [];
|
|
39
|
-
for (const [key, val] of Object.entries(obj)) if (typeof val === "object" && val !== null) {
|
|
40
|
-
lines.push(`${indent}${key} {`);
|
|
41
|
-
for (const [p, v] of Object.entries(val)) lines.push(`${indent} ${camelToKebab(p)}: ${v};`);
|
|
42
|
-
lines.push(`${indent}}`);
|
|
43
|
-
}
|
|
44
|
-
return lines.join("\n");
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
34
|
* Resolve {scale.path} and {scale.path/alpha} token aliases in a CSS value string.
|
|
48
35
|
* Mirrors the Rust theme_resolver's resolve_token_aliases logic.
|
|
49
36
|
*/
|
|
@@ -72,7 +59,23 @@ function resolveBlock(selectors) {
|
|
|
72
59
|
const rules = [];
|
|
73
60
|
for (const [selector, styleObj] of Object.entries(selectors)) {
|
|
74
61
|
if (selector.startsWith("@keyframes")) {
|
|
75
|
-
|
|
62
|
+
const frames = [];
|
|
63
|
+
for (const [pct, frameStyles] of Object.entries(styleObj)) if (typeof frameStyles === "object" && frameStyles !== null) {
|
|
64
|
+
const decls = [];
|
|
65
|
+
for (const [prop, raw] of Object.entries(frameStyles)) {
|
|
66
|
+
const cfg = propConfig[prop];
|
|
67
|
+
const cssProps = cfg?.properties?.length ? cfg.properties : cfg ? [cfg.property] : [prop];
|
|
68
|
+
let resolved = raw;
|
|
69
|
+
if (cfg?.scale) {
|
|
70
|
+
const key = cfg.scale + "." + raw;
|
|
71
|
+
if (flat[key] != null) resolved = flat[key];
|
|
72
|
+
}
|
|
73
|
+
resolved = resolveTokenAliases(String(resolved));
|
|
74
|
+
for (const cssProp of cssProps) decls.push(` ${camelToKebab(cssProp)}: ${resolved};`);
|
|
75
|
+
}
|
|
76
|
+
frames.push(` ${pct} {\n${decls.join("\n")}\n }`);
|
|
77
|
+
}
|
|
78
|
+
rules.push(`${selector} {\n${frames.join("\n")}\n}`);
|
|
76
79
|
continue;
|
|
77
80
|
}
|
|
78
81
|
const decls = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/vite-plugin",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.21",
|
|
4
4
|
"description": "Animus static CSS extraction Vite plugin",
|
|
5
5
|
"author": "codecaaron <airrobb@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"vite": ">=5.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@animus-ui/extract": "0.1.0-next.
|
|
28
|
+
"@animus-ui/extract": "0.1.0-next.21",
|
|
29
29
|
"browserslist": "^4.24.0",
|
|
30
30
|
"lightningcss": "^1.29.0"
|
|
31
31
|
}
|