chaincss 2.1.21 → 2.1.22
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 +1 -9
- package/dist/runtime/index.js +1 -9
- package/package.json +1 -1
- package/src/runtime/index.ts +2 -12
package/dist/index.js
CHANGED
|
@@ -3353,16 +3353,8 @@ var compileRuntime = (s, moduleId) => styleInjector.injectMultiple(s, moduleId);
|
|
|
3353
3353
|
// src/runtime/index.ts
|
|
3354
3354
|
function injectChainStyles(styles) {
|
|
3355
3355
|
let css = "";
|
|
3356
|
-
let staticCount = 0, dynamicCount = 0, hybridCount = 0;
|
|
3357
3356
|
for (const [key, obj] of Object.entries(styles)) {
|
|
3358
3357
|
if (!obj || !obj.selectors) continue;
|
|
3359
|
-
if (obj.__isHybrid) {
|
|
3360
|
-
hybridCount++;
|
|
3361
|
-
} else if (obj.__runtimeClasses && Object.keys(obj.__runtimeClasses).length > 0) {
|
|
3362
|
-
dynamicCount++;
|
|
3363
|
-
} else {
|
|
3364
|
-
staticCount++;
|
|
3365
|
-
}
|
|
3366
3358
|
const sel = "." + obj.selectors[0];
|
|
3367
3359
|
css += sel + "{";
|
|
3368
3360
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -3387,7 +3379,7 @@ function injectChainStyles(styles) {
|
|
|
3387
3379
|
el.setAttribute("data-chaincss", "runtime");
|
|
3388
3380
|
el.textContent = css;
|
|
3389
3381
|
document.head.appendChild(el);
|
|
3390
|
-
console.log("\u26D3\uFE0F ChainCSS
|
|
3382
|
+
console.log("\u26D3\uFE0F ChainCSS \u2014 " + Object.keys(styles).length + " styles injected | CSS: " + css.length + " bytes | smartChain auto-detect active");
|
|
3391
3383
|
return el;
|
|
3392
3384
|
}
|
|
3393
3385
|
|
package/dist/runtime/index.js
CHANGED
|
@@ -3909,16 +3909,8 @@ var injectStyleContextSvelte = (...args) => getSvelteExports().injectStyleContex
|
|
|
3909
3909
|
var chainStyles2 = (...args) => getSvelteExports().chainStyles?.(...args);
|
|
3910
3910
|
function injectChainStyles(styles3) {
|
|
3911
3911
|
let css = "";
|
|
3912
|
-
let staticCount = 0, dynamicCount = 0, hybridCount = 0;
|
|
3913
3912
|
for (const [key, obj] of Object.entries(styles3)) {
|
|
3914
3913
|
if (!obj || !obj.selectors) continue;
|
|
3915
|
-
if (obj.__isHybrid) {
|
|
3916
|
-
hybridCount++;
|
|
3917
|
-
} else if (obj.__runtimeClasses && Object.keys(obj.__runtimeClasses).length > 0) {
|
|
3918
|
-
dynamicCount++;
|
|
3919
|
-
} else {
|
|
3920
|
-
staticCount++;
|
|
3921
|
-
}
|
|
3922
3914
|
const sel = "." + obj.selectors[0];
|
|
3923
3915
|
css += sel + "{";
|
|
3924
3916
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -3943,7 +3935,7 @@ function injectChainStyles(styles3) {
|
|
|
3943
3935
|
el.setAttribute("data-chaincss", "runtime");
|
|
3944
3936
|
el.textContent = css;
|
|
3945
3937
|
document.head.appendChild(el);
|
|
3946
|
-
console.log("\u26D3\uFE0F ChainCSS
|
|
3938
|
+
console.log("\u26D3\uFE0F ChainCSS \u2014 " + Object.keys(styles3).length + " styles injected | CSS: " + css.length + " bytes | smartChain auto-detect active");
|
|
3947
3939
|
return el;
|
|
3948
3940
|
}
|
|
3949
3941
|
export {
|
package/package.json
CHANGED
package/src/runtime/index.ts
CHANGED
|
@@ -92,20 +92,10 @@ export type {
|
|
|
92
92
|
// Auto-inject styles into DOM
|
|
93
93
|
export function injectChainStyles(styles: Record<string, any>) {
|
|
94
94
|
let css = '';
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
|
|
97
96
|
for (const [key, obj] of Object.entries(styles)) {
|
|
98
97
|
if (!obj || !obj.selectors) continue;
|
|
99
98
|
|
|
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++;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
99
|
const sel = '.' + obj.selectors[0];
|
|
110
100
|
css += sel + '{';
|
|
111
101
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -132,7 +122,7 @@ export function injectChainStyles(styles: Record<string, any>) {
|
|
|
132
122
|
document.head.appendChild(el);
|
|
133
123
|
|
|
134
124
|
// Show split stats in console
|
|
135
|
-
console.log('⛓️ ChainCSS
|
|
125
|
+
console.log('⛓️ ChainCSS — ' + Object.keys(styles).length + ' styles injected | CSS: ' + css.length + ' bytes | smartChain auto-detect active');
|
|
136
126
|
|
|
137
127
|
return el;
|
|
138
128
|
}
|