@@ -21,13 +21,15 @@ import type { Logger } from 'roarr';
21
21
// parseFloat(style.fontSize) * parseFloat(style.getPropertyValue("--invoke-space-8"))
22
22
//
23
23
// This will give you the pixel value for the theme token in pixels.
24
- const SPACING_2 = 6 ; // Equivalent to theme token 2
25
- const SPACING_4 = 12 ; // Equivalent to theme token 4
26
- const SPACING_8 = 24 ; // Equivalent to theme token 8
27
- const BORDER_RADIUS_BASE = 4 ; // Equivalent to theme borderRadius "base"
28
- const BORDER_WIDTH = 1 ; // Standard border width
29
- const FONT_SIZE_SM = 12 ; // Equivalent to theme fontSize "sm"
30
- const BADGE_MIN_WIDTH = 200 ;
24
+ //
25
+ // You cannot do this dynamically in this file, because it depends on the styles being applied to the document, which
26
+ // will not have happened yet when this module is loaded.
27
+
28
+ const SPACING_4 = 12 ; // --invoke-space-4 in pixels
29
+ const BORDER_RADIUS_BASE = 4 ; // --invoke-radii-base in pixels
30
+ const BORDER_WIDTH = 1 ;
31
+ const FONT_SIZE_MD = 14.4 ; // --invoke-fontSizes-md
32
+ const BADGE_WIDTH = 192 ;
31
33
const BADGE_HEIGHT = 36 ;
32
34
33
35
type ImageNameSrc = { type : 'imageName' ; data : string } ;
@@ -93,9 +95,9 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
93
95
badgeBg : new Konva . Rect ( {
94
96
name : `${ this . type } :placeholder_badge_bg` ,
95
97
fill : 'hsl(220 12% 10% / 0.8)' , // 'base.900' with opacity
96
- x : SPACING_2 - 2 , // Slight offset for visual balance
97
- y : SPACING_2 - 2 ,
98
- width : Math . min ( BADGE_MIN_WIDTH + 4 , width - SPACING_2 * 2 + 4 ) ,
98
+ x : SPACING_4 ,
99
+ y : SPACING_4 ,
100
+ width : BADGE_WIDTH ,
99
101
height : BADGE_HEIGHT ,
100
102
cornerRadius : BORDER_RADIUS_BASE ,
101
103
stroke : 'hsl(220 12% 50% / 1)' , // 'base.700'
@@ -106,14 +108,14 @@ export class CanvasStagingAreaModule extends CanvasModuleBase {
106
108
text : new Konva . Text ( {
107
109
name : `${ this . type } :placeholder_text` ,
108
110
fill : 'hsl(220 12% 80% / 1)' , // 'base.300'
109
- x : SPACING_2 ,
110
- y : SPACING_2 ,
111
- width : Math . min ( BADGE_MIN_WIDTH , width - SPACING_4 ) ,
112
- height : SPACING_8 ,
111
+ x : SPACING_4 ,
112
+ y : SPACING_4 ,
113
+ width : BADGE_WIDTH ,
114
+ height : BADGE_HEIGHT ,
113
115
align : 'center' ,
114
116
verticalAlign : 'middle' ,
115
117
fontFamily : '"Inter Variable", sans-serif' ,
116
- fontSize : FONT_SIZE_SM ,
118
+ fontSize : FONT_SIZE_MD ,
117
119
fontStyle : '600' , // Equivalent to theme fontWeight "semibold"
118
120
text : 'Waiting for Image' ,
119
121
listening : false ,
0 commit comments