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,7 +4,9 @@
4
4
  # LICENSE file in the root directory of this source tree.
5
5
 
6
6
  require "json"
7
- require_relative "../../scripts/react_native_pods.rb"
7
+
8
+ react_native_path = "../.."
9
+ require_relative "#{react_native_path}/scripts/react_native_pods.rb"
8
10
 
9
11
  package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
10
12
  version = package['version']
@@ -31,7 +33,7 @@ Pod::Spec.new do |s|
31
33
  s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#774)
32
34
  s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
33
35
  s.source = source
34
- s.source_files = "**/*.{c,h,m,mm,cpp}"
36
+ s.source_files = "**/FBReactNativeSpec*.{h,mm}"
35
37
  s.header_dir = "FBReactNativeSpec"
36
38
 
37
39
  s.pod_target_xcconfig = {
@@ -47,5 +49,11 @@ Pod::Spec.new do |s|
47
49
  s.dependency "React-jsi", version
48
50
  s.dependency "ReactCommon/turbomodule/core", version
49
51
 
50
- use_react_native_codegen! (s)
52
+ use_react_native_codegen!(s, {
53
+ :react_native_path => react_native_path,
54
+ :js_srcs_dir => "#{react_native_path}/Libraries",
55
+ :library_name => "FBReactNativeSpec",
56
+ :library_type => "modules",
57
+ :output_dir => "#{react_native_path}/React/FBReactNativeSpec/FBReactNativeSpec"
58
+ })
51
59
  end
@@ -133,6 +133,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
133
133
  [self.scrollViewDelegateSplitter removeAllDelegates];
134
134
  }
135
135
 
136
+ - (void)layoutSubviews
137
+ {
138
+ [super layoutSubviews];
139
+
140
+ if (_subviewClippingEnabled) {
141
+ [self _remountChildren];
142
+ }
143
+ }
144
+
136
145
  - (RCTGenericDelegateSplitter<id<UIScrollViewDelegate>> *)scrollViewDelegateSplitter
