react-native-macos 0.0.0-cfdd34990 → 0.0.0-d2f5a1ffb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/AnimatedEvent.js +23 -4
  3. package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
  4. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  5. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  6. package/Libraries/Components/Button.js +1 -1
  7. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  8. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
  9. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
  10. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  11. package/Libraries/Components/ScrollView/ScrollView.js +8 -5
  12. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
  13. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  14. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  15. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  16. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  17. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  18. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  19. package/Libraries/Components/View/View.js +8 -10
  20. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  21. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  22. package/Libraries/Core/ExceptionsManager.js +3 -1
  23. package/Libraries/Core/ReactNativeVersion.js +5 -1
  24. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  25. package/Libraries/Core/setUpGlobals.js +2 -0
  26. package/Libraries/Core/setUpTimers.js +2 -2
  27. package/Libraries/Image/Image.ios.js +6 -0
  28. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  29. package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
  30. package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
  31. package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
  32. package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
  33. package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
  34. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
  35. package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
  36. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +1 -2
  37. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -1
  38. package/Libraries/NewAppScreen/components/logo.png +0 -0
  39. package/Libraries/Pressability/Pressability.js +1 -0
  40. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
  41. package/Libraries/Renderer/REVISION +1 -1
  42. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +238 -47
  43. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +84 -18
  44. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +84 -18
  45. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +238 -47
  46. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +84 -18
  47. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +84 -18
  48. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  49. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  50. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  51. package/Libraries/StyleSheet/normalizeColor.js +2 -2
  52. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  53. package/Libraries/Text/Text/RCTTextView.m +8 -4
  54. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  55. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  56. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  57. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -1
  58. package/Libraries/Text/TextProps.js +1 -7
  59. package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
  60. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  61. package/Libraries/Utilities/HMRClient.js +1 -1
  62. package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
  63. package/README.md +18 -42
  64. package/React/Base/RCTBridge+Private.h +8 -0
  65. package/React/Base/RCTBridge.h +4 -0
  66. package/React/Base/RCTBridge.m +17 -0
  67. package/React/Base/RCTBridgeModule.h +2 -2
  68. package/React/Base/RCTBundleURLProvider.h +1 -1
  69. package/React/Base/RCTBundleURLProvider.mm +2 -2
  70. package/React/Base/RCTConvert.m +23 -6
  71. package/React/Base/RCTDefines.h +12 -3
  72. package/React/Base/RCTEventDispatcherProtocol.h +2 -0
  73. package/React/Base/RCTImageSource.m +2 -0
  74. package/React/Base/RCTJSStackFrame.m +2 -0
  75. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  76. package/React/Base/RCTKeyCommands.m +2 -0
  77. package/React/Base/RCTModuleData.mm +2 -0
  78. package/React/Base/RCTModuleMethod.mm +2 -0
  79. package/React/Base/RCTRootView.h +15 -0
  80. package/React/Base/RCTRootView.m +15 -0
  81. package/React/Base/RCTTouchEvent.m +2 -0
  82. package/React/Base/RCTVersion.m +5 -1
  83. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
  84. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
  85. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  86. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  87. package/React/CoreModules/RCTActionSheetManager.mm +4 -0
  88. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  89. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  90. package/React/CoreModules/RCTAlertController.m +8 -4
  91. package/React/CoreModules/RCTAppearance.mm +5 -1
  92. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  93. package/React/CoreModules/RCTDevMenu.mm +4 -4
  94. package/React/CoreModules/RCTDevSettings.mm +6 -6
  95. package/React/CoreModules/RCTDevSplitBundleLoader.mm +1 -1
  96. package/React/CoreModules/RCTDeviceInfo.mm +4 -4
  97. package/React/CoreModules/RCTEventDispatcher.mm +5 -0
  98. package/React/CoreModules/RCTPerfMonitor.mm +9 -4
  99. package/React/CxxBridge/RCTCxxBridge.mm +18 -1
  100. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  101. package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
  102. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  103. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  104. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
  105. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
  106. package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
  107. package/React/Fabric/RCTScheduler.mm +10 -3
  108. package/React/Modules/RCTEventEmitter.h +2 -2
  109. package/React/Modules/RCTLayoutAnimation.m +2 -0
  110. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  111. package/React/Modules/RCTUIManager.m +19 -10
  112. package/React/Views/RCTFont.mm +58 -47
  113. package/React/Views/RCTShadowView.m +3 -1
  114. package/React/Views/RCTView.h +5 -2
  115. package/React/Views/RCTView.m +22 -10
  116. package/React/Views/RCTViewManager.m +12 -17
  117. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  118. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
  119. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
  120. package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
  121. package/React/Views/ScrollView/RCTScrollView.m +1 -5
  122. package/React-Core.podspec +0 -11
  123. package/ReactAndroid/build.gradle +12 -6
  124. package/ReactAndroid/gradle.properties +1 -1
  125. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
  126. package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
  127. package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -1
  128. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  129. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  130. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +51 -21
  131. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
  132. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
  133. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
  134. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +4 -0
  135. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
  136. package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
  137. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
  138. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  139. package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -0
  140. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -0
  141. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
  142. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +14 -0
  143. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +2 -0
  144. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -1
  145. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +19 -0
  146. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  147. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
  148. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
  149. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +2 -2
  150. package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +7 -1
  151. package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
  152. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
  153. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  154. package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
  155. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
  156. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
  157. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
  158. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +8 -0
  159. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
  160. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
  161. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
  162. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
  163. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
  164. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  165. package/ReactAndroid/src/main/jni/react/jni/Android.mk +3 -2
  166. package/ReactAndroid/src/main/jni/react/jni/BUCK +2 -0
  167. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +29 -0
  168. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
  169. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
  170. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
  171. package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +22 -0
  172. package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
  173. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  174. package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
  175. package/ReactCommon/React-Fabric.podspec +9 -0
  176. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  177. package/ReactCommon/hermes/inspector/tools/msggen/package.json +7 -4
  178. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1238 -1491
  179. package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
  180. package/ReactCommon/react/renderer/animations/BUCK +1 -0
  181. package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
  182. package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +5 -26
  183. package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +3 -13
  184. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1399 -1622
  185. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +76 -244
  186. package/ReactCommon/react/renderer/animations/conversions.h +212 -0
  187. package/ReactCommon/react/renderer/animations/primitives.h +104 -0
  188. package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
  189. package/ReactCommon/react/renderer/animations/utils.h +80 -0
  190. package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
  191. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
  192. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
  193. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -1
  194. package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
  195. package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
  196. package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +1 -17
  197. package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
  198. package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -23
  199. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +2 -3
  200. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -0
  201. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
  202. package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
  203. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +14 -6
  204. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -0
  205. package/ReactCommon/react/renderer/core/Props.h +1 -0
  206. package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
  207. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
  208. package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
  209. package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
  210. package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
  211. package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
  212. package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
  213. package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
  214. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  215. package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +12 -0
  216. package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +10 -1
  217. package/ReactCommon/react/renderer/runtimescheduler/BUCK +0 -1
  218. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +4 -2
  219. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +4 -2
  220. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +4 -3
  221. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +4 -2
  222. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +4 -2
  223. package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +4 -3
  224. package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +4 -2
  225. package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -2
  226. package/ReactCommon/react/renderer/runtimescheduler/primitives.h +4 -2
  227. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
  228. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
  229. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
  230. package/ReactCommon/react/renderer/timeline/BUCK +6 -6
  231. package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
  232. package/ReactCommon/react/test_utils/BUCK +3 -0
  233. package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
  234. package/ReactCommon/react/utils/ContextContainer.h +0 -27
  235. package/flow/global.js +45 -0
  236. package/index.js +15 -10
  237. package/jest/preprocessor.js +7 -75
  238. package/local-cli/cli.js +0 -0
  239. package/package.json +28 -22
  240. package/react.gradle +1 -1
  241. package/scripts/generate-specs-cli.js +18 -0
  242. package/scripts/ios-configure-glog.sh +4 -0
  243. package/scripts/react-native-xcode.sh +1 -1
  244. package/scripts/react_native_pods.rb +157 -38
  245. package/template/_flowconfig +1 -1
  246. package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  247. package/template/package.json +4 -2
  248. package/CHANGELOG.json +0 -500
  249. package/CHANGELOG.md +0 -240
  250. package/Libraries/.npmignore +0 -1
  251. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
  252. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
  253. package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
  254. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  255. package/React/Base/macOS/RCTDynamicColor.m +0 -217
  256. package/ReactAndroid/.npmignore +0 -5
  257. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
  258. package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
  259. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
  260. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
  261. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
  262. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
  263. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
  264. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +0 -20
  265. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +0 -39
  266. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +0 -34
  267. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +0 -35
  268. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +0 -15
  269. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +0 -46
  270. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +0 -40
  271. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  272. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  273. package/scripts/generate-specs.sh +0 -99
  274. package/template/_editorconfig +0 -3
  275. package/template/_gitattributes +0 -3
