react-native-macos 0.0.0-a598ee4ef → 0.0.0-a7b72a012

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 (263) 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/ReactNativeViewAttributes.js +1 -0
  8. package/Libraries/Components/View/ViewPropTypes.js +10 -6
  9. package/Libraries/Core/ReactNativeVersion.js +1 -1
  10. package/Libraries/Image/RCTImageView.mm +14 -10
  11. package/Libraries/Image/React-RCTImage.podspec +1 -1
  12. package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
  13. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  14. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
  15. package/Libraries/Lists/FlatList.js +25 -2
  16. package/Libraries/Lists/VirtualizedList.js +118 -113
  17. package/Libraries/Lists/VirtualizedSectionList.js +9 -5
  18. package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
  19. package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
  20. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
  21. package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
  22. package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
  23. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
  24. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  25. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  26. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  27. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
  28. package/Libraries/Text/RCTTextAttributes.h +11 -3
  29. package/Libraries/Text/RCTTextAttributes.m +26 -0
  30. package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
  31. package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
  32. package/Libraries/Text/Text/RCTTextView.m +123 -58
  33. package/Libraries/Text/Text.js +0 -14
  34. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
  35. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +57 -2
  36. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
  37. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
  38. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +69 -2
  39. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +7 -1
  40. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
  41. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +3 -2
  42. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +4 -1
  43. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +97 -2
  44. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +6 -1
  45. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -0
  46. package/Libraries/Text/TextNativeComponent.js +2 -0
  47. package/Libraries/Text/TextProps.js +29 -0
  48. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  49. package/Libraries/Types/CoreEventTypes.js +0 -1
  50. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  51. package/React/Base/RCTAssert.h +30 -15
  52. package/React/Base/RCTAssert.m +59 -19
  53. package/React/Base/RCTBridge.m +5 -3
  54. package/React/Base/RCTConstants.h +6 -0
  55. package/React/Base/RCTConstants.m +15 -0
  56. package/React/Base/RCTConvert.m +7 -4
  57. package/React/Base/RCTEventDispatcherProtocol.h +5 -0
  58. package/React/Base/RCTTouchHandler.m +4 -0
  59. package/React/Base/RCTUIKit.h +57 -13
  60. package/React/Base/RCTUtils.m +6 -3
  61. package/React/Base/RCTVersion.m +1 -1
  62. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
  63. package/React/Base/macOS/RCTUIKit.m +52 -0
  64. package/React/CoreModules/RCTAlertManager.mm +1 -1
  65. package/React/CoreModules/RCTEventDispatcher.mm +6 -1
  66. package/React/CoreModules/RCTLogBox.h +1 -1
  67. package/React/CoreModules/RCTLogBox.mm +35 -19
  68. package/React/CoreModules/RCTLogBoxView.h +8 -5
  69. package/React/CoreModules/RCTLogBoxView.mm +64 -23
  70. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  71. package/React/CoreModules/React-CoreModules.podspec +1 -1
  72. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
  73. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
  74. package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
  75. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
  76. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
  77. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
  78. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
  79. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
  80. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
  81. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
  82. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
  83. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
  84. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
  85. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
  86. package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
  87. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
  88. package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
  89. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +3 -3
  90. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +4 -4
  91. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
  92. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
  93. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -4
  94. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +56 -30
  95. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
  96. package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +5 -5
  97. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
  98. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
  99. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
  100. package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
  101. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
  102. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
  103. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
  104. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
  105. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
  106. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
  107. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
  108. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
  109. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
  110. package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
  111. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
  112. package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
  113. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
  114. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +31 -23
  115. package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
  116. package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
  117. package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
  118. package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
  119. package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
  120. package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
  121. package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
  122. package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
  123. package/React/Fabric/Mounting/RCTMountingManager.mm +28 -19
  124. package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
  125. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
  126. package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
  127. package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
  128. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
  129. package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
  130. package/React/Fabric/RCTConversions.h +15 -7
  131. package/React/Fabric/RCTImageResponseDelegate.h +1 -1
  132. package/React/Fabric/RCTLocalizationProvider.h +1 -1
  133. package/React/Fabric/RCTLocalizationProvider.mm +10 -4
  134. package/React/Fabric/RCTScheduler.h +8 -1
  135. package/React/Fabric/RCTScheduler.mm +15 -0
  136. package/React/Fabric/RCTSurfacePresenter.h +10 -2
  137. package/React/Fabric/RCTSurfacePresenter.mm +59 -27
  138. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
  139. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  140. package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
  141. package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
  142. package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
  143. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  144. package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
  145. package/React/Modules/RCTSurfacePresenterStub.h +4 -0
  146. package/React/Modules/RCTUIManager.m +4 -2
  147. package/React/React-RCTFabric.podspec +2 -2
  148. package/React/Views/RCTActivityIndicatorView.m +2 -1
  149. package/React/Views/RCTMaskedView.h +1 -1
  150. package/React/Views/RCTModalHostView.h +2 -2
  151. package/React/Views/RCTModalHostViewController.h +1 -1
  152. package/React/Views/RCTModalManager.h +1 -1
  153. package/React/Views/RCTView.h +1 -0
  154. package/React/Views/RCTView.m +51 -17
  155. package/React/Views/RCTViewKeyboardEvent.m +9 -1
  156. package/React/Views/RCTViewManager.m +5 -14
  157. package/React/Views/RCTWeakViewHolder.h +1 -1
  158. package/React/Views/RCTWrapperViewController.h +2 -2
  159. package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
  160. package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
  161. package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
  162. package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
  163. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  164. package/React/Views/ScrollView/RCTScrollContentView.m +6 -0
  165. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  166. package/React/Views/ScrollView/RCTScrollView.h +2 -1
  167. package/React/Views/ScrollView/RCTScrollView.m +65 -93
  168. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
  169. package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
  170. package/React/Views/UIView+React.h +2 -0
  171. package/React/Views/UIView+React.m +22 -13
  172. package/ReactAndroid/gradle.properties +1 -1
  173. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
  174. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  175. package/ReactAndroid/src/main/jni/Application.mk +1 -1
  176. package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
  177. package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
  178. package/ReactCommon/React-Fabric.podspec +1 -1
  179. package/ReactCommon/React-rncore.podspec +1 -1
  180. package/ReactCommon/ReactCommon.podspec +1 -1
  181. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  182. package/ReactCommon/cxxreact/tests/BUCK +1 -1
  183. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  184. package/ReactCommon/microprofiler/BUCK +1 -1
  185. package/ReactCommon/react/debug/react_native_assert.h +1 -1
  186. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
  187. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
  188. package/ReactCommon/react/renderer/animations/conversions.h +11 -11
  189. package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
  190. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
  191. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
  192. package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
  193. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
  194. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
  195. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
  196. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
  197. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
  198. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
  199. package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
  200. package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
  201. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
  202. package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
  203. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
  204. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
  205. package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
  206. package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
  207. package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
  208. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
  209. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
  210. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
  211. package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
  212. package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
  213. package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
  214. package/ReactCommon/react/renderer/core/EventListener.h +44 -0
  215. package/ReactCommon/react/renderer/core/Props.h +0 -4
  216. package/ReactCommon/react/renderer/core/RawProps.h +1 -1
  217. package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
  218. package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
  219. package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
  220. package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
  221. package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
  222. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  223. package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
  224. package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
  225. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
  226. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
  227. package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
  228. package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
  229. package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
  230. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  231. package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
  232. package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
  233. package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
  234. package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
  235. package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
  236. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
  237. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
  238. package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
  239. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
  240. package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
  241. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
  242. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
  243. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
  244. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
  245. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
  246. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
  247. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
  248. package/ReactCommon/react/utils/ContextContainer.h +2 -2
  249. package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
  250. package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
  251. package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
  252. package/ReactCommon/yoga/Yoga.podspec +1 -1
  253. package/index.js +0 -11
  254. package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
  255. package/package.json +4 -1
  256. package/scripts/generate-artifacts.js +21 -17
  257. package/scripts/react_native_pods.rb +1 -4
  258. package/template/Gemfile.lock +5 -5
  259. package/template/package.json +1 -1
  260. package/Libraries/Alert/AlertMacOS.js +0 -211
  261. package/ReactCommon/butter/optional.h +0 -38
  262. package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
  263. package/third-party-podspecs/boost-for-react-native.podspec +0 -20