137
146
  {
138
147
  return ((RCTEnhancedScrollView *)_scrollView).delegateSplitter;
@@ -10,6 +10,7 @@
10
10
  #import <better/map.h>
11
11
 
12
12
  #import <React/RCTAssert.h>
13
+ #import <React/RCTComponent.h>
13
14
  #import <React/RCTFollyConvert.h>
14
15
  #import <React/RCTLog.h>
15
16
  #import <React/RCTUtils.h>
@@ -26,6 +27,18 @@
26
27
 
27
28
  using namespace facebook::react;
28
29
 
30
+ static SurfaceId RCTSurfaceIdForView(UIView *view)
31
+ {
32
+ do {
33
+ if (RCTIsReactRootView(@(view.tag))) {
34
+ return view.tag;
35
+ }
36
+ view = view.superview;
37
+ } while (view != nil);
38
+
39
+ return -1;
40
+ }
41
+
29
42
  static void RCTPerformMountInstructions(
30
43
  ShadowViewMutationList const &mutations,
31
44
  RCTComponentViewRegistry *registry,
@@ -282,9 +295,10 @@ static void RCTPerformMountInstructions(
282
295
  {
283
296
  RCTAssertMainQueue();
284
297
  UIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag];
298
+ SurfaceId surfaceId = RCTSurfaceIdForView(componentView);
285
299
  SharedProps oldProps = [componentView props];
286
300
  SharedProps newProps = componentDescriptor.cloneProps(
287
- PropsParserContext{-1, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
301
+ PropsParserContext{surfaceId, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
288
302
 
289
303
  NSSet<NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new];
290
304
  propKeys = [propKeys setByAddingObjectsFromArray:props.allKeys];
@@ -110,7 +110,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
110
110
  std::shared_ptr<SchedulerDelegateProxy> _delegateProxy;
111
111
  std::shared_ptr<LayoutAnimationDelegateProxy> _layoutAnimationDelegateProxy;
112
112
  RunLoopObserver::Unique _uiRunLoopObserver;
113
- BOOL _layoutAnimationsEnabled;
114
113
  }
115
114
 
116
115
  - (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
@@ -118,14 +117,22 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
118
117
  if (self = [super init]) {
119
118
  auto reactNativeConfig =
120
119
  toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
121
- _layoutAnimationsEnabled = reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios");
122
120
 
123
121
  _delegateProxy = std::make_shared<SchedulerDelegateProxy>((__bridge void *)self);
124
122
 
125
- if (_layoutAnimationsEnabled) {
123
+ if (reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios")) {
126
124
  _layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
127
125
  _animationDriver =
128
126
  std::make_shared<LayoutAnimationDriver>(toolbox.runtimeExecutor, _layoutAnimationDelegateProxy.get());
127
+ if (reactNativeConfig->getBool("react_fabric:enabled_skip_invalidated_key_frames_ios")) {
128
+ _animationDriver->enableSkipInvalidatedKeyFrames();
129
+ }
130
+ if (reactNativeConfig->getBool("react_fabric:enable_crash_on_missing_component_descriptor")) {
131
+ _animationDriver->enableCrashOnMissingComponentDescriptor();
132
+ }
133
+ if (reactNativeConfig->getBool("react_fabric:enable_simulate_image_props_memory_access")) {
134
+ _animationDriver->enableSimulateImagePropsMemoryAccess();
135
+ }
129
136
  _uiRunLoopObserver =
130
137
  toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
131
138
  _uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
@@ -14,8 +14,8 @@
14
14
  @interface RCTEventEmitter : NSObject <RCTBridgeModule, RCTInvalidating>
15
15
 
16
16
  @property (nonatomic, weak) RCTBridge * _Nullable bridge; // TODO(macOS GH#774)
17
- @property (nonatomic, weak) RCTModuleRegistry *moduleRegistry;
18
- @property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED;
17
+ @property (nonatomic, weak) RCTModuleRegistry * _Nullable moduleRegistry; // TODO(macOS GH#774)
18
+ @property (nonatomic, weak) RCTViewRegistry * _Nullable viewRegistry_DEPRECATED; // TODO(macOS GH#774)
19
19
 
20
20
  - (instancetype _Nullable)initWithDisabledObservation; // TODO(macOS GH#774)
21
21
 
@@ -190,6 +190,7 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
190
190
  _animationType == animation.animationType;
191
191
  }
192
192
 
193
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
193
194
  - (NSString *)description
194
195
  {
195
196
  return [NSString
@@ -204,5 +205,6 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
204
205
  _initialVelocity,
205
206
  (long)_animationType];
206
207
  }
208
+ #endif // TODO(macOS GH#774)
207
209
 
208
210
  @end
@@ -64,6 +64,7 @@
64
64
  [_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
65
65
  }
66
66
 
67
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
67
68
  - (NSString *)description
68
69
  {
69
70
  return
@@ -75,5 +76,6 @@
75
76
  [_updatingLayoutAnimation description],
76
77
  [_deletingLayoutAnimation description]];
77
78
  }
79
+ #endif // TODO(macOS GH#774)
78
80
 
79
81
  @end
@@ -1501,6 +1501,7 @@ RCT_EXPORT_METHOD(clearJSResponder)
1501
1501
  static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
1502
1502
  NSMutableDictionary<NSString *, NSDictionary *> *directEvents,
1503
1503
  NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents,
1504
+ NSMutableDictionary<NSString *, NSString *> *registrationCache, // TODO(macOS GH#774)
1504
1505
  RCTComponentData *componentData)
1505
1506
  {
1506
1507
  NSMutableDictionary<NSString *, id> *moduleConstants = [NSMutableDictionary new];
@@ -1520,6 +1521,8 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
1520
1521
  moduleConstants[@"bubblingEventTypes"] = bubblingEventTypes;
1521
1522
  moduleConstants[@"directEventTypes"] = directEventTypes;
1522
1523
 
1524
+ NSString *componentName = [componentData name]; // TODO(macOS GH#774)
1525
+
1523
1526
  // Add direct events
1524
1527
  for (NSString *eventName in viewConfig[@"directEvents"]) {
1525
1528
  if (!directEvents[eventName]) {
@@ -1530,11 +1533,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
1530
1533
  directEventTypes[eventName] = directEvents[eventName];
1531
1534
  if (RCT_DEBUG && bubblingEvents[eventName]) {
1532
1535
  RCTLogError(
1533
- @"Component '%@' re-registered bubbling event '%@' as a "
1536
+ @"Component '%@' re-registered bubbling event '%@' (originally registered by '%@') as a "
1534
1537
  "direct event",
1535
- componentData.name,
1536
- eventName);
1538
+ componentName,
1539
+ eventName,
1540
+ registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
1537
1541
  }
1542
+ registrationCache[eventName] = componentName; // TODO(macOS GH#774)
1538
1543
  }
1539
1544
 
1540
1545
  // Add bubbling events
@@ -1551,11 +1556,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
1551
1556
  bubblingEventTypes[eventName] = bubblingEvents[eventName];
1552
1557
  if (RCT_DEBUG && directEvents[eventName]) {
1553
1558
  RCTLogError(
1554
- @"Component '%@' re-registered direct event '%@' as a "
1559
+ @"Component '%@' re-registered direct event '%@' (originally registered by '%@') as a "
1555
1560
  "bubbling event",
1556
- componentData.name,
1557
- eventName);
1561
+ componentName,
1562
+ eventName,
1563
+ registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
1558
1564
  }
1565
+ registrationCache[eventName] = componentName; // TODO(macOS GH#774)
1559
1566
  }
1560
1567
 
1561
1568
  return moduleConstants;
@@ -1571,12 +1578,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
1571
1578
  NSMutableDictionary<NSString *, NSDictionary *> *constants = [NSMutableDictionary new];
1572
1579
  NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
1573
1580
  NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
1581
+ NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
1574
1582
 
1575
1583
  [_componentDataByName
1576
1584
  enumerateKeysAndObjectsUsingBlock:^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {
1577
1585
  RCTAssert(!constants[name], @"UIManager already has constants for %@", componentData.name);
1578
1586
  NSMutableDictionary<NSString *, id> *moduleConstants =
1579
- moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
1587
+ moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
1580
1588
  constants[name] = moduleConstants;
1581
1589
  }];
1582
1590
 
@@ -1621,10 +1629,11 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView : (NSString *)name)
1621
1629
  bridge:self.bridge
1622
1630
  eventDispatcher:self.bridge.eventDispatcher];
1623
1631
  _componentDataByName[componentData.name] = componentData;
1624
- NSMutableDictionary *directEvents = [NSMutableDictionary new];
1625
- NSMutableDictionary *bubblingEvents = [NSMutableDictionary new];
1632
+ NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
1633
+ NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
1634
+ NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
1626
1635
  NSMutableDictionary<NSString *, id> *moduleConstants =
1627
- moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
1636
+ moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
1628
1637
  return @{
1629
1638
  @"viewConfig" : moduleConstants,
1630
1639
  };
@@ -11,18 +11,16 @@
11
11
 
12
12
  #import <CoreText/CoreText.h>
13
13
 
14
- #import <mutex>
15
-
16
14
  typedef CGFloat RCTFontWeight;
17
15
  static RCTFontWeight weightOfFont(UIFont *font)
18
16
  {
19
- static NSArray *fontNames;
20
- static NSArray *fontWeights;
17
+ static NSArray<NSString *> *weightSuffixes;
18
+ static NSArray<NSNumber *> *fontWeights;
21
19
  static dispatch_once_t onceToken;
22
20
  dispatch_once(&onceToken, ^{
23
21
  // We use two arrays instead of one map because
24
22
  // the order is important for suffix matching.
25
- fontNames = @[
23
+ weightSuffixes = @[
26
24
  @"normal",
27
25
  @"ultralight",
28
26
  @"thin",
@@ -54,28 +52,29 @@ static RCTFontWeight weightOfFont(UIFont *font)
54
52
  ];
55
53
  });
56
54
 
57
- for (NSInteger i = 0; i < 0 || i < (unsigned)fontNames.count; i++) {
58
- if ([font.fontName.lowercaseString hasSuffix:fontNames[i]]) {
59
- return (RCTFontWeight)[fontWeights[i] doubleValue];
55
+ NSString *fontName = font.fontName;
56
+ NSInteger i = 0;
57
+ for (NSString *suffix in weightSuffixes) {
58
+ // CFStringFind is much faster than any variant of rangeOfString: because it does not use a locale.
59
+ auto options = kCFCompareCaseInsensitive | kCFCompareAnchored | kCFCompareBackwards;
60
+ if (CFStringFind((CFStringRef)fontName, (CFStringRef)suffix, options).location != kCFNotFound) {
61
+ return (RCTFontWeight)fontWeights[i].doubleValue;
60
62
  }
63
+ i++;
61
64
  }
62
65
 
63
- NSDictionary *traits = [font.fontDescriptor objectForKey:UIFontDescriptorTraitsAttribute];
66
+ auto traits = (__bridge_transfer NSDictionary *)CTFontCopyTraits((CTFontRef)font);
64
67
  return (RCTFontWeight)[traits[UIFontWeightTrait] doubleValue];
65
68
  }
66
69
 
67
70
  static BOOL isItalicFont(UIFont *font)
68
71
  {
69
- NSDictionary *traits = [font.fontDescriptor objectForKey:UIFontDescriptorTraitsAttribute];
70
- UIFontDescriptorSymbolicTraits symbolicTraits = [traits[UIFontSymbolicTrait] unsignedIntValue];
71
- return (symbolicTraits & UIFontDescriptorTraitItalic) != 0;
72
+ return (CTFontGetSymbolicTraits((CTFontRef)font) & kCTFontTraitItalic) != 0;
72
73
  }
73
74
 
74
75
  static BOOL isCondensedFont(UIFont *font)
75
76
  {
76
- NSDictionary *traits = [font.fontDescriptor objectForKey:UIFontDescriptorTraitsAttribute];
77
- UIFontDescriptorSymbolicTraits symbolicTraits = [traits[UIFontSymbolicTrait] unsignedIntValue];
78
- return (symbolicTraits & UIFontDescriptorTraitCondensed) != 0;
77
+ return (CTFontGetSymbolicTraits((CTFontRef)font) & kCTFontTraitCondensed) != 0;
79
78
  }
80
79
 
81
80
  static RCTFontHandler defaultFontHandler;
@@ -130,18 +129,16 @@ static NSString *FontWeightDescriptionFromUIFontWeight(UIFontWeight fontWeight)
130
129
 
131
130
  static UIFont *cachedSystemFont(CGFloat size, RCTFontWeight weight)
132
131
  {
133
- static NSCache *fontCache;
134
- static std::mutex *fontCacheMutex = new std::mutex;
135
-
136
- NSString *cacheKey = [NSString stringWithFormat:@"%.1f/%.2f", size, weight];
137
- UIFont *font;
138
- {
139
- std::lock_guard<std::mutex> lock(*fontCacheMutex);
140
- if (!fontCache) {
141
- fontCache = [NSCache new];
142
- }
143
- font = [fontCache objectForKey:cacheKey];
144
- }
132
+ static NSCache<NSValue *, UIFont *> *fontCache = [NSCache new];
133
+
134
+ struct __attribute__((__packed__)) CacheKey {
135
+ CGFloat size;
136
+ RCTFontWeight weight;
137
+ };
138
+
139
+ CacheKey key{size, weight};
140
+ NSValue *cacheKey = [[NSValue alloc] initWithBytes:&key objCType:@encode(CacheKey)];
141
+ UIFont *font = [fontCache objectForKey:cacheKey];
145
142
 
146
143
  if (!font) {
147
144
  if (defaultFontHandler) {
@@ -157,27 +154,43 @@ static UIFont *cachedSystemFont(CGFloat size, RCTFontWeight weight)
157
154
  font = [UIFont systemFontOfSize:size weight:weight];
158
155
  }
159
156
 
160
- {
161
- std::lock_guard<std::mutex> lock(*fontCacheMutex);
162
- [fontCache setObject:font forKey:cacheKey];
163
- }
157
+ [fontCache setObject:font forKey:cacheKey];
164
158
  }
165
159
 
166
160
  return font;
167
161
  }
168
162
 
169
- static NSArray<NSString *> *fontNamesForFamilyName(NSString *familyName) // [TODO(macOS GH#774)
163
+ // Caching wrapper around expensive +[UIFont fontNamesForFamilyName:]
164
+ static NSArray<NSString *> *fontNamesForFamilyName(NSString *familyName)
170
165
  {
171
- #if !TARGET_OS_OSX
172
- return [UIFont fontNamesForFamilyName:familyName];
166
+ static NSCache<NSString *, NSArray<NSString *> *> *cache;
167
+ static dispatch_once_t onceToken;
168
+ dispatch_once(&onceToken, ^{
169
+ cache = [NSCache new];
170
+ [NSNotificationCenter.defaultCenter
171
+ addObserverForName:(NSNotificationName)kCTFontManagerRegisteredFontsChangedNotification
172
+ object:nil
173
+ queue:nil
174
+ usingBlock:^(NSNotification *) {
175
+ [cache removeAllObjects];
176
+ }];
177
+ });
178
+
179
+ auto names = [cache objectForKey:familyName];
180
+ if (!names) {
181
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
182
+ names = [UIFont fontNamesForFamilyName:familyName] ?: [NSArray new];
173
183
  #else
174
- NSMutableArray<NSString *> *fontNames = [NSMutableArray array];
175
- for (NSArray *fontSettings in [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName]) {
176
- [fontNames addObject:fontSettings[0]];
184
+ NSMutableArray<NSString *> *fontNames = [NSMutableArray array];
185
+ for (NSArray *fontSettings in [[NSFontManager sharedFontManager] availableMembersOfFontFamily:familyName]) {
186
+ [fontNames addObject:fontSettings[0]];
187
+ }
188
+ names = fontNames;
189
+ #endif // ]TODO(macOS GH#774)
190
+ [cache setObject:names forKey:familyName];
177
191
  }
178
- return fontNames;
179
- #endif
180
- } // ]TODO(macOS GH#774)
192
+ return names;
193
+ }
181
194
 
182
195
  @implementation RCTConvert (RCTFont)
183
196
 
@@ -334,7 +347,7 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
334
347
 
335
348
  // Gracefully handle being given a font name rather than font family, for
336
349
  // example: "Helvetica Light Oblique" rather than just "Helvetica".
337
- if (!didFindFont && fontNamesForFamilyName(familyName).count == 0) { // TODO(macOS GH#774)
350
+ if (!didFindFont && fontNamesForFamilyName(familyName).count == 0) {
338
351
  font = [UIFont fontWithName:familyName size:fontSize];
339
352
  if (font) {
340
353
  // It's actually a font name, not a font family name,
@@ -361,7 +374,8 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
361
374
 
362
375
  // Get the closest font that matches the given weight for the fontFamily
363
376
  CGFloat closestWeight = INFINITY;
364
- for (NSString *name in fontNamesForFamilyName(familyName)) { // TODO(macOS GH#774)
377
+ NSArray<NSString *> *names = fontNamesForFamilyName(familyName);
378
+ for (NSString *name in names) {
365
379
  UIFont *match = [UIFont fontWithName:name size:fontSize];
366
380
  if (isItalic == isItalicFont(match) && isCondensed == isCondensedFont(match)) {
367
381
  CGFloat testWeight = weightOfFont(match);
@@ -374,11 +388,8 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
374
388
 
375
389
  // If we still don't have a match at least return the first font in the fontFamily
376
390
  // This is to support built-in font Zapfino and other custom single font families like Impact
377
- if (!font) {
378
- NSArray *names = fontNamesForFamilyName(familyName); // TODO(macOS GH#774)
379
- if (names.count > 0) {
380
- font = [UIFont fontWithName:names[0] size:fontSize];
381
- }
391
+ if (!font && names.count > 0) {
392
+ font = [UIFont fontWithName:names[0] size:fontSize];
382
393
  }
383
394
 
384
395
  // Apply font variants to font object
@@ -52,7 +52,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
52
52
  #if !TARGET_OS_OSX // [TODO(macOS GH#774)
53
53
  float pixelsInPoint = RCTScreenScale();
54
54
  #else
55
- float pixelsInPoint = 0; // TODO(ISS#1656079): Turn off pixel rounding for macOS until we can get screen resolution passed here
55
+ float pixelsInPoint = 1; // TODO(ISS#1656079): Use 1x alignment for macOS until we can use backing resolution
56
56
  #endif // ]TODO(macOS GH#774)
57
57
  YGConfigSetPointScaleFactor(yogaConfig, pixelsInPoint);
58
58
  YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
@@ -393,6 +393,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
393
393
  return self.reactTag;
394
394
  }
395
395
 
396
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
396
397
  - (NSString *)description
397
398
  {
398
399
  NSString *description = super.description;
@@ -403,6 +404,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
403
404
  NSStringFromCGRect(self.layoutMetrics.frame)];
404
405
  return description;
405
406
  }
407
+ #endif // TODO(macOS GH#774)
406
408
 
407
409
  - (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
408
410
  {
@@ -9,7 +9,7 @@
9
9
 
10
10
  #import <React/RCTBorderStyle.h>
11
11
  #import <React/RCTComponent.h>
12
- #import <React/RCTEventDispatcher.h> // TODO(OSS Candidate ISS#2710739)
12
+ #import <React/RCTEventDispatcherProtocol.h> // TODO(OSS Candidate ISS#2710739)
13
13
  #import <React/RCTPointerEvents.h>
14
14
 
15
15
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
@@ -23,7 +23,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
23
23
  @interface RCTView : RCTUIView // TODO(macOS ISS#3536887)
24
24
 
25
25
  // [TODO(OSS Candidate ISS#2710739)
26
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher;
26
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher;
27
27
 
28
28
  - (BOOL)becomeFirstResponder;
29
29
  - (BOOL)resignFirstResponder;
@@ -128,6 +128,9 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
128
128
  /**
129
129
  * macOS Properties
130
130
  */
131
+
132
+ @property (nonatomic, assign) CATransform3D transform3D;
133
+
131
134
  @property (nonatomic, copy) RCTDirectEventBlock onDoubleClick;
132
135
  @property (nonatomic, copy) RCTDirectEventBlock onClick;
133
136
  @property (nonatomic, copy) RCTDirectEventBlock onMouseEnter;
@@ -123,7 +123,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
123
123
 
124
124
  @implementation RCTView {
125
125
  RCTUIColor *_backgroundColor; // TODO(OSS Candidate ISS#2710739)
126
- RCTEventDispatcher *_eventDispatcher; // TODO(OSS Candidate ISS#2710739)
126
+ id<RCTEventDispatcherProtocol> _eventDispatcher; // TODO(OSS Candidate ISS#2710739)
127
127
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
128
128
  NSTrackingArea *_trackingArea;
129
129
  BOOL _hasMouseOver;
@@ -133,7 +133,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
133
133
  }
134
134
 
135
135
  // [TODO(OSS Candidate ISS#2710739)
136
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
136
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
137
137
  {
138
138
  if ((self = [self initWithFrame:CGRectZero])) {
139
139
  _eventDispatcher = eventDispatcher;
@@ -162,6 +162,9 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
162
162
  _borderBottomEndRadius = -1;
163
163
  _borderStyle = RCTBorderStyleSolid;
164
164
  _hitTestEdgeInsets = UIEdgeInsetsZero;
165
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
166
+ _transform3D = CATransform3DIdentity;
167
+ #endif // TODO(macOS GH#774)
165
168
 
166
169
  _backgroundColor = super.backgroundColor;
167
170
  }
@@ -708,17 +711,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
708
711
  }
709
712
  #endif // ]TODO(macOS GH#774)
710
713
 
714
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
711
715
  - (NSString *)description
712
716
  {
713
- NSString *superDescription = super.description;
714
- NSRange semicolonRange = [superDescription rangeOfString:@";"];
715
- if (semicolonRange.location == NSNotFound) { // [TODO(macOS GH#774)
716
- return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; reactTag: %@; frame = %@; layer = %@>", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
717
- } else { // ]TODO(macOS GH#774)
718
- NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@;", self.reactTag];
719
- return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
720
- } // TODO(macOS GH#774)
717
+ // TODO(macOS GH#774): we shouldn't make assumptions on what super's description is. Just append additional content.
718
+ return [[super description] stringByAppendingFormat:@" reactTag: %@; frame = %@; layer = %@", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
721
719
  }
720
+ #endif // TODO(macOS GH#774)
722
721
 
723
722
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
724
723
  - (void)viewDidMoveToWindow
@@ -1169,6 +1168,19 @@ static CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x)
1169
1168
  backgroundColor = _backgroundColor.CGColor;
1170
1169
  #endif
1171
1170
 
1171
+ #if TARGET_OS_OSX // [TODO(macOS GH#1035)
1172
+ CATransform3D transform = [self transform3D];
1173
+ CGPoint anchorPoint = [layer anchorPoint];
1174
+ if (CGPointEqualToPoint(anchorPoint, CGPointZero) && !CATransform3DEqualToTransform(transform, CATransform3DIdentity)) {
1175
+ // https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint
1176
+ // This compensates for the fact that layer.anchorPoint is {0, 0} instead of {0.5, 0.5} on macOS for some reason.
1177
+ CATransform3D originAdjust = CATransform3DTranslate(CATransform3DIdentity, self.frame.size.width / 2, self.frame.size.height / 2, 0);
1178
+ transform = CATransform3DConcat(CATransform3DConcat(CATransform3DInvert(originAdjust), transform), originAdjust);
1179
+ // Enable edge antialiasing in perspective transforms
1180
+ [layer setAllowsEdgeAntialiasing:!(transform.m34 == 0.0f)];
1181
+ }
1182
+ [layer setTransform:transform];
1183
+ #endif // ]TODO(macOS GH#1035)
1172
1184
  if (useIOSBorderRendering) {
1173
1185
  layer.cornerRadius = cornerRadii.topLeft;
1174
1186
  layer.borderColor = borderColors.left;
@@ -51,7 +51,6 @@ RCT_MULTI_ENUM_CONVERTER(
51
51
  // a set of RN accessibilityTraits are macOS specific accessiblity roles and map to nothing on iOS:
52
52
  @"disclosure" : @(UIAccessibilityTraitNone),
53
53
  @"group" : @(UIAccessibilityTraitNone),
54
- @"list" : @(UIAccessibilityTraitNone),
55
54
  // ]TODO(macOS GH#774)
56
55
  @"alert" : @(UIAccessibilityTraitNone),
57
56
  @"checkbox" : @(UIAccessibilityTraitNone),
@@ -59,7 +58,7 @@ RCT_MULTI_ENUM_CONVERTER(
59
58
  @"menu" : @(UIAccessibilityTraitNone),
60
59
  @"menubar" : @(UIAccessibilityTraitNone),
61
60
  @"menuitem" : @(UIAccessibilityTraitNone),
62
- @"progressbar" : @(UIAccessibilityTraitNone),
61
+ @"progressbar" : @(UIAccessibilityTraitUpdatesFrequently),
63
62
  @"radio" : @(UIAccessibilityTraitNone),
64
63
  @"radiogroup" : @(UIAccessibilityTraitNone),
65
64
  @"scrollbar" : @(UIAccessibilityTraitNone),
@@ -216,15 +215,16 @@ RCT_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, RCTView)
216
215
 
217
216
  RCT_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, RCTView)
218
217
  {
219
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
218
+ #if TARGET_OS_OSX // [TODO(macOS GH#460)
219
+ CATransform3D transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
220
+ [view setTransform3D:transform];
221
+ [view setNeedsDisplay];
222
+ #else // ]TODO(macOS GH#460)]
220
223
  view.layer.transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
221
- // Enable edge antialiasing in perspective transforms
222
- view.layer.allowsEdgeAntialiasing = !(view.layer.transform.m34 == 0.0f);
223
- #elif TARGET_OS_OSX // [TODO(macOS GH#774)
224
- view.layer.sublayerTransform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.sublayerTransform;
225
- // TODO: Improve this by enabling edge antialiasing only for transforms with rotation or skewing
226
- view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(view.layer.sublayerTransform) ? kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge : 0;
227
- #endif // ]TODO(macOS GH#774)
224
+ // Enable edge antialiasing in rotation, skew, or perspective transforms
225
+ view.layer.allowsEdgeAntialiasing =
226
+ view.layer.transform.m12 != 0.0f || view.layer.transform.m21 != 0.0f || view.layer.transform.m34 != 0.0f;
227
+ #endif // [TODO(macOS GH#460)]
228
228
  }
229
229
 
230
230
  RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
@@ -233,7 +233,8 @@ RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
233
233
  const UIAccessibilityTraits AccessibilityRolesMask = UIAccessibilityTraitNone | UIAccessibilityTraitButton |
234
234
  UIAccessibilityTraitLink | UIAccessibilityTraitSearchField | UIAccessibilityTraitImage |
235
235
  UIAccessibilityTraitKeyboardKey | UIAccessibilityTraitStaticText | UIAccessibilityTraitAdjustable |
236
- UIAccessibilityTraitHeader | UIAccessibilityTraitSummaryElement | SwitchAccessibilityTrait;
236
+ UIAccessibilityTraitHeader | UIAccessibilityTraitSummaryElement | UIAccessibilityTraitTabBar |
237
+ UIAccessibilityTraitUpdatesFrequently | SwitchAccessibilityTrait;
237
238
  view.reactAccessibilityElement.accessibilityTraits =
238
239
  view.reactAccessibilityElement.accessibilityTraits & ~AccessibilityRolesMask;
239
240
  UIAccessibilityTraits newTraits = json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
@@ -386,12 +387,6 @@ RCT_CUSTOM_VIEW_PROPERTY(acceptsFirstMouse, BOOL, RCTView)
386
387
  view.acceptsFirstMouse = json ? [RCTConvert BOOL:json] : defaultView.acceptsFirstMouse;
387
388
  }
388
389
  }
389
- RCT_CUSTOM_VIEW_PROPERTY(acceptsKeyboardFocus, BOOL, RCTView)
390
- {
391
- if ([view respondsToSelector:@selector(setFocusable:)]) {
392
- view.focusable = json ? [RCTConvert BOOL:json] : defaultView.focusable;
393
- }
394
- }
395
390
  RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL, RCTView)
396
391
  {
397
392
  if ([view respondsToSelector:@selector(setFocusable:)]) {
@@ -30,6 +30,7 @@
30
30
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
31
31
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
32
32
 
33
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
33
34
  - (NSString *)description
34
35
  {
35
36
  NSString *superDescription = [super description];
@@ -44,6 +45,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
44
45
  NSStringFromUIEdgeInsets([self safeAreaInsetsIfSupportedAndEnabled]),
45
46
  NSStringFromUIEdgeInsets(_currentSafeAreaInsets)];
46
47
  }
48
+ #endif // TODO(macOS GH#774)
47
49
 
48
50
  - (BOOL)isSupportedByOS
49
51
  {
@@ -14,8 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
14
14
  @property (nonatomic, assign) CGFloat horizontalScrollerHeight;
15
15
  @property (nonatomic, assign) CGFloat verticalScrollerWidth;
16
16
 
17
- - (instancetype)initWithVerticalScroller:(nullable NSScroller *)verticalScroller
18
- horizontalScroller:(nullable NSScroller *)horizontalScroller;
17
+ - (instancetype)initWithVerticalScrollerWidth:(CGFloat)verticalScrollerWidth
18
+ horizontalScrollerHeight:(CGFloat)horizontalScrollerHeight;
19
19
 
20
20
  @end
21
21