chaincss 2.0.5 → 2.0.7
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/README.md +0 -6
- package/dist/cli/index.js +391 -14
- package/dist/compiler/btt.d.ts +8 -0
- package/dist/compiler/btt.d.ts.map +1 -1
- package/dist/compiler/index.js +97 -1
- package/dist/core/compiler.d.ts.map +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +4505 -4098
- package/dist/plugins/vite.js +24029 -23628
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -2
- package/dist/runtime/injector.d.ts +1 -0
- package/dist/runtime/injector.d.ts.map +1 -1
- package/dist/runtime/react.js +54 -0
- package/dist/runtime/vue.js +54 -0
- package/package.json +1 -1
package/dist/runtime/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* WARNING: Importing from this module adds ~3.2KB to your bundle.
|
|
5
5
|
* For production, use build-time compilation with chaincss/plugin/vite instead.
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { $, compileRuntime as compile, runRuntime as run, styleInjector } from './injector.js';
|
|
8
8
|
export { useChainStyles, useDynamicChainStyles, useThemeChainStyles, ChainCSSGlobal, cx, withChainStyles, enableChainCSSDebug, disableChainCSSDebug, isDebugEnabled, createStyledComponent, useComputedStyles } from './react.js';
|
|
9
9
|
export { useAtomicClasses, ChainCSSGlobal as ChainCSSGlobalVue, createStyledComponent as createStyledVueComponent, // This is fine - it renames
|
|
10
10
|
createStyledComponents as createStyledVueComponents, useComputedStyles as useComputedStylesVue, // This renames useComputedStyles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,cAAc,IAAI,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/F,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,EAAE,EACF,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,gBAAgB,EAChB,cAAc,IAAI,iBAAiB,EACnC,qBAAqB,IAAI,wBAAwB,EAAG,4BAA4B;AAChF,sBAAsB,IAAI,yBAAyB,EACnD,iBAAiB,IAAI,oBAAoB,EAAG,iCAAiC;AAC7E,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGpD,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,EAAE,IAAI,OAAO,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,cAAc,EACf,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EACjB,MAAM,YAAY,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -127,7 +127,7 @@ ${hoverStyles}}
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
var styleInjector = new StyleInjector();
|
|
130
|
-
function chainRuntime(useTokens =
|
|
130
|
+
function chainRuntime(useTokens = false) {
|
|
131
131
|
const catcher = {};
|
|
132
132
|
const handler = {
|
|
133
133
|
get: (target, prop) => {
|
|
@@ -180,6 +180,7 @@ function chainRuntime(useTokens = true) {
|
|
|
180
180
|
const proxy = new Proxy({}, handler);
|
|
181
181
|
return proxy;
|
|
182
182
|
}
|
|
183
|
+
var $ = chainRuntime();
|
|
183
184
|
function compileRuntime(styles) {
|
|
184
185
|
return styleInjector.injectMultiple(styles);
|
|
185
186
|
}
|
|
@@ -512,7 +513,7 @@ function createDebugger(module) {
|
|
|
512
513
|
};
|
|
513
514
|
}
|
|
514
515
|
export {
|
|
515
|
-
|
|
516
|
+
$,
|
|
516
517
|
ChainCSSGlobal,
|
|
517
518
|
ChainCSSGlobal2 as ChainCSSGlobalVue,
|
|
518
519
|
cn as cnUtils,
|
|
@@ -28,6 +28,7 @@ declare class StyleInjector {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const styleInjector: StyleInjector;
|
|
30
30
|
export declare function chainRuntime(useTokens?: boolean): {};
|
|
31
|
+
export declare const $: {};
|
|
31
32
|
export declare function compileRuntime(styles: Record<string, StyleDefinition>): Record<string, string>;
|
|
32
33
|
export declare function runRuntime(...styles: StyleDefinition[]): string;
|
|
33
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injector.d.ts","sourceRoot":"","sources":["../../src/runtime/injector.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,cAAM,aAAa;IACjB,OAAO,CAAC,YAAY,CAAiC;IACrD,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,cAAc,CAAqB;;IAM3C,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,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MAAM,CAAC;IAyB/E,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM;IAwBvD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAc7B,eAAe,IAAI,gBAAgB,GAAG,IAAI;IAI1C,KAAK,IAAI,IAAI;CAOd;AAGD,eAAO,MAAM,aAAa,eAAsB,CAAC;AAGjD,wBAAgB,YAAY,CAAC,SAAS,UAAQ,MA0D7C;AAED,eAAO,MAAM,CAAC,IAAiB,CAAC;AAGhC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE9F;AAGD,wBAAgB,UAAU,CAAC,GAAG,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAqC/D;AAID;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqB7B,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,aAAa,EAAE,MAAM,OAAO,iBAAiB,EAC7C,QAAQ,SAAS,EACjB,MAAM,SAAS,GACd,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAMrB"}
|
package/dist/runtime/react.js
CHANGED
|
@@ -130,6 +130,60 @@ ${hoverStyles}}
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
var styleInjector = new StyleInjector();
|
|
133
|
+
function chainRuntime(useTokens = false) {
|
|
134
|
+
const catcher = {};
|
|
135
|
+
const handler = {
|
|
136
|
+
get: (target, prop) => {
|
|
137
|
+
if (prop === "$el") {
|
|
138
|
+
return (...selectors) => {
|
|
139
|
+
if (selectors.length === 0) {
|
|
140
|
+
const result2 = { ...catcher };
|
|
141
|
+
Object.keys(catcher).forEach((key) => delete catcher[key]);
|
|
142
|
+
return result2;
|
|
143
|
+
}
|
|
144
|
+
const result = {
|
|
145
|
+
selectors,
|
|
146
|
+
...catcher
|
|
147
|
+
};
|
|
148
|
+
Object.keys(catcher).forEach((key) => delete catcher[key]);
|
|
149
|
+
return result;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (prop === "hover") {
|
|
153
|
+
return () => {
|
|
154
|
+
const hoverCatcher = {};
|
|
155
|
+
const hoverHandler = {
|
|
156
|
+
get: (_, hoverProp) => {
|
|
157
|
+
if (hoverProp === "end") {
|
|
158
|
+
return () => {
|
|
159
|
+
catcher.hover = { ...hoverCatcher };
|
|
160
|
+
Object.keys(hoverCatcher).forEach((key) => delete hoverCatcher[key]);
|
|
161
|
+
return proxy;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return (value) => {
|
|
165
|
+
hoverCatcher[hoverProp] = value;
|
|
166
|
+
return hoverProxy;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const hoverProxy = new Proxy({}, hoverHandler);
|
|
171
|
+
return hoverProxy;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (prop === "end") {
|
|
175
|
+
return () => proxy;
|
|
176
|
+
}
|
|
177
|
+
return (value) => {
|
|
178
|
+
catcher[prop] = value;
|
|
179
|
+
return proxy;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const proxy = new Proxy({}, handler);
|
|
184
|
+
return proxy;
|
|
185
|
+
}
|
|
186
|
+
var $ = chainRuntime();
|
|
133
187
|
function compileRuntime(styles) {
|
|
134
188
|
return styleInjector.injectMultiple(styles);
|
|
135
189
|
}
|
package/dist/runtime/vue.js
CHANGED
|
@@ -130,6 +130,60 @@ ${hoverStyles}}
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
var styleInjector = new StyleInjector();
|
|
133
|
+
function chainRuntime(useTokens = false) {
|
|
134
|
+
const catcher = {};
|
|
135
|
+
const handler = {
|
|
136
|
+
get: (target, prop) => {
|
|
137
|
+
if (prop === "$el") {
|
|
138
|
+
return (...selectors) => {
|
|
139
|
+
if (selectors.length === 0) {
|
|
140
|
+
const result2 = { ...catcher };
|
|
141
|
+
Object.keys(catcher).forEach((key) => delete catcher[key]);
|
|
142
|
+
return result2;
|
|
143
|
+
}
|
|
144
|
+
const result = {
|
|
145
|
+
selectors,
|
|
146
|
+
...catcher
|
|
147
|
+
};
|
|
148
|
+
Object.keys(catcher).forEach((key) => delete catcher[key]);
|
|
149
|
+
return result;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (prop === "hover") {
|
|
153
|
+
return () => {
|
|
154
|
+
const hoverCatcher = {};
|
|
155
|
+
const hoverHandler = {
|
|
156
|
+
get: (_, hoverProp) => {
|
|
157
|
+
if (hoverProp === "end") {
|
|
158
|
+
return () => {
|
|
159
|
+
catcher.hover = { ...hoverCatcher };
|
|
160
|
+
Object.keys(hoverCatcher).forEach((key) => delete hoverCatcher[key]);
|
|
161
|
+
return proxy;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return (value) => {
|
|
165
|
+
hoverCatcher[hoverProp] = value;
|
|
166
|
+
return hoverProxy;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const hoverProxy = new Proxy({}, hoverHandler);
|
|
171
|
+
return hoverProxy;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (prop === "end") {
|
|
175
|
+
return () => proxy;
|
|
176
|
+
}
|
|
177
|
+
return (value) => {
|
|
178
|
+
catcher[prop] = value;
|
|
179
|
+
return proxy;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const proxy = new Proxy({}, handler);
|
|
184
|
+
return proxy;
|
|
185
|
+
}
|
|
186
|
+
var $ = chainRuntime();
|
|
133
187
|
function compileRuntime(styles) {
|
|
134
188
|
return styleInjector.injectMultiple(styles);
|
|
135
189
|
}
|