@@ -35,7 +35,7 @@ import type {
35
35
  ViewToken,
36
36
  ViewabilityConfigCallbackPair,
37
37
  } from './ViewabilityHelper';
38
- import type {ScrollEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
38
+ import type {KeyEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
39
39
  import {
40
40
  VirtualizedListCellContextProvider,
41
41
  VirtualizedListContext,
@@ -109,12 +109,24 @@ type OptionalProps = {|
109
109
  * this for debugging purposes. Defaults to false.
110
110
  */
111
111
  disableVirtualization?: ?boolean,
112
+ // [TODO(macOS GH#774)
112
113
  /**
113
- * Handles key down events and updates selection based on the key event
114
+ * Allows you to 'select' a row using arrow keys. The selected row will have the prop `isSelected`
115
+ * passed in as true to it's renderItem / ListItemComponent. You can also imperatively select a row
116
+ * using the `selectRowAtIndex` method. You can set the initially selected row using the
117
+ * `initialSelectedIndex` prop.
118
+ * Keyboard Behavior:
119
+ * - ArrowUp: Select row above current selected row
120
+ * - ArrowDown: Select row below current selected row
121
+ * - Option+ArrowUp: Select the first row
122
+ * - Opton+ArrowDown: Select the last 'realized' row
123
+ * - Home: Scroll to top of list
124
+ * - End: Scroll to end of list
114
125
  *
115
126
  * @platform macos
116
127
  */
117
- enableSelectionOnKeyPress?: ?boolean, // TODO(macOS GH#774)
128
+ enableSelectionOnKeyPress?: ?boolean,
129
+ // ]TODO(macOS GH#774)
118
130
  /**
119
131
  * A marker property for telling the list to re-render (since it implements `PureComponent`). If
120
132
  * any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
@@ -145,6 +157,12 @@ type OptionalProps = {|
145
157
  * `getItemLayout` to be implemented.
146
158
  */
147
159
  initialScrollIndex?: ?number,
160
+ // [TODO(macOS GH#774)
161
+ /**
162
+ * The initially selected row, if `enableSelectionOnKeyPress` is set.
163
+ */
164
+ initialSelectedIndex?: ?number,
165
+ // ]TODO(macOS GH#774)
148
166
  /**
149
167
  * Reverses the direction of scroll. Uses scale transforms of -1.
150
168
  */
@@ -782,7 +800,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
782
800
  (this.props.initialScrollIndex || 0) +
783
801
  initialNumToRenderOrDefault(this.props.initialNumToRender),
784
802
  ) - 1,
785
- selectedRowIndex: 0, // TODO(macOS GH#774)
803
+ selectedRowIndex: this.props.initialSelectedIndex ?? -1, // TODO(macOS GH#774)
786
804
  };
787
805
 
788
806
  if (this._isNestedWithSameOrientation()) {
@@ -845,7 +863,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
845
863
  ),
846
864
  last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1)),