@@ -4,25 +4,29 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict-local
7
+ * @flow
8
8
  * @format
9
9
  */
10
10
 
11
- import type {LayoutEvent} from '../../Types/CoreEventTypes';
12
- import setAndForwardRef from 'react-native/Libraries/Utilities/setAndForwardRef';
13
- import Platform from '../../Utilities/Platform';
14
- import StyleSheet from '../../StyleSheet/StyleSheet';
15
- import Animated from '../../Animated/Animated';
11
+ import AnimatedImplementation from '../../Animated/AnimatedImplementation';
12
+ import AnimatedAddition from '../../Animated/nodes/AnimatedAddition';
13
+ import AnimatedDiffClamp from '../../Animated/nodes/AnimatedDiffClamp';
14
+ import AnimatedNode from '../../Animated/nodes/AnimatedNode';
15
+
16
16
  import * as React from 'react';
17
- import {useEffect, useMemo, useRef, useCallback} from 'react';
17
+ import StyleSheet from '../../StyleSheet/StyleSheet';
18
+ import View from '../View/View';
19
+ import Platform from '../../Utilities/Platform';
20
+
21
+ import type {LayoutEvent} from '../../Types/CoreEventTypes';
18
22
 
19
- const AnimatedView = Animated.View;
23
+ const AnimatedView = AnimatedImplementation.createAnimatedComponent(View);
20
24
 
