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.
- package/Libraries/Components/ScrollView/ScrollView.js +9 -37
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.js +8 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Lists/FlatList.js +13 -0
- package/Libraries/Lists/VirtualizedList.js +82 -41
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +10 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +16 -2
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +8 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +8 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +3 -2
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m +4 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +28 -1
- package/React/Base/RCTTouchHandler.m +11 -1
- package/React/Base/RCTUIKit.h +2 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +3 -1
- package/React/Base/macOS/RCTUIKit.m +13 -0
- package/React/CoreModules/RCTDevLoadingView.mm +1 -1
- package/React/Modules/RCTUIManager.m +6 -0
- package/React/Views/RCTView.m +3 -0
- package/React/Views/ScrollView/RCTScrollView.m +36 -21
- package/React/Views/UIView+React.m +18 -10
- package/ReactAndroid/build.gradle +2 -1
- package/ReactAndroid/gradle.properties +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +16 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +346 -1294
- package/package.json +5 -3
- package/template/Gemfile.lock +6 -6
- 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)];
|
package/React/Views/RCTView.m
CHANGED
|
@@ -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
|
-
|
|
1287
|
+
if (modifierFlags & NSEventModifierFlagOption) {
|
|
1288
|
+
return @"OPTION_DOWN";
|
|
1289
|
+
} else {
|
|
1290
|
+
return @"DOWN_ARROW";
|
|
1291
|
+
}
|
|
1282
1292
|
|
|
1283
1293
|
case 126:
|
|
1284
|
-
|
|
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
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
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
|
-
|
|
286
|
-
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
|
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-
|
|
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
|
|
@@ -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 = "
|
|
538
|
-
url = "mvn:androidx.appcompat:appcompat:aar:1.
|
|
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 = "
|
|
562
|
-
url = "mvn:androidx.core:core:aar:1.0
|
|
573
|
+
sha1 = "b26edc58f29ca0671e60828a68582760f880acdd",
|
|
574
|
+
url = "mvn:androidx.core:core:aar:1.7.0",
|
|
563
575
|
)
|
|
564
576
|
|
|
565
577
|
fb_native.remote_file(
|