847
865
  selectedRowIndex: Math.max(
848
- 0,
866
+ -1, // Used to indicate no row is selected
849
867
  Math.min(prevState.selectedRowIndex, getItemCount(data)),
850
868
  ), // TODO(macOS GH#774)
851
869
  };
@@ -961,11 +979,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
961
979
  this.props;
962
980
  const {data, horizontal} = this.props;
963
981
  const isVirtualizationDisabled = this._isVirtualizationDisabled();
964
- const inversionStyle = this.props.inverted
965
- ? horizontalOrDefault(this.props.horizontal)
966
- ? styles.horizontallyInverted
967
- : styles.verticallyInverted
968
- : null;
982
+ // macOS natively supports inverted lists, thus not needing an inversion style
983
+ const inversionStyle =
984
+ this.props.inverted && Platform.OS !== 'macos' // TODO(macOS GH#774)
985
+ ? horizontalOrDefault(this.props.horizontal)
986
+ ? styles.horizontallyInverted
987
+ : styles.verticallyInverted
988
+ : null;
969
989
  const cells = [];
970
990
  const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
971
991
  const stickyHeaderIndices = [];
@@ -1309,14 +1329,29 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1309
1329
  }
1310
1330
 
1311
1331
  _defaultRenderScrollComponent = props => {
1312
- let keyEventHandler = this.props.onScrollKeyDown; // [TODO(macOS GH#774)
1313
- if (!keyEventHandler) {
1314
- keyEventHandler = this.props.enableSelectionOnKeyPress
1315
- ? this._handleKeyDown
1316
- : null;
1317
- }
1332
+ // [TODO(macOS GH#774)
1318
1333
  const preferredScrollerStyleDidChangeHandler =
1319
- this.props.onPreferredScrollerStyleDidChange; // ]TODO(macOS GH#774)
1334
+ this.props.onPreferredScrollerStyleDidChange;
1335
+ const invertedDidChange = this.props.onInvertedDidChange;
1336
+
1337
+ const isFirstRowSelected = this.state.selectedRowIndex === this.state.first;
1338
+ const isLastRowSelected = this.state.selectedRowIndex === this.state.last;
1339
+
1340
+ // Don't pass in ArrowUp/ArrowDown at the top/bottom of the list so that keyboard event can bubble
1341
+ let _validKeysDown = ['Home', 'End'];
1342
+ if (!isFirstRowSelected) {
1343
+ _validKeysDown.push('ArrowUp');
1344
+ }
1345
+ if (!isLastRowSelected) {
1346
+ _validKeysDown.push('ArrowDown');
1347
+ }
1348
+
1349
+ const keyboardNavigationProps = {
1350
+ focusable: true,
1351
+ validKeysDown: _validKeysDown,
1352
+ onKeyDown: this._handleKeyDown,
1353
+ };
1354
+ // ]TODO(macOS GH#774)
1320
1355
  const onRefresh = props.onRefresh;
1321
1356
  if (this._isNestedWithSameOrientation()) {
1322
1357
  // $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors
@@ -1331,13 +1366,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1331
1366
  return (
1332
1367
  // $FlowFixMe[prop-missing] Invalid prop usage
1333
1368
  <ScrollView
1334
- {...props}
1335
1369
  // [TODO(macOS GH#774)
1336
- {...(props.enableSelectionOnKeyPress && {focusable: true})}
1337
- onScrollKeyDown={keyEventHandler}
1370
+ {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1371
+ onInvertedDidChange={invertedDidChange}
1338
1372
  onPreferredScrollerStyleDidChange={
1339
1373
  preferredScrollerStyleDidChangeHandler
1340
1374
  } // TODO(macOS GH#774)]
1375
+ {...props}
1341
1376
  refreshControl={
1342
1377
  props.refreshControl == null ? (
1343
1378
  <RefreshControl
@@ -1355,12 +1390,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1355
1390
  return (
1356
1391
  // $FlowFixMe Invalid prop usage
1357
1392
  <ScrollView
1358
- {...props}
1359
- {...(props.enableSelectionOnKeyPress && {focusable: true})} // [TODO(macOS GH#774)
1360
- onScrollKeyDown={keyEventHandler}
1393
+ // [TODO(macOS GH#774)
1394
+ {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1395
+ onInvertedDidChange={invertedDidChange}
1361
1396
  onPreferredScrollerStyleDidChange={
1362
1397
  preferredScrollerStyleDidChangeHandler
1363
1398
  } // TODO(macOS GH#774)]
1399
+ {...props}
1364
1400
  />
1365
1401
  );
1366
1402
  }
@@ -1510,98 +1546,11 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1510
1546
  };
1511
1547
 
1512
1548
  // [TODO(macOS GH#774)
1513
- _selectRowAboveIndex = rowIndex => {
1514
- const rowAbove = rowIndex > 0 ? rowIndex - 1 : rowIndex;
1515
- this.setState(state => {
1516
- return {selectedRowIndex: rowAbove};
1517
- });
1518
- return rowAbove;
1519
- };
1520
-
1521
1549
  _selectRowAtIndex = rowIndex => {
1522
- this.setState(state => {
1523
- return {selectedRowIndex: rowIndex};
1524
- });
1525
- return rowIndex;
1526
- };
1527
-
1528
- _selectRowBelowIndex = rowIndex => {
1529
- if (this.props.getItemCount) {
1530
- const {data} = this.props;
1531
- const itemCount = this.props.getItemCount(data);
1532
- const rowBelow = rowIndex < itemCount - 1 ? rowIndex + 1 : rowIndex;
1533
- this.setState(state => {
1534
- return {selectedRowIndex: rowBelow};
1535
- });
1536
- return rowBelow;
1537
- } else {
1538
- return rowIndex;
1539
- }
1540
- };
1550
+ const prevIndex = this.state.selectedRowIndex;
1551
+ const newIndex = rowIndex;
1552
+ this.setState({selectedRowIndex: newIndex});
1541
1553
 
1542
- _handleKeyDown = (event: ScrollEvent) => {
1543
- if (this.props.onScrollKeyDown) {
1544
- this.props.onScrollKeyDown(event);
1545
- } else {
1546
- if (Platform.OS === 'macos') {
1547
- // $FlowFixMe Cannot get e.nativeEvent because property nativeEvent is missing in Event
1548
- const nativeEvent = event.nativeEvent;
1549
- const key = nativeEvent.key;
1550
-
1551
- let prevIndex = -1;
1552
- let newIndex = -1;
1553
- if ('selectedRowIndex' in this.state) {
1554
- prevIndex = this.state.selectedRowIndex;
1555
- }
1556
-
1557
- // const {data, getItem} = this.props;
1558
- if (key === 'UP_ARROW') {
1559
- newIndex = this._selectRowAboveIndex(prevIndex);
1560
- this._handleSelectionChange(prevIndex, newIndex);
1561
- } else if (key === 'DOWN_ARROW') {
1562
- newIndex = this._selectRowBelowIndex(prevIndex);
1563
- this._handleSelectionChange(prevIndex, newIndex);
1564
- } else if (key === 'ENTER') {
1565
- if (this.props.onSelectionEntered) {
1566
- const item = this.props.getItem(this.props.data, prevIndex);
1567
- if (this.props.onSelectionEntered) {
1568
- this.props.onSelectionEntered(item);
1569
- }
1570
- }
1571
- } else if (key === 'OPTION_UP') {
1572
- newIndex = this._selectRowAtIndex(0);
1573
- this._handleSelectionChange(prevIndex, newIndex);
1574
- } else if (key === 'OPTION_DOWN') {
1575
- newIndex = this._selectRowAtIndex(this.state.last);
1576
- this._handleSelectionChange(prevIndex, newIndex);
1577
- } else if (key === 'PAGE_UP') {
1578
- const maxY =
1579
- event.nativeEvent.contentSize.height -
1580
- event.nativeEvent.layoutMeasurement.height;
1581
- const newOffset = Math.min(
1582
- maxY,
1583
- nativeEvent.contentOffset.y + -nativeEvent.layoutMeasurement.height,
1584
- );
1585
- this.scrollToOffset({animated: true, offset: newOffset});
1586
- } else if (key === 'PAGE_DOWN') {
1587
- const maxY =
1588
- event.nativeEvent.contentSize.height -
1589
- event.nativeEvent.layoutMeasurement.height;
1590
- const newOffset = Math.min(
1591
- maxY,
1592
- nativeEvent.contentOffset.y + nativeEvent.layoutMeasurement.height,
1593
- );
1594
- this.scrollToOffset({animated: true, offset: newOffset});
1595
- } else if (key === 'HOME') {
1596
- this.scrollToOffset({animated: true, offset: 0});
1597
- } else if (key === 'END') {
1598
- this.scrollToEnd({animated: true});
1599
- }
1600
- }
1601
- }
1602
- };
1603
-
1604
- _handleSelectionChange = (prevIndex, newIndex) => {
1605
1554
  this.ensureItemAtIndexIsVisible(newIndex);
1606
1555
  if (prevIndex !== newIndex) {
1607
1556
  const item = this.props.getItem(this.props.data, newIndex);
@@ -1613,6 +1562,62 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1613
1562
  });
1614
1563
  }
1615
1564
  }
1565
+
1566
+ return newIndex;
1567
+ };
1568
+
1569
+ _selectRowAboveIndex = rowIndex => {
1570
+ const rowAbove = rowIndex > 0 ? rowIndex - 1 : rowIndex;
1571
+ this._selectRowAtIndex(rowAbove);
1572
+ };
1573
+
1574
+ _selectRowBelowIndex = rowIndex => {
1575
+ const rowBelow = rowIndex < this.state.last ? rowIndex + 1 : rowIndex;
1576
+ this._selectRowAtIndex(rowBelow);
1577
+ };
1578
+
1579
+ _handleKeyDown = (event: KeyEvent) => {
1580
+ if (Platform.OS === 'macos') {
1581
+ this.props.onKeyDown?.(event);
1582
+ if (event.defaultPrevented) {
1583
+ return;
1584
+ }
1585
+
1586
+ const nativeEvent = event.nativeEvent;
1587
+ const key = nativeEvent.key;
1588
+
1589
+ let selectedIndex = -1;
1590
+ if (this.state.selectedRowIndex >= 0) {
1591
+ selectedIndex = this.state.selectedRowIndex;
1592
+ }
1593
+
1594
+ if (key === 'ArrowUp') {
1595
+ if (nativeEvent.altKey) {
1596
+ // Option+Up selects the first element
1597
+ this._selectRowAtIndex(0);
1598
+ } else {
1599
+ this._selectRowAboveIndex(selectedIndex);
1600
+ }
1601
+ } else if (key === 'ArrowDown') {
1602
+ if (nativeEvent.altKey) {
1603
+ // Option+Down selects the last element
1604
+ this._selectRowAtIndex(this.state.last);
1605
+ } else {
1606
+ this._selectRowBelowIndex(selectedIndex);
1607
+ }
1608
+ } else if (key === 'Enter') {
1609
+ if (this.props.onSelectionEntered) {
1610
+ const item = this.props.getItem(this.props.data, selectedIndex);
1611
+ if (this.props.onSelectionEntered) {
1612
+ this.props.onSelectionEntered(item);
1613
+ }
1614
+ }
1615
+ } else if (key === 'Home') {
1616
+ this.scrollToOffset({animated: true, offset: 0});
1617
+ } else if (key === 'End') {
1618
+ this.scrollToEnd({animated: true});
1619
+ }
1620
+ }
1616
1621
  };
1617
1622
  // ]TODO(macOS GH#774)
1618
1623
 
@@ -12,7 +12,7 @@ const Platform = require('../Utilities/Platform'); // TODO(macOS GH#774)
12
12
  import invariant from 'invariant';
13
13
  import type {ViewToken} from './ViewabilityHelper';
14
14
  import type {SelectedRowIndexPathType} from './VirtualizedList'; // TODO(macOS GH#774)
15
- import type {ScrollEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
15
+ import type {KeyEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
16
16
  import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils';
17
17
  import {View, VirtualizedList} from 'react-native';
18
18
  import * as React from 'react';
@@ -311,8 +311,12 @@ class VirtualizedSectionList<
311
311
  }
312
312
  };
313
313
 
314
- _handleKeyDown = (e: ScrollEvent) => {
314
+ _handleKeyDown = (e: KeyEvent) => {
315
315
  if (Platform.OS === 'macos') {
316
+ if (e.defaultPrevented) {
317
+ return;
318
+ }
319
+
316
320
  const event = e.nativeEvent;
317
321
  const key = event.key;
318
322
  let prevIndexPath = this.state.selectedRowIndexPath;
@@ -320,7 +324,7 @@ class VirtualizedSectionList<
320
324
  const sectionIndex = this.state.selectedRowIndexPath.sectionIndex;
321
325
  const rowIndex = this.state.selectedRowIndexPath.rowIndex;
322
326
 
323
- if (key === 'DOWN_ARROW') {
327
+ if (key === 'ArrowDown') {
324
328
  nextIndexPath = this._selectRowBelowIndexPath(prevIndexPath);
325
329
  this._ensureItemAtIndexPathIsVisible(nextIndexPath);
326
330
 
@@ -332,7 +336,7 @@ class VirtualizedSectionList<
332
336
  item: item,
333
337
  });
334
338
  }
335
- } else if (key === 'UP_ARROW') {
339
+ } else if (key === 'ArrowUp') {
336
340
  nextIndexPath = this._selectRowAboveIndexPath(prevIndexPath);
337
341
  this._ensureItemAtIndexPathIsVisible(nextIndexPath);
338
342
 
@@ -344,7 +348,7 @@ class VirtualizedSectionList<
344
348
  item: item,
345
349
  });
346
350
  }
347
- } else if (key === 'ENTER') {
351
+ } else if (key === 'Enter') {
348
352
  if (this.props.onSelectionEntered) {
349
353
  const item = this.props.sections[sectionIndex].data[rowIndex];
350
354
  this.props.onSelectionEntered(item);
@@ -5,8 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #include "MountingTransactionMetadata.h"
8
+ #import <React/RCTAnimatedNode.h>
9
9
 
10
- namespace facebook {
11
- namespace react {} // namespace react
12
- } // namespace facebook
10
+ @interface RCTColorAnimatedNode : RCTAnimatedNode
11
+
12
+ @property (nonatomic, assign) int32_t color;
13
+
14
+ @end
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and 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/RCTColorAnimatedNode.h>
9
+ #import <React/RCTValueAnimatedNode.h>
10
+
11
+ @implementation RCTColorAnimatedNode
12
+
13
+ - (void)performUpdate
14
+ {
15
+ [super performUpdate];
16
+
17
+ RCTValueAnimatedNode *rNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"r"]];
18
+ RCTValueAnimatedNode *gNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"g"]];
19
+ RCTValueAnimatedNode *bNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"b"]];
20
+ RCTValueAnimatedNode *aNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"a"]];
21
+
22
+ _color = ((int)round(aNode.value * 255) & 0xff) << 24 |
23
+ ((int)round(rNode.value) & 0xff) << 16 |
24
+ ((int)round(gNode.value) & 0xff) << 8 |
25
+ ((int)round(bNode.value) & 0xff);
26
+
27
+ // TODO (T111179606): Support platform colors for color animations
28
+ }
29
+
30
+ @end
@@ -12,6 +12,7 @@
12
12
  #import <React/RCTStyleAnimatedNode.h>
