9
9
*/
10
10
11
11
import type { ViewConfig } from '../../Renderer/shims/ReactNativeTypes' ;
12
- import { DynamicallyInjectedByGestureHandler } from '../../NativeComponent/ViewConfigIgnore ' ;
12
+ import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid ' ;
13
13
import { Platform } from 'react-native' ;
14
14
15
- const ReactNativeViewViewConfigAndroid = {
16
- bubblingEventTypes : { } ,
17
- directEventTypes : {
18
- topAccessibilityAction : {
19
- registrationName : 'onAccessibilityAction' ,
20
- } ,
21
- topPointerEnter : {
22
- registrationName : 'pointerenter' ,
23
- } ,
24
- topPointerLeave : {
25
- registrationName : 'pointerleave' ,
26
- } ,
27
- topPointerMove : {
28
- registrationName : 'pointermove' ,
29
- } ,
30
- } ,
31
- validAttributes : {
32
- elevation : true ,
33
- hasTVPreferredFocus : true ,
34
- focusable : true ,
35
- nativeBackgroundAndroid : true ,
36
- nativeForegroundAndroid : true ,
37
- nextFocusDown : true ,
38
- nextFocusForward : true ,
39
- nextFocusLeft : true ,
40
- nextFocusRight : true ,
41
- nextFocusUp : true ,
42
- renderToHardwareTextureAndroid : true ,
43
- translateX : true ,
44
- scaleX : true ,
45
- scaleY : true ,
46
- importantForAccessibility : true ,
47
- accessibilityLiveRegion : true ,
48
- rotation : true ,
49
- translateY : true ,
50
- transform : true ,
51
- hitSlop : true ,
52
- pointerenter : true ,
53
- pointerleave : true ,
54
- pointermove : true ,
55
- } ,
56
- } ;
57
-
58
- const ReactNativeViewViewConfigIOS = {
15
+ const ReactNativeViewConfig : ViewConfig = {
16
+ uiViewClassName : 'RCTView' ,
17
+ baseModuleName : null ,
18
+ Manager : 'ViewManager' ,
19
+ Commands : { } ,
20
+ Constants : { } ,
59
21
bubblingEventTypes : {
22
+ ...ReactNativeViewViewConfigAndroid . bubblingEventTypes ,
60
23
topBlur : {
61
24
phasedRegistrationNames : {
62
25
bubbled : 'onBlur' ,
@@ -125,6 +88,7 @@ const ReactNativeViewViewConfigIOS = {
125
88
} ,
126
89
} ,
127
90
directEventTypes : {
91
+ ...ReactNativeViewViewConfigAndroid . directEventTypes ,
128
92
topAccessibilityAction : {
129
93
registrationName : 'onAccessibilityAction' ,
130
94
} ,
@@ -140,56 +104,36 @@ const ReactNativeViewViewConfigIOS = {
140
104
topMagicTap : {
141
105
registrationName : 'onMagicTap' ,
142
106
} ,
143
- } ,
144
- validAttributes : {
145
- accessibilityElementsHidden : true ,
146
- accessibilityIgnoresInvertColors : true ,
147
- accessibilityViewIsModal : true ,
148
- direction : true ,
149
- onAccessibilityAction : true ,
150
- onAccessibilityEscape : true ,
151
- onAccessibilityTap : true ,
152
- onMagicTap : true ,
153
- shadowOffset : { diff : require ( '../../Utilities/differ/sizesDiffer' ) } ,
154
- shadowOpacity : true ,
155
- shadowRadius : true ,
156
- shouldRasterizeIOS : true ,
157
- transform : { diff : require ( '../../Utilities/differ/matricesDiffer' ) } ,
158
- hitSlop : { diff : require ( '../../Utilities/differ/insetsDiffer' ) } ,
159
- } ,
160
- } ;
161
-
162
- const PlatformSpecificViewConfig =
163
- Platform . OS === 'android'
164
- ? ReactNativeViewViewConfigAndroid
165
- : ReactNativeViewViewConfigIOS ;
166
-
167
- const ReactNativeViewConfig : ViewConfig = {
168
- uiViewClassName : 'RCTView' ,
169
- baseModuleName : null ,
170
- Manager : 'ViewManager' ,
171
- Commands : { } ,
172
- Constants : { } ,
173
- bubblingEventTypes : PlatformSpecificViewConfig . bubblingEventTypes ,
174
- directEventTypes : {
175
- ...PlatformSpecificViewConfig . directEventTypes ,
107
+ topPointerEnter : {
108
+ registrationName : 'pointerenter' ,
109
+ } ,
110
+ topPointerLeave : {
111
+ registrationName : 'pointerleave' ,
112
+ } ,
113
+ topPointerMove : {
114
+ registrationName : 'pointermove' ,
115
+ } ,
176
116
// Events for react-native-gesture-handler (T45765076)
177
117
// Remove once this library can handle JS View Configs
178
- onGestureHandlerEvent : DynamicallyInjectedByGestureHandler ( {
118
+ onGestureHandlerEvent : {
179
119
registrationName : 'onGestureHandlerEvent' ,
180
- } ) ,
181
- onGestureHandlerStateChange : DynamicallyInjectedByGestureHandler ( {
120
+ } ,
121
+ onGestureHandlerStateChange : {
182
122
registrationName : 'onGestureHandlerStateChange' ,
183
- } ) ,
123
+ } ,
184
124
} ,
185
125
validAttributes : {
186
- ...PlatformSpecificViewConfig . validAttributes ,
126
+ ...ReactNativeViewViewConfigAndroid . validAttributes ,
187
127
accessibilityActions : true ,
128
+ accessibilityElementsHidden : true ,
188
129
accessibilityHint : true ,
130
+ accessibilityIgnoresInvertColors : true ,
189
131
accessibilityLabel : true ,
132
+ accessibilityLiveRegion : true ,
190
133
accessibilityRole : true ,
191
134
accessibilityState : true ,
192
135
accessibilityValue : true ,
136
+ accessibilityViewIsModal : true ,
193
137
accessible : true ,
194
138
alignContent : true ,
195
139
alignItems : true ,
@@ -222,8 +166,11 @@ const ReactNativeViewConfig: ViewConfig = {
222
166
borderTopWidth : true ,
223
167
borderWidth : true ,
224
168
bottom : true ,
169
+ clickable : true ,
225
170
collapsable : true ,
171
+ direction : true ,
226
172
display : true ,
173
+ elevation : true ,
227
174
end : true ,
228
175
flex : true ,
229
176
flexBasis : true ,
@@ -232,6 +179,8 @@ const ReactNativeViewConfig: ViewConfig = {
232
179
flexShrink : true ,
233
180
flexWrap : true ,
234
181
height : true ,
182
+ hitSlop : { diff : require ( '../../Utilities/differ/insetsDiffer' ) } ,
183
+ importantForAccessibility : true ,
235
184
justifyContent : true ,
236
185
left : true ,
237
186
margin : true ,
@@ -252,7 +201,11 @@ const ReactNativeViewConfig: ViewConfig = {
252
201
onAccessibilityAction : true ,
253
202
onAccessibilityEscape : true ,
254
203
onAccessibilityTap : true ,
204
+ pointerenter : true ,
205
+ pointerleave : true ,
206
+ pointermove : true ,
255
207
onLayout : true ,
208
+ onMagicTap : true ,
256
209
opacity : true ,
257
210
overflow : true ,
258
211
padding : true ,
@@ -267,8 +220,16 @@ const ReactNativeViewConfig: ViewConfig = {
267
220
pointerEvents : true ,
268
221
position : true ,
269
222
removeClippedSubviews : true ,
223
+ renderToHardwareTextureAndroid : true ,
270
224
right : true ,
225
+ rotation : true ,
226
+ scaleX : true ,
227
+ scaleY : true ,
271
228
shadowColor : { process : require ( '../../StyleSheet/processColor' ) } ,
229
+ shadowOffset : { diff : require ( '../../Utilities/differ/sizesDiffer' ) } ,
230
+ shadowOpacity : true ,
231
+ shadowRadius : true ,
232
+ shouldRasterizeIOS : true ,
272
233
start : true ,
273
234
style : {
274
235
alignContent : true ,
@@ -372,9 +333,10 @@ const ReactNativeViewConfig: ViewConfig = {
372
333
textTransform : true ,
373
334
tintColor : { process : require ( '../../StyleSheet/processColor' ) } ,
374
335
top : true ,
375
- transform : {
376
- process : require ( '../../StyleSheet/processTransform' ) ,
377
- } ,
336
+ transform :
337
+ Platform . OS === 'ios'
338
+ ? { diff : require ( '../../Utilities/differ/matricesDiffer' ) }
339
+ : { process : require ( '../../StyleSheet/processTransform' ) } ,
378
340
transformMatrix : true ,
379
341
translateX : true ,
380
342
translateY : true ,
@@ -384,6 +346,12 @@ const ReactNativeViewConfig: ViewConfig = {
384
346
} ,
385
347
testID : true ,
386
348
top : true ,
349
+ transform :
350
+ Platform . OS === 'ios'
351
+ ? { diff : require ( '../../Utilities/differ/matricesDiffer' ) }
352
+ : { process : require ( '../../StyleSheet/processTransform' ) } ,
353
+ translateX : true ,
354
+ translateY : true ,
387
355
width : true ,
388
356
zIndex : true ,
389
357
} ,
0 commit comments