react-native-macos 0.0.0-4b9ab10e1 → 0.0.0-4c3fb808f

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/Alert/Alert.js +115 -6
  2. package/Libraries/Alert/NativeAlertManager.js +1 -19
  3. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  4. package/Libraries/Components/ScrollView/ScrollView.js +11 -45
  5. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  6. package/Libraries/Components/TextInput/TextInput.js +79 -1
  7. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  8. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  9. package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
  10. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
  11. package/Libraries/Components/View/ViewAccessibility.js +0 -5
  12. package/Libraries/Components/View/ViewPropTypes.js +101 -117
  13. package/Libraries/Core/ReactNativeVersion.js +1 -1
  14. package/Libraries/Image/RCTImageView.mm +14 -10
  15. package/Libraries/Image/React-RCTImage.podspec +1 -1
  16. package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
  17. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  18. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
  19. package/Libraries/Lists/FlatList.js +25 -1
  20. package/Libraries/Lists/VirtualizedList.js +118 -113
  21. package/Libraries/Lists/VirtualizedSectionList.js +9 -5
  22. package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
  23. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  24. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  25. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  26. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  27. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  28. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  29. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  30. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  31. package/Libraries/StyleSheet/StyleSheetTypes.js +25 -0
  32. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
  33. package/Libraries/Text/RCTTextAttributes.h +11 -3
  34. package/Libraries/Text/RCTTextAttributes.m +31 -5
  35. package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
  36. package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
  37. package/Libraries/Text/Text/RCTTextView.m +123 -58
  38. package/Libraries/Text/Text.js +0 -14
  39. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
  40. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +57 -2
  41. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
  42. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
  43. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +69 -2
  44. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +7 -1
  45. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
  46. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +3 -2
  47. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +4 -1
  48. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +97 -2
  49. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +6 -1
  50. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -0
  51. package/Libraries/Text/TextNativeComponent.js +2 -0
  52. package/Libraries/Text/TextProps.js +29 -0
  53. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  54. package/Libraries/Types/CoreEventTypes.js +0 -1
  55. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  56. package/React/Base/RCTAssert.h +30 -15
  57. package/React/Base/RCTAssert.m +59 -19
  58. package/React/Base/RCTBridge.m +5 -3
  59. package/React/Base/RCTConstants.h +6 -0
  60. package/React/Base/RCTConstants.m +15 -0
  61. package/React/Base/RCTConvert.m +8 -4
  62. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  63. package/React/Base/RCTTouchHandler.m +4 -0
  64. package/React/Base/RCTUIKit.h +72 -13
  65. package/React/Base/RCTUtils.m +33 -3
  66. package/React/Base/RCTVersion.m +1 -1
  67. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  68. package/React/Base/macOS/RCTUIKit.m +89 -0
  69. package/React/CoreModules/RCTAlertManager.mm +1 -1
  70. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  71. package/React/CoreModules/RCTLogBox.h +1 -1
  72. package/React/CoreModules/RCTLogBox.mm +35 -19
  73. package/React/CoreModules/RCTLogBoxView.h +8 -5
  74. package/React/CoreModules/RCTLogBoxView.mm +64 -23
  75. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  76. package/React/CoreModules/React-CoreModules.podspec +1 -1
  77. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  78. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  79. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
  80. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  81. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  82. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  83. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  84. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
  85. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
  86. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  87. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  88. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  89. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  90. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
  91. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  92. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  93. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +10 -1
  94. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +5 -3
  95. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +23 -6
  96. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  97. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +17 -1
  98. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
  99. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +98 -34
  100. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  101. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +19 -5
  102. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  103. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
  104. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
  105. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
  106. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
  107. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
  108. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  109. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
  110. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  111. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
  112. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
  113. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
  114. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  115. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
  116. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  117. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
  118. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  119. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +31 -23
  120. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  121. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  122. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  123. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
  124. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
  125. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  126. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  127. package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
  128. package/React/Fabric/Mounting/RCTMountingManager.mm +28 -19
  129. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  130. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
  131. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
  132. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
  133. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
  134. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
  135. package/React/Fabric/RCTConversions.h +15 -7
  136. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  137. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  138. package/React/Fabric/RCTLocalizationProvider.mm +10 -4
  139. package/React/Fabric/RCTScheduler.h +8 -1
  140. package/React/Fabric/RCTScheduler.mm +15 -0
  141. package/React/Fabric/RCTSurfacePresenter.h +10 -2
  142. package/React/Fabric/RCTSurfacePresenter.mm +59 -27
  143. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  144. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  145. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  146. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
  147. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  148. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  149. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  150. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  151. package/React/Modules/RCTUIManager.m +4 -2
  152. package/React/React-RCTFabric.podspec +2 -2
  153. package/React/Views/RCTActivityIndicatorView.m +2 -1
  154. package/React/Views/RCTCursor.h +39 -0
  155. package/React/Views/RCTCursor.m +105 -0
  156. package/React/Views/RCTMaskedView.h +1 -1
  157. package/React/Views/RCTModalHostView.h +2 -2
  158. package/React/Views/RCTModalHostViewController.h +1 -1
  159. package/React/Views/RCTModalManager.h +1 -1
  160. package/React/Views/RCTSwitch.h +1 -10
  161. package/React/Views/RCTSwitch.m +0 -20
  162. package/React/Views/RCTSwitchManager.m +0 -4
  163. package/React/Views/RCTView.h +12 -0
  164. package/React/Views/RCTView.m +122 -33
  165. package/React/Views/RCTViewKeyboardEvent.m +9 -1
  166. package/React/Views/RCTViewManager.m +19 -13
  167. package/React/Views/RCTWeakViewHolder.h +1 -1
  168. package/React/Views/RCTWrapperViewController.h +2 -2
  169. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  170. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  171. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  172. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  173. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  174. package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
  175. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  176. package/React/Views/ScrollView/RCTScrollView.h +2 -1
  177. package/React/Views/ScrollView/RCTScrollView.m +66 -89
  178. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
  179. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  180. package/React/Views/UIView+React.h +2 -0
  181. package/React/Views/UIView+React.m +22 -13
  182. package/ReactAndroid/gradle.properties +1 -1
  183. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  184. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  185. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  186. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  187. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  188. package/ReactCommon/React-Fabric.podspec +1 -1
  189. package/ReactCommon/React-rncore.podspec +1 -1
  190. package/ReactCommon/ReactCommon.podspec +1 -1
  191. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  192. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  193. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  194. package/ReactCommon/microprofiler/BUCK +1 -1
  195. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  196. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  197. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  198. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  199. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  200. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  201. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  202. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  203. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  204. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  205. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
  206. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  207. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  208. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  209. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  210. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  211. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  212. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  213. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  214. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  215. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  216. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  217. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  218. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  219. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  220. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  221. package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
  222. package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
  223. package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
  224. package/ReactCommon/react/renderer/core/EventListener.h +44 -0
  225. package/ReactCommon/react/renderer/core/Props.h +0 -4
  226. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  227. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  228. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  229. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  230. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  231. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  232. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  233. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  234. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  235. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  236. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  237. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  238. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  239. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  240. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  241. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  242. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  243. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  244. package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
  245. package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
  246. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
  247. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
  248. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  249. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
  250. package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
  251. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  252. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  253. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
  254. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  255. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  256. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  257. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm +5 -0
  258. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  259. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  260. package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
  261. package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
  262. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  263. package/ReactCommon/yoga/Yoga.podspec +1 -1
  264. package/index.js +0 -11
  265. package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
  266. package/package.json +4 -1
  267. package/scripts/generate-artifacts.js +21 -17
  268. package/scripts/react_native_pods.rb +1 -4
  269. package/template/Gemfile.lock +8 -8
  270. package/template/android/gradlew.bat +89 -89
  271. package/template/package.json +1 -1
  272. package/Libraries/Alert/AlertMacOS.js +0 -211
  273. package/ReactCommon/butter/optional.h +0 -38
  274. package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
  275. package/third-party-podspecs/boost-for-react-native.podspec +0 -20
