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
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Store = void 0;
|
|
4
4
|
class Store {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
componentsByName = {};
|
|
6
|
+
propsById = {};
|
|
7
|
+
pendingPropsById = {};
|
|
8
|
+
componentsInstancesById = {};
|
|
9
|
+
wrappedComponents = {};
|
|
10
|
+
lazyRegistratorFn;
|
|
11
11
|
updateProps(componentId, props, callback) {
|
|
12
12
|
this.mergeNewPropsForId(componentId, props);
|
|
13
13
|
const component = this.componentsInstancesById[componentId];
|
|
@@ -15,7 +15,14 @@ class Store {
|
|
|
15
15
|
component.setProps(props, callback);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
setPendingProps(componentId, newProps) {
|
|
19
|
+
this.pendingPropsById[componentId] = newProps;
|
|
20
|
+
}
|
|
18
21
|
getPropsForId(componentId) {
|
|
22
|
+
if (this.pendingPropsById[componentId]) {
|
|
23
|
+
this.propsById[componentId] = this.pendingPropsById[componentId];
|
|
24
|
+
delete this.pendingPropsById[componentId];
|
|
25
|
+
}
|
|
19
26
|
return this.propsById[componentId] || {};
|
|
20
27
|
}
|
|
21
28
|
mergeNewPropsForId(componentId, newProps) {
|
|
File without changes
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandsObserver = void 0;
|
|
4
4
|
class CommandsObserver {
|
|
5
|
+
uniqueIdProvider;
|
|
6
|
+
listeners = {};
|
|
5
7
|
constructor(uniqueIdProvider) {
|
|
6
8
|
this.uniqueIdProvider = uniqueIdProvider;
|
|
7
|
-
this.listeners = {};
|
|
8
9
|
}
|
|
9
10
|
register(listener) {
|
|
10
11
|
const id = this.uniqueIdProvider.generate();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Component } from 'react';
|
|
2
2
|
import { EventSubscription } from '../interfaces/EventSubscription';
|
|
3
3
|
import { NavigationComponentListener } from '../interfaces/NavigationComponentListener';
|
|
4
4
|
import { ComponentWillAppearEvent, ComponentDidAppearEvent, ComponentDidDisappearEvent, NavigationButtonPressedEvent, SearchBarUpdatedEvent, SearchBarCancelPressedEvent, PreviewCompletedEvent, ScreenPoppedEvent } from '../interfaces/ComponentEvents';
|
|
@@ -11,7 +11,9 @@ export declare class ComponentEventsObserver {
|
|
|
11
11
|
private alreadyRegistered;
|
|
12
12
|
constructor(nativeEventsReceiver: NativeEventsReceiver, store: Store);
|
|
13
13
|
registerOnceForAllComponentEvents(): void;
|
|
14
|
-
bindComponent(component:
|
|
14
|
+
bindComponent(component: Component<{
|
|
15
|
+
componentId?: string;
|
|
16
|
+
}>, componentId?: string): EventSubscription;
|
|
15
17
|
registerComponentListener(listener: NavigationComponentListener, componentId: string): EventSubscription;
|
|
16
18
|
unmounted(componentId: string): void;
|
|
17
19
|
notifyComponentWillAppear(event: ComponentWillAppearEvent): void;
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComponentEventsObserver = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
|
|
6
|
-
const isNil_1 = tslib_1.__importDefault(require("lodash/isNil"));
|
|
7
|
-
const uniqueId_1 = tslib_1.__importDefault(require("lodash/uniqueId"));
|
|
8
|
-
const unset_1 = tslib_1.__importDefault(require("lodash/unset"));
|
|
9
|
-
const forEach_1 = tslib_1.__importDefault(require("lodash/forEach"));
|
|
5
|
+
const isString_1 = (0, tslib_1.__importDefault)(require("lodash/isString"));
|
|
6
|
+
const isNil_1 = (0, tslib_1.__importDefault)(require("lodash/isNil"));
|
|
7
|
+
const uniqueId_1 = (0, tslib_1.__importDefault)(require("lodash/uniqueId"));
|
|
8
|
+
const unset_1 = (0, tslib_1.__importDefault)(require("lodash/unset"));
|
|
9
|
+
const forEach_1 = (0, tslib_1.__importDefault)(require("lodash/forEach"));
|
|
10
10
|
class ComponentEventsObserver {
|
|
11
|
+
nativeEventsReceiver;
|
|
12
|
+
store;
|
|
13
|
+
listeners = {};
|
|
14
|
+
alreadyRegistered = false;
|
|
11
15
|
constructor(nativeEventsReceiver, store) {
|
|
12
16
|
this.nativeEventsReceiver = nativeEventsReceiver;
|
|
13
17
|
this.store = store;
|
|
14
|
-
this.listeners = {};
|
|
15
|
-
this.alreadyRegistered = false;
|
|
16
18
|
this.notifyComponentWillAppear = this.notifyComponentWillAppear.bind(this);
|
|
17
19
|
this.notifyComponentDidAppear = this.notifyComponentDidAppear.bind(this);
|
|
18
20
|
this.notifyComponentDidDisappear = this.notifyComponentDidDisappear.bind(this);
|
|
@@ -38,24 +40,24 @@ class ComponentEventsObserver {
|
|
|
38
40
|
}
|
|
39
41
|
bindComponent(component, componentId) {
|
|
40
42
|
const computedComponentId = componentId || component.props.componentId;
|
|
41
|
-
if (!isString_1.default(computedComponentId)) {
|
|
43
|
+
if (!(0, isString_1.default)(computedComponentId)) {
|
|
42
44
|
throw new Error(`bindComponent expects a component with a componentId in props or a componentId as the second argument`);
|
|
43
45
|
}
|
|
44
46
|
return this.registerComponentListener(component, computedComponentId);
|
|
45
47
|
}
|
|
46
48
|
registerComponentListener(listener, componentId) {
|
|
47
|
-
if (!isString_1.default(componentId)) {
|
|
49
|
+
if (!(0, isString_1.default)(componentId)) {
|
|
48
50
|
throw new Error(`registerComponentListener expects a componentId as the second argument`);
|
|
49
51
|
}
|
|
50
|
-
if (isNil_1.default(this.listeners[componentId])) {
|
|
52
|
+
if ((0, isNil_1.default)(this.listeners[componentId])) {
|
|
51
53
|
this.listeners[componentId] = {};
|
|
52
54
|
}
|
|
53
|
-
const key = uniqueId_1.default();
|
|
55
|
+
const key = (0, uniqueId_1.default)();
|
|
54
56
|
this.listeners[componentId][key] = listener;
|
|
55
|
-
return { remove: () => unset_1.default(this.listeners[componentId], key) };
|
|
57
|
+
return { remove: () => (0, unset_1.default)(this.listeners[componentId], key) };
|
|
56
58
|
}
|
|
57
59
|
unmounted(componentId) {
|
|
58
|
-
unset_1.default(this.listeners, componentId);
|
|
60
|
+
(0, unset_1.default)(this.listeners, componentId);
|
|
59
61
|
}
|
|
60
62
|
notifyComponentWillAppear(event) {
|
|
61
63
|
event.passProps = this.store.getPropsForId(event.componentId);
|
|
@@ -84,7 +86,7 @@ class ComponentEventsObserver {
|
|
|
84
86
|
this.triggerOnAllListenersByComponentId(event, 'screenPopped');
|
|
85
87
|
}
|
|
86
88
|
triggerOnAllListenersByComponentId(event, method) {
|
|
87
|
-
forEach_1.default(this.listeners[event.componentId], (component) => {
|
|
89
|
+
(0, forEach_1.default)(this.listeners[event.componentId], (component) => {
|
|
88
90
|
if (component && component[method]) {
|
|
89
91
|
component[method](event);
|
|
90
92
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Component } from 'react';
|
|
2
2
|
import { EmitterSubscription } from 'react-native';
|
|
3
3
|
import { NativeEventsReceiver } from '../adapters/NativeEventsReceiver';
|
|
4
4
|
import { CommandsObserver } from './CommandsObserver';
|
|
@@ -27,7 +27,7 @@ export declare class EventsRegistry {
|
|
|
27
27
|
registerSearchBarCancelPressedListener(callback: (event: SearchBarCancelPressedEvent) => void): EmitterSubscription;
|
|
28
28
|
registerPreviewCompletedListener(callback: (event: PreviewCompletedEvent) => void): EmitterSubscription;
|
|
29
29
|
registerCommandListener(callback: (name: string, params: any) => void): EventSubscription;
|
|
30
|
-
bindComponent(component:
|
|
30
|
+
bindComponent(component: Component<any>, componentId?: string): EventSubscription;
|
|
31
31
|
registerComponentListener(listener: NavigationComponentListener, componentId: string): EventSubscription;
|
|
32
32
|
registerScreenPoppedListener(callback: (event: ScreenPoppedEvent) => void): EmitterSubscription;
|
|
33
33
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventsRegistry = void 0;
|
|
4
4
|
class EventsRegistry {
|
|
5
|
+
nativeEventsReceiver;
|
|
6
|
+
commandsObserver;
|
|
7
|
+
componentEventsObserver;
|
|
5
8
|
constructor(nativeEventsReceiver, commandsObserver, componentEventsObserver) {
|
|
6
9
|
this.nativeEventsReceiver = nativeEventsReceiver;
|
|
7
10
|
this.commandsObserver = commandsObserver;
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Navigation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const NavigationDelegate_1 = require("./NavigationDelegate");
|
|
6
|
+
const navigationDelegate = new NavigationDelegate_1.NavigationDelegate();
|
|
7
|
+
exports.Navigation = navigationDelegate;
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./components/Modal"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./events/EventsRegistry"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./adapters/Constants"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./interfaces/ComponentEvents"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./interfaces/Events"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./interfaces/EventSubscription"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./interfaces/Layout"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./interfaces/Options"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./interfaces/NavigationComponent"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./interfaces/NavigationComponentProps"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./interfaces/NavigationComponentListener"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./interfaces/NavigationFunctionComponent"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./interfaces/CommandName"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./interfaces/Processors"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./interfaces/ProcessorSubscription"), exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NavigationComponent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
6
|
class NavigationComponent extends react_1.default.Component {
|
|
7
|
+
/**
|
|
8
|
+
* Options used to apply a style configuration when the screen appears.
|
|
9
|
+
*
|
|
10
|
+
* This field can either contain the concrete options to be applied, or a generator function
|
|
11
|
+
* which accepts props and returns an Options object.
|
|
12
|
+
*/
|
|
13
|
+
static options;
|
|
7
14
|
componentWillAppear(_event) { }
|
|
8
15
|
componentDidAppear(_event) { }
|
|
9
16
|
componentDidDisappear(_event) { }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -360,6 +360,10 @@ export interface HardwareBackButtonOptions {
|
|
|
360
360
|
* @default true
|
|
361
361
|
*/
|
|
362
362
|
popStackOnPress?: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Controls hardware back button bottom tab selection behaviour
|
|
365
|
+
*/
|
|
366
|
+
bottomTabsOnPress?: 'exit' | 'first' | 'previous';
|
|
363
367
|
}
|
|
364
368
|
export interface OptionsTopBarScrollEdgeAppearanceBackground {
|
|
365
369
|
/**
|
|
@@ -430,6 +434,11 @@ export interface OptionsTopBarButton {
|
|
|
430
434
|
* Set the button icon
|
|
431
435
|
*/
|
|
432
436
|
icon?: ImageResource;
|
|
437
|
+
/**
|
|
438
|
+
* Set the SF symbol as icon (will be used primarily)
|
|
439
|
+
* #### (iOS 13+ specific)
|
|
440
|
+
*/
|
|
441
|
+
sfSymbol?: string;
|
|
433
442
|
/**
|
|
434
443
|
* Set the button icon insets
|
|
435
444
|
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LayoutProcessorsStore = void 0;
|
|
4
4
|
class LayoutProcessorsStore {
|
|
5
|
-
|
|
6
|
-
this.layoutProcessors = [];
|
|
7
|
-
}
|
|
5
|
+
layoutProcessors = [];
|
|
8
6
|
addProcessor(processor) {
|
|
9
7
|
this.layoutProcessors.push(processor);
|
|
10
8
|
return { remove: () => this.removeProcessor(processor) };
|
|
File without changes
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OptionProcessorsStore = void 0;
|
|
4
4
|
class OptionProcessorsStore {
|
|
5
|
-
|
|
6
|
-
this.optionsProcessorsByObjectPath = {};
|
|
7
|
-
}
|
|
5
|
+
optionsProcessorsByObjectPath = {};
|
|
8
6
|
addProcessor(optionPath, processor) {
|
|
9
7
|
if (!this.optionsProcessorsByObjectPath[optionPath])
|
|
10
8
|
this.optionsProcessorsByObjectPath[optionPath] = [];
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
typedef void (^RNNAnimationEndedBlock)(void);
|
|
4
|
+
|
|
5
|
+
@interface AnimationObserver : NSObject
|
|
6
|
+
|
|
7
|
+
+ (AnimationObserver *)sharedObserver;
|
|
8
|
+
|
|
9
|
+
@property(nonatomic) BOOL isAnimating;
|
|
10
|
+
|
|
11
|
+
- (void)registerAnimationEndedBlock:(RNNAnimationEndedBlock)block;
|
|
12
|
+
|
|
13
|
+
- (void)beginAnimation;
|
|
14
|
+
|
|
15
|
+
- (void)endAnimation;
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#import "AnimationObserver.h"
|
|
2
|
+
|
|
3
|
+
@implementation AnimationObserver {
|
|
4
|
+
NSMutableArray<RNNAnimationEndedBlock> *_animationEndedBlocks;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
- (instancetype)init {
|
|
8
|
+
self = [super init];
|
|
9
|
+
_animationEndedBlocks = [NSMutableArray array];
|
|
10
|
+
return self;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
+ (AnimationObserver *)sharedObserver {
|
|
14
|
+
static AnimationObserver *_sharedObserver = nil;
|
|
15
|
+
static dispatch_once_t onceToken;
|
|
16
|
+
dispatch_once(&onceToken, ^{
|
|
17
|
+
_sharedObserver = [[AnimationObserver alloc] init];
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return _sharedObserver;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
- (void)registerAnimationEndedBlock:(RNNAnimationEndedBlock)block {
|
|
24
|
+
[_animationEndedBlocks addObject:block];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (void)beginAnimation {
|
|
28
|
+
_isAnimating = YES;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (void)endAnimation {
|
|
32
|
+
_isAnimating = NO;
|
|
33
|
+
|
|
34
|
+
for (RNNAnimationEndedBlock block in _animationEndedBlocks) {
|
|
35
|
+
block();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[_animationEndedBlocks removeAllObjects];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@end
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
- (void)applyOptions:(RNNNavigationOptions *)options child:(UIViewController *)child;
|
|
9
9
|
|
|
10
|
-
- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options
|
|
11
|
-
child:(UIViewController *)child;
|
|
12
|
-
|
|
13
10
|
- (void)createTabBarItem:(UIViewController *)child
|
|
14
11
|
bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions;
|
|
15
12
|
|
|
@@ -17,14 +17,6 @@
|
|
|
17
17
|
- (void)applyOptions:(RNNNavigationOptions *)options child:(UIViewController *)child {
|
|
18
18
|
RNNNavigationOptions *withDefault = [options withDefault:self.defaultOptions];
|
|
19
19
|
|
|
20
|
-
[child setTabBarItemBadge:[withDefault.bottomTab.badge withDefault:[NSNull null]]];
|
|
21
|
-
[child setTabBarItemBadgeColor:[withDefault.bottomTab.badgeColor withDefault:nil]];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options
|
|
25
|
-
child:(UIViewController *)child {
|
|
26
|
-
RNNNavigationOptions *withDefault = [options withDefault:self.defaultOptions];
|
|
27
|
-
|
|
28
20
|
[self createTabBarItem:child bottomTabOptions:withDefault.bottomTab];
|
|
29
21
|
[child setTabBarItemBadge:[withDefault.bottomTab.badge withDefault:[NSNull null]]];
|
|
30
22
|
[child setTabBarItemBadgeColor:[withDefault.bottomTab.badgeColor withDefault:nil]];
|
package/lib/ios/RNNAssert.h
CHANGED
|
@@ -12,8 +12,8 @@ extern BOOL RNNIsMainQueue(void);
|
|
|
12
12
|
if ((condition) == 0) { \
|
|
13
13
|
if (RNN_NSASSERT) { \
|
|
14
14
|
[[NSAssertionHandler currentHandler] \
|
|
15
|
-
handleFailureInFunction:(NSString *
|
|
16
|
-
file:(NSString *
|
|
15
|
+
handleFailureInFunction:(NSString *_Nonnull)@(__func__) \
|
|
16
|
+
file:(NSString *_Nonnull)@(__FILE__) \
|
|
17
17
|
lineNumber:__LINE__ \
|
|
18
18
|
description:__VA_ARGS__]; \
|
|
19
19
|
} \
|
|
@@ -24,8 +24,6 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
|
|
|
24
24
|
|
|
25
25
|
- (void)applyOptions:(RNNNavigationOptions *)options;
|
|
26
26
|
|
|
27
|
-
- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options;
|
|
28
|
-
|
|
29
27
|
- (void)mergeOptions:(RNNNavigationOptions *)options
|
|
30
28
|
resolvedOptions:(RNNNavigationOptions *)resolvedOptions;
|
|
31
29
|
|
|
@@ -42,8 +40,6 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
|
|
|
42
40
|
|
|
43
41
|
- (UINavigationItem *)currentNavigationItem;
|
|
44
42
|
|
|
45
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent;
|
|
46
|
-
|
|
47
43
|
- (UIStatusBarStyle)getStatusBarStyle;
|
|
48
44
|
|
|
49
45
|
- (UIInterfaceOrientationMask)getOrientation;
|
|
@@ -40,15 +40,6 @@
|
|
|
40
40
|
- (void)componentDidDisappear {
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
44
|
-
if (parent) {
|
|
45
|
-
RNNNavigationOptions *resolvedOptions = [self.boundViewController resolveOptions];
|
|
46
|
-
[self applyOptionsOnWillMoveToParentViewController:resolvedOptions];
|
|
47
|
-
[self.boundViewController onChildAddToParent:self.boundViewController
|
|
48
|
-
options:resolvedOptions];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
43
|
- (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions {
|
|
53
44
|
UIViewController *viewController = self.boundViewController;
|
|
54
45
|
RNNNavigationOptions *withDefault = [initialOptions withDefault:[self defaultOptions]];
|
|
@@ -66,9 +57,6 @@
|
|
|
66
57
|
- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
|
|
67
58
|
}
|
|
68
59
|
|
|
69
|
-
- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
|
|
70
|
-
}
|
|
71
|
-
|
|
72
60
|
- (void)applyOptions:(RNNNavigationOptions *)options {
|
|
73
61
|
}
|
|
74
62
|
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
self.testID.hasValue || self.icon.hasValue || self.selectedIcon.hasValue ||
|
|
85
85
|
self.iconColor.hasValue || self.selectedIconColor.hasValue ||
|
|
86
86
|
self.selectedTextColor.hasValue || self.iconInsets.hasValue || self.textColor.hasValue ||
|
|
87
|
-
self.visible.hasValue || self.selectTabOnPress.hasValue || self.sfSymbol.hasValue ||
|
|
87
|
+
self.visible.hasValue || self.selectTabOnPress.hasValue || self.sfSymbol.hasValue ||
|
|
88
|
+
self.sfSelectedSymbol.hasValue;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
@end
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
}
|
|
47
47
|
#endif
|
|
48
48
|
|
|
49
|
+
[self createTabBarItems:childViewControllers];
|
|
50
|
+
|
|
49
51
|
self.longPressRecognizer =
|
|
50
52
|
[[UILongPressGestureRecognizer alloc] initWithTarget:self
|
|
51
53
|
action:@selector(handleLongPressGesture:)];
|
|
@@ -54,16 +56,18 @@
|
|
|
54
56
|
return self;
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
- (void)createTabBarItems:(NSArray<UIViewController *> *)childViewControllers {
|
|
60
|
+
for (UIViewController *child in childViewControllers) {
|
|
61
|
+
[_bottomTabPresenter applyOptions:child.resolveOptions child:child];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
- (void)viewWillAppear:(BOOL)animated {
|
|
58
66
|
[super viewWillAppear:animated];
|
|
59
67
|
_viewWillAppearOnce = YES;
|
|
60
68
|
[self loadChildren:self.pendingChildViewControllers];
|
|
61
69
|
}
|
|
62
70
|
|
|
63
|
-
- (void)onChildAddToParent:(UIViewController *)child options:(RNNNavigationOptions *)options {
|
|
64
|
-
[_bottomTabPresenter applyOptionsOnWillMoveToParentViewController:options child:child];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
71
|
- (void)mergeChildOptions:(RNNNavigationOptions *)options child:(UIViewController *)child {
|
|
68
72
|
[super mergeChildOptions:options child:child];
|
|
69
73
|
UIViewController *childViewController = [self findViewController:child];
|
|
@@ -189,10 +193,6 @@
|
|
|
189
193
|
|
|
190
194
|
#pragma mark - UIViewController overrides
|
|
191
195
|
|
|
192
|
-
- (void)willMoveToParentViewController:(UIViewController *)parent {
|
|
193
|
-
[self.presenter willMoveToParentViewController:parent];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
196
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
197
197
|
return [self.presenter getStatusBarStyle];
|
|
198
198
|
}
|
|
@@ -113,7 +113,6 @@
|
|
|
113
113
|
- (void)onBridgeWillReload {
|
|
114
114
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
115
115
|
[self->_overlayManager dismissAllOverlays];
|
|
116
|
-
[self->_modalManager dismissAllModalsSynchronosly];
|
|
117
116
|
[self->_componentRegistry clear];
|
|
118
117
|
UIApplication.sharedApplication.delegate.window.rootViewController = nil;
|
|
119
118
|
});
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
return [[RNNUIBarButtonItem alloc] initCustomIcon:button
|
|
32
32
|
iconCreator:_iconCreator
|
|
33
33
|
onPress:onPress];
|
|
34
|
+
} else if (button.sfSymbol.hasValue) {
|
|
35
|
+
return [[RNNUIBarButtonItem alloc] initWithSFSymbol:button onPress:onPress];
|
|
34
36
|
} else if (button.icon.hasValue) {
|
|
35
37
|
return [[RNNUIBarButtonItem alloc] initWithIcon:button onPress:onPress];
|
|
36
38
|
} else if (button.text.hasValue) {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
@property(nonatomic, strong) Color *color;
|
|
17
17
|
@property(nonatomic, strong) Color *disabledColor;
|
|
18
18
|
@property(nonatomic, strong) Image *icon;
|
|
19
|
+
@property(nonatomic, strong) Text *sfSymbol;
|
|
19
20
|
@property(nonatomic, strong) Bool *enabled;
|
|
20
21
|
@property(nonatomic, strong) RNNInsetsOptions *iconInsets;
|
|
21
22
|
@property(nonatomic, strong) Bool *selectTabOnPress;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
self.fontWeight = [TextParser parse:dict key:@"fontWeight"];
|
|
12
12
|
self.fontSize = [NumberParser parse:dict key:@"fontSize"];
|
|
13
13
|
self.text = [TextParser parse:dict key:@"text"];
|
|
14
|
+
self.sfSymbol = [TextParser parse:dict key:@"sfSymbol"];
|
|
14
15
|
self.testID = [TextParser parse:dict key:@"testID"];
|
|
15
16
|
self.accessibilityLabel = [TextParser parse:dict key:@"accessibilityLabel"];
|
|
16
17
|
self.color = [ColorParser parse:dict key:@"color"];
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
newOptions.color = self.color.copy;
|
|
40
41
|
newOptions.disabledColor = self.disabledColor.copy;
|
|
41
42
|
newOptions.icon = self.icon.copy;
|
|
43
|
+
newOptions.sfSymbol = self.sfSymbol.copy;
|
|
42
44
|
newOptions.iconInsets = self.iconInsets.copy;
|
|
43
45
|
newOptions.enabled = self.enabled.copy;
|
|
44
46
|
newOptions.selectTabOnPress = self.selectTabOnPress.copy;
|
|
@@ -71,6 +73,8 @@
|
|
|
71
73
|
self.disabledColor = options.disabledColor;
|
|
72
74
|
if (options.icon.hasValue)
|
|
73
75
|
self.icon = options.icon;
|
|
76
|
+
if (options.sfSymbol.hasValue)
|
|
77
|
+
self.sfSymbol = options.sfSymbol;
|
|
74
78
|
if (options.enabled.hasValue) {
|
|
75
79
|
self.enabled = options.enabled;
|
|
76
80
|
[self.iconBackground setEnabled:self.enabled];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import "RNNCommandsHandler.h"
|
|
2
|
+
#import "AnimationObserver.h"
|
|
2
3
|
#import "RNNAssert.h"
|
|
3
4
|
#import "RNNComponentViewController.h"
|
|
4
5
|
#import "RNNConvert.h"
|
|
@@ -82,10 +83,7 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
[_modalManager
|
|
86
|
-
completion:^{
|
|
87
|
-
|
|
88
|
-
}];
|
|
86
|
+
[_modalManager reset];
|
|
89
87
|
|
|
90
88
|
UIViewController *vc = [_controllerFactory createLayout:layout[@"root"]];
|
|
91
89
|
[_layoutManager addPendingViewController:vc];
|
|
@@ -203,12 +201,16 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
} else {
|
|
206
|
-
|
|
204
|
+
BOOL animated = [optionsWithDefault.animations.push.enable withDefault:YES];
|
|
205
|
+
BOOL waitForRender = optionsWithDefault.animations.push.shouldWaitForRender;
|
|
206
|
+
newVc.waitForRender = waitForRender;
|
|
207
207
|
__weak UIViewController *weakNewVC = newVc;
|
|
208
208
|
[newVc setReactViewReadyCallback:^{
|
|
209
|
+
if (animated && !waitForRender)
|
|
210
|
+
[[AnimationObserver sharedObserver] beginAnimation];
|
|
209
211
|
[fromVC.stack push:weakNewVC
|
|
210
212
|
onTop:fromVC
|
|
211
|
-
animated:
|
|
213
|
+
animated:animated
|
|
212
214
|
completion:^{
|
|
213
215
|
[self->_layoutManager removePendingViewController:weakNewVC];
|
|
214
216
|
[self->_eventEmitter sendOnNavigationCommandCompletion:push
|
|
@@ -369,14 +371,19 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
369
371
|
[_layoutManager addPendingViewController:newVc];
|
|
370
372
|
|
|
371
373
|
__weak UIViewController *weakNewVC = newVc;
|
|
372
|
-
|
|
374
|
+
BOOL animated = [withDefault.animations.showModal.enter.enable withDefault:YES];
|
|
375
|
+
BOOL waitForRender = [withDefault.animations.showModal.enter shouldWaitForRender];
|
|
376
|
+
newVc.waitForRender = waitForRender;
|
|
373
377
|
newVc.modalPresentationStyle = [RNNConvert
|
|
374
378
|
UIModalPresentationStyle:[withDefault.modalPresentationStyle withDefault:@"default"]];
|
|
375
379
|
newVc.modalTransitionStyle = [RNNConvert
|
|
376
380
|
UIModalTransitionStyle:[withDefault.modalTransitionStyle withDefault:@"coverVertical"]];
|
|
381
|
+
|
|
382
|
+
if (animated && !waitForRender)
|
|
383
|
+
[[AnimationObserver sharedObserver] beginAnimation];
|
|
377
384
|
[newVc setReactViewReadyCallback:^{
|
|
378
385
|
[self->_modalManager showModal:weakNewVC
|
|
379
|
-
animated:
|
|
386
|
+
animated:animated
|
|
380
387
|
completion:^(NSString *componentId) {
|
|
381
388
|
[self->_layoutManager removePendingViewController:weakNewVC];
|
|
382
389
|
[self->_eventEmitter sendOnNavigationCommandCompletion:showModal
|