react-native-macos 0.0.0-8119efe83 → 0.0.0-825d334e8

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 (34) hide show
  1. package/Libraries/Components/ScrollView/ScrollView.js +9 -37
  2. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  3. package/Libraries/Components/TextInput/TextInput.js +8 -0
  4. package/Libraries/Core/ReactNativeVersion.js +1 -1
  5. package/Libraries/Lists/FlatList.js +13 -0
  6. package/Libraries/Lists/VirtualizedList.js +82 -41
  7. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +10 -0
  8. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +16 -2
  9. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +8 -0
  10. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +8 -2
  11. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +3 -2
  12. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m +4 -0
  13. package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -0
  14. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +28 -1
  15. package/React/Base/RCTTouchHandler.m +11 -1
  16. package/React/Base/RCTUIKit.h +2 -0
  17. package/React/Base/RCTVersion.m +1 -1
  18. package/React/Base/macOS/RCTPlatformDisplayLink.m +3 -1
  19. package/React/Base/macOS/RCTUIKit.m +13 -0
  20. package/React/CoreModules/RCTDevLoadingView.mm +1 -1
  21. package/React/Modules/RCTUIManager.m +6 -0
  22. package/React/Views/RCTView.m +3 -0
  23. package/React/Views/ScrollView/RCTScrollView.m +36 -21
  24. package/React/Views/UIView+React.m +18 -10
  25. package/ReactAndroid/build.gradle +2 -1
  26. package/ReactAndroid/gradle.properties +2 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  28. package/ReactAndroid/src/main/third-party/android/androidx/BUCK +16 -4
  29. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  30. package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
  31. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +346 -1294
  32. package/package.json +5 -3
  33. package/template/Gemfile.lock +6 -6
  34. package/template/package.json +1 -1
@@ -354,6 +354,8 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
354
354
  return name;
355
355
  }
356
356
 
357
+ // Re-enable componentViewName_DO_NOT_USE_THIS_IS_BROKEN once macOS uses Fabric
358
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
357
359
  __block RCTPlatformView *view; // TODO(macOS GH#774)
358
360
  RCTUnsafeExecuteOnMainQueueSync(^{
359
361
  view = self->_viewRegistry[reactTag];
@@ -367,6 +369,7 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
367
369
  }
368
370
 
369
371
  #pragma clang diagnostic pop
372
+ #endif // ]TODO(macOS GH#774)
370
373
  return nil;
371
374
  }
372
375
 
@@ -1135,6 +1138,8 @@ RCT_EXPORT_METHOD(dispatchViewManagerCommand
1135
1138
  RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
1136
1139
  RCTComponentData *componentData = _componentDataByName[shadowView.viewName];
1137
1140
 
1141
+ // Re-enable componentViewName_DO_NOT_USE_THIS_IS_BROKEN once macOS uses Fabric
1142
+ #if !TARGET_OS_OSX // [TODO(macOS GH#774)
1138
1143
  // Achtung! Achtung!
1139
1144
  // This is a remarkably hacky and ugly workaround.
1140
1145
  // We need this only temporary for some testing. We need this hack until Fabric fully implements command-execution
@@ -1152,6 +1157,7 @@ RCT_EXPORT_METHOD(dispatchViewManagerCommand
1152
1157
  }
1153
1158
  }
1154
1159
  #pragma clang diagnostic pop
1160
+ #endif // ]TODO(macOS GH#774)
1155
1161
 
1156
1162
  Class managerClass = componentData.managerClass;
1157
1163
  RCTModuleData *moduleData = [_bridge moduleDataForName:RCTBridgeModuleNameForClass(managerClass)];
@@ -1596,6 +1596,9 @@ NSString* const downArrowPressKey = @"ArrowDown";
1596
1596
  BOOL tabKeyPressed = NO;
1597
1597
  BOOL escapeKeyPressed = NO;
1598
1598
  NSString *key = event.charactersIgnoringModifiers;
1599
+ if ([key length] == 0) {
1600
+ return nil;
1601
+ }
1599
1602
  unichar const code = [key characterAtIndex:0];
1600
1603
 
1601
1604
  // detect arrow key presses
@@ -1258,16 +1258,22 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1258
1258
 
1259
1259
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
1260
1260
 
