ReactNativeViewViewConfig.js 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow
  8. * @format
  9. */
  10. 'use strict';
  11. import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid';
  12. import {Platform} from 'react-native';
  13. const ReactNativeViewConfig = {
  14. uiViewClassName: 'RCTView',
  15. baseModuleName: null,
  16. Manager: 'ViewManager',
  17. Commands: ({}: {...}),
  18. Constants: ({}: {...}),
  19. bubblingEventTypes: {
  20. ...ReactNativeViewViewConfigAndroid.bubblingEventTypes,
  21. topBlur: {
  22. phasedRegistrationNames: {
  23. bubbled: 'onBlur',
  24. captured: 'onBlurCapture',
  25. },
  26. },
  27. topChange: {
  28. phasedRegistrationNames: {
  29. bubbled: 'onChange',
  30. captured: 'onChangeCapture',
  31. },
  32. },
  33. topEndEditing: {
  34. phasedRegistrationNames: {
  35. bubbled: 'onEndEditing',
  36. captured: 'onEndEditingCapture',
  37. },
  38. },
  39. topFocus: {
  40. phasedRegistrationNames: {
  41. bubbled: 'onFocus',
  42. captured: 'onFocusCapture',
  43. },
  44. },
  45. topKeyPress: {
  46. phasedRegistrationNames: {
  47. bubbled: 'onKeyPress',
  48. captured: 'onKeyPressCapture',
  49. },
  50. },
  51. topPress: {
  52. phasedRegistrationNames: {
  53. bubbled: 'onPress',
  54. captured: 'onPressCapture',
  55. },
  56. },
  57. topSubmitEditing: {
  58. phasedRegistrationNames: {
  59. bubbled: 'onSubmitEditing',
  60. captured: 'onSubmitEditingCapture',
  61. },
  62. },
  63. topTouchCancel: {
  64. phasedRegistrationNames: {
  65. bubbled: 'onTouchCancel',
  66. captured: 'onTouchCancelCapture',
  67. },
  68. },
  69. topTouchEnd: {
  70. phasedRegistrationNames: {
  71. bubbled: 'onTouchEnd',
  72. captured: 'onTouchEndCapture',
  73. },
  74. },
  75. topTouchMove: {
  76. phasedRegistrationNames: {
  77. bubbled: 'onTouchMove',
  78. captured: 'onTouchMoveCapture',
  79. },
  80. },
  81. topTouchStart: {
  82. phasedRegistrationNames: {
  83. bubbled: 'onTouchStart',
  84. captured: 'onTouchStartCapture',
  85. },
  86. },
  87. },
  88. directEventTypes: {
  89. ...ReactNativeViewViewConfigAndroid.directEventTypes,
  90. topAccessibilityAction: {
  91. registrationName: 'onAccessibilityAction',
  92. },
  93. topAccessibilityEscape: {
  94. registrationName: 'onAccessibilityEscape',
  95. },
  96. topAccessibilityTap: {
  97. registrationName: 'onAccessibilityTap',
  98. },
  99. topLayout: {
  100. registrationName: 'onLayout',
  101. },
  102. topMagicTap: {
  103. registrationName: 'onMagicTap',
  104. },
  105. // Events for react-native-gesture-handler (T45765076)
  106. // Remove once this library can handle JS View Configs
  107. onGestureHandlerEvent: {
  108. registrationName: 'onGestureHandlerEvent',
  109. },
  110. onGestureHandlerStateChange: {
  111. registrationName: 'onGestureHandlerStateChange',
  112. },
  113. },
  114. validAttributes: {
  115. ...ReactNativeViewViewConfigAndroid.validAttributes,
  116. accessibilityActions: true,
  117. accessibilityElementsHidden: true,
  118. accessibilityHint: true,
  119. accessibilityIgnoresInvertColors: true,
  120. accessibilityLabel: true,
  121. accessibilityLiveRegion: true,
  122. accessibilityRole: true,
  123. accessibilityStates: true, // TODO: Can be removed after next release
  124. accessibilityState: true,
  125. accessibilityValue: true,
  126. accessibilityViewIsModal: true,
  127. accessible: true,
  128. alignContent: true,
  129. alignItems: true,
  130. alignSelf: true,
  131. aspectRatio: true,
  132. backfaceVisibility: true,
  133. backgroundColor: {process: require('../../StyleSheet/processColor')},
  134. borderBottomColor: {process: require('../../StyleSheet/processColor')},
  135. borderBottomEndRadius: true,
  136. borderBottomLeftRadius: true,
  137. borderBottomRightRadius: true,
  138. borderBottomStartRadius: true,
  139. borderBottomWidth: true,
  140. borderColor: {process: require('../../StyleSheet/processColor')},
  141. borderEndColor: {process: require('../../StyleSheet/processColor')},
  142. borderEndWidth: true,
  143. borderLeftColor: {process: require('../../StyleSheet/processColor')},
  144. borderLeftWidth: true,
  145. borderRadius: true,
  146. borderRightColor: {process: require('../../StyleSheet/processColor')},
  147. borderRightWidth: true,
  148. borderStartColor: {process: require('../../StyleSheet/processColor')},
  149. borderStartWidth: true,
  150. borderStyle: true,
  151. borderTopColor: {process: require('../../StyleSheet/processColor')},
  152. borderTopEndRadius: true,
  153. borderTopLeftRadius: true,
  154. borderTopRightRadius: true,
  155. borderTopStartRadius: true,
  156. borderTopWidth: true,
  157. borderWidth: true,
  158. bottom: true,
  159. clickable: true,
  160. collapsable: true,
  161. direction: true,
  162. display: true,
  163. elevation: true,
  164. end: true,
  165. flex: true,
  166. flexBasis: true,
  167. flexDirection: true,
  168. flexGrow: true,
  169. flexShrink: true,
  170. flexWrap: true,
  171. height: true,
  172. hitSlop: {diff: (require('../../Utilities/differ/insetsDiffer'): any)},
  173. importantForAccessibility: true,
  174. justifyContent: true,
  175. left: true,
  176. margin: true,
  177. marginBottom: true,
  178. marginEnd: true,
  179. marginHorizontal: true,
  180. marginLeft: true,
  181. marginRight: true,
  182. marginStart: true,
  183. marginTop: true,
  184. marginVertical: true,
  185. maxHeight: true,
  186. maxWidth: true,
  187. minHeight: true,
  188. minWidth: true,
  189. nativeID: true,
  190. needsOffscreenAlphaCompositing: true,
  191. onAccessibilityAction: true,
  192. onAccessibilityEscape: true,
  193. onAccessibilityTap: true,
  194. onLayout: true,
  195. onMagicTap: true,
  196. opacity: true,
  197. overflow: true,
  198. padding: true,
  199. paddingBottom: true,
  200. paddingEnd: true,
  201. paddingHorizontal: true,
  202. paddingLeft: true,
  203. paddingRight: true,
  204. paddingStart: true,
  205. paddingTop: true,
  206. paddingVertical: true,
  207. pointerEvents: true,
  208. position: true,
  209. removeClippedSubviews: true,
  210. renderToHardwareTextureAndroid: true,
  211. right: true,
  212. rotation: true,
  213. scaleX: true,
  214. scaleY: true,
  215. shadowColor: {process: require('../../StyleSheet/processColor')},
  216. shadowOffset: {diff: require('../../Utilities/differ/sizesDiffer')},
  217. shadowOpacity: true,
  218. shadowRadius: true,
  219. shouldRasterizeIOS: true,
  220. start: true,
  221. style: {
  222. alignContent: true,
  223. alignItems: true,
  224. alignSelf: true,
  225. aspectRatio: true,
  226. backfaceVisibility: true,
  227. backgroundColor: {process: require('../../StyleSheet/processColor')},
  228. borderBottomColor: {process: require('../../StyleSheet/processColor')},
  229. borderBottomEndRadius: true,
  230. borderBottomLeftRadius: true,
  231. borderBottomRightRadius: true,
  232. borderBottomStartRadius: true,
  233. borderBottomWidth: true,
  234. borderColor: {process: require('../../StyleSheet/processColor')},
  235. borderEndColor: {process: require('../../StyleSheet/processColor')},
  236. borderEndWidth: true,
  237. borderLeftColor: {process: require('../../StyleSheet/processColor')},
  238. borderLeftWidth: true,
  239. borderRadius: true,
  240. borderRightColor: {process: require('../../StyleSheet/processColor')},
  241. borderRightWidth: true,
  242. borderStartColor: {process: require('../../StyleSheet/processColor')},
  243. borderStartWidth: true,
  244. borderStyle: true,
  245. borderTopColor: {process: require('../../StyleSheet/processColor')},
  246. borderTopEndRadius: true,
  247. borderTopLeftRadius: true,
  248. borderTopRightRadius: true,
  249. borderTopStartRadius: true,
  250. borderTopWidth: true,
  251. borderWidth: true,
  252. bottom: true,
  253. color: {process: require('../../StyleSheet/processColor')},
  254. decomposedMatrix: true,
  255. direction: true,
  256. display: true,
  257. elevation: true,
  258. end: true,
  259. flex: true,
  260. flexBasis: true,
  261. flexDirection: true,
  262. flexGrow: true,
  263. flexShrink: true,
  264. flexWrap: true,
  265. fontFamily: true,
  266. fontSize: true,
  267. fontStyle: true,
  268. fontVariant: true,
  269. fontWeight: true,
  270. height: true,
  271. includeFontPadding: true,
  272. justifyContent: true,
  273. left: true,
  274. letterSpacing: true,
  275. lineHeight: true,
  276. margin: true,
  277. marginBottom: true,
  278. marginEnd: true,
  279. marginHorizontal: true,
  280. marginLeft: true,
  281. marginRight: true,
  282. marginStart: true,
  283. marginTop: true,
  284. marginVertical: true,
  285. maxHeight: true,
  286. maxWidth: true,
  287. minHeight: true,
  288. minWidth: true,
  289. opacity: true,
  290. overflow: true,
  291. overlayColor: {process: require('../../StyleSheet/processColor')},
  292. padding: true,
  293. paddingBottom: true,
  294. paddingEnd: true,
  295. paddingHorizontal: true,
  296. paddingLeft: true,
  297. paddingRight: true,
  298. paddingStart: true,
  299. paddingTop: true,
  300. paddingVertical: true,
  301. position: true,
  302. resizeMode: true,
  303. right: true,
  304. rotation: true,
  305. scaleX: true,
  306. scaleY: true,
  307. shadowColor: {process: require('../../StyleSheet/processColor')},
  308. shadowOffset: {diff: require('../../Utilities/differ/sizesDiffer')},
  309. shadowOpacity: true,
  310. shadowRadius: true,
  311. start: true,
  312. textAlign: true,
  313. textAlignVertical: true,
  314. textDecorationColor: {process: require('../../StyleSheet/processColor')},
  315. textDecorationLine: true,
  316. textDecorationStyle: true,
  317. textShadowColor: {process: require('../../StyleSheet/processColor')},
  318. textShadowOffset: true,
  319. textShadowRadius: true,
  320. textTransform: true,
  321. tintColor: {process: require('../../StyleSheet/processColor')},
  322. top: true,
  323. transform: ((Platform.OS === 'ios'
  324. ? {diff: require('../../Utilities/differ/matricesDiffer')}
  325. : {process: require('../../StyleSheet/processTransform')}): any),
  326. transformMatrix: true,
  327. translateX: true,
  328. translateY: true,
  329. width: true,
  330. writingDirection: true,
  331. zIndex: true,
  332. },
  333. testID: true,
  334. top: true,
  335. transform: ((Platform.OS === 'ios'
  336. ? {diff: require('../../Utilities/differ/matricesDiffer')}
  337. : {process: require('../../StyleSheet/processTransform')}): any),
  338. translateX: true,
  339. translateY: true,
  340. width: true,
  341. zIndex: true,
  342. },
  343. };
  344. module.exports = ReactNativeViewConfig;