react-native-macos 0.0.0-3b1f57593 → 0.0.0-3bc4d42a9

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 (238) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +2 -3
  2. package/Libraries/Alert/Alert.js +2 -2
  3. package/Libraries/Alert/RCTAlertManager.android.js +1 -1
  4. package/Libraries/Animated/AnimatedImplementation.js +53 -53
  5. package/Libraries/Animated/AnimatedMock.js +8 -8
  6. package/Libraries/Animated/NativeAnimatedHelper.js +23 -20
  7. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  8. package/Libraries/Animated/nodes/AnimatedNode.js +10 -9
  9. package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
  10. package/Libraries/AppState/AppState.js +8 -7
  11. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +2 -2
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -20
  13. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -2
  14. package/Libraries/Components/Button.js +1 -2
  15. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +6 -7
  16. package/Libraries/Components/Keyboard/Keyboard.js +8 -7
  17. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -10
  18. package/Libraries/Components/Pressable/Pressable.js +1 -2
  19. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -1
  20. package/Libraries/Components/RefreshControl/RefreshControl.js +2 -7
  21. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
  22. package/Libraries/Components/SafeAreaView/SafeAreaView.js +2 -2
  23. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -5
  24. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +3 -5
  25. package/Libraries/Components/ScrollView/ScrollView.js +29 -67
  26. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -4
  27. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
  28. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +2 -8
  29. package/Libraries/Components/Sound/SoundManager.js +1 -1
  30. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -2
  31. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +3 -5
  32. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +3 -5
  33. package/Libraries/Components/TextInput/TextInput.js +123 -12
  34. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +3 -3
  35. package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +3 -3
  36. package/Libraries/Components/Touchable/BoundingDimensions.js +2 -2
  37. package/Libraries/Components/Touchable/PooledClass.js +6 -6
  38. package/Libraries/Components/Touchable/Position.js +1 -1
  39. package/Libraries/Components/Touchable/Touchable.js +26 -25
  40. package/Libraries/Components/Touchable/TouchableBounce.js +1 -2
  41. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -2
  42. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -11
  43. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -2
  44. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  45. package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
  46. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
  47. package/Libraries/Components/View/View.js +0 -7
  48. package/Libraries/Components/View/ViewNativeComponent.js +3 -4
  49. package/Libraries/Components/View/ViewPropTypes.js +10 -6
  50. package/Libraries/Core/Devtools/parseHermesStack.js +2 -1
  51. package/Libraries/Core/ExceptionsManager.js +2 -2
  52. package/Libraries/Core/NativeExceptionsManager.js +2 -3
  53. package/Libraries/Core/ReactNativeVersion.js +1 -1
  54. package/Libraries/Core/Timers/JSTimers.js +17 -13
  55. package/Libraries/Core/setUpAlert.js +1 -1
  56. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  57. package/Libraries/Core/setUpPerformance.js +1 -1
  58. package/Libraries/Core/setUpRegeneratorRuntime.js +1 -1
  59. package/Libraries/Core/setUpSegmentFetcher.js +4 -4
  60. package/Libraries/EventEmitter/NativeEventEmitter.js +2 -1
  61. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -1
  62. package/Libraries/HeapCapture/HeapCapture.js +1 -1
  63. package/Libraries/Image/AssetSourceResolver.js +2 -4
  64. package/Libraries/Image/Image.android.js +4 -4
  65. package/Libraries/Image/Image.ios.js +3 -3
  66. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -3
  67. package/Libraries/Image/ImageBackground.js +1 -2
  68. package/Libraries/Image/ImagePickerIOS.js +6 -6
  69. package/Libraries/Image/ImageViewNativeComponent.js +2 -4
  70. package/Libraries/Image/NativeImageLoaderAndroid.js +1 -3
  71. package/Libraries/Image/RCTImageCache.m +1 -1
  72. package/Libraries/Image/RCTImageView.mm +14 -10
  73. package/Libraries/Image/TextInlineImageNativeComponent.js +3 -5
  74. package/Libraries/Inspector/ElementProperties.js +2 -4
  75. package/Libraries/Inspector/InspectorOverlay.js +1 -2
  76. package/Libraries/Inspector/InspectorPanel.js +1 -2
  77. package/Libraries/Inspector/NetworkOverlay.js +5 -11
  78. package/Libraries/Interaction/BridgeSpyStallHandler.js +1 -1
  79. package/Libraries/Interaction/FrameRateLogger.js +2 -2
  80. package/Libraries/Interaction/InteractionManager.js +2 -4
  81. package/Libraries/Interaction/JSEventLoopWatchdog.js +4 -4
  82. package/Libraries/Interaction/PanResponder.js +3 -4
  83. package/Libraries/Interaction/TouchHistoryMath.js +7 -7
  84. package/Libraries/JSInspector/NetworkAgent.js +1 -6
  85. package/Libraries/LayoutAnimation/LayoutAnimation.js +3 -3
  86. package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
  87. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
  88. package/Libraries/Lists/FillRateHelper.js +1 -3
  89. package/Libraries/Lists/FlatList.js +28 -5
  90. package/Libraries/Lists/ViewabilityHelper.js +4 -10
  91. package/Libraries/Lists/VirtualizeUtils.js +2 -6
  92. package/Libraries/Lists/VirtualizedList.js +125 -149
  93. package/Libraries/Lists/VirtualizedListContext.js +3 -5
  94. package/Libraries/Lists/VirtualizedSectionList.js +63 -68
  95. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  96. package/Libraries/LogBox/Data/parseLogBoxLog.js +12 -23
  97. package/Libraries/LogBox/UI/LogBoxButton.js +2 -4
  98. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -4
  99. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -2
  100. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -2
  101. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -6
  102. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -2
  103. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -4
  104. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -4
  105. package/Libraries/LogBox/UI/LogBoxNotification.js +2 -4
  106. package/Libraries/Modal/Modal.js +2 -4
  107. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -4
  108. package/Libraries/Network/XHRInterceptor.js +5 -6
  109. package/Libraries/NewAppScreen/components/Header.js +2 -4
  110. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -2
  111. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +2 -4
  112. package/Libraries/Performance/SamplingProfiler.js +3 -3
  113. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
  114. package/Libraries/Pressability/Pressability.js +2 -2
  115. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +4 -2
  116. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
  117. package/Libraries/ReactNative/AppContainer.js +4 -6
  118. package/Libraries/ReactNative/AppRegistry.js +2 -3
  119. package/Libraries/ReactNative/I18nManager.js +2 -5
  120. package/Libraries/ReactNative/PaperUIManager.js +2 -3
  121. package/Libraries/ReactNative/RootTag.js +2 -3
  122. package/Libraries/ReactNative/renderApplication.js +1 -2
  123. package/Libraries/Storage/AsyncStorage.js +21 -21
  124. package/Libraries/StyleSheet/StyleSheet.js +2 -1
  125. package/Libraries/StyleSheet/StyleSheetTypes.js +26 -1
  126. package/Libraries/StyleSheet/processColor.js +2 -2
  127. package/Libraries/StyleSheet/splitLayoutProps.js +1 -3
  128. package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +1 -0
  129. package/Libraries/Text/RCTTextAttributes.h +2 -0
  130. package/Libraries/Text/RCTTextAttributes.m +14 -5
  131. package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
  132. package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
  133. package/Libraries/Text/Text.js +2 -1
  134. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +3 -0
  135. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +6 -1
  136. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +11 -0
  137. package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +1 -0
  138. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +88 -3
  139. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +13 -1
  140. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
  141. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
  142. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +12 -0
  143. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +9 -1
  144. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +120 -2
  145. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +12 -0
  146. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -0
  147. package/Libraries/Text/TextNativeComponent.js +4 -5
  148. package/Libraries/Text/TextProps.js +17 -0
  149. package/Libraries/Types/CoreEventTypes.js +0 -1
  150. package/Libraries/Utilities/Appearance.js +8 -5
  151. package/Libraries/Utilities/BackHandler.android.js +4 -4
  152. package/Libraries/Utilities/HMRClient.js +2 -2
  153. package/Libraries/Utilities/JSDevSupportModule.js +3 -4
  154. package/Libraries/Utilities/MatrixMath.js +19 -19
  155. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -3
  156. package/Libraries/Utilities/ReactNativeTestTools.js +2 -4
  157. package/Libraries/Utilities/SceneTracker.js +1 -3
  158. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -3
  159. package/Libraries/Utilities/buildStyleInterpolator.js +9 -9
  160. package/Libraries/Utilities/codegenNativeComponent.js +4 -2
  161. package/Libraries/Utilities/differ/deepDiffer.js +1 -1
  162. package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
  163. package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
  164. package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
  165. package/Libraries/Utilities/differ/sizesDiffer.js +1 -1
  166. package/Libraries/Utilities/logError.js +1 -1
  167. package/Libraries/Utilities/mergeIntoFast.js +1 -1
  168. package/Libraries/Utilities/truncate.js +1 -1
  169. package/Libraries/Vibration/Vibration.js +2 -2
  170. package/Libraries/WebSocket/WebSocketInterceptor.js +4 -4
  171. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  172. package/Libraries/vendor/emitter/_EmitterSubscription.js +2 -1
  173. package/Libraries/vendor/emitter/_EventEmitter.js +2 -1
  174. package/Libraries/vendor/emitter/_EventSubscription.js +2 -1
  175. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
  176. package/React/Base/RCTConvert.m +9 -5
  177. package/React/Base/RCTRootView.m +0 -9
  178. package/React/Base/RCTTouchHandler.m +4 -0
  179. package/React/Base/RCTUtils.m +33 -3
  180. package/React/Base/RCTVersion.m +1 -1
  181. package/React/Base/macOS/RCTUIKit.m +7 -0
  182. package/React/CoreModules/RCTAppearance.mm +21 -5
  183. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  184. package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
  185. package/React/Modules/RCTUIManager.m +2 -1
  186. package/React/Views/RCTActivityIndicatorView.m +2 -1
  187. package/React/Views/RCTCursor.h +39 -0
  188. package/React/Views/RCTCursor.m +105 -0
  189. package/React/Views/RCTView.h +16 -0
  190. package/React/Views/RCTView.m +135 -190
  191. package/React/Views/RCTViewKeyboardEvent.h +6 -28
  192. package/React/Views/RCTViewKeyboardEvent.m +66 -61
  193. package/React/Views/RCTViewManager.m +17 -12
  194. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  195. package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
  196. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  197. package/React/Views/ScrollView/RCTScrollView.h +2 -1
  198. package/React/Views/ScrollView/RCTScrollView.m +69 -62
  199. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
  200. package/React/Views/UIView+React.h +2 -0
  201. package/React/Views/UIView+React.m +23 -14
  202. package/ReactAndroid/gradle.properties +1 -1
  203. package/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +1 -2
  204. package/ReactAndroid/src/androidTest/js/Asserts.js +2 -2
  205. package/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +1 -1
  206. package/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +1 -2
  207. package/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +1 -2
  208. package/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +54 -54
  209. package/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +1 -1
  210. package/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +6 -7
  211. package/ReactAndroid/src/androidTest/js/ShareTestModule.js +1 -1
  212. package/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +12 -19
  213. package/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +2 -3
  214. package/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +2 -2
  215. package/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +17 -17
  216. package/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +10 -10
  217. package/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +2 -2
  218. package/ReactAndroid/src/androidTest/js/TextInputTestModule.js +2 -3
  219. package/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +3 -6
  220. package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +3 -6
  221. package/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +5 -5
  222. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  223. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  224. package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +1 -1
  225. package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -1
  226. package/jest/assetFileTransformer.js +2 -2
  227. package/jest/preprocessor.js +2 -2
  228. package/jest/setup.js +3 -3
  229. package/package.json +22 -25
  230. package/scripts/generate-artifacts.js +21 -17
  231. package/scripts/react_native_pods.rb +0 -3
  232. package/template/App.js +4 -8
  233. package/template/Gemfile.lock +6 -6
  234. package/template/android/gradlew.bat +89 -89
  235. package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
  236. package/template/package.json +1 -1
  237. package/Libraries/Types/RootTagTypes.js~merged +0 -23
  238. package/third-party-podspecs/boost-for-react-native.podspec +0 -20
