chaincss 2.1.19 → 2.1.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.js CHANGED
@@ -3356,15 +3356,13 @@ function injectChainStyles(styles) {
3356
3356
  let staticCount = 0, dynamicCount = 0, hybridCount = 0;
3357
3357
  for (const [key, obj] of Object.entries(styles)) {
3358
3358
  if (!obj || !obj.selectors) continue;
3359
- let stat = 0, dyn = 0;
3360
- for (const [k, v] of Object.entries(obj)) {
3361
- if (["selectors", "hover", "atRules", "nestedRules", "_name", "_classes", "__buildClasses", "__runtimeClasses", "__isHybrid"].includes(k)) continue;
3362
- if (typeof v === "function") dyn++;
3363
- else stat++;
3359
+ if (obj.__isHybrid) {
3360
+ hybridCount++;
3361
+ } else if (obj.__runtimeClasses && Object.keys(obj.__runtimeClasses).length > 0) {
3362
+ dynamicCount++;
3363
+ } else {
3364
+ staticCount++;
3364
3365
  }
3365
- if (stat > 0 && dyn > 0) hybridCount++;
3366
- else if (dyn > 0) dynamicCount++;
3367
- else staticCount++;
3368
3366
  const sel = "." + obj.selectors[0];
3369
3367
  css += sel + "{";
3370
3368
  for (const [k, v] of Object.entries(obj)) {
@@ -3453,10 +3453,8 @@ const setManifest = (manifest) => {
3453
3453
  if (chainCount > 0) {
3454
3454
  console.log("");
3455
3455
  console.log("\u26D3\uFE0F ChainCSS \u2014 Ready");
3456
- console.log(` \u{1F4E6} Static: ${staticCount} styles \u2192 CSS`);
3457
- console.log(` \u26A1 Dynamic: ${dynamicCount} styles \u2192 JS runtime`);
3458
- console.log(` \u{1F500} Hybrid: ${hybridCount} styles \u2192 Auto-split`);
3459
- console.log(` \u{1F4DD} Total: ${chainCount} chain() calls detected`);
3456
+ console.log(` \u{1F4DD} ${chainCount} chain() calls detected`);
3457
+ console.log(" \u{1F500} Auto-split active \u2014 open browser console for split report");
3460
3458
  console.log("");
3461
3459
  }
3462
3460
  return {
@@ -3912,15 +3912,13 @@ function injectChainStyles(styles3) {
3912
3912
  let staticCount = 0, dynamicCount = 0, hybridCount = 0;
3913
3913
  for (const [key, obj] of Object.entries(styles3)) {
3914
3914
  if (!obj || !obj.selectors) continue;
3915
- let stat = 0, dyn = 0;
3916
- for (const [k, v] of Object.entries(obj)) {
3917
- if (["selectors", "hover", "atRules", "nestedRules", "_name", "_classes", "__buildClasses", "__runtimeClasses", "__isHybrid"].includes(k)) continue;
3918
- if (typeof v === "function") dyn++;
3919
- else stat++;
3915
+ if (obj.__isHybrid) {
3916
+ hybridCount++;
3917
+ } else if (obj.__runtimeClasses && Object.keys(obj.__runtimeClasses).length > 0) {
3918
+ dynamicCount++;
3919
+ } else {
3920
+ staticCount++;
3920
3921
  }
3921
- if (stat > 0 && dyn > 0) hybridCount++;
3922
- else if (dyn > 0) dynamicCount++;
3923
- else staticCount++;
3924
3922
  const sel = "." + obj.selectors[0];
3925
3923
  css += sel + "{";
3926
3924
  for (const [k, v] of Object.entries(obj)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chaincss",
3
- "version": "2.1.19",
4
- "description": "ChainCSS v3.0 - The first CSS-in-JS library with true auto-detection mixed mode. Zero runtime by default, dynamic when you need it.",
3
+ "version": "2.1.21",
4
+ "description": "ChainCSS - The first CSS-in-JS library with true auto-detection mixed mode. Zero runtime by default, dynamic when you need it.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -347,10 +347,8 @@ const setManifest = (manifest) => {
347
347
  if (chainCount > 0) {
348
348
  console.log('');
349
349
  console.log('⛓️ ChainCSS — Ready');
350
- console.log(` 📦 Static: ${staticCount} styles CSS`);
351
- console.log(` Dynamic: ${dynamicCount} styles JS runtime`);
352
- console.log(` 🔀 Hybrid: ${hybridCount} styles → Auto-split`);
353
- console.log(` 📝 Total: ${chainCount} chain() calls detected`);
350
+ console.log(` 📝 ${chainCount} chain() calls detected`);
351
+ console.log(' 🔀 Auto-split active open browser console for split report');
354
352
  console.log('');
355
353
  }
356
354
 
@@ -97,16 +97,14 @@ export function injectChainStyles(styles: Record<string, any>) {
97
97
  for (const [key, obj] of Object.entries(styles)) {
98
98
  if (!obj || !obj.selectors) continue;
99
99
 
100
- // Count static vs dynamic
101
- let stat = 0, dyn = 0;
102
- for (const [k, v] of Object.entries(obj)) {
103
- if (['selectors','hover','atRules','nestedRules','_name','_classes','__buildClasses','__runtimeClasses','__isHybrid'].includes(k)) continue;
104
- if (typeof v === 'function') dyn++;
105
- else stat++;
100
+ // Use smartChain's built-in detection
101
+ if (obj.__isHybrid) {
102
+ hybridCount++;
103
+ } else if (obj.__runtimeClasses && Object.keys(obj.__runtimeClasses).length > 0) {
104
+ dynamicCount++;
105
+ } else {
106
+ staticCount++;
106
107
  }
107
- if (stat > 0 && dyn > 0) hybridCount++;
108
- else if (dyn > 0) dynamicCount++;
109
- else staticCount++;
110
108
 
111
109
  const sel = '.' + obj.selectors[0];
112
110
  css += sel + '{';