1261
- - (NSString*)keyCommandFromKeyCode:(NSInteger)keyCode
1261
+ - (NSString*)keyCommandFromKeyCode:(NSInteger)keyCode modifierFlags:(NSEventModifierFlags)modifierFlags
1262
1262
  {
1263
1263
  switch (keyCode)
1264
1264
  {
1265
1265
  case 36:
1266
1266
  return @"ENTER";
1267
1267
 
1268
+ case 115:
1269
+ return @"HOME";
1270
+
1268
1271
  case 116:
1269
1272
  return @"PAGE_UP";
1270
1273
 
1274
+ case 119:
1275
+ return @"END";
1276
+
1271
1277
  case 121:
1272
1278
  return @"PAGE_DOWN";
1273
1279
 
@@ -1278,10 +1284,18 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1278
1284
  return @"RIGHT_ARROW";
1279
1285
 
1280
1286
  case 125:
1281
- return @"DOWN_ARROW";
1287
+ if (modifierFlags & NSEventModifierFlagOption) {
1288
+ return @"OPTION_DOWN";
1289
+ } else {
1290
+ return @"DOWN_ARROW";
1291
+ }
1282
1292
 
1283
1293
  case 126:
1284
- return @"UP_ARROW";
1294
+ if (modifierFlags & NSEventModifierFlagOption) {
1295
+ return @"OPTION_UP";
1296
+ } else {
1297
+ return @"UP_ARROW";
1298
+ }
1285
1299
  }
1286
1300
  return @"";
1287
1301
  }
@@ -1289,24 +1303,25 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1289
1303
  - (void)keyDown:(UIEvent*)theEvent
