tailwind-styled-v4 5.0.18 → 5.0.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/{analyzeWorkspace-CopJNGmi.d.ts → analyzeWorkspace-B1_XRfdl.d.ts} +1 -0
- package/dist/{analyzeWorkspace-DpVPccjz.d.mts → analyzeWorkspace-hYfu4Hg3.d.mts} +1 -0
- package/dist/analyzer.d.mts +2 -2
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.js +5 -4
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +5 -4
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +3 -3
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +3 -3
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +38 -2
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +38 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +43 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +43 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +177 -2
- package/dist/compiler.d.ts +177 -2
- package/dist/compiler.js +172 -10
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +159 -11
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.d.mts +3 -3
- package/dist/engine.d.ts +3 -3
- package/dist/engine.js +182 -14
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +182 -14
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BFqmBxl9.d.mts +102 -0
- package/dist/{index-DJv28Uzq.d.mts → index-DQI6O24n.d.mts} +1 -1
- package/dist/index-DwNErRJ_.d.ts +102 -0
- package/dist/{index-BDQw13kn.d.ts → index-UkYbyBkR.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +182 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -14
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +193 -11
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +193 -11
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +3 -101
- package/dist/plugin-api.d.ts +3 -101
- package/dist/plugin.d.mts +3 -5
- package/dist/plugin.d.ts +3 -5
- package/dist/plugin.js +0 -97
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +1 -77
- package/dist/plugin.mjs.map +1 -1
- package/dist/shared.js +177 -10
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +177 -10
- package/dist/shared.mjs.map +1 -1
- package/dist/turbopackLoader.js +179 -12
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +179 -12
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +43 -6
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +43 -6
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +315 -147
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +315 -147
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +38 -2
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +38 -2
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { C as CompoundCondition, T as TokenMap } from './index-NDINUhLN.mjs';
|
|
2
|
+
|
|
3
|
+
interface TwClassResult {
|
|
4
|
+
css: string;
|
|
5
|
+
classes: string[];
|
|
6
|
+
}
|
|
7
|
+
interface DesignTokens {
|
|
8
|
+
[key: string]: string | number | DesignTokens;
|
|
9
|
+
}
|
|
10
|
+
interface TwPluginOptions {
|
|
11
|
+
classProcessor?: (classes: string[]) => TwClassResult;
|
|
12
|
+
tokens?: DesignTokens;
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
minify?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type VariantResolver = (selector: string) => string;
|
|
17
|
+
interface UtilityDefinition {
|
|
18
|
+
[property: string]: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ComponentConfig {
|
|
22
|
+
base: string;
|
|
23
|
+
variants: Record<string, Record<string, string>>;
|
|
24
|
+
compoundVariants: Array<{
|
|
25
|
+
class: string;
|
|
26
|
+
} & CompoundCondition>;
|
|
27
|
+
defaultVariants: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
interface TransformMeta {
|
|
30
|
+
componentName: string;
|
|
31
|
+
tag: string;
|
|
32
|
+
}
|
|
33
|
+
type TransformFn = (config: ComponentConfig, meta: TransformMeta) => ComponentConfig;
|
|
34
|
+
type CssHook = (css: string) => string;
|
|
35
|
+
interface TwContext {
|
|
36
|
+
addVariant(name: string, resolver: VariantResolver): void;
|
|
37
|
+
addUtility(name: string, styles: UtilityDefinition): void;
|
|
38
|
+
addToken(name: string, value: string): void;
|
|
39
|
+
addTransform(fn: TransformFn): void;
|
|
40
|
+
onGenerateCSS(hook: CssHook): void;
|
|
41
|
+
onBuildEnd(hook: () => void | Promise<void>): void;
|
|
42
|
+
getToken(name: string): string | undefined;
|
|
43
|
+
subscribeTokens(callback: (tokens: TokenMap) => void): () => void;
|
|
44
|
+
readonly config: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
interface TwPlugin {
|
|
47
|
+
name: string;
|
|
48
|
+
setup(ctx: TwContext): void;
|
|
49
|
+
}
|
|
50
|
+
interface PluginRegistry {
|
|
51
|
+
variants: Map<string, VariantResolver>;
|
|
52
|
+
utilities: Map<string, UtilityDefinition>;
|
|
53
|
+
tokens: Map<string, string>;
|
|
54
|
+
transforms: TransformFn[];
|
|
55
|
+
cssHooks: CssHook[];
|
|
56
|
+
buildHooks: Array<() => void | Promise<void>>;
|
|
57
|
+
plugins: Set<string>;
|
|
58
|
+
}
|
|
59
|
+
interface TokenEngineAPI {
|
|
60
|
+
getToken?: (name: string) => string | undefined;
|
|
61
|
+
getTokens?: () => Record<string, string> | undefined;
|
|
62
|
+
subscribeTokens?: (callback: (tokens: Record<string, string>) => void) => () => void;
|
|
63
|
+
subscribe?: (callback: (tokens: Record<string, string>) => void) => () => void;
|
|
64
|
+
}
|
|
65
|
+
declare function resolveTokenEngine(): TokenEngineAPI | undefined;
|
|
66
|
+
declare function readToken(engine: TokenEngineAPI | undefined, name: string): string | undefined;
|
|
67
|
+
interface TransformContext {
|
|
68
|
+
filename?: string;
|
|
69
|
+
componentName?: string;
|
|
70
|
+
tag?: string;
|
|
71
|
+
}
|
|
72
|
+
interface TwGlobalRegistry {
|
|
73
|
+
transforms: Array<(config: ComponentConfig, ctx: TransformContext) => ComponentConfig>;
|
|
74
|
+
tokens: Record<string, string>;
|
|
75
|
+
variants: Map<string, VariantResolver>;
|
|
76
|
+
}
|
|
77
|
+
declare function getGlobalRegistry(): TwGlobalRegistry;
|
|
78
|
+
declare function registerTransform(transform: (config: ComponentConfig, ctx: TransformContext) => ComponentConfig): void;
|
|
79
|
+
declare function registerToken(name: string, value: string): void;
|
|
80
|
+
declare function createPluginRegistry(): PluginRegistry;
|
|
81
|
+
declare function resetGlobalRegistry(): void;
|
|
82
|
+
declare function createPluginContext(registry: PluginRegistry, config?: Record<string, unknown>): TwContext;
|
|
83
|
+
declare function createTw(config?: Record<string, unknown>): TwContext & {
|
|
84
|
+
registry: {
|
|
85
|
+
plugins: Set<string>;
|
|
86
|
+
variants: Map<string, VariantResolver>;
|
|
87
|
+
utilities: Map<string, UtilityDefinition>;
|
|
88
|
+
tokens: Map<string, string>;
|
|
89
|
+
};
|
|
90
|
+
use: (plugin: TwPlugin) => void;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Creates a TwContext that writes through to the global (legacy) registry.
|
|
94
|
+
* Used by createTwPlugin() in the plugin package.
|
|
95
|
+
*/
|
|
96
|
+
declare function createGlobalPluginContext(config?: Record<string, unknown>): TwContext;
|
|
97
|
+
declare function use(plugin: TwPlugin): void;
|
|
98
|
+
declare function presetTokens(tokens: Record<string, string>): TwPlugin;
|
|
99
|
+
declare function presetVariants(variants: Record<string, VariantResolver>): TwPlugin;
|
|
100
|
+
declare function presetScrollbar(): TwPlugin;
|
|
101
|
+
|
|
102
|
+
export { type ComponentConfig as C, type DesignTokens as D, type PluginRegistry as P, type TwContext as T, type UtilityDefinition as U, type VariantResolver as V, type TwPluginOptions as a, type CssHook as b, type TokenEngineAPI as c, type TransformContext as d, type TransformFn as e, type TransformMeta as f, type TwClassResult as g, type TwGlobalRegistry as h, type TwPlugin as i, createGlobalPluginContext as j, createPluginContext as k, createPluginRegistry as l, createTw as m, getGlobalRegistry as n, presetTokens as o, presetScrollbar as p, presetVariants as q, readToken as r, registerToken as s, registerTransform as t, resetGlobalRegistry as u, resolveTokenEngine as v, use as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as AnalyzerSemanticReport, d as AnalyzerReport, h as analyzeWorkspace$1 } from './analyzeWorkspace-
|
|
1
|
+
import { e as AnalyzerSemanticReport, d as AnalyzerReport, h as analyzeWorkspace$1 } from './analyzeWorkspace-hYfu4Hg3.mjs';
|
|
2
2
|
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.mjs';
|
|
3
3
|
|
|
4
4
|
declare class RuleId {
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { C as CompoundCondition, T as TokenMap } from './index-NDINUhLN.js';
|
|
2
|
+
|
|
3
|
+
interface TwClassResult {
|
|
4
|
+
css: string;
|
|
5
|
+
classes: string[];
|
|
6
|
+
}
|
|
7
|
+
interface DesignTokens {
|
|
8
|
+
[key: string]: string | number | DesignTokens;
|
|
9
|
+
}
|
|
10
|
+
interface TwPluginOptions {
|
|
11
|
+
classProcessor?: (classes: string[]) => TwClassResult;
|
|
12
|
+
tokens?: DesignTokens;
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
minify?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type VariantResolver = (selector: string) => string;
|
|
17
|
+
interface UtilityDefinition {
|
|
18
|
+
[property: string]: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ComponentConfig {
|
|
22
|
+
base: string;
|
|
23
|
+
variants: Record<string, Record<string, string>>;
|
|
24
|
+
compoundVariants: Array<{
|
|
25
|
+
class: string;
|
|
26
|
+
} & CompoundCondition>;
|
|
27
|
+
defaultVariants: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
interface TransformMeta {
|
|
30
|
+
componentName: string;
|
|
31
|
+
tag: string;
|
|
32
|
+
}
|
|
33
|
+
type TransformFn = (config: ComponentConfig, meta: TransformMeta) => ComponentConfig;
|
|
34
|
+
type CssHook = (css: string) => string;
|
|
35
|
+
interface TwContext {
|
|
36
|
+
addVariant(name: string, resolver: VariantResolver): void;
|
|
37
|
+
addUtility(name: string, styles: UtilityDefinition): void;
|
|
38
|
+
addToken(name: string, value: string): void;
|
|
39
|
+
addTransform(fn: TransformFn): void;
|
|
40
|
+
onGenerateCSS(hook: CssHook): void;
|
|
41
|
+
onBuildEnd(hook: () => void | Promise<void>): void;
|
|
42
|
+
getToken(name: string): string | undefined;
|
|
43
|
+
subscribeTokens(callback: (tokens: TokenMap) => void): () => void;
|
|
44
|
+
readonly config: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
interface TwPlugin {
|
|
47
|
+
name: string;
|
|
48
|
+
setup(ctx: TwContext): void;
|
|
49
|
+
}
|
|
50
|
+
interface PluginRegistry {
|
|
51
|
+
variants: Map<string, VariantResolver>;
|
|
52
|
+
utilities: Map<string, UtilityDefinition>;
|
|
53
|
+
tokens: Map<string, string>;
|
|
54
|
+
transforms: TransformFn[];
|
|
55
|
+
cssHooks: CssHook[];
|
|
56
|
+
buildHooks: Array<() => void | Promise<void>>;
|
|
57
|
+
plugins: Set<string>;
|
|
58
|
+
}
|
|
59
|
+
interface TokenEngineAPI {
|
|
60
|
+
getToken?: (name: string) => string | undefined;
|
|
61
|
+
getTokens?: () => Record<string, string> | undefined;
|
|
62
|
+
subscribeTokens?: (callback: (tokens: Record<string, string>) => void) => () => void;
|
|
63
|
+
subscribe?: (callback: (tokens: Record<string, string>) => void) => () => void;
|
|
64
|
+
}
|
|
65
|
+
declare function resolveTokenEngine(): TokenEngineAPI | undefined;
|
|
66
|
+
declare function readToken(engine: TokenEngineAPI | undefined, name: string): string | undefined;
|
|
67
|
+
interface TransformContext {
|
|
68
|
+
filename?: string;
|
|
69
|
+
componentName?: string;
|
|
70
|
+
tag?: string;
|
|
71
|
+
}
|
|
72
|
+
interface TwGlobalRegistry {
|
|
73
|
+
transforms: Array<(config: ComponentConfig, ctx: TransformContext) => ComponentConfig>;
|
|
74
|
+
tokens: Record<string, string>;
|
|
75
|
+
variants: Map<string, VariantResolver>;
|
|
76
|
+
}
|
|
77
|
+
declare function getGlobalRegistry(): TwGlobalRegistry;
|
|
78
|
+
declare function registerTransform(transform: (config: ComponentConfig, ctx: TransformContext) => ComponentConfig): void;
|
|
79
|
+
declare function registerToken(name: string, value: string): void;
|
|
80
|
+
declare function createPluginRegistry(): PluginRegistry;
|
|
81
|
+
declare function resetGlobalRegistry(): void;
|
|
82
|
+
declare function createPluginContext(registry: PluginRegistry, config?: Record<string, unknown>): TwContext;
|
|
83
|
+
declare function createTw(config?: Record<string, unknown>): TwContext & {
|
|
84
|
+
registry: {
|
|
85
|
+
plugins: Set<string>;
|
|
86
|
+
variants: Map<string, VariantResolver>;
|
|
87
|
+
utilities: Map<string, UtilityDefinition>;
|
|
88
|
+
tokens: Map<string, string>;
|
|
89
|
+
};
|
|
90
|
+
use: (plugin: TwPlugin) => void;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Creates a TwContext that writes through to the global (legacy) registry.
|
|
94
|
+
* Used by createTwPlugin() in the plugin package.
|
|
95
|
+
*/
|
|
96
|
+
declare function createGlobalPluginContext(config?: Record<string, unknown>): TwContext;
|
|
97
|
+
declare function use(plugin: TwPlugin): void;
|
|
98
|
+
declare function presetTokens(tokens: Record<string, string>): TwPlugin;
|
|
99
|
+
declare function presetVariants(variants: Record<string, VariantResolver>): TwPlugin;
|
|
100
|
+
declare function presetScrollbar(): TwPlugin;
|
|
101
|
+
|
|
102
|
+
export { type ComponentConfig as C, type DesignTokens as D, type PluginRegistry as P, type TwContext as T, type UtilityDefinition as U, type VariantResolver as V, type TwPluginOptions as a, type CssHook as b, type TokenEngineAPI as c, type TransformContext as d, type TransformFn as e, type TransformMeta as f, type TwClassResult as g, type TwGlobalRegistry as h, type TwPlugin as i, createGlobalPluginContext as j, createPluginContext as k, createPluginRegistry as l, createTw as m, getGlobalRegistry as n, presetTokens as o, presetScrollbar as p, presetVariants as q, readToken as r, registerToken as s, registerTransform as t, resetGlobalRegistry as u, resolveTokenEngine as v, use as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as AnalyzerSemanticReport, d as AnalyzerReport, h as analyzeWorkspace$1 } from './analyzeWorkspace-
|
|
1
|
+
import { e as AnalyzerSemanticReport, d as AnalyzerReport, h as analyzeWorkspace$1 } from './analyzeWorkspace-B1_XRfdl.js';
|
|
2
2
|
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.js';
|
|
3
3
|
|
|
4
4
|
declare class RuleId {
|
package/dist/index.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import { a as AnimateOptions } from './types-DXr2PmGP.mjs';
|
|
|
3
3
|
import { H as HtmlTagName } from './index-NDINUhLN.mjs';
|
|
4
4
|
export { T as TokenMap } from './index-NDINUhLN.mjs';
|
|
5
5
|
export { a as LiveTokenSet, T as TokenSubscriber, b as applyTokenSet, t as containerRef, c as createUseTokens, g as generateTokenCssString, d as getToken, e as getTokens, l as liveToken, s as setToken, h as setTokens, i as subscribeTokens, t as tokenRef, j as tokenVar } from './liveTokenEngine-DKoWRtqH.mjs';
|
|
6
|
-
export { K as createEngine } from './index-
|
|
7
|
-
import './analyzeWorkspace-
|
|
6
|
+
export { K as createEngine } from './index-DQI6O24n.mjs';
|
|
7
|
+
import './analyzeWorkspace-hYfu4Hg3.mjs';
|
|
8
8
|
import './schemas-DR-SLxZZ.mjs';
|
|
9
9
|
import 'zod';
|
|
10
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { a as AnimateOptions } from './types-DXr2PmGP.js';
|
|
|
3
3
|
import { H as HtmlTagName } from './index-NDINUhLN.js';
|
|
4
4
|
export { T as TokenMap } from './index-NDINUhLN.js';
|
|
5
5
|
export { a as LiveTokenSet, T as TokenSubscriber, b as applyTokenSet, t as containerRef, c as createUseTokens, g as generateTokenCssString, d as getToken, e as getTokens, l as liveToken, s as setToken, h as setTokens, i as subscribeTokens, t as tokenRef, j as tokenVar } from './liveTokenEngine-CN9ian1R.js';
|
|
6
|
-
export { K as createEngine } from './index-
|
|
7
|
-
import './analyzeWorkspace-
|
|
6
|
+
export { K as createEngine } from './index-UkYbyBkR.js';
|
|
7
|
+
import './analyzeWorkspace-B1_XRfdl.js';
|
|
8
8
|
import './schemas-DR-SLxZZ.js';
|
|
9
9
|
import 'zod';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -1050,8 +1050,44 @@ var init_nativeBridge = __esm({
|
|
|
1050
1050
|
try {
|
|
1051
1051
|
const binding = _loadNative(result.path);
|
|
1052
1052
|
if (isValidNativeBridge(binding)) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1053
|
+
const toCamelCase = (str) => {
|
|
1054
|
+
return str.replace(/_([a-z0-9])/g, (_, g) => g.toUpperCase());
|
|
1055
|
+
};
|
|
1056
|
+
nativeBridge = new Proxy(binding, {
|
|
1057
|
+
get(target, prop) {
|
|
1058
|
+
if (typeof prop === "string") {
|
|
1059
|
+
if (prop in target) {
|
|
1060
|
+
return target[prop];
|
|
1061
|
+
}
|
|
1062
|
+
const camelKey = toCamelCase(prop);
|
|
1063
|
+
if (camelKey in target) {
|
|
1064
|
+
const val = target[camelKey];
|
|
1065
|
+
if (typeof val === "function") {
|
|
1066
|
+
return val.bind(target);
|
|
1067
|
+
}
|
|
1068
|
+
return val;
|
|
1069
|
+
}
|
|
1070
|
+
const napiKey = `${camelKey}Napi`;
|
|
1071
|
+
if (napiKey in target) {
|
|
1072
|
+
const val = target[napiKey];
|
|
1073
|
+
if (typeof val === "function") {
|
|
1074
|
+
return val.bind(target);
|
|
1075
|
+
}
|
|
1076
|
+
return val;
|
|
1077
|
+
}
|
|
1078
|
+
const napiInnerKey = `${camelKey}NapiInner`;
|
|
1079
|
+
if (napiInnerKey in target) {
|
|
1080
|
+
const val = target[napiInnerKey];
|
|
1081
|
+
if (typeof val === "function") {
|
|
1082
|
+
return val.bind(target);
|
|
1083
|
+
}
|
|
1084
|
+
return val;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
return target[prop];
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
log("Native bridge loaded successfully and proxy-wrapped from:", result.path);
|
|
1055
1091
|
return nativeBridge;
|
|
1056
1092
|
}
|
|
1057
1093
|
} catch (e) {
|
|
@@ -1099,8 +1135,8 @@ async function generateCssNative(classes, options) {
|
|
|
1099
1135
|
return css;
|
|
1100
1136
|
}
|
|
1101
1137
|
function clearThemeCache() {
|
|
1138
|
+
const native = getNativeBridge();
|
|
1102
1139
|
try {
|
|
1103
|
-
const native = getNativeBridge();
|
|
1104
1140
|
if (!native?.clearThemeCache) {
|
|
1105
1141
|
return;
|
|
1106
1142
|
}
|
|
@@ -1108,6 +1144,16 @@ function clearThemeCache() {
|
|
|
1108
1144
|
} catch {
|
|
1109
1145
|
}
|
|
1110
1146
|
}
|
|
1147
|
+
function resetCacheStats() {
|
|
1148
|
+
const native = getNativeBridge();
|
|
1149
|
+
try {
|
|
1150
|
+
if (!native?.resetCacheStats) {
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
native.resetCacheStats();
|
|
1154
|
+
} catch {
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1111
1157
|
var init_cssGeneratorNative = __esm({
|
|
1112
1158
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1113
1159
|
init_nativeBridge();
|
|
@@ -1233,6 +1279,16 @@ function minifyCss(css) {
|
|
|
1233
1279
|
if (!native?.minify_css) throw new Error("minify_css not available");
|
|
1234
1280
|
return native.minify_css(css);
|
|
1235
1281
|
}
|
|
1282
|
+
function generateCss(ruleJson, minify) {
|
|
1283
|
+
const native = getNativeBridge();
|
|
1284
|
+
if (!native?.generate_css) throw new Error("generate_css not available");
|
|
1285
|
+
return native.generate_css(ruleJson, minify);
|
|
1286
|
+
}
|
|
1287
|
+
function generateCssBatch(rulesJson, minify) {
|
|
1288
|
+
const native = getNativeBridge();
|
|
1289
|
+
if (!native?.generate_css_batch) throw new Error("generate_css_batch not available");
|
|
1290
|
+
return native.generate_css_batch(rulesJson, minify);
|
|
1291
|
+
}
|
|
1236
1292
|
function compileAnimation(animationName, from, to) {
|
|
1237
1293
|
const native = getNativeBridge();
|
|
1238
1294
|
if (!native?.compile_animation) throw new Error("compile_animation not available");
|
|
@@ -1670,7 +1726,7 @@ function postProcessWithLightning(rawCss) {
|
|
|
1670
1726
|
}
|
|
1671
1727
|
return result.css;
|
|
1672
1728
|
}
|
|
1673
|
-
async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
1729
|
+
async function runCssPipeline(classes, cssEntryContent, root, minify = true, minifier = "lightning") {
|
|
1674
1730
|
const filtered = classes.filter(Boolean);
|
|
1675
1731
|
const uniqueMap = /* @__PURE__ */ new Map();
|
|
1676
1732
|
filtered.forEach((cls) => uniqueMap.set(cls, cls));
|
|
@@ -1678,7 +1734,7 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1678
1734
|
if (unique.length === 0) {
|
|
1679
1735
|
return { css: "", classes: [], sizeBytes: 0, optimized: false };
|
|
1680
1736
|
}
|
|
1681
|
-
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root)
|
|
1737
|
+
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root) + `|${minifier}`;
|
|
1682
1738
|
const cached = _cssCache.get(cacheKey);
|
|
1683
1739
|
if (cached) {
|
|
1684
1740
|
_cacheHits++;
|
|
@@ -1695,7 +1751,14 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1695
1751
|
const theme = getThemeConfig();
|
|
1696
1752
|
rawCss = await generateCssNative(unique, { theme });
|
|
1697
1753
|
usedRustCompiler = true;
|
|
1698
|
-
|
|
1754
|
+
let finalCss = rawCss;
|
|
1755
|
+
if (minify) {
|
|
1756
|
+
if (minifier === "fast") {
|
|
1757
|
+
finalCss = minifyCss(rawCss);
|
|
1758
|
+
} else {
|
|
1759
|
+
finalCss = postProcessWithLightning(rawCss);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1699
1762
|
if (process.env.DEBUG?.includes("compiler")) {
|
|
1700
1763
|
console.log(
|
|
1701
1764
|
`[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
|
|
@@ -1731,6 +1794,7 @@ var init_tailwindEngine = __esm({
|
|
|
1731
1794
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1732
1795
|
init_nativeBridge();
|
|
1733
1796
|
init_cssGeneratorNative();
|
|
1797
|
+
init_cssCompilationNative();
|
|
1734
1798
|
module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
|
|
1735
1799
|
_cssCache = /* @__PURE__ */ new Map();
|
|
1736
1800
|
_cacheHits = 0;
|
|
@@ -1763,9 +1827,10 @@ __export(parser_exports, {
|
|
|
1763
1827
|
mergeClassesStatic: () => mergeClassesStatic,
|
|
1764
1828
|
normalizeAndDedupClasses: () => normalizeAndDedupClasses,
|
|
1765
1829
|
normalizeClasses: () => normalizeClasses,
|
|
1830
|
+
parseClass: () => parseClass,
|
|
1766
1831
|
parseClasses: () => parseClasses
|
|
1767
1832
|
});
|
|
1768
|
-
var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1833
|
+
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1769
1834
|
var init_parser = __esm({
|
|
1770
1835
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1771
1836
|
init_nativeBridge();
|
|
@@ -1776,6 +1841,14 @@ var init_parser = __esm({
|
|
|
1776
1841
|
}
|
|
1777
1842
|
return native.parseClasses(raw) || [];
|
|
1778
1843
|
};
|
|
1844
|
+
parseClass = (input) => {
|
|
1845
|
+
const native = getNativeBridge();
|
|
1846
|
+
if (!native?.parseClass) {
|
|
1847
|
+
throw new Error("FATAL: Native binding 'parseClass' is required but not available.");
|
|
1848
|
+
}
|
|
1849
|
+
const result = native.parseClass(input);
|
|
1850
|
+
return typeof result === "string" ? JSON.parse(result) : result;
|
|
1851
|
+
};
|
|
1779
1852
|
extractAllClasses = (source) => {
|
|
1780
1853
|
const native = getNativeBridge();
|
|
1781
1854
|
if (!native?.extractAllClasses) {
|
|
@@ -1907,6 +1980,35 @@ function mergeCssDeclarationsNative(cssChunks) {
|
|
|
1907
1980
|
if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
|
|
1908
1981
|
return native.mergeCssDeclarations(cssChunks);
|
|
1909
1982
|
}
|
|
1983
|
+
function getWeek6FeaturesStatus() {
|
|
1984
|
+
const native = getNativeBridge();
|
|
1985
|
+
if (!native?.getWeek6FeaturesStatus) throw new Error("getWeek6FeaturesStatus not available");
|
|
1986
|
+
const resultJson = native.getWeek6FeaturesStatus();
|
|
1987
|
+
return JSON.parse(resultJson);
|
|
1988
|
+
}
|
|
1989
|
+
function getMemoryStatsNative() {
|
|
1990
|
+
const native = getNativeBridge();
|
|
1991
|
+
if (!native?.getMemoryStatsNative) throw new Error("getMemoryStatsNative not available");
|
|
1992
|
+
const resultJson = native.getMemoryStatsNative();
|
|
1993
|
+
return JSON.parse(resultJson);
|
|
1994
|
+
}
|
|
1995
|
+
function getMemoryRecommendationsNative() {
|
|
1996
|
+
const native = getNativeBridge();
|
|
1997
|
+
if (!native?.getMemoryRecommendationsNative) throw new Error("getMemoryRecommendationsNative not available");
|
|
1998
|
+
const resultJson = native.getMemoryRecommendationsNative();
|
|
1999
|
+
return JSON.parse(resultJson);
|
|
2000
|
+
}
|
|
2001
|
+
function estimateOptimalCacheConfigNative(workloadType, expectedEntries) {
|
|
2002
|
+
const native = getNativeBridge();
|
|
2003
|
+
if (!native?.estimateOptimalCacheConfigNative) throw new Error("estimateOptimalCacheConfigNative not available");
|
|
2004
|
+
const resultJson = native.estimateOptimalCacheConfigNative(workloadType, expectedEntries);
|
|
2005
|
+
return JSON.parse(resultJson);
|
|
2006
|
+
}
|
|
2007
|
+
function resetMemoryStats() {
|
|
2008
|
+
const native = getNativeBridge();
|
|
2009
|
+
if (!native?.resetMemoryStats) throw new Error("resetMemoryStats not available");
|
|
2010
|
+
native.resetMemoryStats();
|
|
2011
|
+
}
|
|
1910
2012
|
var init_analyzerNative = __esm({
|
|
1911
2013
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1912
2014
|
init_nativeBridge();
|
|
@@ -2196,6 +2298,52 @@ function cachePriority(mtimeMs, sizeBytes, hitCount) {
|
|
|
2196
2298
|
if (!native?.cache_priority) throw new Error("cache_priority not available");
|
|
2197
2299
|
return native.cache_priority(mtimeMs, sizeBytes, hitCount);
|
|
2198
2300
|
}
|
|
2301
|
+
function getResolverPoolStats() {
|
|
2302
|
+
const native = getNativeBridge();
|
|
2303
|
+
if (!native?.getResolverPoolStats) throw new Error("getResolverPoolStats not available");
|
|
2304
|
+
const statsJson = native.getResolverPoolStats();
|
|
2305
|
+
try {
|
|
2306
|
+
return JSON.parse(statsJson);
|
|
2307
|
+
} catch {
|
|
2308
|
+
return {
|
|
2309
|
+
hits: 0,
|
|
2310
|
+
misses: 0,
|
|
2311
|
+
total: 0,
|
|
2312
|
+
hit_rate: 0,
|
|
2313
|
+
cached_resolvers: 0
|
|
2314
|
+
};
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
function clearResolverPool() {
|
|
2318
|
+
const native = getNativeBridge();
|
|
2319
|
+
if (!native?.clearResolverPool) throw new Error("clearResolverPool not available");
|
|
2320
|
+
const resultJson = native.clearResolverPool();
|
|
2321
|
+
try {
|
|
2322
|
+
return JSON.parse(resultJson);
|
|
2323
|
+
} catch {
|
|
2324
|
+
return { status: "error" };
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
function resolveColorCached(themeId, color, configJson) {
|
|
2328
|
+
const native = getNativeBridge();
|
|
2329
|
+
if (!native?.resolveColorCached) throw new Error("resolveColorCached not available");
|
|
2330
|
+
return native.resolveColorCached(themeId, color, configJson);
|
|
2331
|
+
}
|
|
2332
|
+
function resolveSpacingCached(themeId, spacing, configJson) {
|
|
2333
|
+
const native = getNativeBridge();
|
|
2334
|
+
if (!native?.resolveSpacingCached) throw new Error("resolveSpacingCached not available");
|
|
2335
|
+
return native.resolveSpacingCached(themeId, spacing, configJson);
|
|
2336
|
+
}
|
|
2337
|
+
function resolveFontSizeCached(themeId, size, configJson) {
|
|
2338
|
+
const native = getNativeBridge();
|
|
2339
|
+
if (!native?.resolveFontSizeCached) throw new Error("resolveFontSizeCached not available");
|
|
2340
|
+
return native.resolveFontSizeCached(themeId, size, configJson);
|
|
2341
|
+
}
|
|
2342
|
+
function resetResolverPoolStats() {
|
|
2343
|
+
const native = getNativeBridge();
|
|
2344
|
+
if (!native?.resetResolverPoolStats) throw new Error("resetResolverPoolStats not available");
|
|
2345
|
+
native.resetResolverPoolStats();
|
|
2346
|
+
}
|
|
2199
2347
|
var init_cacheNative = __esm({
|
|
2200
2348
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2201
2349
|
init_nativeBridge();
|
|
@@ -2844,9 +2992,9 @@ var init_src = __esm({
|
|
|
2844
2992
|
if (normalized.includes("/layout.") || normalized.includes("/loading.") || normalized.includes("/error.")) {
|
|
2845
2993
|
return "__global";
|
|
2846
2994
|
}
|
|
2847
|
-
const pageMatch = normalized.match(
|
|
2995
|
+
const pageMatch = normalized.match(/(?:^|\/)app\/(.+?)\/page\.[tj]sx?$/);
|
|
2848
2996
|
if (pageMatch) return `/${pageMatch[1]}`;
|
|
2849
|
-
const rootPage = normalized.match(
|
|
2997
|
+
const rootPage = normalized.match(/(?:^|\/)app\/page\.[tj]sx?$/);
|
|
2850
2998
|
if (rootPage) return "/";
|
|
2851
2999
|
return null;
|
|
2852
3000
|
};
|
|
@@ -3005,6 +3153,7 @@ __export(internal_exports, {
|
|
|
3005
3153
|
clearCssGenCache: () => clearCssGenCache,
|
|
3006
3154
|
clearParseCache: () => clearParseCache,
|
|
3007
3155
|
clearResolveCache: () => clearResolveCache,
|
|
3156
|
+
clearResolverPool: () => clearResolverPool,
|
|
3008
3157
|
clearThemeCache: () => clearThemeCache,
|
|
3009
3158
|
collectFiles: () => collectFiles,
|
|
3010
3159
|
compileAnimation: () => compileAnimation,
|
|
@@ -3027,6 +3176,7 @@ __export(internal_exports, {
|
|
|
3027
3176
|
eliminateDeadCssNative: () => eliminateDeadCssNative,
|
|
3028
3177
|
emitPluginHook: () => emitPluginHook,
|
|
3029
3178
|
estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
|
|
3179
|
+
estimateOptimalCacheConfigNative: () => estimateOptimalCacheConfigNative,
|
|
3030
3180
|
extractAllClasses: () => extractAllClasses,
|
|
3031
3181
|
extractAndGenerateStateCss: () => extractAndGenerateStateCss,
|
|
3032
3182
|
extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
|
|
@@ -3040,6 +3190,8 @@ __export(internal_exports, {
|
|
|
3040
3190
|
fileToRoute: () => fileToRoute,
|
|
3041
3191
|
findDeadVariants: () => findDeadVariants,
|
|
3042
3192
|
generateAtomicCss: () => generateAtomicCss,
|
|
3193
|
+
generateCss: () => generateCss,
|
|
3194
|
+
generateCssBatch: () => generateCssBatch,
|
|
3043
3195
|
generateCssForClasses: () => generateCssForClasses,
|
|
3044
3196
|
generateCssNative: () => generateCssNative,
|
|
3045
3197
|
generateSafelist: () => generateSafelist,
|
|
@@ -3055,10 +3207,14 @@ __export(internal_exports, {
|
|
|
3055
3207
|
getCompilerDiagnostics: () => getCompilerDiagnostics,
|
|
3056
3208
|
getContentPaths: () => getContentPaths,
|
|
3057
3209
|
getIncrementalEngine: () => getIncrementalEngine,
|
|
3210
|
+
getMemoryRecommendationsNative: () => getMemoryRecommendationsNative,
|
|
3211
|
+
getMemoryStatsNative: () => getMemoryStatsNative,
|
|
3058
3212
|
getNativeBridge: () => getNativeBridge,
|
|
3059
3213
|
getPluginHooks: () => getPluginHooks,
|
|
3214
|
+
getResolverPoolStats: () => getResolverPoolStats,
|
|
3060
3215
|
getRouteClasses: () => getRouteClasses,
|
|
3061
3216
|
getWatchStats: () => getWatchStats,
|
|
3217
|
+
getWeek6FeaturesStatus: () => getWeek6FeaturesStatus,
|
|
3062
3218
|
hasTwUsage: () => hasTwUsage,
|
|
3063
3219
|
hashContent: () => hashContent,
|
|
3064
3220
|
hoistComponentsNative: () => hoistComponentsNative,
|
|
@@ -3087,6 +3243,7 @@ __export(internal_exports, {
|
|
|
3087
3243
|
normalizeClasses: () => normalizeClasses,
|
|
3088
3244
|
optimizeCssNative: () => optimizeCssNative,
|
|
3089
3245
|
parseAtomicClass: () => parseAtomicClass,
|
|
3246
|
+
parseClass: () => parseClass,
|
|
3090
3247
|
parseClasses: () => parseClasses,
|
|
3091
3248
|
pollWatchEvents: () => pollWatchEvents,
|
|
3092
3249
|
processFileChange: () => processFileChange,
|
|
@@ -3138,12 +3295,18 @@ __export(internal_exports, {
|
|
|
3138
3295
|
registerPropertyName: () => registerPropertyName,
|
|
3139
3296
|
registerValueName: () => registerValueName,
|
|
3140
3297
|
resetBucketEngine: () => resetBucketEngine,
|
|
3298
|
+
resetCacheStats: () => resetCacheStats,
|
|
3141
3299
|
resetCompilationMetrics: () => resetCompilationMetrics,
|
|
3142
3300
|
resetIncrementalEngine: () => resetIncrementalEngine,
|
|
3301
|
+
resetMemoryStats: () => resetMemoryStats,
|
|
3302
|
+
resetResolverPoolStats: () => resetResolverPoolStats,
|
|
3143
3303
|
resolveCascade: () => resolveCascade,
|
|
3144
3304
|
resolveClassNames: () => resolveClassNames,
|
|
3305
|
+
resolveColorCached: () => resolveColorCached,
|
|
3145
3306
|
resolveConflictGroup: () => resolveConflictGroup,
|
|
3307
|
+
resolveFontSizeCached: () => resolveFontSizeCached,
|
|
3146
3308
|
resolveSimpleVariants: () => resolveSimpleVariants,
|
|
3309
|
+
resolveSpacingCached: () => resolveSpacingCached,
|
|
3147
3310
|
resolveThemeValue: () => resolveThemeValue,
|
|
3148
3311
|
resolveVariants: () => resolveVariants,
|
|
3149
3312
|
reverseLookupProperty: () => reverseLookupProperty,
|
|
@@ -3389,7 +3552,11 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3389
3552
|
return result;
|
|
3390
3553
|
}
|
|
3391
3554
|
function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
3392
|
-
const result = extractStaticStateCss(srcDir,
|
|
3555
|
+
const result = extractStaticStateCss(srcDir, {
|
|
3556
|
+
verbose: options.verbose,
|
|
3557
|
+
resolvedCss: options.resolvedCss || ""
|
|
3558
|
+
// ← ensure always passed
|
|
3559
|
+
});
|
|
3393
3560
|
const twClassesDir = path9__namespace.default.join(path9__namespace.default.dirname(safelistPath), "tw-classes");
|
|
3394
3561
|
fs3__namespace.default.mkdirSync(twClassesDir, { recursive: true });
|
|
3395
3562
|
const stateFilePath = path9__namespace.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
@@ -6298,7 +6465,7 @@ function sanitizeFrequentThreshold(value) {
|
|
|
6298
6465
|
// packages/domain/analyzer/src/binding.ts
|
|
6299
6466
|
var isAnalyzerModule = (module) => {
|
|
6300
6467
|
const candidate = module;
|
|
6301
|
-
return typeof candidate?.analyzeClasses === "function";
|
|
6468
|
+
return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
|
|
6302
6469
|
};
|
|
6303
6470
|
var createAnalyzerBindingLoader = () => {
|
|
6304
6471
|
const _state = { bindingPromise: null };
|
|
@@ -6317,7 +6484,7 @@ var createAnalyzerBindingLoader = () => {
|
|
|
6317
6484
|
runtimeDir,
|
|
6318
6485
|
candidates,
|
|
6319
6486
|
isValid: isAnalyzerModule,
|
|
6320
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
6487
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
6321
6488
|
});
|
|
6322
6489
|
if (binding) {
|
|
6323
6490
|
debugLog(`native binding loaded from: ${loadedPath}`);
|
|
@@ -6360,7 +6527,7 @@ async function requireNativeBinding() {
|
|
|
6360
6527
|
runtimeDir,
|
|
6361
6528
|
candidates,
|
|
6362
6529
|
isValid: isAnalyzerModule,
|
|
6363
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
6530
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
6364
6531
|
});
|
|
6365
6532
|
const lines = [
|
|
6366
6533
|
"Native analyzer binding not found. Ensure `tailwind_styled_parser.node` is built."
|
|
@@ -6780,7 +6947,8 @@ async function analyzeWorkspace(root, options = {}) {
|
|
|
6780
6947
|
);
|
|
6781
6948
|
const nativeReport = (() => {
|
|
6782
6949
|
try {
|
|
6783
|
-
const
|
|
6950
|
+
const fn = binding.analyzeClassesWorkspace || binding.analyzeClasses;
|
|
6951
|
+
const report = fn(filesJson, resolvedRoot, topLimit);
|
|
6784
6952
|
if (!report) {
|
|
6785
6953
|
throw new Error(`Native analyzer returned no report for "${resolvedRoot}".`);
|
|
6786
6954
|
}
|