@@ -28,6 +28,7 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
28
28
placeholder : {
29
29
group : Konva . Group ;
30
30
rect : Konva . Rect ;
31
+ badgeBg : Konva . Rect ;
31
32
text : Konva . Text ;
32
33
} ;
33
34
} ;
@@ -64,21 +65,36 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
64
65
} ) ,
65
66
rect : new Konva . Rect ( {
66
67
name : `${ this . type } :placeholder_rect` ,
67
- fill : 'hsl(220 12% 10% / 1)' , // 'base.900'
68
+ fill : 'transparent' ,
68
69
width,
69
70
height,
70
71
listening : false ,
71
72
perfectDrawEnabled : false ,
72
73
} ) ,
74
+ badgeBg : new Konva . Rect ( {
75
+ name : `${ this . type } :placeholder_badge_bg` ,
76
+ fill : 'hsl(220 12% 10% / 0.8)' , // 'base.900' with opacity
77
+ x : 6 ,
78
+ y : 6 ,
79
+ width : Math . min ( 204 , width - 12 ) ,
80
+ height : 36 ,
81
+ cornerRadius : 6 ,
82
+ stroke : 'hsl(220 12% 50% / 1)' , // 'base.700'
83
+ strokeWidth : 1 ,
84
+ listening : false ,
85
+ perfectDrawEnabled : false ,
86
+ } ) ,
73
87
text : new Konva . Text ( {
74
88
name : `${ this . type } :placeholder_text` ,
75
- fill : 'hsl(220 12% 80% / 1)' , // 'base.900'
76
- width,
77
- height,
89
+ fill : 'hsl(220 12% 80% / 1)' , // 'base.300'
90
+ x : 8 ,
91
+ y : 8 ,
92
+ width : Math . min ( 200 , width - 16 ) ,
93
+ height : 32 ,
78
94
align : 'center' ,
79
95
verticalAlign : 'middle' ,
80
96
fontFamily : '"Inter Variable", sans-serif' ,
81
- fontSize : width / 24 ,
97
+ fontSize : 14 ,
82
98
fontStyle : '600' ,
83
99
text : 'Waiting for Image' ,
84
100
listening : false ,
@@ -88,6 +104,7 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
88
104
} ;
89
105
90
106
this . konva . placeholder . group . add ( this . konva . placeholder . rect ) ;
107
+ this . konva . placeholder . group . add ( this . konva . placeholder . badgeBg ) ;
91
108
this . konva . placeholder . group . add ( this . konva . placeholder . text ) ;
92
109
this . konva . group . add ( this . konva . placeholder . group ) ;
93
110
@@ -124,9 +141,8 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
124
141
const { width, height } = this . manager . stateApi . getBbox ( ) . rect ;
125
142
this . konva . placeholder . rect . width ( width ) ;
126
143
this . konva . placeholder . rect . height ( height ) ;
127
- this . konva . placeholder . text . width ( width ) ;
128
- this . konva . placeholder . text . height ( height ) ;
129
- this . konva . placeholder . text . fontSize ( width / 24 ) ;
144
+ this . konva . placeholder . badgeBg . width ( Math . min ( 204 , width - 12 ) ) ;
145
+ this . konva . placeholder . text . width ( Math . min ( 200 , width - 16 ) ) ;
130
146
} ;
131
147
132
148
initialize = ( ) => {
0 commit comments