@@ -20,6 +20,9 @@ import { PaddingControl } from "../controls/paddingControl";
20
20
21
21
import React , { useContext } from "react" ;
22
22
import { EditorContext } from "comps/editorState" ;
23
+ import { clickEvent , eventHandlerControl } from "../controls/eventHandlerControl" ;
24
+
25
+ const EventOptions = [ clickEvent ] as const ;
23
26
24
27
const getStyle = ( style : TextStyleType ) => {
25
28
return css `
@@ -126,6 +129,7 @@ let TextTmpComp = (function () {
126
129
"text" ,
127
130
trans ( "textShow.text" , { name : "{{currentUser.name}}" } )
128
131
) ,
132
+ onEvent : eventHandlerControl ( EventOptions ) ,
129
133
autoHeight : AutoHeightControl ,
130
134
type : dropdownControl ( typeOptions , "markdown" ) ,
131
135
horizontalAlignment : alignWithJustifyControl ( ) ,
@@ -148,6 +152,7 @@ let TextTmpComp = (function () {
148
152
textAlign : props . horizontalAlignment ,
149
153
rotate : props . style . rotation
150
154
} }
155
+ onClick = { ( ) => props . onEvent ( "click" ) }
151
156
>
152
157
{ props . type === "markdown" ? < TacoMarkDown > { value } </ TacoMarkDown > : value }
153
158
</ TextContainer >
@@ -168,6 +173,7 @@ let TextTmpComp = (function () {
168
173
{ [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
169
174
< Section name = { sectionNames . interaction } >
170
175
{ hiddenPropertyView ( children ) }
176
+ { children . onEvent . getPropertyView ( ) }
171
177
</ Section >
172
178
) }
173
179
0 commit comments