UNPKG

3.06 kBPlain TextView Raw
1'use strict';
2type AllowlistsHolder = {
3 UI_THREAD_PROPS_WHITELIST: Record<string, boolean>;
4 NATIVE_THREAD_PROPS_WHITELIST: Record<string, boolean>;
5};
6
7export const PropsAllowlists: AllowlistsHolder = {
8 /**
9 * Styles allowed to be direcly updated in UI thread
10 */
11 UI_THREAD_PROPS_WHITELIST: {
12 opacity: true,
13 transform: true,
14 /* colors */
15 backgroundColor: true,
16 borderRightColor: true,
17 borderBottomColor: true,
18 borderColor: true,
19 borderEndColor: true,
20 borderLeftColor: true,
21 borderStartColor: true,
22 borderTopColor: true,
23 /* ios styles */
24 shadowOpacity: true,
25 shadowRadius: true,
26 /* legacy android transform properties */
27 scaleX: true,
28 scaleY: true,
29 translateX: true,
30 translateY: true,
31 },
32 /**
33 * Whitelist of view props that can be updated in native thread via UIManagerModule
34 */
35 NATIVE_THREAD_PROPS_WHITELIST: {
36 borderBottomWidth: true,
37 borderEndWidth: true,
38 borderLeftWidth: true,
39 borderRightWidth: true,
40 borderStartWidth: true,
41 borderTopWidth: true,
42 borderWidth: true,
43 bottom: true,
44 flex: true,
45 flexGrow: true,
46 flexShrink: true,
47 height: true,
48 left: true,
49 margin: true,
50 marginBottom: true,
51 marginEnd: true,
52 marginHorizontal: true,
53 marginLeft: true,
54 marginRight: true,
55 marginStart: true,
56 marginTop: true,
57 marginVertical: true,
58 maxHeight: true,
59 maxWidth: true,
60 minHeight: true,
61 minWidth: true,
62 padding: true,
63 paddingBottom: true,
64 paddingEnd: true,
65 paddingHorizontal: true,
66 paddingLeft: true,
67 paddingRight: true,
68 paddingStart: true,
69 paddingTop: true,
70 paddingVertical: true,
71 right: true,
72 start: true,
73 top: true,
74 width: true,
75 zIndex: true,
76 borderBottomEndRadius: true,
77 borderBottomLeftRadius: true,
78 borderBottomRightRadius: true,
79 borderBottomStartRadius: true,
80 borderRadius: true,
81 borderTopEndRadius: true,
82 borderTopLeftRadius: true,
83 borderTopRightRadius: true,
84 borderTopStartRadius: true,
85 elevation: true,
86 fontSize: true,
87 lineHeight: true,
88 textShadowRadius: true,
89 textShadowOffset: true,
90 letterSpacing: true,
91 aspectRatio: true,
92 columnGap: true, // iOS only
93 end: true, // number or string
94 flexBasis: true, // number or string
95 gap: true,
96 rowGap: true,
97 /* strings */
98 display: true,
99 backfaceVisibility: true,
100 overflow: true,
101 resizeMode: true,
102 fontStyle: true,
103 fontWeight: true,
104 textAlign: true,
105 textDecorationLine: true,
106 fontFamily: true,
107 textAlignVertical: true,
108 fontVariant: true,
109 textDecorationStyle: true,
110 textTransform: true,
111 writingDirection: true,
112 alignContent: true,
113 alignItems: true,
114 alignSelf: true,
115 direction: true, // iOS only
116 flexDirection: true,
117 flexWrap: true,
118 justifyContent: true,
119 position: true,
120 /* text color */
121 color: true,
122 tintColor: true,
123 shadowColor: true,
124 placeholderTextColor: true,
125 },
126};