13
13
  #import <React/RCTUIManager.h>
14
14
  #import <React/RCTValueAnimatedNode.h>
15
+ #import <React/RCTColorAnimatedNode.h>
15
16
 
16
17
  @implementation RCTPropsAnimatedNode
17
18
  {
@@ -118,17 +119,21 @@
118
119
  for (NSNumber *parentTag in self.parentNodes.keyEnumerator) {
119
120
  RCTAnimatedNode *parentNode = [self.parentNodes objectForKey:parentTag];
120
121
  if ([parentNode isKindOfClass:[RCTStyleAnimatedNode class]]) {
121
- [self->_propsDictionary addEntriesFromDictionary:[(RCTStyleAnimatedNode *)parentNode propsDictionary]];
122
-
122
+ RCTStyleAnimatedNode *styleAnimatedNode = (RCTStyleAnimatedNode *)parentNode;
123
+ [_propsDictionary addEntriesFromDictionary:styleAnimatedNode.propsDictionary];
123
124
  } else if ([parentNode isKindOfClass:[RCTValueAnimatedNode class]]) {
125
+ RCTValueAnimatedNode *valueAnimatedNode = (RCTValueAnimatedNode *)parentNode;
124
126
  NSString *property = [self propertyNameForParentTag:parentTag];
125
- id animatedObject = [(RCTValueAnimatedNode *)parentNode animatedObject];
127
+ id animatedObject = valueAnimatedNode.animatedObject;
126
128
  if (animatedObject) {
127
- self->_propsDictionary[property] = animatedObject;
129
+ _propsDictionary[property] = animatedObject;
128
130
  } else {
129
- CGFloat value = [(RCTValueAnimatedNode *)parentNode value];
130
- self->_propsDictionary[property] = @(value);
131
+ _propsDictionary[property] = @(valueAnimatedNode.value);
131
132
  }
133
+ } else if ([parentNode isKindOfClass:[RCTColorAnimatedNode class]]) {
134
+ RCTColorAnimatedNode *colorAnimatedNode = (RCTColorAnimatedNode *)parentNode;
135
+ NSString *property = [self propertyNameForParentTag:parentTag];
136
+ _propsDictionary[property] = @(colorAnimatedNode.color);
132
137
  }
133
138
  }
134
139
 
@@ -9,6 +9,7 @@
9
9
  #import <React/RCTAnimationUtils.h>
10
10
  #import <React/RCTValueAnimatedNode.h>
11
11
  #import <React/RCTTransformAnimatedNode.h>
12
+ #import <React/RCTColorAnimatedNode.h>
12
13
 
13
14
  @implementation RCTStyleAnimatedNode
14
15
  {
@@ -38,11 +39,14 @@
38
39
  RCTAnimatedNode *node = [self.parentNodes objectForKey:nodeTag];
39
40
  if (node) {
40
41
  if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {
41
- RCTValueAnimatedNode *parentNode = (RCTValueAnimatedNode *)node;
42
- [self->_propsDictionary setObject:@(parentNode.value) forKey:property];
42
+ RCTValueAnimatedNode *valueAnimatedNode = (RCTValueAnimatedNode *)node;
43
+ _propsDictionary[property] = @(valueAnimatedNode.value);
43
44
  } else if ([node isKindOfClass:[RCTTransformAnimatedNode class]]) {
44
- RCTTransformAnimatedNode *parentNode = (RCTTransformAnimatedNode *)node;
45
- [self->_propsDictionary addEntriesFromDictionary:parentNode.propsDictionary];
45
+ RCTTransformAnimatedNode *transformAnimatedNode = (RCTTransformAnimatedNode *)node;
46
+ [_propsDictionary addEntriesFromDictionary:transformAnimatedNode.propsDictionary];
47
+ } else if ([node isKindOfClass:[RCTColorAnimatedNode class]]) {
48
+ RCTColorAnimatedNode *colorAnimatedNode = (RCTColorAnimatedNode *)node;
49
+ _propsDictionary[property] = @(colorAnimatedNode.color);
46
50
  }
47
51
  }
48
52
  }];
