@@ -21,7 +21,8 @@ import {
21
21
getParent ,
22
22
MessageType ,
23
23
getId ,
24
- IMessage
24
+ IMessage ,
25
+ IObjectClassInfo
25
26
} from "project-editor/core/object" ;
26
27
import {
27
28
getAncestorOfType ,
@@ -30,6 +31,7 @@ import {
30
31
getListLabel ,
31
32
getProjectStore ,
32
33
Message ,
34
+ ProjectStore ,
33
35
propertyNotFoundMessage ,
34
36
propertyNotSetMessage ,
35
37
Section
@@ -2106,7 +2108,28 @@ export class CallActionActionComponent extends ActionComponent {
2106
2108
< path d = "M17 4a12.25 12.25 0 0 1 0 16" > </ path >
2107
2109
</ svg >
2108
2110
) ,
2109
- componentHeaderColor : "#C7E9C0" ,
2111
+ componentHeaderColor : (
2112
+ object ?: CallActionActionComponent ,
2113
+ componentClass ?: IObjectClassInfo ,
2114
+ projectStore ?: ProjectStore
2115
+ ) => {
2116
+ let actionName ;
2117
+ if ( object ) {
2118
+ actionName = object . action ;
2119
+ projectStore = ProjectEditor . getProjectStore ( object ) ;
2120
+ } else if ( componentClass ) {
2121
+ actionName = componentClass . props ?. action ;
2122
+ }
2123
+
2124
+ if ( projectStore && actionName ) {
2125
+ const action = findAction ( projectStore . project , actionName ) ;
2126
+ if ( action && action . implementationType == "native" ) {
2127
+ return "#9CBA93" ;
2128
+ }
2129
+ }
2130
+
2131
+ return "#C7E9C0" ;
2132
+ } ,
2110
2133
open : ( object : CallActionActionComponent ) => {
2111
2134
object . open ( ) ;
2112
2135
} ,
@@ -4404,8 +4427,15 @@ export class LabelOutActionComponent extends ActionComponent {
4404
4427
4405
4428
let titleStyle : React . CSSProperties | undefined ;
4406
4429
if ( classInfo . componentHeaderColor ) {
4430
+ let backgroundColor ;
4431
+ if ( typeof classInfo . componentHeaderColor == "string" ) {
4432
+ backgroundColor = classInfo . componentHeaderColor ;
4433
+ } else {
4434
+ backgroundColor = classInfo . componentHeaderColor ( this ) ;
4435
+ }
4436
+
4407
4437
titleStyle = {
4408
- backgroundColor : classInfo . componentHeaderColor
4438
+ backgroundColor
4409
4439
} ;
4410
4440
}
4411
4441
@@ -4542,8 +4572,15 @@ export class LabelInActionComponent extends ActionComponent {
4542
4572
4543
4573
let titleStyle : React . CSSProperties | undefined ;
4544
4574
if ( classInfo . componentHeaderColor ) {
4575
+ let backgroundColor ;
4576
+ if ( typeof classInfo . componentHeaderColor == "string" ) {
4577
+ backgroundColor = classInfo . componentHeaderColor ;
4578
+ } else {
4579
+ backgroundColor = classInfo . componentHeaderColor ( this ) ;
4580
+ }
4581
+
4545
4582
titleStyle = {
4546
- backgroundColor : classInfo . componentHeaderColor
4583
+ backgroundColor
4547
4584
} ;
4548
4585
}
4549
4586
0 commit comments