1290
1304
  {
1291
1305
  // Don't emit a scroll event if tab was pressed while the scrollview is first responder
1292
- if (self == [[self window] firstResponder] &&
1293
- theEvent.keyCode != 48) {
1294
- NSString *keyCommand = [self keyCommandFromKeyCode:theEvent.keyCode];
1295
- RCT_SEND_SCROLL_EVENT(onScrollKeyDown, (@{ @"key": keyCommand}));
1296
- } else {
1297
- [super keyDown:theEvent];
1298
-
1299
- // AX: if a tab key was pressed and the first responder is currently clipped by the scroll view,
1300
- // automatically scroll to make the view visible to make it navigable via keyboard.
1301
- if ([theEvent keyCode] == 48) { //tab key
1302
- id firstResponder = [[self window] firstResponder];
1303
- if ([firstResponder isKindOfClass:[NSView class]] &&
1304
- [firstResponder isDescendantOf:[_scrollView documentView]]) {
1305
- NSView *view = (NSView*)firstResponder;
1306
- NSRect visibleRect = ([view superview] == [_scrollView documentView]) ? NSInsetRect(view.frame, -1, -1) :
1307
- [view convertRect:view.frame toView:_scrollView.documentView];
1308
- [[_scrollView documentView] scrollRectToVisible:visibleRect];
1309
- }
1306
+ if (!(self == [[self window] firstResponder] && theEvent.keyCode == 48)) {
1307
+ NSString *keyCommand = [self keyCommandFromKeyCode:theEvent.keyCode modifierFlags:theEvent.modifierFlags];
1308
+ if (![keyCommand isEqual: @""]) {
1309
+ RCT_SEND_SCROLL_EVENT(onScrollKeyDown, (@{ @"key": keyCommand}));
1310
+ } else {
1311
+ [super keyDown:theEvent];
1312
+ }
1313
+ }
1314
+
1315
+ // AX: if a tab key was pressed and the first responder is currently clipped by the scroll view,
1316
+ // automatically scroll to make the view visible to make it navigable via keyboard.
1317
+ if ([theEvent keyCode] == 48) { //tab key
1318
+ id firstResponder = [[self window] firstResponder];
1319
+ if ([firstResponder isKindOfClass:[NSView class]] &&
1320
+ [firstResponder isDescendantOf:[_scrollView documentView]]) {
1321
+ NSView *view = (NSView*)firstResponder;
1322
+ NSRect visibleRect = ([view superview] == [_scrollView documentView]) ? NSInsetRect(view.frame, -1, -1) :
1323
+ [view convertRect:view.frame toView:_scrollView.documentView];
1324
+ [[_scrollView documentView] scrollRectToVisible:visibleRect];
1310
1325
  }
1311
1326
  }
1312
1327
  }
@@ -282,29 +282,37 @@
282
282
 
283
283
  - (void)reactFocus
284
284
  {
285
- if (![self becomeFirstResponder]) {
286
- self.reactIsFocusNeeded = YES;
287
- }
285
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
286
+ if (![[self window] makeFirstResponder:self]) {
287
+ #else
288
+ if (![self becomeFirstResponder]) {
289
+ #endif //// TODO(macOS GH#774)]
290
+ self.reactIsFocusNeeded = YES;
291
+ }
288
292
  }
289
293
 
290
294
  - (void)reactFocusIfNeeded
291
295
  {
292
- if (self.reactIsFocusNeeded) {
293
- if ([self becomeFirstResponder]) {
294
- self.reactIsFocusNeeded = NO;
295
- }
296
- }
296
+ if (self.reactIsFocusNeeded) {
297
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
298
+ if ([[self window] makeFirstResponder:self]) {
299
+ #else
300
+ if ([self becomeFirstResponder]) {
301
+ #endif // TODO(macOS GH#774)]
302
+ self.reactIsFocusNeeded = NO;
303
+ }
304
+ }
297
305
  }
298
306
 
299
307
  - (void)reactBlur
300
308
  {
301
- #if TARGET_OS_OSX // TODO(macOS GH#774)
309
+ #if TARGET_OS_OSX // [TODO(macOS GH#774)
302
310
  if (self == [[self window] firstResponder]) {
303
311
  [[self window] makeFirstResponder:[[self window] nextResponder]];
304
312
  }
305
313
  #else
306
314
  [self resignFirstResponder];
307
- #endif
315
+ #endif // TODO(macOS GH#774)]
308
316
  }
309
317
 
310
318
  #pragma mark - Layout
@@ -364,7 +364,8 @@ dependencies {
364
364
  api("com.facebook.infer.annotation:infer-annotation:0.18.0")
365
365
  api("com.facebook.yoga:proguard-annotations:1.19.0")
366
366
  api("javax.inject:javax.inject:1")
367
- api("androidx.appcompat:appcompat:1.0.2")
367
+ api("androidx.appcompat:appcompat:${APPCOMPAT_VERSION}")
368
+ api("androidx.appcompat:appcompat-resources:${APPCOMPAT_VERSION}")
368
369
  api("androidx.autofill:autofill:1.1.0")
369
370
  api("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
370
371
  api("com.facebook.fresco:fresco:${FRESCO_VERSION}")
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.0.0-8119efe83
1
+ VERSION_NAME=0.0.0-825d334e8
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -11,6 +11,7 @@ ROBOLECTRIC_VERSION=4.4
11
11
  JUNIT_VERSION=4.12
12
12
 
13
13
  ANDROIDX_TEST_VERSION=1.1.0
14
+ APPCOMPAT_VERSION=1.4.1
14
15
  FRESCO_VERSION=2.5.0
15
16
  OKHTTP_VERSION=4.9.2
16
17
  SO_LOADER_VERSION=0.10.3
@@ -22,5 +22,5 @@ public class ReactNativeVersion {
22
22
  "major", 0,
23
23
  "minor", 0,
24
24
  "patch", 0,
25
- "prerelease", "8119efe83");
25
+ "prerelease", "825d334e8");
26
26
  }
@@ -12,6 +12,7 @@ fb_native.android_library(
12
12
  exported_deps = [
13
13
  ":annotation",
14
14
  ":appcompat-binary",
15
+ ":appcompat-resources-binary",
15
16
  ":collection",
16
17
  ":core",
17
18
  ":cursoradapter",
@@ -365,6 +366,11 @@ fb_native.android_prebuilt_aar(
365
366
  aar = ":appcompat-binary-aar",
366
367
  )
367
368
 
369
+ fb_native.android_prebuilt_aar(
370
+ name = "appcompat-resources-binary",
371
+ aar = ":appcompat-resources-binary-aar",
372
+ )
373
+
368
374
  fb_native.android_prebuilt_aar(
369
375
  name = "asynclayoutinflater-binary",
370
376
  aar = ":asynclayoutinflater-binary-aar",
@@ -534,8 +540,14 @@ fb_native.remote_file(
534
540
 
535
541
  fb_native.remote_file(
536
542
  name = "appcompat-binary-aar",
537
- sha1 = "002533a36c928bb27a3cc6843a25f83754b3c3ae",
538
- url = "mvn:androidx.appcompat:appcompat:aar:1.0.2",
543
+ sha1 = "d384d125d196ed4997b418d7ba6fc18a4680ed22",
544
+ url = "mvn:androidx.appcompat:appcompat:aar:1.4.1",
545
+ )
546
+
547
+ fb_native.remote_file(
548
+ name = "appcompat-resources-binary-aar",
549
+ sha1 = "527d93d44bb18bc7dcf5213df8d4d069f0ceff61",
550
+ url = "mvn:androidx.appcompat:appcompat-resources:aar:1.4.1",
539
551
  )
540
552
 
541
553
  fb_native.remote_file(
@@ -558,8 +570,8 @@ fb_native.remote_file(
558
570
 
559
571
  fb_native.remote_file(
560
572
  name = "core-binary-aar",
561
- sha1 = "263deba7f9c24bd0cefb93c0aaaf402cc50828ee",
562
- url = "mvn:androidx.core:core:aar:1.0.1",
573
+ sha1 = "b26edc58f29ca0671e60828a68582760f880acdd",
574
+ url = "mvn:androidx.core:core:aar:1.7.0",
563
575
  )
564
576
 
565
577
  fb_native.remote_file(
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 0;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "8119efe83";
25
+ std::string_view Prerelease = "825d334e8";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -28,7 +28,7 @@
28
28
  "nwmatcher": "1.4.4",
29
29
  "randomatic": "3.0.0",
30
30
  "sshpk": "1.16.1",
31
- "webpack": "^4.41.0"
31
+ "webpack": "^5.73.0"
32
32
  },
33
33
  "resolutions": {
34
34
  "set-value": "^4.1.0"