From fa527aa4a1fc5c0fa259e4207dcdc90091878065 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 25 Apr 2024 15:11:04 -0300 Subject: [PATCH] Fix react-native-ui-lib patch --- package.json | 2 +- patches/react-native-ui-lib+7.2.1.patch | 146 +++++++++++++++++++----- yarn.lock | 2 +- 3 files changed, 119 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index c3ac47752..3e77c7296 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "@bugsnag/react-native": "^7.10.5", - "@codler/react-native-keyboard-aware-scroll-view": "^2.0.1", + "@codler/react-native-keyboard-aware-scroll-view": "2.0.1", "@gorhom/bottom-sheet": "^4.6.1", "@hookform/resolvers": "^2.9.10", "@notifee/react-native": "7.8.2", diff --git a/patches/react-native-ui-lib+7.2.1.patch b/patches/react-native-ui-lib+7.2.1.patch index 6d9ae8b13..b80b47d38 100644 --- a/patches/react-native-ui-lib+7.2.1.patch +++ b/patches/react-native-ui-lib+7.2.1.patch @@ -22,7 +22,7 @@ index b3864d0..e78322f 100644 -#import "RCTEventEmitter.h" +#import #endif - + @interface RCTCustomInputControllerTemp : RCTEventEmitter diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h index 4344724..2786051 100644 @@ -35,7 +35,7 @@ index 4344724..2786051 100644 -#import "RCTRootView.h" +#import #endif - + @interface RCTCustomKeyboardViewControllerTemp : UIInputViewController diff --git a/node_modules/react-native-ui-lib/src/commons/Constants.ts b/node_modules/react-native-ui-lib/src/commons/Constants.ts index c029d61..77f60f7 100644 @@ -67,7 +67,7 @@ index c1da169..8d3c3f5 100644 +export {default as withScrollReached, type WithScrollReachedProps} from './withScrollReached'; export {default as Constants} from './Constants'; export {default as Config} from './Config'; - + export { - ContainerModifiers, - AlignmentModifiers, @@ -96,7 +96,7 @@ index 48884c9..76b4b43 100644 import {ConnectionStatusBarProps, ConnectionStatusBarState, DEFAULT_PROPS} from './Types'; -export {ConnectionStatusBarProps}; +export {type ConnectionStatusBarProps}; - + /** * @description: Top bar to show a "no internet" connection status. Note: Run on real device for best results diff --git a/node_modules/react-native-ui-lib/src/components/dialog/index.tsx b/node_modules/react-native-ui-lib/src/components/dialog/index.tsx @@ -109,7 +109,7 @@ index 4b51b27..7939884 100644 import PanningProvider, {PanningDirections, PanningDirectionsEnum} from '../panningViews/panningProvider'; -export {PanningDirections as DialogDirections, PanningDirectionsEnum as DialogDirectionsEnum}; +export {type PanningDirections as DialogDirections, PanningDirectionsEnum as DialogDirectionsEnum}; - + // TODO: KNOWN ISSUES // 1. iOS pressing on the background while enter animation is happening will not call onDismiss @@ -278,6 +278,7 @@ function createStyles(props: DialogProps) { @@ -127,11 +127,11 @@ index e4f5ba7..4640a05 100644 @@ -409,7 +409,7 @@ class Drawer extends PureComponent { } } - + -export {DrawerProps, DrawerItemProps}; +export { type DrawerProps, type DrawerItemProps}; export default asBaseComponent(Drawer); - + const styles = StyleSheet.create({ diff --git a/node_modules/react-native-ui-lib/src/components/listItem/ListItemPart.tsx b/node_modules/react-native-ui-lib/src/components/listItem/ListItemPart.tsx index 5ca3490..18df0af 100644 @@ -140,11 +140,11 @@ index 5ca3490..18df0af 100644 @@ -23,7 +23,7 @@ class ListItemPart extends Component { } } - + -export {ListItemPartProps}; +export {type ListItemPartProps}; export default asBaseComponent(ListItemPart); - + function createStyles({left, right, middle, column}: ListItemPartProps) { diff --git a/node_modules/react-native-ui-lib/src/components/loaderScreen/index.tsx b/node_modules/react-native-ui-lib/src/components/loaderScreen/index.tsx index bcd8c18..d391ab5 100644 @@ -153,11 +153,11 @@ index bcd8c18..d391ab5 100644 @@ -39,7 +39,7 @@ class LoaderScreen extends Component { } } - + -export {LoaderScreenProps}; +export {type LoaderScreenProps}; export default asBaseComponent(LoaderScreen); - + const styles = StyleSheet.create({ diff --git a/node_modules/react-native-ui-lib/src/components/marquee/index.tsx b/node_modules/react-native-ui-lib/src/components/marquee/index.tsx index 9c9a7d8..a512576 100644 @@ -166,12 +166,12 @@ index 9c9a7d8..a512576 100644 @@ -101,7 +101,7 @@ function Marquee(props: MarqueeProps) { ); } - + -export {MarqueeProps, MarqueeDirections}; +export {type MarqueeProps, MarqueeDirections}; - + export default Marquee; - + diff --git a/node_modules/react-native-ui-lib/src/components/maskedInput/index.tsx b/node_modules/react-native-ui-lib/src/components/maskedInput/index.tsx index f00f2ab..c4b1737 100644 --- a/node_modules/react-native-ui-lib/src/components/maskedInput/index.tsx @@ -179,7 +179,7 @@ index f00f2ab..c4b1737 100644 @@ -13,5 +13,5 @@ function MaskedInputMigrator(props: any, refToForward: any) { } } - + -export {MaskedInputProps}; +export {type MaskedInputProps}; export default forwardRef(MaskedInputMigrator); @@ -188,9 +188,9 @@ index 7847d78..79063d5 100644 --- a/node_modules/react-native-ui-lib/src/components/modal/index.tsx +++ b/node_modules/react-native-ui-lib/src/components/modal/index.tsx @@ -17,7 +17,7 @@ import View from '../../components/view'; - + const BlurView = BlurViewPackage?.BlurView; - + -export {ModalTopBarProps}; +export {type ModalTopBarProps}; export interface ModalProps extends RNModalProps { @@ -210,7 +210,7 @@ index 542a16a..b23336e 100644 import {Colors, BorderRadiuses, Spacings} from '../../style'; @@ -16,7 +15,7 @@ import View from '../view'; import Segment, {SegmentedControlItemProps as SegmentProps} from './segment'; - + const BORDER_WIDTH = 1; -const TIMING_CONFIG: WithTimingConfig = { +const TIMING_CONFIG = { @@ -224,11 +224,11 @@ index 29bf95a..347a78e 100644 @@ -47,7 +47,7 @@ class StateScreen extends Component { } } - + -export {StateScreenProps}; +export {type StateScreenProps}; export default asBaseComponent(StateScreen); - + function createStyles(isRemoteImage: boolean) { diff --git a/node_modules/react-native-ui-lib/src/components/tabController/TabBarItem.tsx b/node_modules/react-native-ui-lib/src/components/tabController/TabBarItem.tsx index 7bb9245..16440be 100644 @@ -263,7 +263,7 @@ index 158406a..456f56c 100644 + type PointTypes as TimelinePointTypes, + type LineTypes as TimelineLineTypes }; - + const CONTENT_CONTAINER_PADDINGS = Spacings.s2; diff --git a/node_modules/react-native-ui-lib/src/components/wizard/index.tsx b/node_modules/react-native-ui-lib/src/components/wizard/index.tsx index 8afc8a8..c086fcb 100644 @@ -275,7 +275,7 @@ index 8afc8a8..c086fcb 100644 import {WizardProps, WizardStepProps, WizardStepStates, WizardStepConfig, WizardStepsConfig} from './types'; -export {WizardProps, WizardStepProps, WizardStepStates, WizardStepConfig, WizardStepsConfig}; +export {type WizardProps, type WizardStepProps, WizardStepStates, type WizardStepConfig, type WizardStepsConfig}; - + interface State { maxWidth: number; diff --git a/node_modules/react-native-ui-lib/src/incubator/Dialog/index.tsx b/node_modules/react-native-ui-lib/src/incubator/Dialog/index.tsx @@ -288,11 +288,11 @@ index e624b8f..12c9fe9 100644 import {DialogProps, DialogDirections, DialogDirectionsEnum, DialogHeaderProps} from './types'; -export {DialogProps, DialogDirections, DialogDirectionsEnum, DialogHeaderProps}; +export {type DialogProps, type DialogDirections, DialogDirectionsEnum, type DialogHeaderProps}; - + const DEFAULT_OVERLAY_BACKGROUND_COLOR = Colors.rgba(Colors.grey20, 0.65); const THRESHOLD_VELOCITY = 750; @@ -199,6 +199,7 @@ const Dialog = (props: DialogProps, ref: ForwardedRef) - + const renderDialog = () => ( + {/* @ts-ignore */} @@ -309,7 +309,7 @@ index a556bde..73c2369 100644 const DialogDirectionsEnum = PanningDirectionsEnum; -export {DialogDirections, DialogDirectionsEnum}; +export {type DialogDirections, DialogDirectionsEnum}; - + export interface DialogHeaderProps extends ViewProps { /** diff --git a/node_modules/react-native-ui-lib/src/incubator/TextField/index.tsx b/node_modules/react-native-ui-lib/src/incubator/TextField/index.tsx @@ -318,7 +318,7 @@ index 0ba2020..0965094 100644 +++ b/node_modules/react-native-ui-lib/src/incubator/TextField/index.tsx @@ -214,10 +214,10 @@ TextField.displayName = 'Incubator.TextField'; TextField.validationMessagePositions = ValidationMessagePosition; - + export { - TextFieldProps, - FieldContextType, @@ -336,7 +336,7 @@ index cb3d69d..790929c 100644 --- a/node_modules/react-native-ui-lib/src/incubator/TouchableOpacity.tsx +++ b/node_modules/react-native-ui-lib/src/incubator/TouchableOpacity.tsx @@ -148,13 +148,13 @@ function TouchableOpacity(props: Props) { - + return ( { const { directions = DEFAULT_DIRECTIONS, @@ -113,12 +114,15 @@ const usePanGesture = (props: PanGestureProps) => { }, [animateToOrigin]); - + const onGestureEvent = useAnimatedGestureHandler({ + // @ts-ignore onStart: (_event: PanGestureHandlerEventPayload, context: {initialTranslation: Frame}) => { @@ -433,3 +433,91 @@ index da8cb97..995207b 100644 export {default as Typography} from './typography'; export {default as BorderRadiuses} from './borderRadiuses'; export {default as Shadows} from './shadows'; +diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +index 97255d2..4e0fe05 100644 +--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m ++++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +@@ -364,6 +364,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N + - (void)ObservingInputAccessoryViewTempKeyboardWillDisappear:(ObservingInputAccessoryViewTemp *)ObservingInputAccessoryViewTemp + { + _bottomViewHeight = kBottomViewHeightTemp; ++ _ObservingInputAccessoryViewTemp.height = 0; + [self updateBottomViewFrame]; + } + +diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +index 1ca52e8..69ac77a 100644 +--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m ++++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +@@ -111,44 +111,57 @@ - (void)setHeight:(CGFloat)height + _height = height; + + [self invalidateIntrinsicContentSize]; ++ [_delegate ObservingInputAccessoryViewTempDidChangeFrame:self]; + } + + - (void)_keyboardWillShowNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateWillShow; ++ if (_keyboardState == KeyboardStateHidden) { ++ _keyboardState = KeyboardStateWillShow; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; + +- if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillAppear:keyboardDelta:)]) +- { +- [_delegate ObservingInputAccessoryViewTempKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight]; ++ if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillAppear:keyboardDelta:)]) ++ { ++ [_delegate ObservingInputAccessoryViewTempKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight]; ++ } + } + } + + - (void)_keyboardDidShowNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateShown; ++ if (_keyboardState == KeyboardStateWillShow) { ++ _keyboardState = KeyboardStateShown; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; ++ } + } + + - (void)_keyboardWillHideNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateWillHide; ++ if (_keyboardState == KeyboardStateShown) { ++ _keyboardState = KeyboardStateWillHide; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; + +- if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillDisappear:)]) +- { +- [_delegate ObservingInputAccessoryViewTempKeyboardWillDisappear:self]; ++ [_delegate ObservingInputAccessoryViewTempDidChangeFrame:self]; ++ ++ if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillDisappear:)]) ++ { ++ [_delegate ObservingInputAccessoryViewTempKeyboardWillDisappear:self]; ++ } + } + } + + - (void)_keyboardDidHideNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateHidden; ++ if (_keyboardState == KeyboardStateWillHide) { ++ _keyboardState = KeyboardStateHidden; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; ++ ++ [_delegate ObservingInputAccessoryViewTempDidChangeFrame:self]; ++ } + } + + - (void)_keyboardWillChangeFrameNotification:(NSNotification*)notification \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 876913c0c..aa4e4ef2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2316,7 +2316,7 @@ glob "^7.1.6" read-pkg-up "^7.0.1" -"@codler/react-native-keyboard-aware-scroll-view@^2.0.1": +"@codler/react-native-keyboard-aware-scroll-view@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@codler/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-2.0.1.tgz#4ca9b9431fc9a3dcbc9ea0e148e9fed4baf7c72d" integrity sha512-95O4QBJQiSTYCIHvaHVfIagqR7qv3XiolKwtb+B9ZgaMsIDvPu1gUQOs+X9nnOtnihjkMDP9hsaRSmtM3sBY+A==