@@ -24,6 +24,8 @@ export type SolidStylingStrategy =
24
24
| "styled-components"
25
25
| "inline-css" ;
26
26
27
+ export type PreactStylingStrategy = ReactStylingStrategy ;
28
+
27
29
export interface FlutterOption {
28
30
framework : Framework . flutter ;
29
31
language : Language . dart ;
@@ -47,6 +49,12 @@ export interface SolidOption {
47
49
styling : SolidStylingStrategy ;
48
50
}
49
51
52
+ export interface PreactOption {
53
+ framework : Framework . preact ;
54
+ language : Language . jsx | Language . tsx ;
55
+ styling : PreactStylingStrategy ;
56
+ }
57
+
50
58
export interface VanillaOption {
51
59
framework : Framework . vanilla ;
52
60
language : Language . html ;
@@ -55,8 +63,9 @@ export interface VanillaOption {
55
63
export type FrameworkOption =
56
64
| ReactOption
57
65
| ReactNativeOption
58
- | FlutterOption
66
+ | PreactOption
59
67
| SolidOption
68
+ | FlutterOption
60
69
| VanillaOption ;
61
70
62
71
export const react_presets = {
@@ -130,6 +139,34 @@ export const solid_presets = {
130
139
} ,
131
140
} ;
132
141
142
+ export const preact_presets = {
143
+ default : < PreactOption > {
144
+ framework : Framework . preact ,
145
+ language : Language . tsx ,
146
+ styling : "styled-components" ,
147
+ } ,
148
+ with_styled_components : < PreactOption > {
149
+ framework : Framework . preact ,
150
+ language : Language . tsx ,
151
+ styling : "styled-components" ,
152
+ } ,
153
+ with_inline_css : < PreactOption > {
154
+ framework : Framework . preact ,
155
+ language : Language . tsx ,
156
+ styling : "inline-css" ,
157
+ } ,
158
+ with_css_module : < PreactOption > {
159
+ framework : Framework . preact ,
160
+ language : Language . tsx ,
161
+ styling : "css-module" ,
162
+ } ,
163
+ with_css : < PreactOption > {
164
+ framework : Framework . preact ,
165
+ language : Language . tsx ,
166
+ styling : "css" ,
167
+ } ,
168
+ } ;
169
+
133
170
export const vanilla_presets = {
134
171
vanilla_default : < VanillaOption > {
135
172
framework : Framework . vanilla ,
@@ -166,6 +203,11 @@ export const all_preset_options_map__prod = {
166
203
react_with_styled_components : react_presets . react_with_styled_components ,
167
204
react_with_inline_css : react_presets . react_with_inline_css ,
168
205
react_with_css_module : react_presets . react_with_css_module ,
206
+ preact : preact_presets . default ,
207
+ preact_default : preact_presets . default ,
208
+ preact_with_styled_components : preact_presets . with_styled_components ,
209
+ preact_with_inline_css : preact_presets . with_inline_css ,
210
+ preact_with_css_module : preact_presets . with_css_module ,
169
211
"react-native" : reactnative_presets . reactnative_default ,
170
212
reactnative : reactnative_presets . reactnative_default ,
171
213
reactnative_default : reactnative_presets . reactnative_default ,
@@ -186,6 +228,7 @@ export const lang_by_framework = {
186
228
flutter : [ Language . dart ] ,
187
229
react : [ Language . jsx , Language . tsx ] ,
188
230
"react-native" : [ Language . jsx , Language . tsx ] ,
231
+ preact : [ Language . jsx , Language . tsx ] ,
189
232
"solid-js" : [ Language . jsx , Language . tsx ] ,
190
233
vanilla : [ Language . html ] ,
191
234
} ;
@@ -197,6 +240,8 @@ export const react_styles: ReactStylingStrategy[] = [
197
240
"css" ,
198
241
] ;
199
242
243
+ export const preact_styles : PreactStylingStrategy [ ] = react_styles ;
244
+
200
245
export const getpreset = ( preset_name : string ) : FrameworkOption => {
201
246
const _p = all_preset_options_map__prod [ preset_name ] ;
202
247
if ( _p ) {
@@ -213,6 +258,10 @@ export const getDefaultPresetNameByFramework = (frameowrk: Framework) => {
213
258
return "react_default" ;
214
259
case Framework . reactnative :
215
260
return "reactnative_default" ;
261
+ case Framework . solid :
262
+ return "solid_default" ;
263
+ case Framework . preact :
264
+ return "default" ;
216
265
case Framework . vanilla :
217
266
return "vanilla_default" ;
218
267
}
0 commit comments