@@ -12,6 +12,7 @@
12
12
  #import <React/RCTAdditionAnimatedNode.h>
13
13
  #import <React/RCTAnimatedNode.h>
14
14
  #import <React/RCTAnimationDriver.h>
15
+ #import <React/RCTColorAnimatedNode.h>
15
16
  #import <React/RCTDiffClampAnimatedNode.h>
16
17
  #import <React/RCTDivisionAnimatedNode.h>
17
18
  #import <React/RCTEventAnimation.h>
@@ -86,6 +87,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
86
87
  dispatch_once(&mapToken, ^{
87
88
  map = @{@"style" : [RCTStyleAnimatedNode class],
88
89
  @"value" : [RCTValueAnimatedNode class],
90
+ @"color" : [RCTColorAnimatedNode class],
89
91
  @"props" : [RCTPropsAnimatedNode class],
90
92
  @"interpolation" : [RCTInterpolationAnimatedNode class],
91
93
  @"addition" : [RCTAdditionAnimatedNode class],
@@ -29,12 +29,12 @@ Pod::Spec.new do |s|
29
29
  s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#214)
30
30
  s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
31
31
  s.source = source
32
- s.source_files = "{Drivers/*,Nodes/*,*}.{m,mm}"
32
+ s.source_files = "**/*.{h,m,mm}"
33
33
  s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
34
34
  s.header_dir = "RCTAnimation"
35
35
  s.pod_target_xcconfig = {
36
36
  "USE_HEADERMAP" => "YES",
37
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
37
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
39
39
  }
40
40
 
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
34
34
  s.header_dir = "RCTNetwork"
35
35
  s.pod_target_xcconfig = {
36
36
  "USE_HEADERMAP" => "YES",
37
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
37
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
39
39
  }
40
40
  s.ios.frameworks = "MobileCoreServices" # TODO(macOS GH#214) - Restrict to iOS
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
35
35
  s.header_dir = "RCTPushNotification"
36
36
  s.pod_target_xcconfig = {
37
37
  "USE_HEADERMAP" => "YES",
38
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
39
39
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
40
40
  }
41
41
  s.framework = "UserNotifications"
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
35
35
  s.header_dir = "RCTSettings"
36
36
  s.pod_target_xcconfig = {
37
37
  "USE_HEADERMAP" => "YES",
38
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
38
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
39
39
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
40
40
  }
41
41
 
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTBaseTextViewManager.h>
9
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
10
+ #import <React/RCTCursor.h>
11
+ #endif // ]TODO(macOS GH#774)
9
12
 
10
13
  @implementation RCTBaseTextViewManager
11
14
 
@@ -36,6 +39,7 @@ RCT_REMAP_SHADOW_PROPERTY(fontWeight, textAttributes.fontWeight, NSString)
36
39
  RCT_REMAP_SHADOW_PROPERTY(fontStyle, textAttributes.fontStyle, NSString)
37
40
  RCT_REMAP_SHADOW_PROPERTY(fontVariant, textAttributes.fontVariant, NSArray)
38
41
  RCT_REMAP_SHADOW_PROPERTY(allowFontScaling, textAttributes.allowFontScaling, BOOL)
42
+ RCT_REMAP_SHADOW_PROPERTY(dynamicTypeRamp, textAttributes.dynamicTypeRamp, RCTDynamicTypeRamp) // TODO(macOS GH#774)
39
43
  RCT_REMAP_SHADOW_PROPERTY(maxFontSizeMultiplier, textAttributes.maxFontSizeMultiplier, CGFloat)
40
44
  RCT_REMAP_SHADOW_PROPERTY(letterSpacing, textAttributes.letterSpacing, CGFloat)
41
45
  RCT_REMAP_SHADOW_PROPERTY(apple_fontSmoothing, textAttributes.fontSmoothing, RCTFontSmoothing) // TODO(OSS Candidate ISS#2710739)
@@ -55,4 +59,8 @@ RCT_REMAP_SHADOW_PROPERTY(textShadowColor, textAttributes.textShadowColor, UICol
55
59
  RCT_REMAP_SHADOW_PROPERTY(isHighlighted, textAttributes.isHighlighted, BOOL)
56
60
  RCT_REMAP_SHADOW_PROPERTY(textTransform, textAttributes.textTransform, RCTTextTransform)
57
61
 
62
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
63
+ RCT_REMAP_SHADOW_PROPERTY(cursor, textAttributes.cursor, RCTCursor)
64
+ #endif // ]TODO(macOS GH#774)
65
+
58
66
  @end
@@ -6,12 +6,15 @@
6
6
  */
7
7
 
8
8
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
-
10
9
  #import <React/RCTTextDecorationLineType.h>
11
- #import <React/RCTFontSmoothing.h> // TODO(OSS Candidate ISS#2710739)
12
-
10
+ #import <React/RCTDynamicTypeRamp.h> // TODO(macOS GH#774)
11
+ #import <React/RCTFontSmoothing.h> // TODO(macOS GH#774)
13
12
  #import "RCTTextTransform.h"
14
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ #import <React/RCTCursor.h>
16
+ #endif // ]TODO(macOS GH#774)
17
+
15
18
  NS_ASSUME_NONNULL_BEGIN
16
19
 
17
20
  extern NSString *const RCTTextAttributesIsHighlightedAttributeName;
@@ -38,6 +41,7 @@ extern NSString *const RCTTextAttributesTagAttributeName;
38
41
  @property (nonatomic, copy, nullable) NSString *fontStyle;
39
42
  @property (nonatomic, copy, nullable) NSArray<NSString *> *fontVariant;
40
43
  @property (nonatomic, assign) BOOL allowFontScaling;
44
+ @property (nonatomic, assign) RCTDynamicTypeRamp dynamicTypeRamp; // TODO(macOS GH#774)
41
45
  @property (nonatomic, assign) CGFloat letterSpacing;
42
46
  @property (nonatomic, assign) RCTFontSmoothing fontSmoothing; // TODO(OSS Candidate ISS#2710739)
43
47
  @property (class, nonatomic, assign) RCTFontSmoothing fontSmoothingDefault; // TODO(OSS Candidate ISS#2710739)
@@ -59,6 +63,10 @@ extern NSString *const RCTTextAttributesTagAttributeName;
59
63
  @property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection;
60
64
  @property (nonatomic, assign) RCTTextTransform textTransform;
61
65
 
66
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
67
+ @property (nonatomic, assign) RCTCursor cursor;
68
+ #endif // ]TODO(macOS GH#774)
69
+
62
70
  #pragma mark - Inheritance
63
71
 
64
72
  - (void)applyTextAttributes:(RCTTextAttributes *)textAttributes;