chaincss 2.1.29 → 2.1.31

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.
@@ -1,45 +1,24 @@
1
+ /**
2
+ * ChainCSS Build-Time Compiler
3
+ * Core compilation, AT-rules, CSS property loading, source maps
4
+ */
1
5
  import { DesignTokens } from './tokens.js';
2
6
  import type { AtomicOptimizer } from './atomic-optimizer.js';
3
7
  export { setBreakpoints } from './breakpoints.js';
4
8
  export { chain, enableDebug } from './Chain.js';
5
- interface StyleSnapshot {
6
- id: string;
7
- timestamp: number;
8
- selector: string;
9
- styles: Record<string, any>;
10
- source: string;
11
- hash: string;
12
- }
13
- interface StyleChange {
14
- id: string;
15
- timestamp: number;
16
- selector: string;
17
- property: string;
18
- oldValue: any;
19
- newValue: any;
20
- type: 'add' | 'remove' | 'modify';
21
- }
22
- export declare function enableTimeline(enable?: boolean): void;
23
- export declare function getStyleHistory(): StyleSnapshot[];
24
- export declare function getStyleChanges(): StyleChange[];
25
- export declare function getStyleDiff(snapshotId1: string, snapshotId2: string): Record<string, any>;
26
- export declare function exportTimeline(): string;
27
- export declare function clearTimeline(): void;
28
- interface ComponentInfo {
29
- name: string;
30
- selector: string;
31
- styles: Record<string, any>;
32
- propsDefinition?: Record<string, any>;
33
- framework: 'react' | 'vue' | 'svelte' | 'solid' | 'auto';
34
- }
35
- export declare function generateComponentCode(info: ComponentInfo): string;
9
+ export { enableTimeline, getStyleHistory, getStyleChanges, getStyleDiff, exportTimeline, clearTimeline, takeSnapshot, isTimelineEnabled } from './timeline.js';
10
+ export type { StyleSnapshot, StyleChange } from './timeline.js';
11
+ export { scanContent, scanFileForStyles } from './scanner.js';
12
+ export { recipe } from './recipe.js';
13
+ export type { RecipeOptions, Recipe } from './recipe.js';
14
+ export { generateComponentCode, detectFramework } from './component-generator.js';
15
+ export type { ComponentInfo } from './component-generator.js';
36
16
  export declare function setSourceComments(enabled: boolean): void;
37
17
  export interface ChainObject {
38
18
  cssOutput: string;
39
19
  cachedValidProperties: string[];
40
20
  classMap: Record<string, string>;
41
21
  atomicStats: any;
42
- componentMap?: Map<string, any>;
43
22
  initializeProperties: () => Promise<void>;
44
23
  getCachedProperties: () => string[] | null;
45
24
  }
@@ -79,44 +58,4 @@ export interface StyleDefinition {
79
58
  }
80
59
  export declare const run: (...args: any[]) => string;
81
60
  export declare const compile: (obj: Record<string, StyleDefinition>) => string;
82
- export interface RecipeOptions<TVariants extends Record<string, Record<string, any>>> {
83
- base?: StyleDefinition | (() => StyleDefinition);
84
- variants?: TVariants;
85
- defaultVariants?: Partial<{
86
- [K in keyof TVariants]: keyof TVariants[K];
87
- }>;
88
- compoundVariants?: Array<{
89
- variants: Partial<{
90
- [K in keyof TVariants]: keyof TVariants[K];
91
- }>;
92
- style: StyleDefinition | (() => StyleDefinition);
93
- }>;
94
- }
95
- export type Recipe<TVariants extends Record<string, Record<string, any>>> = {
96
- (selection?: Partial<{
97
- [K in keyof TVariants]: keyof TVariants[K];
98
- }>): StyleDefinition;
99
- variants: TVariants;
100
- defaultVariants: Partial<{
101
- [K in keyof TVariants]: keyof TVariants[K];
102
- }>;
103
- base: StyleDefinition;
104
- getAllVariants: () => Array<Partial<{
105
- [K in keyof TVariants]: keyof TVariants[K];
106
- }>>;
107
- compileAll: () => string;
108
- getVariantClassNames: () => Record<string, string>;
109
- };
110
- export declare function recipe<TVariants extends Record<string, Record<string, any>>>(options: RecipeOptions<TVariants>): Recipe<TVariants>;
111
- /**
112
- * The "Brain": Extracts ChainCSS calls from raw text
113
- */
114
- export declare const scanContent: (text: string) => string[];
115
- /**
116
- * The "Worker": Reads the file, uses the Brain, feeds the Optimizer
117
- */
118
- export declare function scanFileForStyles(filePath: string, optimizer: any, source?: string | null): {
119
- foundCount: number;
120
- errors: Error[];
121
- };
122
61
  export { atomicOptimizer, chains as chainObject };
@@ -0,0 +1,10 @@
1
+ interface ComponentInfo {
2
+ name: string;
3
+ selector: string;
4
+ styles: Record<string, any>;
5
+ propsDefinition?: Record<string, any>;
6
+ framework: 'react' | 'vue' | 'svelte' | 'solid' | 'auto';
7
+ }
8
+ export declare function detectFramework(): 'react' | 'vue' | 'svelte' | 'solid';
9
+ export declare function generateComponentCode(info: ComponentInfo): string;
10
+ export type { ComponentInfo };