@@ -17,6 +17,13 @@ const DEFAULT_FLEX_STYLE: NodeStyle = {
1717 alignItems : 'center' ,
1818} ;
1919
20+ const DEFAULT_LAYOUT_MODE = {
21+ widthMode : 'fixed' as const ,
22+ heightMode : 'fixed' as const ,
23+ widthUnit : 'px' as const ,
24+ heightUnit : 'px' as const ,
25+ } ;
26+
2027export const COMPONENT_DEFAULTS : Record < WcxNode [ 'type' ] , ComponentDefaults > = {
2128 Image : {
2229 props : {
@@ -33,6 +40,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
3340 width : 400 ,
3441 height : 300 ,
3542 zIndex : 0 ,
43+ ...DEFAULT_LAYOUT_MODE ,
3644 } ,
3745 } ,
3846 Heading : {
@@ -52,6 +60,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
5260 width : 200 ,
5361 height : 50 ,
5462 zIndex : 1 ,
63+ ...DEFAULT_LAYOUT_MODE ,
5564 } ,
5665 } ,
5766 Text : {
@@ -72,6 +81,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
7281 width : 300 ,
7382 height : 100 ,
7483 zIndex : 1 ,
84+ ...DEFAULT_LAYOUT_MODE ,
7585 } ,
7686 } ,
7787 Button : {
@@ -90,6 +100,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
90100 width : 120 ,
91101 height : 40 ,
92102 zIndex : 2 ,
103+ ...DEFAULT_LAYOUT_MODE ,
93104 } ,
94105 } ,
95106 Container : {
@@ -107,6 +118,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
107118 width : 500 ,
108119 height : 200 ,
109120 zIndex : 0 ,
121+ ...DEFAULT_LAYOUT_MODE ,
110122 } ,
111123 } ,
112124 Modal : {
@@ -127,6 +139,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
127139 width : 400 ,
128140 height : 300 ,
129141 zIndex : 100 ,
142+ ...DEFAULT_LAYOUT_MODE ,
130143 } ,
131144 } ,
132145 Stack : {
@@ -144,6 +157,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
144157 width : 300 ,
145158 height : 300 ,
146159 zIndex : 0 ,
160+ ...DEFAULT_LAYOUT_MODE ,
147161 } ,
148162 } ,
149163 Group : {
@@ -157,6 +171,7 @@ export const COMPONENT_DEFAULTS: Record<WcxNode['type'], ComponentDefaults> = {
157171 width : 200 ,
158172 height : 200 ,
159173 zIndex : 0 ,
174+ ...DEFAULT_LAYOUT_MODE ,
160175 } ,
161176 } ,
162177} ;
0 commit comments