@@ -50,8 +50,7 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil<PreviewShape> {
50
50
) ;
51
51
52
52
const isLoading = false ;
53
- // @ts -expect-error TODO: remove this when stable v2
54
- const isEditing = useIsEditing ( ) ;
53
+ const isEditing = useIsEditing ( shape . id ) ;
55
54
const { source } = shape . props ;
56
55
57
56
return (
@@ -73,18 +72,49 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil<PreviewShape> {
73
72
< DefaultSpinner />
74
73
</ div >
75
74
) : (
76
- < iframe
77
- src = { source }
78
- width = { toDomPrecision ( shape . props . w ) }
79
- height = { toDomPrecision ( shape . props . h ) }
80
- draggable = { false }
81
- style = { {
82
- pointerEvents : isEditing ? "auto" : "none" ,
83
- boxShadow,
84
- border : "1px solid var(--color-panel-contrast)" ,
85
- borderRadius : "var(--radius-2)" ,
86
- } }
87
- />
75
+ < >
76
+ < iframe
77
+ src = { source }
78
+ width = { toDomPrecision ( shape . props . w ) }
79
+ height = { toDomPrecision ( shape . props . h ) }
80
+ draggable = { false }
81
+ style = { {
82
+ pointerEvents : isEditing ? "auto" : "none" ,
83
+ boxShadow,
84
+ border : "1px solid var(--color-panel-contrast)" ,
85
+ borderRadius : "var(--radius-2)" ,
86
+ } }
87
+ />
88
+ < div
89
+ style = { {
90
+ textAlign : "center" ,
91
+ position : "absolute" ,
92
+ bottom : isEditing ? - 40 : 0 ,
93
+ padding : 4 ,
94
+ fontFamily : "inherit" ,
95
+ fontSize : 12 ,
96
+ left : 0 ,
97
+ width : "100%" ,
98
+ display : "flex" ,
99
+ alignItems : "center" ,
100
+ justifyContent : "center" ,
101
+ pointerEvents : "none" ,
102
+ } }
103
+ >
104
+ < span
105
+ style = { {
106
+ background : "var(--color-panel)" ,
107
+ padding : "4px 12px" ,
108
+ borderRadius : 99 ,
109
+ border : "1px solid var(--color-muted-1)" ,
110
+ } }
111
+ >
112
+ { isEditing
113
+ ? "Click the canvas to exit"
114
+ : "Double click to interact" }
115
+ </ span >
116
+ </ div >
117
+ </ >
88
118
) }
89
119
</ HTMLContainer >
90
120
) ;
0 commit comments