@@ -156,7 +156,8 @@ RCT_EXPORT_MODULE()
156
156
 
157
157
  - (void)setBridge:(RCTBridge *)bridge
158
158
  {
159
- RCTEnforceNotAllowedForNewArchitecture(self, @"RCTUIManager must not be initialized for the new architecture");
159
+ RCTEnforceNewArchitectureValidation(
160
+ RCTNotAllowedInBridgeless, self, @"RCTUIManager must not be initialized for the new architecture");
160
161
 
161
162
  RCTAssert(_bridge == nil, @"Should not re-use same UIManager instance");
162
163
  _bridge = bridge;
@@ -332,12 +333,13 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
332
333
  _viewRegistry[reactTag] = rootView;
333
334
 
334
335
  // Register shadow view
336
+ RCTRootShadowView *shadowView = [RCTRootShadowView new]; // TODO(macOS GH#774) - do this early to prevent RCTI18nUtil deadlock
337
+
335
338
  RCTExecuteOnUIManagerQueue(^{
336
339
  if (!self->_viewRegistry) {
337
340
  return;
338
341
  }
339
342
 
340
- RCTRootShadowView *shadowView = [RCTRootShadowView new];
341
343
  shadowView.availableSize = availableSize;
342
344
  shadowView.reactTag = reactTag;
343
345
  shadowView.viewName = NSStringFromClass([rootView class]);
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
28
28
  s.homepage = "https://reactnative.dev/"
29
29
  s.license = package["license"]
30
30
  s.author = "Facebook, Inc. and its affiliates"
31
- s.platforms = { :ios => "11.0" }
31
+ s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#774)
32
32
  s.source = source
33
33
  s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}"
34
34
  s.exclude_files = "**/tests/*",
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.header_dir = "React"
38
38
  s.framework = "JavaScriptCore"
39
39
  s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
40
- s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
40
+ s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
41
41
  "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
42
42
 
43
43
  s.dependency "React-Core", version
@@ -8,7 +8,8 @@
8
8
  #import "RCTActivityIndicatorView.h"
9
9
 
10
10
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
11
- #import <QuartzCore/QuartzCore.h>
11
+ #import <CoreImage/CIFilter.h>
12
+ #import <CoreImage/CIVector.h>
12
13
 
13
14
  @interface RCTActivityIndicatorView ()
14
15
  @property (nonatomic, readwrite, getter=isAnimating) BOOL animating;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <React/RCTConvert.h>
9
+
10
+ typedef NS_ENUM(NSInteger, RCTCursor) {
11
+ RCTCursorAuto,
12
+ RCTCursorArrow,
13
+ RCTCursorIBeam,
14
+ RCTCursorCrosshair,
15
+ RCTCursorClosedHand,
16
+ RCTCursorOpenHand,
17
+ RCTCursorPointingHand,
18
+ RCTCursorResizeLeft,
19
+ RCTCursorResizeRight,
20
+ RCTCursorResizeLeftRight,
21
+ RCTCursorResizeUp,
22
+ RCTCursorResizeDown,
23
+ RCTCursorResizeUpDown,
24
+ RCTCursorDisappearingItem,
25
+ RCTCursorIBeamCursorForVerticalLayout,
26
+ RCTCursorOperationNotAllowed,
27
+ RCTCursorDragLink,
28
+ RCTCursorDragCopy,
29
+ RCTCursorContextualMenu,
30
+ };
31
+
32
+ @interface RCTConvert (RCTCursor)
33
+
34
+ + (RCTCursor)RCTCursor:(id)json;
35
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
36
+ + (NSCursor *)NSCursor:(RCTCursor)rctCursor;
37
+ #endif // ]TODO(macOS GH#774)
38
+
39
+ @end
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <React/RCTCursor.h>
9
+
10
+ @implementation RCTConvert (RCTCursor)
11
+
12
+ RCT_ENUM_CONVERTER(
13
+ RCTCursor,
14
+ (@{
15
+ @"alias" : @(RCTCursorDragLink),
16
+ @"auto" : @(RCTCursorAuto),
17
+ @"col-resize" : @(RCTCursorResizeLeftRight),
18
+ @"context-menu" : @(RCTCursorContextualMenu),
19
+ @"copy" : @(RCTCursorDragCopy),
20
+ @"crosshair" : @(RCTCursorCrosshair),
21
+ @"default" : @(RCTCursorArrow),
22
+ @"disappearing-item" : @(RCTCursorDisappearingItem),
23
+ @"e-resize" : @(RCTCursorResizeRight),
24
+ @"grab" : @(RCTCursorOpenHand),
25
+ @"grabbing" : @(RCTCursorClosedHand),
26
+ @"n-resize" : @(RCTCursorResizeUp),
27
+ @"no-drop" : @(RCTCursorOperationNotAllowed),
28
+ @"not-allowed" : @(RCTCursorOperationNotAllowed),
29
+ @"pointer" : @(RCTCursorPointingHand),
30
+ @"row-resize" : @(RCTCursorResizeUpDown),
31
+ @"s-resize" : @(RCTCursorResizeDown),
32
+ @"text" : @(RCTCursorIBeam),
33
+ @"vertical-text" : @(RCTCursorIBeamCursorForVerticalLayout),
34
+ @"w-resize" : @(RCTCursorResizeLeft),
35
+ }),
36
+ RCTCursorAuto,
37
+ integerValue)
38
+
39
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
40
+ + (NSCursor *)NSCursor:(RCTCursor)rctCursor
41
+ {
42
+ NSCursor *cursor;
43
+
44
+ switch (rctCursor) {
45
+ case RCTCursorArrow:
46
+ cursor = [NSCursor arrowCursor];
47
+ break;
48
+ case RCTCursorClosedHand:
49
+ cursor = [NSCursor closedHandCursor];
50
+ break;
51
+ case RCTCursorContextualMenu:
52
+ cursor = [NSCursor contextualMenuCursor];
53
+ break;
54
+ case RCTCursorCrosshair:
55
+ cursor = [NSCursor crosshairCursor];
56
+ break;
57
+ case RCTCursorDisappearingItem:
58
+ cursor = [NSCursor disappearingItemCursor];
59
+ break;
60
+ case RCTCursorDragCopy:
61
+ cursor = [NSCursor dragCopyCursor];
62
+ break;
63
+ case RCTCursorDragLink:
64
+ cursor = [NSCursor dragLinkCursor];
65
+ break;
66
+ case RCTCursorIBeam:
67
+ cursor = [NSCursor IBeamCursor];
68
+ break;
69
+ case RCTCursorIBeamCursorForVerticalLayout:
70
+ cursor = [NSCursor IBeamCursorForVerticalLayout];
71
+ break;
72
+ case RCTCursorOpenHand:
73
+ cursor = [NSCursor openHandCursor];
74
+ break;
75
+ case RCTCursorOperationNotAllowed:
76
+ cursor = [NSCursor operationNotAllowedCursor];
77
+ break;
78
+ case RCTCursorPointingHand:
79
+ cursor = [NSCursor pointingHandCursor];
80
+ break;
81
+ case RCTCursorResizeDown:
82
+ cursor = [NSCursor resizeDownCursor];
83
+ break;
84
+ case RCTCursorResizeLeft:
85
+ cursor = [NSCursor resizeLeftCursor];
86
+ break;
87
+ case RCTCursorResizeLeftRight:
88
+ cursor = [NSCursor resizeLeftRightCursor];
89
+ break;
90
+ case RCTCursorResizeRight:
91
+ cursor = [NSCursor resizeRightCursor];
92
+ break;
93
+ case RCTCursorResizeUp:
94
+ cursor = [NSCursor resizeUpCursor];
95
+ break;
96
+ case RCTCursorResizeUpDown:
97
+ cursor = [NSCursor resizeUpDownCursor];
98
+ break;
99
+ }
100
+
101
+ return cursor;
102
+ }
103
+ #endif // ]TODO(macOS GH#774)
104
+
105
+ @end
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTView.h>
11
11
 
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTInvalidating.h>
11
11
  #import <React/RCTModalHostViewManager.h>
@@ -16,7 +16,7 @@
16
16
 
17
17
  @protocol RCTModalHostViewInteractor;
18
18
 
19
- @interface RCTModalHostView : UIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate>
19
+ @interface RCTModalHostView : RCTUIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate> // TODO(macOS GH#774)
20
20
 
21
21
  @property (nonatomic, copy) NSString *animationType;
22
22
  @property (nonatomic, assign) UIModalPresentationStyle presentationStyle;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  @interface RCTModalHostViewController : UIViewController
11
11
 
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
8
+ #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTBridgeModule.h>
11
11
  #import <React/RCTEventEmitter.h>
@@ -9,18 +9,9 @@
9
9
 
10
10
  #import <React/RCTComponent.h>
11
11
 
12
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
- @interface RCTSwitch : UISwitch
14
- #else // [TODO(macOS GH#774)
15
- @interface RCTSwitch : NSSwitch
16
- #endif // ]TODO(macOS GH#774)
12
+ @interface RCTSwitch : RCTUISwitch
17
13
 
18
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
19
14
  @property (nonatomic, assign) BOOL wasOn;
20
- #else // [TODO(macOS GH#774)
21
- @property (nonatomic, assign) BOOL on;
22
- - (void)setOn:(BOOL)on animated:(BOOL)animated;
23
- #endif // ]TODO(macOS GH#774)
24
15
  @property (nonatomic, copy) RCTBubblingEventBlock onChange;
25
16
 
26
17
  @end
@@ -11,30 +11,10 @@
11
11
 
12
12
  @implementation RCTSwitch
13
13
 
14
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
15
14
  - (void)setOn:(BOOL)on animated:(BOOL)animated
16
15
  {
17
16
  _wasOn = on;
18
17
  [super setOn:on animated:animated];
19
18
  }
20
- #else // [TODO(macOS GH#774)
21
- - (void)setOn:(BOOL)on animated:(BOOL)animated {
22
- self.state = on ? NSControlStateValueOn : NSControlStateValueOff;
23
- }
24
- #endif // ]TODO(macOS GH#774)
25
-
26
- #if TARGET_OS_OSX
27
-
28
- - (BOOL)on
29
- {
30
- return self.state == NSControlStateValueOn;
31
- }
32
-
33
- - (void)setOn:(BOOL)on
34
- {
35
- self.state = on ? NSControlStateValueOn : NSControlStateValueOff;
36
- }
37
-
38
- #endif // ]TODO(macOS GH#774)
39
19
 
40
20
  @end
@@ -30,16 +30,12 @@ RCT_EXPORT_MODULE()
30
30
 
31
31
  - (void)onChange:(RCTSwitch *)sender
32
32
  {
33
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
34
33
  if (sender.wasOn != sender.on) {
35
34
  if (sender.onChange) {
36
35
  sender.onChange(@{@"value" : @(sender.on)});
37
36
  }
38
37
  sender.wasOn = sender.on;
39
38
  }
40
- #else // [TODO(macOS GH#774)
41
- sender.onChange(@{ @"value": @(sender.on) });
42
- #endif // ]TODO(macOS GH#774)
43
39
  }
44
40
 
45
41
  RCT_EXPORT_METHOD(setValue : (nonnull NSNumber *)viewTag toValue : (BOOL)value)
@@ -12,6 +12,10 @@
12
12
  #import <React/RCTEventDispatcherProtocol.h> // TODO(OSS Candidate ISS#2710739)
13
13
  #import <React/RCTPointerEvents.h>
14
14
 
15
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
16
+ #import <React/RCTCursor.h>
17
+ #endif // TODO(macOS GH#774)
18
+
15
19
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
16
20
  extern const UIAccessibilityTraits SwitchAccessibilityTrait;
17
21
  #endif // TODO(macOS GH#774)
@@ -27,6 +31,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
27
31
  - (BOOL)resignFirstResponder;
28
32
 
29
33
  #if TARGET_OS_OSX
34
+ - (NSDictionary*)dataTransferInfoFromPasteboard:(NSPasteboard*)pasteboard;
30
35
  - (BOOL)handleKeyboardEvent:(NSEvent *)event;
31
36
  #endif
32
37
  // ]TODO(OSS Candidate ISS#2710739)
@@ -123,6 +128,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
123
128
  /**
124
129
  * macOS Properties
125
130
  */
131
+ @property (nonatomic, assign) RCTCursor cursor;
126
132
 
127
133
  @property (nonatomic, assign) CATransform3D transform3D;
128
134
 
@@ -139,6 +145,12 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
139
145
  @property (nonatomic, copy) RCTDirectEventBlock onKeyUp;
140
146
  @property (nonatomic, copy) NSArray<NSString*> *validKeysDown;
141
147
  @property (nonatomic, copy) NSArray<NSString*> *validKeysUp;
148
+
149
+ // Shadow Properties
150
+ @property (nonatomic, strong) NSColor *shadowColor;
151
+ @property (nonatomic, assign) CGFloat shadowOpacity;
152
+ @property (nonatomic, assign) CGFloat shadowRadius;
153
+ @property (nonatomic, assign) CGSize shadowOffset;
142
154
  #endif // ]TODO(macOS GH#774)
143
155
 
144
156
  /**
@@ -7,7 +7,7 @@
7
7
 
8
8
  #import "RCTView.h"
9
9
 
10
- #import <QuartzCore/QuartzCore.h> // TODO(macOS GH#774) - import needed on macOS to prevent compiler error on invocation of CAShapeLayer further down
10
+ #import <QuartzCore/QuartzCore.h>
11
11
 
12
12
  #import "RCTAutoInsetsProtocol.h"
13
13
  #import "RCTBorderDrawing.h"
@@ -165,6 +165,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
165
165
  _hitTestEdgeInsets = UIEdgeInsetsZero;
166
166
  #if TARGET_OS_OSX // TODO(macOS GH#774)
167
167
  _transform3D = CATransform3DIdentity;
168
+ _shadowColor = nil;
168
169
  #endif // TODO(macOS GH#774)
169
170
 
170
171
  _backgroundColor = super.backgroundColor;
@@ -716,6 +717,51 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
716
717
  #endif // TODO(macOS GH#774)
717
718
 
718
719
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
720
+ - (void)setShadowColor:(NSColor *)shadowColor
721
+ {
722
+ if (_shadowColor != shadowColor)
723
+ {
724
+ _shadowColor = shadowColor;
725
+ [self didUpdateShadow];
726
+ }
727
+ }
728
+
729
+ - (void)setShadowOffset:(CGSize)shadowOffset
730
+ {
731
+ if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
732
+ {
733
+ _shadowOffset = shadowOffset;
734
+ [self didUpdateShadow];
735
+ }
736
+ }
737
+
738
+ - (void)setShadowOpacity:(CGFloat)shadowOpacity
739
+ {
740
+ if (_shadowOpacity != shadowOpacity)
741
+ {
742
+ _shadowOpacity = shadowOpacity;
743
+ [self didUpdateShadow];
744
+ }
745
+ }
746
+
747
+ - (void)setShadowRadius:(CGFloat)shadowRadius
748
+ {
749
+ if (_shadowRadius != shadowRadius)
750
+ {
751
+ _shadowRadius = shadowRadius;
752
+ [self didUpdateShadow];
753
+ }
754
+ }
755
+
756
+ -(void)didUpdateShadow
757
+ {
758
+ NSShadow *shadow = [NSShadow new];
759
+ shadow.shadowColor = [[self shadowColor] colorWithAlphaComponent:[self shadowOpacity]];
760
+ shadow.shadowOffset = [self shadowOffset];
761
+ shadow.shadowBlurRadius = [self shadowRadius];
762
+ [self setShadow:shadow];
763
+ }
764
+
719
765
  - (void)viewDidMoveToWindow
720
766
  {
721
767
  // Subscribe to view bounds changed notification so that the view can be notified when a
@@ -733,6 +779,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
733
779
  name:NSViewBoundsDidChangeNotification
734
780
  object:[[self enclosingScrollView] contentView]];
735
781
  }
782
+
783
+ [self reactViewDidMoveToWindow]; // TODO(macOS GH#1412)
784
+
736
785
  [super viewDidMoveToWindow];
737
786
  }
738
787
 
@@ -742,16 +791,16 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
742
791
  // the mouseExited: event does not get called on the view where mouseEntered: was previously called.
743
792
  // This creates an unnatural pairing of mouse enter and exit events and can cause problems.
744
793
  // We therefore explicitly check for this here and handle them by calling the appropriate callbacks.
745
-
794
+
746
795
  if (!_hasMouseOver && self.onMouseEnter)
747
796
  {
748
797
  NSPoint locationInWindow = [[self window] mouseLocationOutsideOfEventStream];
749
798
  NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
750
-
799
+
751
800
  if (NSPointInRect(locationInView, [self bounds]))
752
801
  {
753
802
  _hasMouseOver = YES;
754
-
803
+
755
804
  [self sendMouseEventWithBlock:self.onMouseEnter
756
805
  locationInfo:[self locationInfoFromDraggingLocation:locationInWindow]
757
806
  modifierFlags:0
@@ -762,11 +811,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
762
811
  {
763
812
  NSPoint locationInWindow = [[self window] mouseLocationOutsideOfEventStream];
764
813
  NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
765
-
814
+
766
815
  if (!NSPointInRect(locationInView, [self bounds]))
767
816
  {
768
817
  _hasMouseOver = NO;
769
-
818
+
770
819
  [self sendMouseEventWithBlock:self.onMouseLeave
771
820
  locationInfo:[self locationInfoFromDraggingLocation:locationInWindow]
772
821
  modifierFlags:0
@@ -1365,6 +1414,15 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1365
1414
  #pragma mark - macOS Event Handler
1366
1415
 
1367
1416
  #if TARGET_OS_OSX
1417
+ - (void)resetCursorRects
1418
+ {
1419
+ [self discardCursorRects];
1420
+ NSCursor *cursor = [RCTConvert NSCursor:self.cursor];
1421
+ if (cursor) {
1422
+ [self addCursorRect:self.bounds cursor:cursor];
1423
+ }
1424
+ }
1425
+
1368
1426
  - (void)setOnDoubleClick:(RCTDirectEventBlock)block
1369
1427
  {
1370
1428
  if (_onDoubleClick != block) {
@@ -1382,9 +1440,14 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1382
1440
  }
1383
1441
  }
1384
1442
 
1443
+ - (BOOL)needsPanelToBecomeKey {
1444
+ // We need to override this so that mouse clicks don't move keyboard focus on focusable views by default.
1445
+ return false;
1446
+ }
1447
+
1385
1448
  - (BOOL)acceptsFirstResponder
1386
1449
  {
1387
- return ([self focusable] && [NSApp isFullKeyboardAccessEnabled]) || [super acceptsFirstResponder];
1450
+ return [self focusable] || [super acceptsFirstResponder];
1388
1451
  }
1389
1452
 
1390
1453
  - (void)updateTrackingAreas
@@ -1392,7 +1455,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1392
1455
  if (_trackingArea) {
1393
1456
  [self removeTrackingArea:_trackingArea];
1394
1457
  }
1395
-
1458
+
1396
1459
  if (self.onMouseEnter || self.onMouseLeave) {
1397
1460
  _trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds
1398
1461
  options:NSTrackingActiveAlways|NSTrackingMouseEnteredAndExited
@@ -1400,7 +1463,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1400
1463
  userInfo:nil];
1401
1464
  [self addTrackingArea:_trackingArea];
1402
1465
  }
1403
-
1466
+
1404
1467
  [super updateTrackingAreas];
1405
1468
  }
1406
1469
 
@@ -1426,7 +1489,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1426
1489
  {
1427
1490
  NSPoint locationInWindow = event.locationInWindow;
1428
1491
  NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
1429
-
1492
+
1430
1493
  return @{@"screenX": @(locationInWindow.x),
1431
1494
  @"screenY": @(locationInWindow.y),
1432
1495
  @"clientX": @(locationInView.x),
@@ -1457,25 +1520,21 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1457
1520
  if (modifierFlags & NSEventModifierFlagCommand) {
1458
1521
  body[@"metaKey"] = @YES;
1459
1522
  }
1460
-
1523
+
1461
1524
  if (locationInfo) {
1462
1525
  [body addEntriesFromDictionary:locationInfo];
1463
1526
  }
1464
-
1527
+
1465
1528
  if (additionalData) {
1466
1529
  [body addEntriesFromDictionary:additionalData];
1467
1530
  }
1468
-
1531
+
1469
1532
  block(body);
1470
1533
  }
1471
1534
 
1472
- - (NSDictionary*)dataTransferInfoFromPastboard:(NSPasteboard*)pastboard
1535
+ - (NSDictionary*)dataTransferInfoFromPasteboard:(NSPasteboard*)pasteboard
1473
1536
  {
1474
- if (![pastboard.types containsObject:NSFilenamesPboardType]) {
1475
- return @{};
1476
- }
1477
-
1478
- NSArray *fileNames = [pastboard propertyListForType:NSFilenamesPboardType];
1537
+ NSArray *fileNames = [pasteboard propertyListForType:NSFilenamesPboardType] ?: @[];
1479
1538
  NSMutableArray *files = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
1480
1539
  NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
1481
1540
  NSMutableArray *types = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
@@ -1495,27 +1554,57 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1495
1554
  MIMETypeString = (__bridge_transfer NSString *)MIMEType;
1496
1555
  }
1497
1556
  }
1498
-
1557
+
1499
1558
  NSNumber *fileSizeValue = nil;
1500
1559
  NSError *fileSizeError = nil;
1501
1560
  BOOL success = [fileURL getResourceValue:&fileSizeValue
1502
1561
  forKey:NSURLFileSizeKey
1503
1562
  error:&fileSizeError];
1504
-
1563
+
1564
+ NSNumber *width = nil;
1565
+ NSNumber *height = nil;
1566
+ if ([MIMETypeString hasPrefix:@"image/"]) {
1567
+ NSImage *image = [[NSImage alloc] initWithContentsOfURL:fileURL];
1568
+ width = @(image.size.width);
1569
+ height = @(image.size.height);
1570
+ }
1571
+
1505
1572
  [files addObject:@{@"name": RCTNullIfNil(fileURL.lastPathComponent),
1506
1573
  @"type": RCTNullIfNil(MIMETypeString),
1507
- @"uri": RCTNullIfNil(fileURL.absoluteString),
1508
- @"size": success ? fileSizeValue : (id)kCFNull
1574
+ @"uri": RCTNullIfNil(fileURL.path),
1575
+ @"size": success ? fileSizeValue : (id)kCFNull,
1576
+ @"width": RCTNullIfNil(width),
1577
+ @"height": RCTNullIfNil(height)
1509
1578
  }];
1510
-
1579
+
1511
1580
  [items addObject:@{@"kind": @"file",
1512
1581
  @"type": RCTNullIfNil(MIMETypeString),
1513
1582
  }];
1514
-
1583
+
1515
1584
  [types addObject:RCTNullIfNil(MIMETypeString)];
1516
1585
  }
1517
1586
  }
1518
-
1587
+
1588
+ NSPasteboardType imageType = [pasteboard availableTypeFromArray:@[NSPasteboardTypePNG, NSPasteboardTypeTIFF]];
1589
+ if (imageType && fileNames.count == 0) {
1590
+ NSString *MIMETypeString = imageType == NSPasteboardTypePNG ? @"image/png" : @"image/tiff";
1591
+ NSData *imageData = [pasteboard dataForType:imageType];
1592
+ NSImage *image = [[NSImage alloc] initWithData:imageData];
1593
+
1594
+ [files addObject:@{@"type": RCTNullIfNil(MIMETypeString),
1595
+ @"uri": RCTDataURL(MIMETypeString, imageData).absoluteString,
1596
+ @"size": @(imageData.length),
1597
+ @"width": @(image.size.width),
1598
+ @"height": @(image.size.height),
1599
+ }];
1600
+
1601
+ [items addObject:@{@"kind": @"image",
1602
+ @"type": RCTNullIfNil(MIMETypeString),
1603
+ }];
1604
+
1605
+ [types addObject:RCTNullIfNil(MIMETypeString)];
1606
+ }
1607
+
1519
1608
  return @{@"dataTransfer": @{@"files": files,
1520
1609
  @"items": items,
1521
1610
  @"types": types}};
@@ -1524,7 +1613,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1524
1613
  - (NSDictionary*)locationInfoFromDraggingLocation:(NSPoint)locationInWindow
1525
1614
  {
1526
1615
  NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
1527
-
1616
+
1528
1617
  return @{@"screenX": @(locationInWindow.x),
1529
1618
  @"screenY": @(locationInWindow.y),
1530
1619
  @"clientX": @(locationInView.x),
@@ -1536,13 +1625,13 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1536
1625
  {
1537
1626
  NSPasteboard *pboard = sender.draggingPasteboard;
1538
1627
  NSDragOperation sourceDragMask = sender.draggingSourceOperationMask;
1539
-
1628
+
1540
1629
  [self sendMouseEventWithBlock:self.onDragEnter
1541
1630
  locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
1542
1631
  modifierFlags:0
1543
- additionalData:[self dataTransferInfoFromPastboard:pboard]];
1544
-
1545
- if ([pboard.types containsObject:NSFilenamesPboardType]) {
1632
+ additionalData:[self dataTransferInfoFromPasteboard:pboard]];
1633
+
1634
+ if ([pboard availableTypeFromArray:self.registeredDraggedTypes]) {
1546
1635
  if (sourceDragMask & NSDragOperationLink) {
1547
1636
  return NSDragOperationLink;
1548
1637
  } else if (sourceDragMask & NSDragOperationCopy) {
@@ -1557,7 +1646,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1557
1646
  [self sendMouseEventWithBlock:self.onDragLeave
1558
1647
  locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
1559
1648
  modifierFlags:0
1560
- additionalData:[self dataTransferInfoFromPastboard:sender.draggingPasteboard]];
1649
+ additionalData:[self dataTransferInfoFromPasteboard:sender.draggingPasteboard]];
1561
1650
  }
1562
1651
 
1563
1652
  - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
@@ -1565,7 +1654,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
1565
1654
  [self sendMouseEventWithBlock:self.onDrop
1566
1655
  locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
1567
1656
  modifierFlags:0
1568
- additionalData:[self dataTransferInfoFromPastboard:[sender draggingPasteboard]]];
1657
+ additionalData:[self dataTransferInfoFromPasteboard:sender.draggingPasteboard]];
1569
1658
  return YES;
1570
1659
  }
1571
1660
  #endif // ]TODO(macOS GH#774)
@@ -52,7 +52,15 @@
52
52
  return @"Backspace";
53
53
  } else if (code == NSDeleteFunctionKey) {
54
54
  return @"Delete";
55
- }
55
+ } else if (code == NSHomeFunctionKey) {
56
+ return @"Home";
57
+ } else if (code == NSEndFunctionKey) {
58
+ return @"End";
59
+ } else if (code == NSPageUpFunctionKey) {
60
+ return @"PageUp";
61
+ } else if (code == NSPageDownFunctionKey) {
62
+ return @"PageDown";
63
+ }
56
64
 
57
65
  return key;
58
66
  }