@bamboocss/vite 1.14.0 → 1.16.0
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.cjs +172 -548
- package/dist/index.d.cts +14 -18
- package/dist/index.d.mts +14 -18
- package/dist/index.mjs +172 -548
- package/package.json +9 -9
package/dist/index.d.cts
CHANGED
|
@@ -31,9 +31,18 @@ declare const createRuntimeCss: (ctx: Context) => RuntimeCss;
|
|
|
31
31
|
* Why a call site was left alone. Surfaced through `panda`-style diagnostics so a
|
|
32
32
|
* user can tell the difference between "this folded" and "this silently didn't".
|
|
33
33
|
*/
|
|
34
|
-
type SkipReason = 'dynamic' | 'raw-call' | 'not-foldable' | 'unsupported-kind' | 'not-imported' | 'no-call-expression' | 'overlapping' | 'empty';
|
|
34
|
+
type SkipReason = 'dynamic' | 'raw-call' | 'not-foldable' | 'unsupported-kind' | 'not-imported' | 'no-call-expression' | 'overlapping' | 'empty' | 'unresolved-token';
|
|
35
35
|
interface FoldedCall {
|
|
36
36
|
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* What the call collapsed to.
|
|
39
|
+
*
|
|
40
|
+
* `class` is every style surface: a class string bound for a `class` attribute. `value`
|
|
41
|
+
* is `token()`, which resolves to a CSS *value* (`var(--colors-red-300)`). The two are
|
|
42
|
+
* not interchangeable, and a consumer that checks folded classes against the emitted
|
|
43
|
+
* stylesheet has to skip the latter — there is no rule named after a variable reference.
|
|
44
|
+
*/
|
|
45
|
+
kind: 'class' | 'value';
|
|
37
46
|
/** The class string resolved outright, empty when the whole call lowered to ternaries. */
|
|
38
47
|
className: string;
|
|
39
48
|
/**
|
|
@@ -42,6 +51,8 @@ interface FoldedCall {
|
|
|
42
51
|
* which `className` alone does not carry.
|
|
43
52
|
*/
|
|
44
53
|
classNames: string[];
|
|
54
|
+
/** The literal written in place of the call, for a `value` fold. */
|
|
55
|
+
value?: string;
|
|
45
56
|
start: number;
|
|
46
57
|
end: number;
|
|
47
58
|
}
|
|
@@ -75,13 +86,8 @@ interface FoldOptions {
|
|
|
75
86
|
/** Reuse one runtime `css` across files in a build. */
|
|
76
87
|
runtimeCss?: RuntimeCss;
|
|
77
88
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
jsx?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Split a `css()` call or a `styled.*` element that is only partly static, keeping the
|
|
84
|
-
* dynamic half at runtime. On by default.
|
|
89
|
+
* Split a `css()` call that is only partly static, keeping the dynamic half at runtime.
|
|
90
|
+
* On by default.
|
|
85
91
|
*/
|
|
86
92
|
partial?: boolean;
|
|
87
93
|
}
|
|
@@ -98,16 +104,6 @@ interface BambooVitePluginOptions {
|
|
|
98
104
|
* @default false
|
|
99
105
|
*/
|
|
100
106
|
transform?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Also collapse `styled.*` and pattern elements to the tag they render, rather than
|
|
103
|
-
* folding call sites alone.
|
|
104
|
-
*
|
|
105
|
-
* On by default, and the larger of the two wins: the factory runs `splitProps`,
|
|
106
|
-
* `css()` and `cx` for every element on every render, inside a `forwardRef` component.
|
|
107
|
-
*
|
|
108
|
-
* @default true
|
|
109
|
-
*/
|
|
110
|
-
jsx?: boolean;
|
|
111
107
|
/**
|
|
112
108
|
* Split a call or element that is only partly static, so the resolvable half becomes a
|
|
113
109
|
* literal and only the rest keeps its runtime call. On by default.
|
package/dist/index.d.mts
CHANGED
|
@@ -31,9 +31,18 @@ declare const createRuntimeCss: (ctx: Context) => RuntimeCss;
|
|
|
31
31
|
* Why a call site was left alone. Surfaced through `panda`-style diagnostics so a
|
|
32
32
|
* user can tell the difference between "this folded" and "this silently didn't".
|
|
33
33
|
*/
|
|
34
|
-
type SkipReason = 'dynamic' | 'raw-call' | 'not-foldable' | 'unsupported-kind' | 'not-imported' | 'no-call-expression' | 'overlapping' | 'empty';
|
|
34
|
+
type SkipReason = 'dynamic' | 'raw-call' | 'not-foldable' | 'unsupported-kind' | 'not-imported' | 'no-call-expression' | 'overlapping' | 'empty' | 'unresolved-token';
|
|
35
35
|
interface FoldedCall {
|
|
36
36
|
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* What the call collapsed to.
|
|
39
|
+
*
|
|
40
|
+
* `class` is every style surface: a class string bound for a `class` attribute. `value`
|
|
41
|
+
* is `token()`, which resolves to a CSS *value* (`var(--colors-red-300)`). The two are
|
|
42
|
+
* not interchangeable, and a consumer that checks folded classes against the emitted
|
|
43
|
+
* stylesheet has to skip the latter — there is no rule named after a variable reference.
|
|
44
|
+
*/
|
|
45
|
+
kind: 'class' | 'value';
|
|
37
46
|
/** The class string resolved outright, empty when the whole call lowered to ternaries. */
|
|
38
47
|
className: string;
|
|
39
48
|
/**
|
|
@@ -42,6 +51,8 @@ interface FoldedCall {
|
|
|
42
51
|
* which `className` alone does not carry.
|
|
43
52
|
*/
|
|
44
53
|
classNames: string[];
|
|
54
|
+
/** The literal written in place of the call, for a `value` fold. */
|
|
55
|
+
value?: string;
|
|
45
56
|
start: number;
|
|
46
57
|
end: number;
|
|
47
58
|
}
|
|
@@ -75,13 +86,8 @@ interface FoldOptions {
|
|
|
75
86
|
/** Reuse one runtime `css` across files in a build. */
|
|
76
87
|
runtimeCss?: RuntimeCss;
|
|
77
88
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
jsx?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Split a `css()` call or a `styled.*` element that is only partly static, keeping the
|
|
84
|
-
* dynamic half at runtime. On by default.
|
|
89
|
+
* Split a `css()` call that is only partly static, keeping the dynamic half at runtime.
|
|
90
|
+
* On by default.
|
|
85
91
|
*/
|
|
86
92
|
partial?: boolean;
|
|
87
93
|
}
|
|
@@ -98,16 +104,6 @@ interface BambooVitePluginOptions {
|
|
|
98
104
|
* @default false
|
|
99
105
|
*/
|
|
100
106
|
transform?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Also collapse `styled.*` and pattern elements to the tag they render, rather than
|
|
103
|
-
* folding call sites alone.
|
|
104
|
-
*
|
|
105
|
-
* On by default, and the larger of the two wins: the factory runs `splitProps`,
|
|
106
|
-
* `css()` and `cx` for every element on every render, inside a `forwardRef` component.
|
|
107
|
-
*
|
|
108
|
-
* @default true
|
|
109
|
-
*/
|
|
110
|
-
jsx?: boolean;
|
|
111
107
|
/**
|
|
112
108
|
* Split a call or element that is only partly static, so the resolvable half becomes a
|
|
113
109
|
* literal and only the rest keeps its runtime call. On by default.
|