21
25
  export type Props = $ReadOnly<{
22
- children?: React.Element<$FlowFixMe>,
26
+ children?: React.Element<any>,
23
27
  nextHeaderLayoutY: ?number,
24
28
  onLayout: (event: LayoutEvent) => void,
25
- scrollAnimatedValue: Animated.Value,
29
+ scrollAnimatedValue: AnimatedImplementation.Value,
26
30
  // Will cause sticky headers to stick at the bottom of the ScrollView instead
27
31
  // of the top.
28
32
  inverted: ?boolean,
@@ -32,275 +36,287 @@ export type Props = $ReadOnly<{
32
36
  hiddenOnScroll?: ?boolean,
33
37
  }>;
34
38
 
35
- const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent<
36
- Props,
37
- $ReadOnly<{
38
- setNextHeaderY: number => void,
39
- ...$Exact<React.ElementRef<typeof AnimatedView>>,
40
- }>,
41
- > = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) {
42
- const {
43
- inverted,
44
- scrollViewHeight,
45
- hiddenOnScroll,
46
- scrollAnimatedValue,
47
- nextHeaderLayoutY: _nextHeaderLayoutY,
48
- } = props;
39
+ type State = {
40
+ measured: boolean,
41
+ layoutY: number,
42
+ layoutHeight: number,
43
+ nextHeaderLayoutY: ?number,
44
+ translateY: ?number,
45
+ ...
46
+ };
49
47
 
50
- const [measured, setMeasured] = React.useState<boolean>(false);
51
- const [layoutY, setLayoutY] = React.useState<number>(0);
52
- const [layoutHeight, setLayoutHeight] = React.useState<number>(0);
53
- const [translateY, setTranslateY] = React.useState<?number>(null);
54
- const [nextHeaderLayoutY, setNextHeaderLayoutY] = React.useState<?number>(
55
- _nextHeaderLayoutY,
56
- );
57
- const [isFabric, setIsFabric] = React.useState<boolean>(false);
48
+ class ScrollViewStickyHeader extends React.Component<Props, State> {
49
+ state: State = {
50
+ measured: false,
51
+ layoutY: 0,
52
+ layoutHeight: 0,
53
+ nextHeaderLayoutY: this.props.nextHeaderLayoutY,
54
+ translateY: null,
55
+ };
58
56
 
59
- const componentRef = React.useRef<?React.ElementRef<typeof AnimatedView>>();
60
- const _setNativeRef = setAndForwardRef({
61
- getForwardedRef: () => forwardedRef,
62
- setLocalRef: ref => {
63
- componentRef.current = ref;
64
- if (ref) {
65
- ref.setNextHeaderY = value => {
66
- setNextHeaderLayoutY(value);
67
- };
68
- setIsFabric(
69
- !!(
70
- // An internal transform mangles variables with leading "_" as private.
71
- // eslint-disable-next-line dot-notation
72
- ref['_internalInstanceHandle']?.stateNode?.canonical
73
- ),
74
- );
75
- }
76
- },
77
- });
57
+ _translateY: ?AnimatedNode = null;
58
+ _shouldRecreateTranslateY: boolean = true;
59
+ _haveReceivedInitialZeroTranslateY: boolean = true;
60
+ _ref: any; // TODO T53738161: flow type this, and the whole file
78
61
 
79
- const offset = useMemo(
80
- () =>
81
- hiddenOnScroll === true
82
- ? Animated.diffClamp(
83
- scrollAnimatedValue
84
- .interpolate({
85
- extrapolateLeft: 'clamp',
86
- inputRange: [layoutY, layoutY + 1],
87
- outputRange: ([0, 1]: Array<number>),
88
- })
89
- .interpolate({
90
- inputRange: [0, 1],
91
- outputRange: ([0, -1]: Array<number>),
92
- }),
93
- -layoutHeight,
94
- 0,
95
- )
96
- : null,
97
- [scrollAnimatedValue, layoutHeight, layoutY, hiddenOnScroll],
98
- );
62
+ // Fabric-only:
63
+ _timer: ?TimeoutID;
64
+ _animatedValueListenerId: string;
65
+ _animatedValueListener: (valueObject: $ReadOnly<{|value: number|}>) => void;
66
+ _debounceTimeout: number = Platform.OS === 'android' ? 15 : 64;
99
67
 
100
- const [
101
- animatedTranslateY,
102
- setAnimatedTranslateY,
103
- ] = React.useState<Animated.Node>(() => {
104
- const inputRange: Array<number> = [-1, 0];
105
- const outputRange: Array<number> = [0, 0];
106
- const initialTranslateY: Animated.Interpolation = scrollAnimatedValue.interpolate(
107
- {
108
- inputRange,
109
- outputRange,
110
- },
111
- );
68
+ setNextHeaderY: (y: number) => void = (y: number): void => {
69
+ this._shouldRecreateTranslateY = true;
70
+ this.setState({nextHeaderLayoutY: y});
71
+ };
112
72
 
113
- if (offset != null) {
114
- return Animated.add(initialTranslateY, offset);
73
+ componentWillUnmount() {
74
+ if (this._translateY != null && this._animatedValueListenerId != null) {
75
+ this._translateY.removeListener(this._animatedValueListenerId);
76
+ }
77
+ if (this._timer) {
78
+ clearTimeout(this._timer);
115
79
  }
116
- return initialTranslateY;
117
- });
80
+ }
118
81
 
119
- const _haveReceivedInitialZeroTranslateY = useRef<boolean>(true);
120
- const _timer = useRef<?TimeoutID>(null);
82
+ UNSAFE_componentWillReceiveProps(nextProps: Props) {
83
+ if (
84
+ nextProps.scrollViewHeight !== this.props.scrollViewHeight ||
85
+ nextProps.scrollAnimatedValue !== this.props.scrollAnimatedValue ||
86
+ nextProps.inverted !== this.props.inverted
87
+ ) {
88
+ this._shouldRecreateTranslateY = true;
89
+ }
90
+ }
121
91
 
122
- useEffect(() => {
123
- if (translateY !== 0 && translateY != null) {
124
- _haveReceivedInitialZeroTranslateY.current = false;
92
+ updateTranslateListener(
93
+ translateY: AnimatedImplementation.Interpolation,
94
+ isFabric: boolean,
95
+ offset: AnimatedDiffClamp | null,
96
+ ) {
97
+ if (this._translateY != null && this._animatedValueListenerId != null) {
98
+ this._translateY.removeListener(this._animatedValueListenerId);
125
99
  }
126
- }, [translateY]);
100
+ offset
101
+ ? (this._translateY = new AnimatedAddition(translateY, offset))
102
+ : (this._translateY = translateY);
127
103
 
128
- // This is called whenever the (Interpolated) Animated Value
129
- // updates, which is several times per frame during scrolling.
130
- // To ensure that the Fabric ShadowTree has the most recent
131
- // translate style of this node, we debounce the value and then
132
- // pass it through to the underlying node during render.
133
- // This is:
134
- // 1. Only an issue in Fabric.
135
- // 2. Worse in Android than iOS. In Android, but not iOS, you
136
- // can touch and move your finger slightly and still trigger
137
- // a "tap" event. In iOS, moving will cancel the tap in
138
- // both Fabric and non-Fabric. On Android when you move
139
- // your finger, the hit-detection moves from the Android
140
- // platform to JS, so we need the ShadowTree to have knowledge
141
- // of the current position.
142
- const animatedValueListener = useCallback(
143
- ({value}) => {
144
- const _debounceTimeout: number = Platform.OS === 'android' ? 15 : 64;
145
- // When the AnimatedInterpolation is recreated, it always initializes
146
- // to a value of zero and emits a value change of 0 to its listeners.
147
- if (value === 0 && !_haveReceivedInitialZeroTranslateY.current) {
148
- _haveReceivedInitialZeroTranslateY.current = true;
149
- return;
150
- }
151
- if (_timer.current != null) {
152
- clearTimeout(_timer.current);
153
- }
154
- _timer.current = setTimeout(() => {
155
- if (value !== translateY) {
156
- setTranslateY(value);
157
- }
158
- }, _debounceTimeout);
159
- },
160
- [translateY],
161
- );
104
+ this._shouldRecreateTranslateY = false;
162
105
 
163
- useEffect(() => {
164
- const inputRange: Array<number> = [-1, 0];
165
- const outputRange: Array<number> = [0, 0];
106
+ if (!isFabric) {
107
+ return;
108
+ }
166
109
 
167
- if (measured) {
168
- if (inverted === true) {
169
- // The interpolation looks like:
170
- // - Negative scroll: no translation
171
- // - `stickStartPoint` is the point at which the header will start sticking.
172
- // It is calculated using the ScrollView viewport height so it is a the bottom.
173
- // - Headers that are in the initial viewport will never stick, `stickStartPoint`
174
- // will be negative.
175
- // - From 0 to `stickStartPoint` no translation. This will cause the header
176
- // to scroll normally until it reaches the top of the scroll view.
177
- // - From `stickStartPoint` to when the next header y hits the bottom edge of the header: translate
178
- // equally to scroll. This will cause the header to stay at the top of the scroll view.
179
- // - Past the collision with the next header y: no more translation. This will cause the
180
- // header to continue scrolling up and make room for the next sticky header.
181
- // In the case that there is no next header just translate equally to
182
- // scroll indefinitely.
183
- if (scrollViewHeight != null) {
184
- const stickStartPoint = layoutY + layoutHeight - scrollViewHeight;
185
- if (stickStartPoint > 0) {
186
- inputRange.push(stickStartPoint);
187
- outputRange.push(0);
188
- inputRange.push(stickStartPoint + 1);
189
- outputRange.push(1);
190
- // If the next sticky header has not loaded yet (probably windowing) or is the last
191
- // we can just keep it sticked forever.
192
- const collisionPoint =
193
- (nextHeaderLayoutY || 0) - layoutHeight - scrollViewHeight;
194
- if (collisionPoint > stickStartPoint) {
195
- inputRange.push(collisionPoint, collisionPoint + 1);
196
- outputRange.push(
197
- collisionPoint - stickStartPoint,
198
- collisionPoint - stickStartPoint,
199
- );
200
- }
201
- }
110
+ if (!this._animatedValueListener) {
111
+ // This is called whenever the (Interpolated) Animated Value
112
+ // updates, which is several times per frame during scrolling.
113
+ // To ensure that the Fabric ShadowTree has the most recent
114
+ // translate style of this node, we debounce the value and then
115
+ // pass it through to the underlying node during render.
116
+ // This is:
117
+ // 1. Only an issue in Fabric.
118
+ // 2. Worse in Android than iOS. In Android, but not iOS, you
119
+ // can touch and move your finger slightly and still trigger
120
+ // a "tap" event. In iOS, moving will cancel the tap in
121
+ // both Fabric and non-Fabric. On Android when you move
122
+ // your finger, the hit-detection moves from the Android
123
+ // platform to JS, so we need the ShadowTree to have knowledge
124
+ // of the current position.
125
+ this._animatedValueListener = ({value}) => {
126
+ // When the AnimatedInterpolation is recreated, it always initializes
127
+ // to a value of zero and emits a value change of 0 to its listeners.
128
+ if (value === 0 && !this._haveReceivedInitialZeroTranslateY) {
129
+ this._haveReceivedInitialZeroTranslateY = true;
130
+ return;
202
131
  }
203
- } else {
204
- // The interpolation looks like:
205
- // - Negative scroll: no translation
206
- // - From 0 to the y of the header: no translation. This will cause the header
207
- // to scroll normally until it reaches the top of the scroll view.
208
- // - From header y to when the next header y hits the bottom edge of the header: translate
209
- // equally to scroll. This will cause the header to stay at the top of the scroll view.
210
- // - Past the collision with the next header y: no more translation. This will cause the
211
- // header to continue scrolling up and make room for the next sticky header.
212
- // In the case that there is no next header just translate equally to
213
- // scroll indefinitely.
214
- inputRange.push(layoutY);
215
- outputRange.push(0);
216
- // If the next sticky header has not loaded yet (probably windowing) or is the last
217
- // we can just keep it sticked forever.
218
- const collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight;
219
- if (collisionPoint >= layoutY) {
220
- inputRange.push(collisionPoint, collisionPoint + 1);
221
- outputRange.push(collisionPoint - layoutY, collisionPoint - layoutY);
222
- } else {
223
- inputRange.push(layoutY + 1);
224
- outputRange.push(1);
132
+ if (this._timer) {
133
+ clearTimeout(this._timer);
225
134
  }
226
- }
227
- }
228
-
229
- let newAnimatedTranslateY: Animated.Node = scrollAnimatedValue.interpolate({
230
- inputRange,
231
- outputRange,
232
- });
233
-
234
- if (offset != null) {
235
- newAnimatedTranslateY = Animated.add(newAnimatedTranslateY, offset);
135
+ this._timer = setTimeout(() => {
136
+ if (value !== this.state.translateY) {
137
+ this.setState({
138
+ translateY: value,
139
+ });
140
+ }
141
+ }, this._debounceTimeout);
142
+ };
236
143
  }
237
-
238
- // add the event listener
239
- let animatedListenerId;
240
- if (isFabric) {
241
- animatedListenerId = newAnimatedTranslateY.addListener(
242
- animatedValueListener,
243
- );
144
+ if (this.state.translateY !== 0 && this.state.translateY != null) {
145
+ this._haveReceivedInitialZeroTranslateY = false;
244
146
  }
147
+ this._animatedValueListenerId = translateY.addListener(
148
+ this._animatedValueListener,
149
+ );
150
+ }
245
151
 
246
- setAnimatedTranslateY(newAnimatedTranslateY);
152
+ _onLayout = event => {
153
+ const layoutY = event.nativeEvent.layout.y;
154
+ const layoutHeight = event.nativeEvent.layout.height;
155
+ const measured = true;
247
156
 
248
- // clean up the event listener and timer
249
- return () => {
250
- if (animatedListenerId) {
251
- newAnimatedTranslateY.removeListener(animatedListenerId);
252
- }
253
- if (_timer.current != null) {
254
- clearTimeout(_timer.current);
255
- }
256
- };
257
- }, [nextHeaderLayoutY, measured, layoutHeight, layoutY, scrollViewHeight, scrollAnimatedValue, inverted, offset, animatedValueListener, isFabric]);
157
+ if (
158
+ layoutY !== this.state.layoutY ||
159
+ layoutHeight !== this.state.layoutHeight ||
160
+ measured !== this.state.measured
161
+ ) {
162
+ this._shouldRecreateTranslateY = true;
163
+ }
258
164
 
259
- const _onLayout = (event: LayoutEvent) => {
260
- setLayoutY(event.nativeEvent.layout.y);
261
- setLayoutHeight(event.nativeEvent.layout.height);
262
- setMeasured(true);
165
+ this.setState({
166
+ measured,
167
+ layoutY,
168
+ layoutHeight,
169
+ });
263
170
 
264
- props.onLayout(event);
265
- const child = React.Children.only(props.children);
171
+ this.props.onLayout(event);
172
+ const child = React.Children.only(this.props.children);
266
173
  if (child.props.onLayout) {
267
174
  child.props.onLayout(event);
268
175
  }
269
176
  };
270
177
 
271
- const child = React.Children.only(props.children);
178
+ _setComponentRef = ref => {
179
+ this._ref = ref;
180
+ };
181
+
182
+ render(): React.Node {
183
+ // Fabric Detection
184
+ const isFabric = !!(
185
+ // An internal transform mangles variables with leading "_" as private.
186
+ // eslint-disable-next-line dot-notation
187
+ (this._ref && this._ref['_internalInstanceHandle']?.stateNode?.canonical)
188
+ );
189
+ // Initially and in the case of updated props or layout, we
190
+ // recreate this interpolated value. Otherwise, we do not recreate
191
+ // when there are state changes.
192
+ if (this._shouldRecreateTranslateY) {
193
+ const {inverted, scrollViewHeight} = this.props;
194
+ const {measured, layoutHeight, layoutY, nextHeaderLayoutY} = this.state;
195
+ const inputRange: Array<number> = [-1, 0];
196
+ const outputRange: Array<number> = [0, 0];
272
197
 
273
- // TODO T68319535: remove this if NativeAnimated is rewritten for Fabric
274
- const passthroughAnimatedPropExplicitValues =
275
- isFabric && translateY != null
276
- ? {
277
- style: {transform: [{translateY: translateY}]},
198
+ if (measured) {
199
+ if (inverted) {
200
+ // The interpolation looks like:
201
+ // - Negative scroll: no translation
202
+ // - `stickStartPoint` is the point at which the header will start sticking.
203
+ // It is calculated using the ScrollView viewport height so it is a the bottom.
204
+ // - Headers that are in the initial viewport will never stick, `stickStartPoint`
205
+ // will be negative.
206
+ // - From 0 to `stickStartPoint` no translation. This will cause the header
207
+ // to scroll normally until it reaches the top of the scroll view.
208
+ // - From `stickStartPoint` to when the next header y hits the bottom edge of the header: translate
209
+ // equally to scroll. This will cause the header to stay at the top of the scroll view.
210
+ // - Past the collision with the next header y: no more translation. This will cause the
211
+ // header to continue scrolling up and make room for the next sticky header.
212
+ // In the case that there is no next header just translate equally to
213
+ // scroll indefinitely.
214
+ if (scrollViewHeight != null) {
215
+ const stickStartPoint = layoutY + layoutHeight - scrollViewHeight;
216
+ if (stickStartPoint > 0) {
217
+ inputRange.push(stickStartPoint);
218
+ outputRange.push(0);
219
+ inputRange.push(stickStartPoint + 1);
220
+ outputRange.push(1);
221
+ // If the next sticky header has not loaded yet (probably windowing) or is the last
222
+ // we can just keep it sticked forever.
223
+ const collisionPoint =
224
+ (nextHeaderLayoutY || 0) - layoutHeight - scrollViewHeight;
225
+ if (collisionPoint > stickStartPoint) {
226
+ inputRange.push(collisionPoint, collisionPoint + 1);
227
+ outputRange.push(
228
+ collisionPoint - stickStartPoint,
229
+ collisionPoint - stickStartPoint,
230
+ );
231
+ }
232
+ }
233
+ }
234
+ } else {
235
+ // The interpolation looks like:
236
+ // - Negative scroll: no translation
237
+ // - From 0 to the y of the header: no translation. This will cause the header
238
+ // to scroll normally until it reaches the top of the scroll view.
239
+ // - From header y to when the next header y hits the bottom edge of the header: translate
240
+ // equally to scroll. This will cause the header to stay at the top of the scroll view.
241
+ // - Past the collision with the next header y: no more translation. This will cause the
242
+ // header to continue scrolling up and make room for the next sticky header.
243
+ // In the case that there is no next header just translate equally to
244
+ // scroll indefinitely.
245
+ inputRange.push(layoutY);
246
+ outputRange.push(0);
247
+ // If the next sticky header has not loaded yet (probably windowing) or is the last
248
+ // we can just keep it sticked forever.
249
+ const collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight;
250
+ if (collisionPoint >= layoutY) {
251
+ inputRange.push(collisionPoint, collisionPoint + 1);
252
+ outputRange.push(
253
+ collisionPoint - layoutY,
254
+ collisionPoint - layoutY,
255
+ );
256
+ } else {
257
+ inputRange.push(layoutY + 1);
258
+ outputRange.push(1);
259
+ }
278
260
  }
279
- : null;
261
+ }
280
262
 
281
- return (
282
- /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
283
- included in the Animated.View flow type. */
284
- <AnimatedView
285
- collapsable={false}
286
- nativeID={props.nativeID}
287
- onLayout={_onLayout}
288
- ref={_setNativeRef}
289
- style={[
290
- child.props.style,
291
- styles.header,
292
- {transform: [{translateY: animatedTranslateY}]},
293
- ]}
294
- passthroughAnimatedPropExplicitValues={
295
- passthroughAnimatedPropExplicitValues
296
- }>
297
- {React.cloneElement(child, {
298
- style: styles.fill, // We transfer the child style to the wrapper.
299
- onLayout: undefined, // we call this manually through our this._onLayout
300
- })}
301
- </AnimatedView>
302
- );
303
- });
263
+ this.updateTranslateListener(
264
+ this.props.scrollAnimatedValue.interpolate({
265
+ inputRange,
266
+ outputRange,
267
+ }),
268
+ isFabric,
269
+ this.props.hiddenOnScroll
270
+ ? new AnimatedDiffClamp(
271
+ this.props.scrollAnimatedValue
272
+ .interpolate({
273
+ extrapolateLeft: 'clamp',
274
+ inputRange: [layoutY, layoutY + 1],
275
+ outputRange: ([0, 1]: Array<number>),
276
+ })
277
+ .interpolate({
278
+ inputRange: [0, 1],
279
+ outputRange: ([0, -1]: Array<number>),
280
+ }),
281
+ -this.state.layoutHeight,
282
+ 0,
283
+ )
284
+ : null,
285
+ );
286
+ }
287
+
288
+ const child = React.Children.only(this.props.children);
289
+
290
+ // TODO T68319535: remove this if NativeAnimated is rewritten for Fabric
291
+ const passthroughAnimatedPropExplicitValues =
292
+ isFabric && this.state.translateY != null
293
+ ? {
294
+ style: {transform: [{translateY: this.state.translateY}]},
295
+ }
296
+ : null;
297
+
298
+ return (
299
+ <AnimatedView
300
+ collapsable={false}
301
+ nativeID={this.props.nativeID}
302
+ onLayout={this._onLayout}
303
+ ref={this._setComponentRef}
304
+ style={[
305
+ child.props.style,
306
+ styles.header,
307
+ {transform: [{translateY: this._translateY}]},
308
+ ]}
309
+ passthroughAnimatedPropExplicitValues={
310
+ passthroughAnimatedPropExplicitValues
311
+ }>
312
+ {React.cloneElement(child, {
313
+ style: styles.fill, // We transfer the child style to the wrapper.
314
+ onLayout: undefined, // we call this manually through our this._onLayout
315
+ })}
316
+ </AnimatedView>
317
+ );
318
+ }
319
+ }
304
320
 
305
321
  const styles = StyleSheet.create({
306
322
  header: {
@@ -312,4 +328,4 @@ const styles = StyleSheet.create({
312
328
  },
313
329
  });
314
330
 
315
- export default ScrollViewStickyHeaderWithForwardedRef;
331
+ module.exports = ScrollViewStickyHeader;
@@ -151,40 +151,29 @@ class TouchableBounce extends React.Component<Props, State> {
151
151
  accessibilityLiveRegion={this.props.accessibilityLiveRegion}
152
152
  accessibilityViewIsModal={this.props.accessibilityViewIsModal}
153
153
  accessibilityElementsHidden={this.props.accessibilityElementsHidden}
154
+ nativeID={this.props.nativeID}
155
+ testID={this.props.testID}
156
+ hitSlop={this.props.hitSlop}
157
+ // [TODO(macOS GH#774)
154
158
  acceptsFirstMouse={
155
159
  this.props.acceptsFirstMouse !== false && !this.props.disabled
156
- } // TODO(macOS GH#774)
160
+ }
157
161
  enableFocusRing={
158
162
  (this.props.enableFocusRing === undefined ||
159
163
  this.props.enableFocusRing === true) &&
160
164
  !this.props.disabled
161
- } // TODO(macOS/win GH#774)
162
- nativeID={this.props.nativeID}
163
- testID={this.props.testID}
164
- hitSlop={this.props.hitSlop}
165
- // [macOS #656 We need to reconcile between focusable and acceptsKeyboardFocus
166
- // (e.g. if one is explicitly disabled, we shouldn't implicitly enable the
167
- // other on the underlying view). Prefer passing acceptsKeyboardFocus if
168
- // passed explicitly to preserve original behavior, and trigger view warnings.
169
- {...(this.props.acceptsKeyboardFocus !== undefined
170
- ? {
171
- acceptsKeyboardFocus:
172
- this.props.acceptsKeyboardFocus === true &&
173
- !this.props.disabled,
174
- }
175
- : {
176
- focusable: this.props.focusable !== false && !this.props.disabled,
177
- })}
178
- // macOS]
179
- tooltip={this.props.tooltip} // TODO(macOS/win GH#774)
180
- onMouseEnter={this.props.onMouseEnter} // [TODO(macOS GH#774)
165
+ }
166
+ focusable={this.props.focusable !== false && !this.props.disabled}
167
+ tooltip={this.props.tooltip}
168
+ onMouseEnter={this.props.onMouseEnter}
181
169
  onMouseLeave={this.props.onMouseLeave}
182
170
  onDragEnter={this.props.onDragEnter}
183
171
  onDragLeave={this.props.onDragLeave}
184
172
  onDrop={this.props.onDrop}
185
173
  onFocus={this.props.onFocus}
186
174
  onBlur={this.props.onBlur}
187
- draggedTypes={this.props.draggedTypes} // ]TODO(macOS GH#774)
175
+ draggedTypes={this.props.draggedTypes}
176
+ // ]TODO(macOS GH#774)
188
177
  ref={this.props.hostRef}
189
178
  {...eventHandlersWithoutBlurAndFocus}>
190
179
  {this.props.children}