99 */
1010
1111import type { ViewConfig } from '../../Renderer/shims/ReactNativeTypes' ;
12- import { DynamicallyInjectedByGestureHandler } from '../../NativeComponent/ViewConfigIgnore ' ;
12+ import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid ' ;
1313import { Platform } from 'react-native' ;
1414
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 : { } ,
5921 bubblingEventTypes : {
22+ ...ReactNativeViewViewConfigAndroid . bubblingEventTypes ,
6023 topBlur : {
6124 phasedRegistrationNames : {
6225 bubbled : 'onBlur' ,
@@ -125,6 +88,7 @@ const ReactNativeViewViewConfigIOS = {
12588 } ,
12689 } ,
12790 directEventTypes : {
91+ ...ReactNativeViewViewConfigAndroid . directEventTypes ,
12892 topAccessibilityAction : {
12993 registrationName : 'onAccessibilityAction' ,
13094 } ,
@@ -140,56 +104,36 @@ const ReactNativeViewViewConfigIOS = {
140104 topMagicTap : {
141105 registrationName : 'onMagicTap' ,
142106 } ,
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+ } ,
176116 // Events for react-native-gesture-handler (T45765076)
177117 // Remove once this library can handle JS View Configs
178- onGestureHandlerEvent : DynamicallyInjectedByGestureHandler ( {
118+ onGestureHandlerEvent : {
179119 registrationName : 'onGestureHandlerEvent' ,
180- } ) ,
181- onGestureHandlerStateChange : DynamicallyInjectedByGestureHandler ( {
120+ } ,
121+ onGestureHandlerStateChange : {
182122 registrationName : 'onGestureHandlerStateChange' ,
183- } ) ,
123+ } ,
184124 } ,
185125 validAttributes : {
186- ...PlatformSpecificViewConfig . validAttributes ,
126+ ...ReactNativeViewViewConfigAndroid . validAttributes ,
187127 accessibilityActions : true ,
128+ accessibilityElementsHidden : true ,
188129 accessibilityHint : true ,
130+ accessibilityIgnoresInvertColors : true ,
189131 accessibilityLabel : true ,
132+ accessibilityLiveRegion : true ,
190133 accessibilityRole : true ,
191134 accessibilityState : true ,
192135 accessibilityValue : true ,
136+ accessibilityViewIsModal : true ,
193137 accessible : true ,
194138 alignContent : true ,
195139 alignItems : true ,
@@ -222,8 +166,11 @@ const ReactNativeViewConfig: ViewConfig = {
222166 borderTopWidth : true ,
223167 borderWidth : true ,
224168 bottom : true ,
169+ clickable : true ,
225170 collapsable : true ,
171+ direction : true ,
226172 display : true ,
173+ elevation : true ,
227174 end : true ,
228175 flex : true ,
229176 flexBasis : true ,
@@ -232,6 +179,8 @@ const ReactNativeViewConfig: ViewConfig = {
232179 flexShrink : true ,
233180 flexWrap : true ,
234181 height : true ,
182+ hitSlop : { diff : require ( '../../Utilities/differ/insetsDiffer' ) } ,
183+ importantForAccessibility : true ,
235184 justifyContent : true ,
236185 left : true ,
237186 margin : true ,
@@ -252,7 +201,11 @@ const ReactNativeViewConfig: ViewConfig = {
252201 onAccessibilityAction : true ,
253202 onAccessibilityEscape : true ,
254203 onAccessibilityTap : true ,
204+ pointerenter : true ,
205+ pointerleave : true ,
206+ pointermove : true ,
255207 onLayout : true ,
208+ onMagicTap : true ,
256209 opacity : true ,
257210 overflow : true ,
258211 padding : true ,
@@ -267,8 +220,16 @@ const ReactNativeViewConfig: ViewConfig = {
267220 pointerEvents : true ,
268221 position : true ,
269222 removeClippedSubviews : true ,
223+ renderToHardwareTextureAndroid : true ,
270224 right : true ,
225+ rotation : true ,
226+ scaleX : true ,
227+ scaleY : true ,
271228 shadowColor : { process : require ( '../../StyleSheet/processColor' ) } ,
229+ shadowOffset : { diff : require ( '../../Utilities/differ/sizesDiffer' ) } ,
230+ shadowOpacity : true ,
231+ shadowRadius : true ,
232+ shouldRasterizeIOS : true ,
272233 start : true ,
273234 style : {
274235 alignContent : true ,
@@ -372,9 +333,10 @@ const ReactNativeViewConfig: ViewConfig = {
372333 textTransform : true ,
373334 tintColor : { process : require ( '../../StyleSheet/processColor' ) } ,
374335 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' ) } ,
378340 transformMatrix : true ,
379341 translateX : true ,
380342 translateY : true ,
@@ -384,6 +346,12 @@ const ReactNativeViewConfig: ViewConfig = {
384346 } ,
385347 testID : true ,
386348 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 ,
387355 width : true ,
388356 zIndex : true ,
389357 } ,
0 commit comments