Skip to content

Commit

Permalink
chore: sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Jan 7, 2025
1 parent ef3bcfe commit a59ad5f
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 242 deletions.
4 changes: 2 additions & 2 deletions packages/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"test": "jest"
},
"dependencies": {
"react": "18.3.1",
"@callstack/react-native-visionos": "1000.0.0"
"react": "19.0.0",
"@callstack/react-native-visionos": "0.77.0-main"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/out-of-tree-platforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dist"
],
"devDependencies": {
"metro-resolver": "^0.81.0-alpha.0"
"metro-resolver": "^0.81.0"
},
"engines": {
"node": ">=18"
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}


#if !TARGET_OS_VISION
- (void)loadReactNativeWindow:(NSDictionary *)launchOptions
{
UIView *rootView = [self.rootViewFactory viewWithModuleName:self.moduleName
Expand All @@ -62,6 +64,7 @@ - (void)loadReactNativeWindow:(NSDictionary *)launchOptions
_window.rootViewController = rootViewController;
[_window makeKeyAndVisible];
}
#endif

#pragma mark - UISceneDelegate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName
surfaceHostingProxyRootView.backgroundColor = [UIColor clearColor];
#else
surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor];
#endif
if (_configuration.customizeRootView != nil) {
_configuration.customizeRootView(surfaceHostingProxyRootView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ - (void)textDidChange

- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
{
#if TARGET_OS_IOS
// Initialize the initial values only once
if (_initialValueLeadingBarButtonGroups == nil) {
// Capture initial values of leading and trailing button groups
Expand All @@ -153,6 +154,7 @@ - (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
self.inputAssistantItem.leadingBarButtonGroups = _initialValueLeadingBarButtonGroups;
self.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
}
#endif
_disableKeyboardShortcuts = disableKeyboardShortcuts;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ - (void)setInputAccessoryViewButtonLabel:(NSString *)inputAccessoryViewButtonLab

- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
{
#if TARGET_OS_IOS
// Initialize the initial values only once
if (_initialValueLeadingBarButtonGroups == nil) {
// Capture initial values of leading and trailing button groups
Expand All @@ -415,6 +416,7 @@ - (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
self.backedTextInputView.inputAssistantItem.leadingBarButtonGroups = _initialValueLeadingBarButtonGroups;
self.backedTextInputView.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
}
#endif
}

#pragma mark - RCTBackedTextInputDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ - (void)setSecureTextEntry:(BOOL)secureTextEntry

- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
{
#if TARGET_OS_IOS
// Initialize the initial values only once
if (_initialValueLeadingBarButtonGroups == nil) {
// Capture initial values of leading and trailing button groups
Expand All @@ -136,6 +137,7 @@ - (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
self.inputAssistantItem.leadingBarButtonGroups = _initialValueLeadingBarButtonGroups;
self.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
}
#endif
_disableKeyboardShortcuts = disableKeyboardShortcuts;
}

Expand Down
1 change: 1 addition & 0 deletions packages/react-native/React/Base/RCTUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ BOOL RCTRunningInAppExtension(void)
}

UIScene *sceneToUse = foregroundActiveScene ? foregroundActiveScene : foregroundInactiveScene;
UIWindowScene *windowScene = (UIWindowScene *)sceneToUse;

#if TARGET_OS_VISION
// Ornaments are supported only on visionOS.
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/React/Views/ScrollView/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,13 @@ - (void)_keyboardWillChangeFrame:(NSNotification *)notification
// Text field active region is below visible area with keyboard - update diff to bring into view
contentDiff = endFrame.origin.y - focusEnd;
} else {
#if !TARGET_OS_VISION
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
if (inputAccessoryView) {
// Text input view is within the inputAccessoryView.
contentDiff = endFrame.origin.y - beginFrame.origin.y;
}
#endif
}
} else if (endFrame.origin.y <= beginFrame.origin.y) {
// Keyboard opened for other reason
Expand Down
Loading

0 comments on commit a59ad5f

Please sign in to comment.