@@ -47,13 +47,13 @@ const AsyncStorage = {
47
47
  *
48
48
  * See https://reactnative.dev/docs/asyncstorage#getitem
49
49
  */
50
- getItem: function(
50
+ getItem: function (
51
51
  key: string,
52
52
  callback?: ?(error: ?Error, result: ?string) => void,
53
53
  ): Promise<?string> {
54
54
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
55
55
  return new Promise((resolve, reject) => {
56
- RCTAsyncStorage.multiGet([key], function(errors, result) {
56
+ RCTAsyncStorage.multiGet([key], function (errors, result) {
57
57
  // Unpack result to get value from [[key,value]]
58
58
  const value = result && result[0] && result[0][1] ? result[0][1] : null;
59
59
  const errs = convertErrors(errors);
@@ -72,14 +72,14 @@ const AsyncStorage = {
72
72
  *
73
73
  * See https://reactnative.dev/docs/asyncstorage#setitem
74
74
  */
75
- setItem: function(
75
+ setItem: function (
76
76
  key: string,
77
77
  value: string,
78
78
  callback?: ?(error: ?Error) => void,
79
79
  ): Promise<void> {
80
80
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
81
81
  return new Promise((resolve, reject) => {
82
- RCTAsyncStorage.multiSet([[key, value]], function(errors) {
82
+ RCTAsyncStorage.multiSet([[key, value]], function (errors) {
83
83
  const errs = convertErrors(errors);
84
84
  callback && callback(errs && errs[0]);
85
85
  if (errs) {
@@ -96,13 +96,13 @@ const AsyncStorage = {
96
96
  *
97
97
  * See https://reactnative.dev/docs/asyncstorage#removeitem
98
98
  */
99
- removeItem: function(
99
+ removeItem: function (
100
100
  key: string,
101
101
  callback?: ?(error: ?Error) => void,
102
102
  ): Promise<void> {
103
103
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
104
104
  return new Promise((resolve, reject) => {
105
- RCTAsyncStorage.multiRemove([key], function(errors) {
105
+ RCTAsyncStorage.multiRemove([key], function (errors) {
106
106
  const errs = convertErrors(errors);
107
107
  callback && callback(errs && errs[0]);
108
108
  if (errs) {
@@ -122,14 +122,14 @@ const AsyncStorage = {
122
122
  *
123
123
  * See https://reactnative.dev/docs/asyncstorage#mergeitem
124
124
  */
125
- mergeItem: function(
125
+ mergeItem: function (
126
126
  key: string,
127
127
  value: string,
128
128
  callback?: ?(error: ?Error) => void,
129
129
  ): Promise<void> {
130
130
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
131
131
  return new Promise((resolve, reject) => {
132
- RCTAsyncStorage.multiMerge([[key, value]], function(errors) {
132
+ RCTAsyncStorage.multiMerge([[key, value]], function (errors) {
133
133
  const errs = convertErrors(errors);
134
134
  callback && callback(errs && errs[0]);
135
135
  if (errs) {
@@ -148,10 +148,10 @@ const AsyncStorage = {
148
148
  *
149
149
  * See https://reactnative.dev/docs/asyncstorage#clear
150
150
  */
151
- clear: function(callback?: ?(error: ?Error) => void): Promise<void> {
151
+ clear: function (callback?: ?(error: ?Error) => void): Promise<void> {
152
152
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
153
153
  return new Promise((resolve, reject) => {
154
- RCTAsyncStorage.clear(function(error) {
154
+ RCTAsyncStorage.clear(function (error) {
155
155
  callback && callback(convertError(error));
156
156
  if (error && convertError(error)) {
157
157
  reject(convertError(error));
@@ -167,12 +167,12 @@ const AsyncStorage = {
167
167
  *
168
168
  * See https://reactnative.dev/docs/asyncstorage#getallkeys
169
169
  */
170
- getAllKeys: function(
170
+ getAllKeys: function (
171
171
  callback?: ?(error: ?Error, keys: ?Array<string>) => void,
172
172
  ): Promise<?Array<string>> {
173
173
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
174
174
  return new Promise((resolve, reject) => {
175
- RCTAsyncStorage.getAllKeys(function(error, keys) {
175
+ RCTAsyncStorage.getAllKeys(function (error, keys) {
176
176
  callback && callback(convertError(error), keys);
177
177
  if (error) {
178
178
  reject(convertError(error));
@@ -198,7 +198,7 @@ const AsyncStorage = {
198
198
  *
199
199
  * See https://reactnative.dev/docs/asyncstorage#flushgetrequests
200
200
  * */
201
- flushGetRequests: function(): void {
201
+ flushGetRequests: function (): void {
202
202
  const getRequests = this._getRequests;
203
203
  const getKeys = this._getKeys;
204
204
 
@@ -206,7 +206,7 @@ const AsyncStorage = {
206
206
  this._getKeys = [];
207
207
 
208
208
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
209
- RCTAsyncStorage.multiGet(getKeys, function(errors, result) {
209
+ RCTAsyncStorage.multiGet(getKeys, function (errors, result) {
210
210
  // Even though the runtime complexity of this is theoretically worse vs if we used a map,
211
211
  // it's much, much faster in practice for the data sets we deal with (we avoid
212
212
  // allocating result pair arrays). This was heavily benchmarked.
@@ -237,7 +237,7 @@ const AsyncStorage = {
237
237
  *
238
238
  * See https://reactnative.dev/docs/asyncstorage#multiget
239
239
  */
240
- multiGet: function(
240
+ multiGet: function (
241
241
  keys: Array<string>,
242
242
  callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void,
243
243
  ): Promise<?Array<Array<string>>> {
@@ -272,13 +272,13 @@ const AsyncStorage = {
272
272
  *
273
273
  * See https://reactnative.dev/docs/asyncstorage#multiset
274
274
  */
275
- multiSet: function(
275
+ multiSet: function (
276
276
  keyValuePairs: Array<Array<string>>,
277
277
  callback?: ?(errors: ?Array<Error>) => void,
278
278
  ): Promise<void> {
279
279
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
280
280
  return new Promise((resolve, reject) => {
281
- RCTAsyncStorage.multiSet(keyValuePairs, function(errors) {
281
+ RCTAsyncStorage.multiSet(keyValuePairs, function (errors) {
282
282
  const error = convertErrors(errors);
283
283
  callback && callback(error);
284
284
  if (error) {
@@ -295,13 +295,13 @@ const AsyncStorage = {
295
295
  *
296
296
  * See https://reactnative.dev/docs/asyncstorage#multiremove
297
297
  */
298
- multiRemove: function(
298
+ multiRemove: function (
299
299
  keys: Array<string>,
300
300
  callback?: ?(errors: ?Array<Error>) => void,
301
301
  ): Promise<void> {
302
302
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
303
303
  return new Promise((resolve, reject) => {
304
- RCTAsyncStorage.multiRemove(keys, function(errors) {
304
+ RCTAsyncStorage.multiRemove(keys, function (errors) {
305
305
  const error = convertErrors(errors);
306
306
  callback && callback(error);
307
307
  if (error) {
@@ -321,13 +321,13 @@ const AsyncStorage = {
321
321
  *
322
322
  * See https://reactnative.dev/docs/asyncstorage#multimerge
323
323
  */
324
- multiMerge: function(
324
+ multiMerge: function (
325
325
  keyValuePairs: Array<Array<string>>,
326
326
  callback?: ?(errors: ?Array<Error>) => void,
327
327
  ): Promise<void> {
328
328
  invariant(RCTAsyncStorage, 'RCTAsyncStorage not available');
329
329
  return new Promise((resolve, reject) => {
330
- RCTAsyncStorage.multiMerge(keyValuePairs, function(errors) {
330
+ RCTAsyncStorage.multiMerge(keyValuePairs, function (errors) {
331
331
  const error = convertErrors(errors);
332
332
  callback && callback(error);
333
333
  if (error) {
@@ -74,7 +74,8 @@ export type ImageStyleProp = ____ImageStyleProp_Internal;
74
74
  * through to an underlying component. Using this is almost always a mistake
75
75
  * and using one of the other more restrictive types is likely the right choice.
76
76
  */
77
- export type DangerouslyImpreciseStyleProp = ____DangerouslyImpreciseStyleProp_Internal;
77
+ export type DangerouslyImpreciseStyleProp =
78
+ ____DangerouslyImpreciseStyleProp_Internal;
78
79
 
79
80
  /**
80
81
  * Utility type for getting the values for specific style keys.
@@ -16,6 +16,29 @@ import type {NativeColorValue} from './PlatformColorValueTypes';
16
16
 
17
17
  export type ____ColorValue_Internal = null | string | NativeColorValue;
18
18
 
19
+ export type CursorValue = ?(
20
+ | 'alias'
21
+ | 'auto'
22
+ | 'col-resize'
23
+ | 'context-menu'
24
+ | 'copy'
25
+ | 'crosshair'
26
+ | 'default'
27
+ | 'disappearing-item'
28
+ | 'e-resize'
29
+ | 'grab'
30
+ | 'grabbing'
31
+ | 'n-resize'
32
+ | 'no-drop'
33
+ | 'not-allowed'
34
+ | 'pointer'
35
+ | 'row-resize'
36
+ | 's-resize'
37
+ | 'text'
38
+ | 'vertical-text'
39
+ | 'w-resize'
40
+ );
41
+
19
42
  export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>;
20
43
  export type PointValue = {|
21
44
  x: number,
@@ -584,6 +607,7 @@ export type ____ViewStyle_Internal = $ReadOnly<{|
584
607
  borderTopWidth?: number | AnimatedNode,
585
608
  opacity?: number | AnimatedNode,
586
609
  elevation?: number,
610
+ cursor?: CursorValue,
587
611
  |}>;
588
612
 
589
613
  export type ____FontWeight_Internal =
@@ -638,6 +662,7 @@ export type ____TextStyle_Internal = $ReadOnly<{|
638
662
  textDecorationColor?: ____ColorValue_Internal,
639
663
  textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase',
640
664
  writingDirection?: 'auto' | 'ltr' | 'rtl',
665
+ cursor?: CursorValue,
641
666
  |}>;
642
667
 
643
668
  export type ____ImageStyle_Internal = $ReadOnly<{|
@@ -678,7 +703,7 @@ export type ____ImageStyleProp_Internal = GenericStyleProp<
678
703
 
679
704
  export type ____Styles_Internal = {
680
705
  +[key: string]: $Shape<____DangerouslyImpreciseStyle_Internal>,
681
- ...,
706
+ ...
682
707
  };
683
708
 
684
709
  export type ____FlattenStyleProp_Internal<+TStyleProp> = $Call<
@@ -31,8 +31,8 @@ function processColor(color?: ?(number | ColorValue)): ?ProcessedColorValue {
31
31
  }
32
32
 
33
33
  if (typeof normalizedColor === 'object') {
34
- const processColorObject = require('./PlatformColorValueTypes')
35
- .processColorObject;
34
+ const processColorObject =
35
+ require('./PlatformColorValueTypes').processColorObject;
36
36
 
37
37
  const processedColorObj = processColorObject(normalizedColor);
38
38
 
@@ -10,9 +10,7 @@
10
10
 
11
11
  import type {____ViewStyle_Internal} from './StyleSheetTypes';
12
12
 
13
- export default function splitLayoutProps(
14
- props: ?____ViewStyle_Internal,
15
- ): {
13
+ export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
16
14
  outer: ?____ViewStyle_Internal,
17
15
  inner: ?____ViewStyle_Internal,
18
16
  } {
@@ -36,6 +36,7 @@ RCT_REMAP_SHADOW_PROPERTY(fontWeight, textAttributes.fontWeight, NSString)
36
36
  RCT_REMAP_SHADOW_PROPERTY(fontStyle, textAttributes.fontStyle, NSString)
37
37
  RCT_REMAP_SHADOW_PROPERTY(fontVariant, textAttributes.fontVariant, NSArray)
38
38
  RCT_REMAP_SHADOW_PROPERTY(allowFontScaling, textAttributes.allowFontScaling, BOOL)
39
+ RCT_REMAP_SHADOW_PROPERTY(dynamicTypeRamp, textAttributes.dynamicTypeRamp, RCTDynamicTypeRamp) // TODO(macOS GH#774)
39
40
  RCT_REMAP_SHADOW_PROPERTY(maxFontSizeMultiplier, textAttributes.maxFontSizeMultiplier, CGFloat)
40
41
  RCT_REMAP_SHADOW_PROPERTY(letterSpacing, textAttributes.letterSpacing, CGFloat)
41
42
  RCT_REMAP_SHADOW_PROPERTY(apple_fontSmoothing, textAttributes.fontSmoothing, RCTFontSmoothing) // TODO(OSS Candidate ISS#2710739)
@@ -8,6 +8,7 @@
8
8
  #import <React/RCTUIKit.h> // TODO(macOS GH#774)
9
9
 
10
10
  #import <React/RCTTextDecorationLineType.h>
11
+ #import <React/RCTDynamicTypeRamp.h> // TODO(macOS GH#774)
11
12
  #import <React/RCTFontSmoothing.h> // TODO(OSS Candidate ISS#2710739)
12
13
 
13
14
  #import "RCTTextTransform.h"
@@ -38,6 +39,7 @@ extern NSString *const RCTTextAttributesTagAttributeName;
38
39
  @property (nonatomic, copy, nullable) NSString *fontStyle;
39
40
  @property (nonatomic, copy, nullable) NSArray<NSString *> *fontVariant;
40
41
  @property (nonatomic, assign) BOOL allowFontScaling;
42
+ @property (nonatomic, assign) RCTDynamicTypeRamp dynamicTypeRamp; // TODO(macOS GH#774)
41
43
  @property (nonatomic, assign) CGFloat letterSpacing;
42
44
  @property (nonatomic, assign) RCTFontSmoothing fontSmoothing; // TODO(OSS Candidate ISS#2710739)
43
45
  @property (class, nonatomic, assign) RCTFontSmoothing fontSmoothingDefault; // TODO(OSS Candidate ISS#2710739)
@@ -70,6 +70,7 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
70
70
  _fontStyle = textAttributes->_fontStyle ?: _fontStyle;
71
71
  _fontVariant = textAttributes->_fontVariant ?: _fontVariant;
72
72
  _allowFontScaling = textAttributes->_allowFontScaling || _allowFontScaling; // *
73
+ _dynamicTypeRamp = textAttributes->_dynamicTypeRamp != RCTDynamicTypeRampUndefined ? textAttributes->_dynamicTypeRamp : _dynamicTypeRamp; // TODO(macOS GH#774)
73
74
  _letterSpacing = !isnan(textAttributes->_letterSpacing) ? textAttributes->_letterSpacing : _letterSpacing;
74
75
  _fontSmoothing = textAttributes->_fontSmoothing != RCTFontSmoothingAuto ? textAttributes->_fontSmoothing : _fontSmoothing; // TODO(OSS Candidate ISS#2710739)
75
76
 
@@ -109,27 +110,27 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
109
110
  alignment = NSTextAlignmentRight;
110
111
  }
111
112
  }
112
-
113
+
113
114
  paragraphStyle.alignment = alignment;
114
115
  isParagraphStyleUsed = YES;
115
116
  }
116
-
117
+
117
118
  if (_baseWritingDirection != NSWritingDirectionNatural) {
118
119
  paragraphStyle.baseWritingDirection = _baseWritingDirection;
119
120
  isParagraphStyleUsed = YES;
120
121
  }
121
-
122
+
122
123
  if (!isnan(_lineHeight)) {
123
124
  CGFloat lineHeight = _lineHeight * self.effectiveFontSizeMultiplier;
124
125
  paragraphStyle.minimumLineHeight = lineHeight;
125
126
  paragraphStyle.maximumLineHeight = lineHeight;
126
127
  isParagraphStyleUsed = YES;
127
128
  }
128
-
129
+
129
130
  if (isParagraphStyleUsed) {
130
131
  return [paragraphStyle copy];
131
132
  }
132
-
133
+
133
134
  return nil;
134
135
  }
135
136
 
@@ -230,6 +231,13 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
230
231
 
231
232
  if (fontScalingEnabled) {
232
233
  CGFloat fontSizeMultiplier = !isnan(_fontSizeMultiplier) ? _fontSizeMultiplier : 1.0;
234
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
235
+ if (_dynamicTypeRamp != RCTDynamicTypeRampUndefined) {
236
+ UIFontMetrics *fontMetrics = RCTUIFontMetricsForDynamicTypeRamp(_dynamicTypeRamp);
237
+ CGFloat baseSize = RCTBaseSizeForDynamicTypeRamp(_dynamicTypeRamp);
238
+ fontSizeMultiplier = [fontMetrics scaledValueForValue:baseSize] / baseSize;
239
+ }
240
+ #endif // ]TODO(macOS GH#774)
233
241
  CGFloat maxFontSizeMultiplier = !isnan(_maxFontSizeMultiplier) ? _maxFontSizeMultiplier : 0.0;
234
242
  return maxFontSizeMultiplier >= 1.0 ? fminf(maxFontSizeMultiplier, fontSizeMultiplier) : fontSizeMultiplier;
235
243
  } else {
@@ -328,6 +336,7 @@ static NSString *capitalizeText(NSString *text)
328
336
  RCTTextAttributesCompareObjects(_fontStyle) &&
329
337
  RCTTextAttributesCompareObjects(_fontVariant) &&
330
338
  RCTTextAttributesCompareOthers(_allowFontScaling) &&
339
+ RCTTextAttributesCompareOthers(_dynamicTypeRamp) && // TODO(macOS GH#774)
331
340
  RCTTextAttributesCompareFloats(_letterSpacing) &&
332
341
  RCTTextAttributesCompareOthers(_fontSmoothing) && // TODO(OSS Candidate ISS#2710739)
333
342
  // Paragraph Styles
@@ -0,0 +1,40 @@
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
+ // TODO(macOS GH#774)
9
+
10
+ #import <Foundation/Foundation.h>
11
+
12
+ #import <React/RCTConvert.h>
13
+
14
+ typedef NS_ENUM(NSInteger, RCTDynamicTypeRamp) {
15
+ RCTDynamicTypeRampUndefined,
16
+ RCTDynamicTypeRampCaption2,
17
+ RCTDynamicTypeRampCaption1,
18
+ RCTDynamicTypeRampFootnote,
19
+ RCTDynamicTypeRampSubheadline,
20
+ RCTDynamicTypeRampCallout,
21
+ RCTDynamicTypeRampBody,
22
+ RCTDynamicTypeRampHeadline,
23
+ RCTDynamicTypeRampTitle3,
24
+ RCTDynamicTypeRampTitle2,
25
+ RCTDynamicTypeRampTitle1,
26
+ RCTDynamicTypeRampLargeTitle
27
+ };
28
+
29
+ @interface RCTConvert (DynamicTypeRamp)
30
+
31
+ + (RCTDynamicTypeRamp)RCTDynamicTypeRamp:(nullable id)json;
32
+
33
+ @end
34
+
35
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
36
+ /// Generates a `UIFontMetrics` instance representing a particular Dynamic Type ramp.
37
+ UIFontMetrics * _Nonnull RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp);
38
+ /// The "reference" size for a particular font scale ramp, equal to a text element's size under default text size settings.
39
+ CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp);
40
+ #endif // ]TODO(macOS GH#774)
@@ -0,0 +1,77 @@
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
+ // TODO(macOS GH#774)
9
+
10
+ #import <React/RCTDynamicTypeRamp.h>
11
+
12
+ @implementation RCTConvert (DynamicTypeRamp)
13
+
14
+ RCT_ENUM_CONVERTER(RCTDynamicTypeRamp, (@{
15
+ @"caption2": @(RCTDynamicTypeRampCaption2),
16
+ @"caption1": @(RCTDynamicTypeRampCaption1),
17
+ @"footnote": @(RCTDynamicTypeRampFootnote),
18
+ @"subheadline": @(RCTDynamicTypeRampSubheadline),
19
+ @"callout": @(RCTDynamicTypeRampCallout),
20
+ @"body": @(RCTDynamicTypeRampBody),
21
+ @"headline": @(RCTDynamicTypeRampHeadline),
22
+ @"title3": @(RCTDynamicTypeRampTitle3),
23
+ @"title2": @(RCTDynamicTypeRampTitle2),
24
+ @"title1": @(RCTDynamicTypeRampTitle1),
25
+ @"largeTitle": @(RCTDynamicTypeRampLargeTitle),
26
+ }), RCTDynamicTypeRampUndefined, integerValue)
27
+
28
+ @end
29
+
30
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
31
+ UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp) {
32
+ static NSDictionary<NSNumber *, UIFontTextStyle> *mapping;
33
+ static dispatch_once_t onceToken;
34
+ dispatch_once(&onceToken, ^{
35
+ mapping = @{
36
+ @(RCTDynamicTypeRampCaption2): UIFontTextStyleCaption2,
37
+ @(RCTDynamicTypeRampCaption1): UIFontTextStyleCaption1,
38
+ @(RCTDynamicTypeRampFootnote): UIFontTextStyleFootnote,
39
+ @(RCTDynamicTypeRampSubheadline): UIFontTextStyleSubheadline,
40
+ @(RCTDynamicTypeRampCallout): UIFontTextStyleCallout,
41
+ @(RCTDynamicTypeRampBody): UIFontTextStyleBody,
42
+ @(RCTDynamicTypeRampHeadline): UIFontTextStyleHeadline,
43
+ @(RCTDynamicTypeRampTitle3): UIFontTextStyleTitle3,
44
+ @(RCTDynamicTypeRampTitle2): UIFontTextStyleTitle2,
45
+ @(RCTDynamicTypeRampTitle1): UIFontTextStyleTitle1,
46
+ @(RCTDynamicTypeRampLargeTitle): UIFontTextStyleLargeTitle,
47
+ };
48
+ });
49
+
50
+ id textStyle = mapping[@(dynamicTypeRamp)] ?: UIFontTextStyleBody; // Default to body if we don't recognize the specified ramp
51
+ return [UIFontMetrics metricsForTextStyle:textStyle];
52
+ }
53
+
54
+ CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp) {
55
+ static NSDictionary<NSNumber *, NSNumber *> *mapping;
56
+ static dispatch_once_t onceToken;
57
+ dispatch_once(&onceToken, ^{
58
+ // Values taken from https://developer.apple.com/design/human-interface-guidelines/foundations/typography/
59
+ mapping = @{
60
+ @(RCTDynamicTypeRampCaption2): @11,
61
+ @(RCTDynamicTypeRampCaption1): @12,
62
+ @(RCTDynamicTypeRampFootnote): @13,
63
+ @(RCTDynamicTypeRampSubheadline): @15,
64
+ @(RCTDynamicTypeRampCallout): @16,
65
+ @(RCTDynamicTypeRampBody): @17,
66
+ @(RCTDynamicTypeRampHeadline): @17,
67
+ @(RCTDynamicTypeRampTitle3): @20,
68
+ @(RCTDynamicTypeRampTitle2): @22,
69
+ @(RCTDynamicTypeRampTitle1): @28,
70
+ @(RCTDynamicTypeRampLargeTitle): @34,
71
+ };
72
+ });
73
+
74
+ NSNumber *baseSize = mapping[@(dynamicTypeRamp)] ?: @17; // Default to body size if we don't recognize the specified ramp
75
+ return CGFLOAT_IS_DOUBLE ? [baseSize doubleValue] : [baseSize floatValue];
76
+ }
77
+ #endif // ]TODO(macOS GH#774)
@@ -71,7 +71,8 @@ const Text: React.AbstractComponent<
71
71
  setHighlighted(false);
72
72
  onPressOut?.(event);
73
73
  },
74
- onResponderTerminationRequest_DEPRECATED: onResponderTerminationRequest,
74
+ onResponderTerminationRequest_DEPRECATED:
75
+ onResponderTerminationRequest,
75
76
  onStartShouldSetResponder_DEPRECATED: onStartShouldSetResponder,
76
77
  }
77
78
  : null,
@@ -11,6 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
11
11
 
12
12
  @interface RCTMultilineTextInputView : RCTBaseTextInputView
13
13
 
14
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
15
+ - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes;
16
+ #endif // ]TODO(macOS GH#774)
14
17
  @end
15
18
 
16
19
  NS_ASSUME_NONNULL_END
@@ -99,6 +99,9 @@
99
99
  }
100
100
  }
101
101
 
102
+ - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes {
103
+ [_backedTextInputView setReadablePasteBoardTypes:readablePasteboardTypes];
104
+ }
102
105
  #endif // ]TODO(macOS GH#774)
103
106
 
104
107
  #pragma mark - UIScrollViewDelegate
@@ -106,7 +109,9 @@
106
109
  - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS ISS#3536887)
107
110
  {
108
111
  RCTDirectEventBlock onScroll = self.onScroll;
109
-
112
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
113
+ [_scrollView setHasVerticalScroller:YES];
114
+ #endif // ]TODO(macOS GH#774)
110
115
  if (onScroll) {
111
116
  CGPoint contentOffset = scrollView.contentOffset;
112
117
  CGSize contentSize = scrollView.contentSize;
@@ -7,6 +7,7 @@
7
7
 
8
8
  #import <React/RCTMultilineTextInputViewManager.h>
9
9
  #import <React/RCTMultilineTextInputView.h>
10
+ #import <React/RCTUITextView.h> // TODO(macOS GH#774)
10
11
 
11
12
  @implementation RCTMultilineTextInputViewManager
12
13
 
@@ -22,4 +23,14 @@ RCT_EXPORT_MODULE()
22
23
  RCT_REMAP_NOT_OSX_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.dataDetectorTypes, UIDataDetectorTypes) // TODO(macOS GH#774)
23
24
  RCT_REMAP_OSX_VIEW_PROPERTY(dataDetectorTypes, backedTextInputView.enabledTextCheckingTypes, NSTextCheckingTypes) // TODO(macOS GH#774)
24
25
 
26
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
27
+ RCT_CUSTOM_VIEW_PROPERTY(pastedTypes, NSArray<NSPasteboardType>*, RCTUITextView)
28
+ {
29
+ NSArray<NSPasteboardType> *types = json ? [RCTConvert NSPasteboardTypeArray:json] : nil;
30
+ if ([view respondsToSelector:@selector(setReadablePasteBoardTypes:)]) {
31
+ [view setReadablePasteBoardTypes: types];
32
+ }
33
+ }
34
+ #endif // ]TODO(macOS GH#774)
35
+
25
36
  @end
@@ -53,6 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
53
53
  @property (nonatomic, assign) NSTextAlignment textAlignment;
54
54
  @property (nonatomic, copy, nullable) NSAttributedString *attributedText;
55
55
  - (NSSize)sizeThatFits:(NSSize)size;
56
+ - (void)setReadablePasteBoardTypes:(NSArray<NSPasteboardType> *)readablePasteboardTypes;
56
57
  #endif // ]TODO(macOS GH#774)
57
58
 
58
59
  @end