react-native-navigation 7.23.1 → 7.24.0
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/.buildkite/pipeline.yml +51 -11
- package/.nvmrc +1 -0
- package/Mock.d.ts +1 -0
- package/Mock.js +4 -0
- package/Mock.ts +1 -1
- package/README.md +0 -1
- package/jest.config.js +40 -0
- package/lib/{src/Mock → Mock}/Application.tsx +0 -0
- package/lib/{src/Mock → Mock}/ComponentProps.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/BottomTabs.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/ComponentScreen.tsx +13 -2
- package/lib/{src/Mock → Mock}/Components/LayoutComponent.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/Modals.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/NavigationButton.tsx +1 -1
- package/lib/{src/Mock → Mock}/Components/Overlays.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/Stack.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/TopBar.tsx +2 -2
- package/lib/{src/Mock → Mock}/Layouts/BottomTabsNode.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/ComponentNode.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/LayoutNodeFactory.ts +0 -0
- package/lib/{src/Mock → Mock}/Layouts/Node.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/ParentNode.ts +2 -2
- package/lib/{src/Mock → Mock}/Layouts/StackNode.ts +0 -0
- package/lib/{src/Mock → Mock}/Stores/EventsStore.ts +10 -2
- package/lib/{src/Mock → Mock}/Stores/LayoutStore.ts +3 -2
- package/lib/{src/Mock → Mock}/connect.ts +0 -0
- package/lib/Mock/constants.d.ts +2 -0
- package/lib/Mock/constants.js +5 -0
- package/lib/{src/Mock → Mock}/constants.ts +0 -0
- package/lib/Mock/index.d.ts +3 -0
- package/lib/Mock/index.js +14 -0
- package/lib/{src/Mock → Mock}/index.ts +0 -0
- package/lib/{src/Mock → Mock}/mocks/AppRegistryService.ts +0 -0
- package/lib/{src/Mock → Mock}/mocks/NativeCommandsSender.tsx +1 -1
- package/lib/{src/Mock → Mock}/mocks/NativeEventsReceiver.ts +7 -4
- package/lib/android/app/build.gradle +23 -21
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/FontOptions.kt +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/HardwareBackButtonOptions.kt +35 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +32 -17
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/Options.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/parsers/TypefaceLoader.kt +16 -10
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +5 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalFrameLayout.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalViewManager.kt +11 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +168 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +5 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +42 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java +12 -16
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +19 -11
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenter.java +6 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManager.kt +8 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +15 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +127 -138
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +183 -22
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonController.kt +25 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +9 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonSpan.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java +52 -71
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/component/ComponentLayout.java +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageMatrixAnimator.kt +2 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBar.java +1 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/ButtonBar.kt +7 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleAndButtonsContainer.kt +0 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleSubTitleLayout.kt +0 -7
- package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +2 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java +7 -6
- package/lib/android/app/src/test/java/com/reactnativenavigation/TestActivity.java +5 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/ImageLoaderMock.kt +5 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/Mocks.kt +3 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/TypefaceLoaderMock.kt +5 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/options/TransitionAnimationOptionsTest.kt +2 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/presentation/PresenterTest.java +25 -10
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/LayoutFactoryTest.java +25 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/MotionEventTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/{TitleAndButtonsMeasurer.kt → TitleAndButtonsMeasurerTest.kt} +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiThreadTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiUtilsTest.java +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.kt +572 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenterTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java +2 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewControllerTest.java +5 -5
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/fakes/FakeParentController.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalAnimatorTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenterTest.java +7 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java +17 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/RootPresenterTest.kt +5 -5
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManagerTest.java +1 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/parent/ParentControllerTest.java +4 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java +6 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt +13 -8
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt +58 -51
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarControllerTest.kt +219 -41
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerTest.java +4 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/TitleAndButtonsContainerTest.kt +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/animations/BaseViewAnimatorTest.kt +4 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainerTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsTest.kt +4 -4
- package/lib/dist/Mock/Application.js +2 -2
- package/lib/dist/Mock/Components/BottomTabs.js +2 -2
- package/lib/dist/Mock/Components/ComponentScreen.js +15 -5
- package/lib/dist/Mock/Components/LayoutComponent.js +3 -2
- package/lib/dist/Mock/Components/Modals.js +2 -2
- package/lib/dist/Mock/Components/NavigationButton.d.ts +1 -1
- package/lib/dist/Mock/Components/NavigationButton.js +8 -10
- package/lib/dist/Mock/Components/Overlays.js +2 -2
- package/lib/dist/Mock/Components/Stack.js +2 -2
- package/lib/dist/Mock/Components/TopBar.d.ts +2 -2
- package/lib/dist/Mock/Components/TopBar.js +7 -6
- package/lib/dist/Mock/Layouts/BottomTabsNode.d.ts +1 -1
- package/lib/dist/Mock/Layouts/BottomTabsNode.js +3 -3
- package/lib/dist/Mock/Layouts/ComponentNode.d.ts +1 -1
- package/lib/dist/Mock/Layouts/ComponentNode.js +4 -4
- package/lib/dist/Mock/Layouts/LayoutNodeFactory.js +3 -3
- package/lib/dist/Mock/Layouts/Node.d.ts +1 -1
- package/lib/dist/Mock/Layouts/Node.js +5 -0
- package/lib/dist/Mock/Layouts/ParentNode.d.ts +2 -2
- package/lib/dist/Mock/Layouts/ParentNode.js +4 -3
- package/lib/dist/Mock/Layouts/StackNode.js +1 -1
- package/lib/dist/Mock/Stores/EventsStore.d.ts +5 -2
- package/lib/dist/Mock/Stores/EventsStore.js +7 -0
- package/lib/dist/Mock/Stores/LayoutStore.js +6 -3
- package/lib/dist/Mock/connect.js +1 -1
- package/lib/dist/Mock/index.js +1 -1
- package/lib/dist/Mock/mocks/NativeCommandsSender.d.ts +1 -1
- package/lib/dist/Mock/mocks/NativeCommandsSender.js +2 -2
- package/lib/dist/Mock/mocks/NativeEventsReceiver.d.ts +3 -3
- package/lib/dist/Mock/mocks/NativeEventsReceiver.js +6 -3
- package/lib/dist/{Navigation.d.ts → src/Navigation.d.ts} +0 -0
- package/lib/dist/{Navigation.js → src/Navigation.js} +19 -3
- package/lib/dist/{NavigationDelegate.d.ts → src/NavigationDelegate.d.ts} +0 -0
- package/lib/dist/{NavigationDelegate.js → src/NavigationDelegate.js} +1 -0
- package/lib/dist/{adapters → src/adapters}/AppRegistryService.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/AppRegistryService.js +0 -0
- package/lib/dist/{adapters → src/adapters}/AssetResolver.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/AssetResolver.js +0 -0
- package/lib/dist/src/adapters/ColorService.d.ts +3 -0
- package/lib/dist/{adapters → src/adapters}/ColorService.js +1 -1
- package/lib/dist/{adapters → src/adapters}/Constants.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/Constants.js +10 -6
- package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.js +1 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.js +1 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.js +0 -0
- package/lib/dist/{adapters → src/adapters}/TouchablePreview.d.ts +0 -0
- package/lib/dist/src/adapters/TouchablePreview.js +89 -0
- package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.js +2 -2
- package/lib/dist/{commands → src/commands}/Commands.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/Commands.js +24 -10
- package/lib/dist/{commands → src/commands}/Deprecations.d.ts +0 -0
- package/lib/dist/src/commands/Deprecations.js +80 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.js +4 -2
- package/lib/dist/{commands → src/commands}/LayoutTreeParser.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeParser.js +1 -0
- package/lib/dist/{commands → src/commands}/LayoutType.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutType.js +0 -0
- package/lib/dist/{commands → src/commands}/OptionsCrawler.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/OptionsCrawler.js +6 -4
- package/lib/dist/{commands → src/commands}/OptionsProcessor.d.ts +1 -1
- package/lib/dist/{commands → src/commands}/OptionsProcessor.js +50 -42
- package/lib/dist/{components → src/components}/ComponentRegistry.d.ts +0 -0
- package/lib/dist/{components → src/components}/ComponentRegistry.js +4 -0
- package/lib/dist/{components → src/components}/ComponentWrapper.d.ts +0 -0
- package/lib/dist/{components → src/components}/ComponentWrapper.js +17 -17
- package/lib/dist/{components → src/components}/Modal.d.ts +0 -0
- package/lib/dist/{components → src/components}/Modal.js +8 -8
- package/lib/dist/{components → src/components}/Store.d.ts +2 -0
- package/lib/dist/{components → src/components}/Store.js +13 -6
- package/lib/dist/{events → src/events}/CommandsObserver.d.ts +0 -0
- package/lib/dist/{events → src/events}/CommandsObserver.js +2 -1
- package/lib/dist/{events → src/events}/ComponentEventsObserver.d.ts +4 -2
- package/lib/dist/{events → src/events}/ComponentEventsObserver.js +16 -14
- package/lib/dist/{events → src/events}/EventsRegistry.d.ts +2 -2
- package/lib/dist/{events → src/events}/EventsRegistry.js +3 -0
- package/lib/dist/{index.d.ts → src/index.d.ts} +0 -0
- package/lib/dist/src/index.js +22 -0
- package/lib/dist/{interfaces → src/interfaces}/CommandName.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/CommandName.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/EventSubscription.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/EventSubscription.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Events.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Events.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Layout.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Layout.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.js +8 -1
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Options.d.ts +9 -0
- package/lib/dist/{interfaces → src/interfaces}/Options.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Processors.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Processors.js +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessor.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessor.js +1 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.js +1 -3
- package/lib/dist/{processors → src/processors}/OptionProcessorsStore.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/OptionProcessorsStore.js +1 -3
- package/lib/dist/{types.d.ts → src/types.d.ts} +0 -0
- package/lib/dist/{types.js → src/types.js} +0 -0
- package/lib/ios/AnimationObserver.h +17 -0
- package/lib/ios/AnimationObserver.m +41 -0
- package/lib/ios/BottomTabPresenter.h +0 -3
- package/lib/ios/BottomTabPresenter.m +0 -8
- package/lib/ios/RNNAssert.h +2 -2
- package/lib/ios/RNNBasePresenter.h +0 -4
- package/lib/ios/RNNBasePresenter.m +0 -12
- package/lib/ios/RNNBottomTabOptions.m +2 -1
- package/lib/ios/RNNBottomTabsController.m +8 -8
- package/lib/ios/RNNBridgeManager.mm +0 -1
- package/lib/ios/RNNButtonBuilder.m +2 -0
- package/lib/ios/RNNButtonOptions.h +1 -0
- package/lib/ios/RNNButtonOptions.m +4 -0
- package/lib/ios/RNNCommandsHandler.m +15 -8
- package/lib/ios/RNNComponentPresenter.m +0 -4
- package/lib/ios/RNNComponentViewController.m +2 -4
- package/lib/ios/RNNDotIndicatorPresenter.m +2 -1
- package/lib/ios/RNNExternalViewController.m +2 -4
- package/lib/ios/RNNModalManager.h +2 -1
- package/lib/ios/RNNModalManager.m +12 -21
- package/lib/ios/RNNSegmentedControl.h +1 -1
- package/lib/ios/RNNSideMenuChildVC.m +0 -4
- package/lib/ios/RNNSideMenuController.m +0 -4
- package/lib/ios/RNNSplitViewController.m +0 -4
- package/lib/ios/RNNStackController.m +0 -4
- package/lib/ios/RNNStackPresenter.m +3 -0
- package/lib/ios/RNNSwizzles.m +20 -0
- package/lib/ios/RNNTabBarItemCreator.m +3 -2
- package/lib/ios/RNNUIBarButtonItem.h +2 -0
- package/lib/ios/RNNUIBarButtonItem.m +17 -0
- package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +8 -0
- package/lib/ios/TopBarPresenter.m +8 -4
- package/lib/ios/UIViewController+RNNOptions.m +1 -1
- package/lib/src/commands/Commands.ts +6 -1
- package/lib/src/commands/LayoutTreeCrawler.ts +2 -2
- package/lib/src/commands/OptionsCrawler.ts +2 -1
- package/lib/src/commands/OptionsProcessor.ts +15 -13
- package/lib/src/components/Store.ts +9 -0
- package/lib/src/events/ComponentEventsObserver.ts +5 -1
- package/lib/src/events/EventsRegistry.ts +2 -1
- package/lib/src/interfaces/Options.ts +10 -0
- package/package.json +19 -60
- package/tsconfig.mocks.json +7 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.java +0 -41
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.java +0 -511
- package/lib/dist/adapters/ColorService.d.ts +0 -3
- package/lib/dist/adapters/TouchablePreview.js +0 -91
- package/lib/dist/commands/Deprecations.js +0 -82
- package/lib/dist/index.js +0 -22
|
@@ -41,10 +41,6 @@
|
|
|
41
41
|
[_buttonsPresenter componentDidDisappear];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
|
|
45
|
-
[super applyOptionsOnWillMoveToParentViewController:options];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
44
|
- (void)applyOptions:(RNNNavigationOptions *)options {
|
|
49
45
|
[super applyOptions:options];
|
|
50
46
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import "RNNComponentViewController.h"
|
|
2
|
+
#import "AnimationObserver.h"
|
|
2
3
|
|
|
3
4
|
@implementation RNNComponentViewController {
|
|
4
5
|
NSArray *_reactViewConstraints;
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
|
|
37
38
|
- (void)viewDidAppear:(BOOL)animated {
|
|
38
39
|
[super viewDidAppear:animated];
|
|
40
|
+
[[AnimationObserver sharedObserver] endAnimation];
|
|
39
41
|
[self.reactView componentDidAppear];
|
|
40
42
|
[self componentDidAppear];
|
|
41
43
|
}
|
|
@@ -224,10 +226,6 @@
|
|
|
224
226
|
|
|
225
227
|
#pragma mark - UIViewController overrides
|
|
226
228
|
|
|
227
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
228
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
229
|
-
}
|
|
230
|
-
|
|
231
229
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
232
230
|
return [self.presenter getStatusBarStyle];
|
|
233
231
|
}
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
return NO;
|
|
93
93
|
UIView *currentIndicator = [self getCurrentIndicator:child];
|
|
94
94
|
|
|
95
|
-
return
|
|
95
|
+
return
|
|
96
|
+
[[currentIndicator backgroundColor] isEqual:[options.color withDefault:[UIColor redColor]]];
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
- (UIView *)getCurrentIndicator:(UIViewController *)child {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import "RNNExternalViewController.h"
|
|
2
|
+
#import "AnimationObserver.h"
|
|
2
3
|
|
|
3
4
|
@implementation RNNExternalViewController {
|
|
4
5
|
UIViewController *_boundViewController;
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
|
|
50
51
|
- (void)viewDidAppear:(BOOL)animated {
|
|
51
52
|
[super viewDidAppear:animated];
|
|
53
|
+
[[AnimationObserver sharedObserver] endAnimation];
|
|
52
54
|
[self.eventEmitter sendComponentDidAppear:self.layoutInfo.componentId
|
|
53
55
|
componentName:self.layoutInfo.name
|
|
54
56
|
componentType:ComponentTypeScreen];
|
|
@@ -63,10 +65,6 @@
|
|
|
63
65
|
|
|
64
66
|
#pragma mark - UIViewController overrides
|
|
65
67
|
|
|
66
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
67
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
68
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
71
69
|
return [self.presenter getStatusBarStyle];
|
|
72
70
|
}
|
|
@@ -22,6 +22,7 @@ typedef void (^RNNTransitionRejectionBlock)(NSString *_Nonnull code, NSString *_
|
|
|
22
22
|
animated:(BOOL)animated
|
|
23
23
|
completion:(RNNTransitionCompletionBlock _Nullable)completion;
|
|
24
24
|
- (void)dismissAllModalsAnimated:(BOOL)animated completion:(void (^__nullable)(void))completion;
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
- (void)reset;
|
|
26
27
|
|
|
27
28
|
@end
|
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
modalHostViewManager.presentationBlock =
|
|
37
37
|
^(UIViewController *reactViewController, UIViewController *viewController, BOOL animated,
|
|
38
38
|
dispatch_block_t completionBlock) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
completionBlock
|
|
44
|
-
|
|
39
|
+
if (reactViewController.presentedViewController != viewController) {
|
|
40
|
+
[self showModal:viewController
|
|
41
|
+
animated:animated
|
|
42
|
+
completion:^(NSString *_Nonnull componentId) {
|
|
43
|
+
if (completionBlock)
|
|
44
|
+
completionBlock();
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
modalHostViewManager.dismissalBlock =
|
|
@@ -128,19 +130,9 @@
|
|
|
128
130
|
completion();
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
- (void)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[self dismissAllModalsAnimated:NO
|
|
135
|
-
completion:^{
|
|
136
|
-
dispatch_semaphore_signal(sem);
|
|
137
|
-
}];
|
|
138
|
-
|
|
139
|
-
while (dispatch_semaphore_wait(sem, DISPATCH_TIME_NOW)) {
|
|
140
|
-
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
|
|
141
|
-
beforeDate:[NSDate dateWithTimeIntervalSinceNow:0]];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
133
|
+
- (void)reset {
|
|
134
|
+
[_presentedModals removeAllObjects];
|
|
135
|
+
[_pendingModalIdsToDismiss removeAllObjects];
|
|
144
136
|
}
|
|
145
137
|
|
|
146
138
|
#pragma mark - private
|
|
@@ -170,8 +162,7 @@
|
|
|
170
162
|
_dismissModalTransitionDelegate;
|
|
171
163
|
}
|
|
172
164
|
|
|
173
|
-
if ((modalToDismiss == topPresentedVC ||
|
|
174
|
-
[[topPresentedVC childViewControllers] containsObject:modalToDismiss])) {
|
|
165
|
+
if ((modalToDismiss == topPresentedVC || [topPresentedVC findViewController:modalToDismiss])) {
|
|
175
166
|
[self dismissSearchController:modalToDismiss];
|
|
176
167
|
[modalToDismiss
|
|
177
168
|
dismissViewControllerAnimated:animated
|
|
@@ -64,10 +64,6 @@
|
|
|
64
64
|
|
|
65
65
|
#pragma mark - UIViewController overrides
|
|
66
66
|
|
|
67
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
68
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
67
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
72
68
|
return [self.presenter getStatusBarStyle];
|
|
73
69
|
}
|
|
@@ -170,10 +170,6 @@
|
|
|
170
170
|
|
|
171
171
|
#pragma mark - UIViewController overrides
|
|
172
172
|
|
|
173
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
174
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
173
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
178
174
|
return [self.presenter getStatusBarStyle];
|
|
179
175
|
}
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
#pragma mark - UIViewController overrides
|
|
17
17
|
|
|
18
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
19
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
23
19
|
return [self.presenter getStatusBarStyle];
|
|
24
20
|
}
|
|
@@ -73,10 +73,6 @@
|
|
|
73
73
|
|
|
74
74
|
#pragma mark - UIViewController overrides
|
|
75
75
|
|
|
76
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
77
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
76
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
81
77
|
return [self.presenter getStatusBarStyle];
|
|
82
78
|
}
|
|
@@ -82,6 +82,9 @@
|
|
|
82
82
|
setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds withDefault:NO]];
|
|
83
83
|
|
|
84
84
|
[stack.view setBackgroundColor:[withDefault.layout.backgroundColor withDefault:nil]];
|
|
85
|
+
if (options.topBar.background.component.name.hasValue) {
|
|
86
|
+
[self setCustomNavigationComponentBackground:options perform:nil];
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
|
package/lib/ios/RNNSwizzles.m
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
#import "RNNSwizzles.h"
|
|
10
|
+
#import "AnimationObserver.h"
|
|
10
11
|
@import ObjectiveC;
|
|
11
12
|
@import UIKit;
|
|
12
13
|
|
|
13
14
|
static id (*__SWZ_initWithEventDispatcher_orig)(id self, SEL _cmd, id eventDispatcher);
|
|
14
15
|
static void (*__SWZ_setFrame_orig)(id self, SEL _cmd, CGRect frame);
|
|
16
|
+
static void (*__SWZ_didMoveToWindow_orig)(id self, SEL _cmd);
|
|
15
17
|
|
|
16
18
|
static void __RNN_setFrame_orig(UIScrollView *self, SEL _cmd, CGRect frame) {
|
|
17
19
|
CGPoint originalOffset = self.contentOffset;
|
|
@@ -37,6 +39,16 @@ static void __RNN_setFrame_orig(UIScrollView *self, SEL _cmd, CGRect frame) {
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
static void __RNN_didMoveToWindow(UIView *self, SEL _cmd) {
|
|
43
|
+
if (![[AnimationObserver sharedObserver] isAnimating] || !self.window) {
|
|
44
|
+
__SWZ_didMoveToWindow_orig(self, _cmd);
|
|
45
|
+
} else {
|
|
46
|
+
[[AnimationObserver sharedObserver] registerAnimationEndedBlock:^{
|
|
47
|
+
__SWZ_didMoveToWindow_orig(self, _cmd);
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
40
52
|
@implementation RNNSwizzles
|
|
41
53
|
|
|
42
54
|
- (id)__swz_initWithEventDispatcher:(id)eventDispatcher {
|
|
@@ -72,6 +84,14 @@ static void __RNN_setFrame_orig(UIScrollView *self, SEL _cmd, CGRect frame) {
|
|
|
72
84
|
m1 = class_getInstanceMethod(cls, @selector(setFrame:));
|
|
73
85
|
__SWZ_setFrame_orig = (void *)method_getImplementation(m1);
|
|
74
86
|
method_setImplementation(m1, (IMP)__RNN_setFrame_orig);
|
|
87
|
+
|
|
88
|
+
cls = NSClassFromString(@"RCTBaseTextInputView");
|
|
89
|
+
if (cls == NULL) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
Method m4 = class_getInstanceMethod(cls, NSSelectorFromString(@"didMoveToWindow"));
|
|
93
|
+
__SWZ_didMoveToWindow_orig = (void *)method_getImplementation(m4);
|
|
94
|
+
method_setImplementation(m4, (IMP)__RNN_didMoveToWindow);
|
|
75
95
|
}
|
|
76
96
|
|
|
77
97
|
@end
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
if (@available(iOS 13.0, *)) {
|
|
20
20
|
if (bottomTabOptions.sfSymbol.hasValue) {
|
|
21
|
-
icon = [UIImage systemImageNamed:
|
|
21
|
+
icon = [UIImage systemImageNamed:[bottomTabOptions.sfSymbol withDefault:nil]];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (bottomTabOptions.sfSelectedSymbol.hasValue) {
|
|
25
|
-
selectedIcon =
|
|
25
|
+
selectedIcon =
|
|
26
|
+
[UIImage systemImageNamed:[bottomTabOptions.sfSelectedSymbol withDefault:nil]];
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -14,6 +14,8 @@ typedef void (^RNNButtonPressCallback)(NSString *buttonId);
|
|
|
14
14
|
- (instancetype)initCustomIcon:(RNNButtonOptions *)buttonOptions
|
|
15
15
|
iconCreator:(RNNIconCreator *)iconCreator
|
|
16
16
|
onPress:(RNNButtonPressCallback)onPress;
|
|
17
|
+
- (instancetype)initWithSFSymbol:(RNNButtonOptions *)buttonOptions
|
|
18
|
+
onPress:(RNNButtonPressCallback)onPress;
|
|
17
19
|
- (instancetype)initWithIcon:(RNNButtonOptions *)buttonOptions
|
|
18
20
|
onPress:(RNNButtonPressCallback)onPress;
|
|
19
21
|
- (instancetype)initWithTitle:(RNNButtonOptions *)buttonOptions
|
|
@@ -20,6 +20,23 @@
|
|
|
20
20
|
return self;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
- (instancetype)initWithSFSymbol:(RNNButtonOptions *)buttonOptions
|
|
24
|
+
onPress:(RNNButtonPressCallback)onPress {
|
|
25
|
+
UIImage *iconImage = [UIImage alloc];
|
|
26
|
+
|
|
27
|
+
if (@available(iOS 13.0, *)) {
|
|
28
|
+
iconImage = [UIImage systemImageNamed:[buttonOptions.sfSymbol withDefault:nil]];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
self = [super initWithImage:iconImage
|
|
32
|
+
style:UIBarButtonItemStylePlain
|
|
33
|
+
target:self
|
|
34
|
+
action:@selector(onButtonPressed:)];
|
|
35
|
+
[self applyOptions:buttonOptions];
|
|
36
|
+
self.onPress = onPress;
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
|
|
23
40
|
- (instancetype)initWithIcon:(RNNButtonOptions *)buttonOptions
|
|
24
41
|
onPress:(RNNButtonPressCallback)onPress {
|
|
25
42
|
UIImage *iconImage = buttonOptions.icon.get;
|
|
@@ -355,6 +355,8 @@
|
|
|
355
355
|
50D3A37723BB5CD900717F95 /* OptionsArrayParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D3A37523BB5CD900717F95 /* OptionsArrayParser.m */; };
|
|
356
356
|
50D4656D23CE2553005A84B2 /* Transition.h in Headers */ = {isa = PBXBuildFile; fileRef = 50D4656B23CE2553005A84B2 /* Transition.h */; };
|
|
357
357
|
50D4656E23CE2553005A84B2 /* Transition.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D4656C23CE2553005A84B2 /* Transition.m */; };
|
|
358
|
+
50DD9154274FC6E200B4C917 /* AnimationObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 50DD9152274FC6E200B4C917 /* AnimationObserver.h */; };
|
|
359
|
+
50DD9155274FC6E200B4C917 /* AnimationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 50DD9153274FC6E200B4C917 /* AnimationObserver.m */; };
|
|
358
360
|
50DE2E45238EA14E005CD5F4 /* NSArray+utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */; };
|
|
359
361
|
50DE2E46238EA14E005CD5F4 /* NSArray+utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 50DE2E44238EA14E005CD5F4 /* NSArray+utils.m */; };
|
|
360
362
|
50E02BD821A6EE0F00A43942 /* SideMenuOpenMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E02BD621A6EE0F00A43942 /* SideMenuOpenMode.h */; };
|
|
@@ -885,6 +887,8 @@
|
|
|
885
887
|
50D4656B23CE2553005A84B2 /* Transition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Transition.h; sourceTree = "<group>"; };
|
|
886
888
|
50D4656C23CE2553005A84B2 /* Transition.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Transition.m; sourceTree = "<group>"; };
|
|
887
889
|
50DA74CF232F80FE004A00C1 /* RCTConvert+UIFontWeight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+UIFontWeight.h"; sourceTree = "<group>"; };
|
|
890
|
+
50DD9152274FC6E200B4C917 /* AnimationObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimationObserver.h; sourceTree = "<group>"; };
|
|
891
|
+
50DD9153274FC6E200B4C917 /* AnimationObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnimationObserver.m; sourceTree = "<group>"; };
|
|
888
892
|
50DE2E43238EA14E005CD5F4 /* NSArray+utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+utils.h"; sourceTree = "<group>"; };
|
|
889
893
|
50DE2E44238EA14E005CD5F4 /* NSArray+utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+utils.m"; sourceTree = "<group>"; };
|
|
890
894
|
50E02BD521A6E54B00A43942 /* RCTConvert+SideMenuOpenGestureMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+SideMenuOpenGestureMode.h"; sourceTree = "<group>"; };
|
|
@@ -1120,6 +1124,8 @@
|
|
|
1120
1124
|
5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */,
|
|
1121
1125
|
C2A57A1A21E815F80066711C /* InteractivePopGestureDelegate.h */,
|
|
1122
1126
|
C2A57A1B21E815F80066711C /* InteractivePopGestureDelegate.m */,
|
|
1127
|
+
50DD9152274FC6E200B4C917 /* AnimationObserver.h */,
|
|
1128
|
+
50DD9153274FC6E200B4C917 /* AnimationObserver.m */,
|
|
1123
1129
|
);
|
|
1124
1130
|
name = Helpers;
|
|
1125
1131
|
sourceTree = "<group>";
|
|
@@ -1931,6 +1937,7 @@
|
|
|
1931
1937
|
50CED44D239EA78700C42EE2 /* TopBarAppearancePresenter.h in Headers */,
|
|
1932
1938
|
50D3A37223B8D77C00717F95 /* SharedElementTransitionOptions.h in Headers */,
|
|
1933
1939
|
50C085F325939F6200B0502C /* RNNButtonBuilder.h in Headers */,
|
|
1940
|
+
50DD9154274FC6E200B4C917 /* AnimationObserver.h in Headers */,
|
|
1934
1941
|
50887C1520ECC5C200D06111 /* RNNButtonOptions.h in Headers */,
|
|
1935
1942
|
5049593E216F5D73006D2B81 /* BoolParser.h in Headers */,
|
|
1936
1943
|
E5F6C3A522DB4D0F0093C2CE /* UIViewController+Utils.h in Headers */,
|
|
@@ -2219,6 +2226,7 @@
|
|
|
2219
2226
|
509416AC23A11CB20036092C /* NullEnum.m in Sources */,
|
|
2220
2227
|
503A8A1A23BCB2ED0094D1C4 /* RNNReactButtonView.m in Sources */,
|
|
2221
2228
|
50570BEB2063E09B006A1B5C /* RNNTitleViewHelper.m in Sources */,
|
|
2229
|
+
50DD9155274FC6E200B4C917 /* AnimationObserver.m in Sources */,
|
|
2222
2230
|
263905E71E4CAC950023D7D3 /* RNNSideMenuChildVC.m in Sources */,
|
|
2223
2231
|
5082CC3423CDC3B800FD2B6A /* HorizontalTranslationTransition.m in Sources */,
|
|
2224
2232
|
50495957216F6B3D006D2B81 /* DictionaryParser.m in Sources */,
|
|
@@ -160,17 +160,21 @@
|
|
|
160
160
|
UIBarButtonItem *backItem = [[RNNUIBarBackButtonItem alloc] initWithOptions:backButtonOptions];
|
|
161
161
|
UINavigationItem *previousNavigationItem = previousViewControllerInStack.navigationItem;
|
|
162
162
|
|
|
163
|
-
|
|
164
163
|
if (@available(iOS 13.0, *)) {
|
|
165
164
|
UIImage *sfSymbol = [UIImage systemImageNamed:[backButtonOptions.sfSymbol withDefault:nil]];
|
|
166
165
|
if (backButtonOptions.sfSymbol.hasValue) {
|
|
167
|
-
icon = color ? [sfSymbol imageWithTintColor:color
|
|
166
|
+
icon = color ? [sfSymbol imageWithTintColor:color
|
|
167
|
+
renderingMode:UIImageRenderingModeAlwaysOriginal]
|
|
168
168
|
: [sfSymbol imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
|
169
169
|
} else {
|
|
170
|
-
icon = color ? [[icon withTintColor:color]
|
|
170
|
+
icon = color ? [[icon withTintColor:color]
|
|
171
|
+
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
|
|
172
|
+
: icon;
|
|
171
173
|
}
|
|
172
174
|
} else {
|
|
173
|
-
icon = color ? [[icon withTintColor:color]
|
|
175
|
+
icon = color ? [[icon withTintColor:color]
|
|
176
|
+
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
|
|
177
|
+
: icon;
|
|
174
178
|
}
|
|
175
179
|
|
|
176
180
|
[self setBackIndicatorImage:icon withColor:color];
|
|
@@ -134,7 +134,7 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
|
|
|
134
134
|
if (blur) {
|
|
135
135
|
if (!curBlurView) {
|
|
136
136
|
UIVisualEffectView *blur = [[UIVisualEffectView alloc]
|
|
137
|
-
initWithEffect:[UIBlurEffect effectWithStyle:
|
|
137
|
+
initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular]];
|
|
138
138
|
blur.frame = [[UIApplication sharedApplication] statusBarFrame];
|
|
139
139
|
blur.tag = BLUR_STATUS_TAG;
|
|
140
140
|
[self.view addSubview:blur];
|
|
@@ -73,7 +73,7 @@ export class Commands {
|
|
|
73
73
|
|
|
74
74
|
public mergeOptions(componentId: string, options: Options) {
|
|
75
75
|
const input = cloneDeep(options);
|
|
76
|
-
this.optionsProcessor.processOptions(
|
|
76
|
+
this.optionsProcessor.processOptions(CommandName.MergeOptions, input);
|
|
77
77
|
|
|
78
78
|
const component = this.store.getComponentInstance(componentId);
|
|
79
79
|
if (component && !component.isMounted)
|
|
@@ -106,6 +106,7 @@ export class Commands {
|
|
|
106
106
|
|
|
107
107
|
public dismissModal(componentId: string, mergeOptions?: Options) {
|
|
108
108
|
const commandId = this.uniqueIdProvider.generate(CommandName.DismissModal);
|
|
109
|
+
this.optionsProcessor.processOptions(CommandName.DismissModal, mergeOptions);
|
|
109
110
|
const result = this.nativeCommandsSender.dismissModal(commandId, componentId, mergeOptions);
|
|
110
111
|
this.commandsObserver.notify(CommandName.DismissModal, {
|
|
111
112
|
commandId,
|
|
@@ -117,6 +118,7 @@ export class Commands {
|
|
|
117
118
|
|
|
118
119
|
public dismissAllModals(mergeOptions?: Options) {
|
|
119
120
|
const commandId = this.uniqueIdProvider.generate(CommandName.DismissAllModals);
|
|
121
|
+
this.optionsProcessor.processOptions(CommandName.DismissAllModals, mergeOptions);
|
|
120
122
|
const result = this.nativeCommandsSender.dismissAllModals(commandId, mergeOptions);
|
|
121
123
|
this.commandsObserver.notify(CommandName.DismissAllModals, { commandId, mergeOptions });
|
|
122
124
|
return result;
|
|
@@ -138,6 +140,7 @@ export class Commands {
|
|
|
138
140
|
|
|
139
141
|
public pop(componentId: string, mergeOptions?: Options) {
|
|
140
142
|
const commandId = this.uniqueIdProvider.generate(CommandName.Pop);
|
|
143
|
+
this.optionsProcessor.processOptions(CommandName.Pop, mergeOptions);
|
|
141
144
|
const result = this.nativeCommandsSender.pop(commandId, componentId, mergeOptions);
|
|
142
145
|
this.commandsObserver.notify(CommandName.Pop, { commandId, componentId, mergeOptions });
|
|
143
146
|
return result;
|
|
@@ -145,6 +148,7 @@ export class Commands {
|
|
|
145
148
|
|
|
146
149
|
public popTo(componentId: string, mergeOptions?: Options) {
|
|
147
150
|
const commandId = this.uniqueIdProvider.generate(CommandName.PopTo);
|
|
151
|
+
this.optionsProcessor.processOptions(CommandName.PopTo, mergeOptions);
|
|
148
152
|
const result = this.nativeCommandsSender.popTo(commandId, componentId, mergeOptions);
|
|
149
153
|
this.commandsObserver.notify(CommandName.PopTo, { commandId, componentId, mergeOptions });
|
|
150
154
|
return result;
|
|
@@ -152,6 +156,7 @@ export class Commands {
|
|
|
152
156
|
|
|
153
157
|
public popToRoot(componentId: string, mergeOptions?: Options) {
|
|
154
158
|
const commandId = this.uniqueIdProvider.generate(CommandName.PopToRoot);
|
|
159
|
+
this.optionsProcessor.processOptions(CommandName.PopToRoot, mergeOptions);
|
|
155
160
|
const result = this.nativeCommandsSender.popToRoot(commandId, componentId, mergeOptions);
|
|
156
161
|
this.commandsObserver.notify(CommandName.PopToRoot, { commandId, componentId, mergeOptions });
|
|
157
162
|
return result;
|
|
@@ -24,7 +24,7 @@ export class LayoutTreeCrawler {
|
|
|
24
24
|
if (node.type === LayoutType.Component) {
|
|
25
25
|
this.handleComponent(node);
|
|
26
26
|
}
|
|
27
|
-
this.optionsProcessor.processOptions(node.data.options
|
|
27
|
+
this.optionsProcessor.processOptions(commandName, node.data.options);
|
|
28
28
|
node.children.forEach((value: LayoutNode) => this.crawl(value, commandName));
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -35,7 +35,7 @@ export class LayoutTreeCrawler {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
private savePropsToStore(node: LayoutNode) {
|
|
38
|
-
this.store.
|
|
38
|
+
this.store.setPendingProps(node.id, node.data.passProps);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
private assertComponentDataName(component: LayoutNode) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
1
2
|
import merge from 'lodash/merge';
|
|
2
3
|
import isFunction from 'lodash/isFunction';
|
|
3
4
|
import { Store } from '../components/Store';
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
import { UniqueIdProvider } from 'react-native-navigation/adapters/UniqueIdProvider';
|
|
15
16
|
import { LayoutType } from './LayoutType';
|
|
16
17
|
|
|
17
|
-
type ComponentWithOptions =
|
|
18
|
+
type ComponentWithOptions = ComponentType<any> & { options(passProps: any): Options };
|
|
18
19
|
|
|
19
20
|
export class OptionsCrawler {
|
|
20
21
|
constructor(public readonly store: Store, public readonly uniqueIdProvider: UniqueIdProvider) {
|
|
@@ -37,17 +37,19 @@ export class OptionsProcessor {
|
|
|
37
37
|
private deprecations: Deprecations
|
|
38
38
|
) {}
|
|
39
39
|
|
|
40
|
-
public processOptions(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
public processOptions(commandName: CommandName, options?: Options, props?: any) {
|
|
41
|
+
if (options) {
|
|
42
|
+
this.processObject(
|
|
43
|
+
options,
|
|
44
|
+
clone(options),
|
|
45
|
+
(key, parentOptions) => {
|
|
46
|
+
this.deprecations.onProcessOptions(key, parentOptions, commandName);
|
|
47
|
+
this.deprecations.checkForDeprecatedOptions(parentOptions);
|
|
48
|
+
},
|
|
49
|
+
commandName,
|
|
50
|
+
props
|
|
51
|
+
);
|
|
52
|
+
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
public processDefaultOptions(options: Options, commandName: CommandName) {
|
|
@@ -200,7 +202,7 @@ export class OptionsProcessor {
|
|
|
200
202
|
if (endsWith(key, 'Buttons')) {
|
|
201
203
|
forEach(value, (button) => {
|
|
202
204
|
if (button.passProps && button.id) {
|
|
203
|
-
this.store.
|
|
205
|
+
this.store.setPendingProps(button.id, button.passProps);
|
|
204
206
|
button.passProps = undefined;
|
|
205
207
|
}
|
|
206
208
|
});
|
|
@@ -212,7 +214,7 @@ export class OptionsProcessor {
|
|
|
212
214
|
value.componentId = value.id ? value.id : this.uniqueIdProvider.generate('CustomComponent');
|
|
213
215
|
this.store.ensureClassForName(value.name);
|
|
214
216
|
if (value.passProps) {
|
|
215
|
-
this.store.
|
|
217
|
+
this.store.setPendingProps(value.componentId, value.passProps);
|
|
216
218
|
}
|
|
217
219
|
options[key].passProps = undefined;
|
|
218
220
|
}
|
|
@@ -5,6 +5,7 @@ import { IWrappedComponent } from './ComponentWrapper';
|
|
|
5
5
|
export class Store {
|
|
6
6
|
private componentsByName: Record<string, ComponentProvider> = {};
|
|
7
7
|
private propsById: Record<string, any> = {};
|
|
8
|
+
private pendingPropsById: Record<string, any> = {};
|
|
8
9
|
private componentsInstancesById: Record<string, IWrappedComponent> = {};
|
|
9
10
|
private wrappedComponents: Record<string, React.ComponentClass<any>> = {};
|
|
10
11
|
private lazyRegistratorFn: ((lazyComponentRequest: string | number) => void) | undefined;
|
|
@@ -18,7 +19,15 @@ export class Store {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
setPendingProps(componentId: string, newProps: any) {
|
|
23
|
+
this.pendingPropsById[componentId] = newProps;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
getPropsForId(componentId: string) {
|
|
27
|
+
if (this.pendingPropsById[componentId]) {
|
|
28
|
+
this.propsById[componentId] = this.pendingPropsById[componentId];
|
|
29
|
+
delete this.pendingPropsById[componentId];
|
|
30
|
+
}
|
|
22
31
|
return this.propsById[componentId] || {};
|
|
23
32
|
}
|
|
24
33
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from 'react';
|
|
1
2
|
import isString from 'lodash/isString';
|
|
2
3
|
import isNil from 'lodash/isNil';
|
|
3
4
|
import uniqueId from 'lodash/uniqueId';
|
|
@@ -60,7 +61,10 @@ export class ComponentEventsObserver {
|
|
|
60
61
|
this.nativeEventsReceiver.registerScreenPoppedListener(this.notifyPreviewCompleted);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
public bindComponent(
|
|
64
|
+
public bindComponent(
|
|
65
|
+
component: Component<{ componentId?: string }>,
|
|
66
|
+
componentId?: string
|
|
67
|
+
): EventSubscription {
|
|
64
68
|
const computedComponentId = componentId || component.props.componentId;
|
|
65
69
|
|
|
66
70
|
if (!isString(computedComponentId)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from 'react';
|
|
1
2
|
import { EmitterSubscription } from 'react-native';
|
|
2
3
|
|
|
3
4
|
import { NativeEventsReceiver } from '../adapters/NativeEventsReceiver';
|
|
@@ -117,7 +118,7 @@ export class EventsRegistry {
|
|
|
117
118
|
return this.commandsObserver.register(callback);
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
public bindComponent(component:
|
|
121
|
+
public bindComponent(component: Component<any>, componentId?: string): EventSubscription {
|
|
121
122
|
return this.componentEventsObserver.bindComponent(component, componentId);
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -414,6 +414,11 @@ export interface HardwareBackButtonOptions {
|
|
|
414
414
|
* @default true
|
|
415
415
|
*/
|
|
416
416
|
popStackOnPress?: boolean;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Controls hardware back button bottom tab selection behaviour
|
|
420
|
+
*/
|
|
421
|
+
bottomTabsOnPress?: 'exit' | 'first' | 'previous';
|
|
417
422
|
}
|
|
418
423
|
|
|
419
424
|
export interface OptionsTopBarScrollEdgeAppearanceBackground {
|
|
@@ -488,6 +493,11 @@ export interface OptionsTopBarButton {
|
|
|
488
493
|
* Set the button icon
|
|
489
494
|
*/
|
|
490
495
|
icon?: ImageResource;
|
|
496
|
+
/**
|
|
497
|
+
* Set the SF symbol as icon (will be used primarily)
|
|
498
|
+
* #### (iOS 13+ specific)
|
|
499
|
+
*/
|
|
500
|
+
sfSymbol?: string;
|
|
491
501
|
/**
|
|
492
502
|
* Set the button icon insets
|
|
493
503
|
*/
|