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.
Files changed (263) hide show
  1. package/.buildkite/pipeline.yml +51 -11
  2. package/.nvmrc +1 -0
  3. package/Mock.d.ts +1 -0
  4. package/Mock.js +4 -0
  5. package/Mock.ts +1 -1
  6. package/README.md +0 -1
  7. package/jest.config.js +40 -0
  8. package/lib/{src/Mock → Mock}/Application.tsx +0 -0
  9. package/lib/{src/Mock → Mock}/ComponentProps.tsx +0 -0
  10. package/lib/{src/Mock → Mock}/Components/BottomTabs.tsx +0 -0
  11. package/lib/{src/Mock → Mock}/Components/ComponentScreen.tsx +13 -2
  12. package/lib/{src/Mock → Mock}/Components/LayoutComponent.tsx +0 -0
  13. package/lib/{src/Mock → Mock}/Components/Modals.tsx +0 -0
  14. package/lib/{src/Mock → Mock}/Components/NavigationButton.tsx +1 -1
  15. package/lib/{src/Mock → Mock}/Components/Overlays.tsx +0 -0
  16. package/lib/{src/Mock → Mock}/Components/Stack.tsx +0 -0
  17. package/lib/{src/Mock → Mock}/Components/TopBar.tsx +2 -2
  18. package/lib/{src/Mock → Mock}/Layouts/BottomTabsNode.ts +1 -1
  19. package/lib/{src/Mock → Mock}/Layouts/ComponentNode.ts +1 -1
  20. package/lib/{src/Mock → Mock}/Layouts/LayoutNodeFactory.ts +0 -0
  21. package/lib/{src/Mock → Mock}/Layouts/Node.ts +1 -1
  22. package/lib/{src/Mock → Mock}/Layouts/ParentNode.ts +2 -2
  23. package/lib/{src/Mock → Mock}/Layouts/StackNode.ts +0 -0
  24. package/lib/{src/Mock → Mock}/Stores/EventsStore.ts +10 -2
  25. package/lib/{src/Mock → Mock}/Stores/LayoutStore.ts +3 -2
  26. package/lib/{src/Mock → Mock}/connect.ts +0 -0
  27. package/lib/Mock/constants.d.ts +2 -0
  28. package/lib/Mock/constants.js +5 -0
  29. package/lib/{src/Mock → Mock}/constants.ts +0 -0
  30. package/lib/Mock/index.d.ts +3 -0
  31. package/lib/Mock/index.js +14 -0
  32. package/lib/{src/Mock → Mock}/index.ts +0 -0
  33. package/lib/{src/Mock → Mock}/mocks/AppRegistryService.ts +0 -0
  34. package/lib/{src/Mock → Mock}/mocks/NativeCommandsSender.tsx +1 -1
  35. package/lib/{src/Mock → Mock}/mocks/NativeEventsReceiver.ts +7 -4
  36. package/lib/android/app/build.gradle +23 -21
  37. package/lib/android/app/src/main/java/com/reactnativenavigation/options/FontOptions.kt +2 -2
  38. package/lib/android/app/src/main/java/com/reactnativenavigation/options/HardwareBackButtonOptions.kt +35 -2
  39. package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +32 -17
  40. package/lib/android/app/src/main/java/com/reactnativenavigation/options/Options.java +1 -1
  41. package/lib/android/app/src/main/java/com/reactnativenavigation/options/parsers/TypefaceLoader.kt +16 -10
  42. package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +5 -2
  43. package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalFrameLayout.kt +3 -3
  44. package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalViewManager.kt +11 -8
  45. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +168 -0
  46. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +5 -2
  47. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +42 -2
  48. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java +12 -16
  49. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +19 -11
  50. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java +2 -2
  51. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenter.java +6 -4
  52. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManager.kt +8 -3
  53. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +15 -7
  54. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +127 -138
  55. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +183 -22
  56. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonController.kt +25 -4
  57. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +9 -1
  58. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonSpan.kt +1 -1
  59. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java +52 -71
  60. package/lib/android/app/src/main/java/com/reactnativenavigation/views/component/ComponentLayout.java +2 -0
  61. package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageMatrixAnimator.kt +2 -3
  62. package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBar.java +1 -2
  63. package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/ButtonBar.kt +7 -12
  64. package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleAndButtonsContainer.kt +0 -2
  65. package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleSubTitleLayout.kt +0 -7
  66. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +2 -1
  67. package/lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java +7 -6
  68. package/lib/android/app/src/test/java/com/reactnativenavigation/TestActivity.java +5 -0
  69. package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/ImageLoaderMock.kt +5 -4
  70. package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/Mocks.kt +3 -2
  71. package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/TypefaceLoaderMock.kt +5 -1
  72. package/lib/android/app/src/test/java/com/reactnativenavigation/options/TransitionAnimationOptionsTest.kt +2 -3
  73. package/lib/android/app/src/test/java/com/reactnativenavigation/presentation/PresenterTest.java +25 -10
  74. package/lib/android/app/src/test/java/com/reactnativenavigation/utils/LayoutFactoryTest.java +25 -2
  75. package/lib/android/app/src/test/java/com/reactnativenavigation/utils/MotionEventTest.kt +1 -1
  76. package/lib/android/app/src/test/java/com/reactnativenavigation/utils/{TitleAndButtonsMeasurer.kt → TitleAndButtonsMeasurerTest.kt} +2 -2
  77. package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiThreadTest.java +2 -2
  78. package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiUtilsTest.java +1 -1
  79. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.kt +572 -0
  80. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenterTest.kt +1 -1
  81. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java +2 -1
  82. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewControllerTest.java +5 -5
  83. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/fakes/FakeParentController.kt +1 -1
  84. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalAnimatorTest.kt +1 -1
  85. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenterTest.java +7 -3
  86. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java +17 -4
  87. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java +2 -2
  88. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/RootPresenterTest.kt +5 -5
  89. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManagerTest.java +1 -0
  90. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/parent/ParentControllerTest.java +4 -0
  91. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java +6 -2
  92. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt +1 -1
  93. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt +13 -8
  94. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt +58 -51
  95. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarControllerTest.kt +219 -41
  96. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerTest.java +4 -1
  97. package/lib/android/app/src/test/java/com/reactnativenavigation/views/TitleAndButtonsContainerTest.kt +2 -2
  98. package/lib/android/app/src/test/java/com/reactnativenavigation/views/animations/BaseViewAnimatorTest.kt +4 -4
  99. package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainerTest.kt +1 -1
  100. package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsTest.kt +4 -4
  101. package/lib/dist/Mock/Application.js +2 -2
  102. package/lib/dist/Mock/Components/BottomTabs.js +2 -2
  103. package/lib/dist/Mock/Components/ComponentScreen.js +15 -5
  104. package/lib/dist/Mock/Components/LayoutComponent.js +3 -2
  105. package/lib/dist/Mock/Components/Modals.js +2 -2
  106. package/lib/dist/Mock/Components/NavigationButton.d.ts +1 -1
  107. package/lib/dist/Mock/Components/NavigationButton.js +8 -10
  108. package/lib/dist/Mock/Components/Overlays.js +2 -2
  109. package/lib/dist/Mock/Components/Stack.js +2 -2
  110. package/lib/dist/Mock/Components/TopBar.d.ts +2 -2
  111. package/lib/dist/Mock/Components/TopBar.js +7 -6
  112. package/lib/dist/Mock/Layouts/BottomTabsNode.d.ts +1 -1
  113. package/lib/dist/Mock/Layouts/BottomTabsNode.js +3 -3
  114. package/lib/dist/Mock/Layouts/ComponentNode.d.ts +1 -1
  115. package/lib/dist/Mock/Layouts/ComponentNode.js +4 -4
  116. package/lib/dist/Mock/Layouts/LayoutNodeFactory.js +3 -3
  117. package/lib/dist/Mock/Layouts/Node.d.ts +1 -1
  118. package/lib/dist/Mock/Layouts/Node.js +5 -0
  119. package/lib/dist/Mock/Layouts/ParentNode.d.ts +2 -2
  120. package/lib/dist/Mock/Layouts/ParentNode.js +4 -3
  121. package/lib/dist/Mock/Layouts/StackNode.js +1 -1
  122. package/lib/dist/Mock/Stores/EventsStore.d.ts +5 -2
  123. package/lib/dist/Mock/Stores/EventsStore.js +7 -0
  124. package/lib/dist/Mock/Stores/LayoutStore.js +6 -3
  125. package/lib/dist/Mock/connect.js +1 -1
  126. package/lib/dist/Mock/index.js +1 -1
  127. package/lib/dist/Mock/mocks/NativeCommandsSender.d.ts +1 -1
  128. package/lib/dist/Mock/mocks/NativeCommandsSender.js +2 -2
  129. package/lib/dist/Mock/mocks/NativeEventsReceiver.d.ts +3 -3
  130. package/lib/dist/Mock/mocks/NativeEventsReceiver.js +6 -3
  131. package/lib/dist/{Navigation.d.ts → src/Navigation.d.ts} +0 -0
  132. package/lib/dist/{Navigation.js → src/Navigation.js} +19 -3
  133. package/lib/dist/{NavigationDelegate.d.ts → src/NavigationDelegate.d.ts} +0 -0
  134. package/lib/dist/{NavigationDelegate.js → src/NavigationDelegate.js} +1 -0
  135. package/lib/dist/{adapters → src/adapters}/AppRegistryService.d.ts +0 -0
  136. package/lib/dist/{adapters → src/adapters}/AppRegistryService.js +0 -0
  137. package/lib/dist/{adapters → src/adapters}/AssetResolver.d.ts +0 -0
  138. package/lib/dist/{adapters → src/adapters}/AssetResolver.js +0 -0
  139. package/lib/dist/src/adapters/ColorService.d.ts +3 -0
  140. package/lib/dist/{adapters → src/adapters}/ColorService.js +1 -1
  141. package/lib/dist/{adapters → src/adapters}/Constants.d.ts +0 -0
  142. package/lib/dist/{adapters → src/adapters}/Constants.js +10 -6
  143. package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.d.ts +0 -0
  144. package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.js +1 -0
  145. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.d.ts +0 -0
  146. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.js +1 -0
  147. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.d.ts +0 -0
  148. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.js +0 -0
  149. package/lib/dist/{adapters → src/adapters}/TouchablePreview.d.ts +0 -0
  150. package/lib/dist/src/adapters/TouchablePreview.js +89 -0
  151. package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.d.ts +0 -0
  152. package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.js +2 -2
  153. package/lib/dist/{commands → src/commands}/Commands.d.ts +0 -0
  154. package/lib/dist/{commands → src/commands}/Commands.js +24 -10
  155. package/lib/dist/{commands → src/commands}/Deprecations.d.ts +0 -0
  156. package/lib/dist/src/commands/Deprecations.js +80 -0
  157. package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.d.ts +0 -0
  158. package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.js +4 -2
  159. package/lib/dist/{commands → src/commands}/LayoutTreeParser.d.ts +0 -0
  160. package/lib/dist/{commands → src/commands}/LayoutTreeParser.js +1 -0
  161. package/lib/dist/{commands → src/commands}/LayoutType.d.ts +0 -0
  162. package/lib/dist/{commands → src/commands}/LayoutType.js +0 -0
  163. package/lib/dist/{commands → src/commands}/OptionsCrawler.d.ts +0 -0
  164. package/lib/dist/{commands → src/commands}/OptionsCrawler.js +6 -4
  165. package/lib/dist/{commands → src/commands}/OptionsProcessor.d.ts +1 -1
  166. package/lib/dist/{commands → src/commands}/OptionsProcessor.js +50 -42
  167. package/lib/dist/{components → src/components}/ComponentRegistry.d.ts +0 -0
  168. package/lib/dist/{components → src/components}/ComponentRegistry.js +4 -0
  169. package/lib/dist/{components → src/components}/ComponentWrapper.d.ts +0 -0
  170. package/lib/dist/{components → src/components}/ComponentWrapper.js +17 -17
  171. package/lib/dist/{components → src/components}/Modal.d.ts +0 -0
  172. package/lib/dist/{components → src/components}/Modal.js +8 -8
  173. package/lib/dist/{components → src/components}/Store.d.ts +2 -0
  174. package/lib/dist/{components → src/components}/Store.js +13 -6
  175. package/lib/dist/{events → src/events}/CommandsObserver.d.ts +0 -0
  176. package/lib/dist/{events → src/events}/CommandsObserver.js +2 -1
  177. package/lib/dist/{events → src/events}/ComponentEventsObserver.d.ts +4 -2
  178. package/lib/dist/{events → src/events}/ComponentEventsObserver.js +16 -14
  179. package/lib/dist/{events → src/events}/EventsRegistry.d.ts +2 -2
  180. package/lib/dist/{events → src/events}/EventsRegistry.js +3 -0
  181. package/lib/dist/{index.d.ts → src/index.d.ts} +0 -0
  182. package/lib/dist/src/index.js +22 -0
  183. package/lib/dist/{interfaces → src/interfaces}/CommandName.d.ts +0 -0
  184. package/lib/dist/{interfaces → src/interfaces}/CommandName.js +0 -0
  185. package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.d.ts +0 -0
  186. package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.js +0 -0
  187. package/lib/dist/{interfaces → src/interfaces}/EventSubscription.d.ts +0 -0
  188. package/lib/dist/{interfaces → src/interfaces}/EventSubscription.js +0 -0
  189. package/lib/dist/{interfaces → src/interfaces}/Events.d.ts +0 -0
  190. package/lib/dist/{interfaces → src/interfaces}/Events.js +0 -0
  191. package/lib/dist/{interfaces → src/interfaces}/Layout.d.ts +0 -0
  192. package/lib/dist/{interfaces → src/interfaces}/Layout.js +0 -0
  193. package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.d.ts +0 -0
  194. package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.js +8 -1
  195. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.d.ts +0 -0
  196. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.js +0 -0
  197. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.d.ts +0 -0
  198. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.js +0 -0
  199. package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.d.ts +0 -0
  200. package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.js +0 -0
  201. package/lib/dist/{interfaces → src/interfaces}/Options.d.ts +9 -0
  202. package/lib/dist/{interfaces → src/interfaces}/Options.js +0 -0
  203. package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.d.ts +0 -0
  204. package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.js +0 -0
  205. package/lib/dist/{interfaces → src/interfaces}/Processors.d.ts +0 -0
  206. package/lib/dist/{interfaces → src/interfaces}/Processors.js +0 -0
  207. package/lib/dist/{processors → src/processors}/LayoutProcessor.d.ts +0 -0
  208. package/lib/dist/{processors → src/processors}/LayoutProcessor.js +1 -0
  209. package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.d.ts +0 -0
  210. package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.js +1 -3
  211. package/lib/dist/{processors → src/processors}/OptionProcessorsStore.d.ts +0 -0
  212. package/lib/dist/{processors → src/processors}/OptionProcessorsStore.js +1 -3
  213. package/lib/dist/{types.d.ts → src/types.d.ts} +0 -0
  214. package/lib/dist/{types.js → src/types.js} +0 -0
  215. package/lib/ios/AnimationObserver.h +17 -0
  216. package/lib/ios/AnimationObserver.m +41 -0
  217. package/lib/ios/BottomTabPresenter.h +0 -3
  218. package/lib/ios/BottomTabPresenter.m +0 -8
  219. package/lib/ios/RNNAssert.h +2 -2
  220. package/lib/ios/RNNBasePresenter.h +0 -4
  221. package/lib/ios/RNNBasePresenter.m +0 -12
  222. package/lib/ios/RNNBottomTabOptions.m +2 -1
  223. package/lib/ios/RNNBottomTabsController.m +8 -8
  224. package/lib/ios/RNNBridgeManager.mm +0 -1
  225. package/lib/ios/RNNButtonBuilder.m +2 -0
  226. package/lib/ios/RNNButtonOptions.h +1 -0
  227. package/lib/ios/RNNButtonOptions.m +4 -0
  228. package/lib/ios/RNNCommandsHandler.m +15 -8
  229. package/lib/ios/RNNComponentPresenter.m +0 -4
  230. package/lib/ios/RNNComponentViewController.m +2 -4
  231. package/lib/ios/RNNDotIndicatorPresenter.m +2 -1
  232. package/lib/ios/RNNExternalViewController.m +2 -4
  233. package/lib/ios/RNNModalManager.h +2 -1
  234. package/lib/ios/RNNModalManager.m +12 -21
  235. package/lib/ios/RNNSegmentedControl.h +1 -1
  236. package/lib/ios/RNNSideMenuChildVC.m +0 -4
  237. package/lib/ios/RNNSideMenuController.m +0 -4
  238. package/lib/ios/RNNSplitViewController.m +0 -4
  239. package/lib/ios/RNNStackController.m +0 -4
  240. package/lib/ios/RNNStackPresenter.m +3 -0
  241. package/lib/ios/RNNSwizzles.m +20 -0
  242. package/lib/ios/RNNTabBarItemCreator.m +3 -2
  243. package/lib/ios/RNNUIBarButtonItem.h +2 -0
  244. package/lib/ios/RNNUIBarButtonItem.m +17 -0
  245. package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +8 -0
  246. package/lib/ios/TopBarPresenter.m +8 -4
  247. package/lib/ios/UIViewController+RNNOptions.m +1 -1
  248. package/lib/src/commands/Commands.ts +6 -1
  249. package/lib/src/commands/LayoutTreeCrawler.ts +2 -2
  250. package/lib/src/commands/OptionsCrawler.ts +2 -1
  251. package/lib/src/commands/OptionsProcessor.ts +15 -13
  252. package/lib/src/components/Store.ts +9 -0
  253. package/lib/src/events/ComponentEventsObserver.ts +5 -1
  254. package/lib/src/events/EventsRegistry.ts +2 -1
  255. package/lib/src/interfaces/Options.ts +10 -0
  256. package/package.json +19 -60
  257. package/tsconfig.mocks.json +7 -0
  258. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.java +0 -41
  259. package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.java +0 -511
  260. package/lib/dist/adapters/ColorService.d.ts +0 -3
  261. package/lib/dist/adapters/TouchablePreview.js +0 -91
  262. package/lib/dist/commands/Deprecations.js +0 -82
  263. package/lib/dist/index.js +0 -22
@@ -2,11 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Commands = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
6
- const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
7
- const map_1 = tslib_1.__importDefault(require("lodash/map"));
5
+ const cloneDeepWith_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeepWith"));
6
+ const cloneDeep_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeep"));
7
+ const map_1 = (0, tslib_1.__importDefault)(require("lodash/map"));
8
8
  const CommandName_1 = require("../interfaces/CommandName");
9
9
  class Commands {
10
+ store;
11
+ nativeCommandsSender;
12
+ layoutTreeParser;
13
+ layoutTreeCrawler;
14
+ commandsObserver;
15
+ uniqueIdProvider;
16
+ optionsProcessor;
17
+ layoutProcessor;
18
+ optionsCrawler;
10
19
  constructor(store, nativeCommandsSender, layoutTreeParser, layoutTreeCrawler, commandsObserver, uniqueIdProvider, optionsProcessor, layoutProcessor, optionsCrawler) {
11
20
  this.store = store;
12
21
  this.nativeCommandsSender = nativeCommandsSender;
@@ -23,12 +32,12 @@ class Commands {
23
32
  this.optionsCrawler.crawl(input.root);
24
33
  const processedRoot = this.layoutProcessor.process(input.root, CommandName_1.CommandName.SetRoot);
25
34
  const root = this.layoutTreeParser.parse(processedRoot);
26
- const modals = map_1.default(input.modals, (modal) => {
35
+ const modals = (0, map_1.default)(input.modals, (modal) => {
27
36
  this.optionsCrawler.crawl(modal);
28
37
  const processedModal = this.layoutProcessor.process(modal, CommandName_1.CommandName.SetRoot);
29
38
  return this.layoutTreeParser.parse(processedModal);
30
39
  });
31
- const overlays = map_1.default(input.overlays, (overlay) => {
40
+ const overlays = (0, map_1.default)(input.overlays, (overlay) => {
32
41
  this.optionsCrawler.crawl(overlay);
33
42
  const processedOverlay = this.layoutProcessor.process(overlay, CommandName_1.CommandName.SetRoot);
34
43
  return this.layoutTreeParser.parse(processedOverlay);
@@ -49,14 +58,14 @@ class Commands {
49
58
  return result;
50
59
  }
51
60
  setDefaultOptions(options) {
52
- const input = cloneDeep_1.default(options);
61
+ const input = (0, cloneDeep_1.default)(options);
53
62
  this.optionsProcessor.processDefaultOptions(input, CommandName_1.CommandName.SetDefaultOptions);
54
63
  this.nativeCommandsSender.setDefaultOptions(input);
55
64
  this.commandsObserver.notify(CommandName_1.CommandName.SetDefaultOptions, { options });
56
65
  }
57
66
  mergeOptions(componentId, options) {
58
- const input = cloneDeep_1.default(options);
59
- this.optionsProcessor.processOptions(input, CommandName_1.CommandName.MergeOptions);
67
+ const input = (0, cloneDeep_1.default)(options);
68
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.MergeOptions, input);
60
69
  const component = this.store.getComponentInstance(componentId);
61
70
  if (component && !component.isMounted)
62
71
  console.warn(`Navigation.mergeOptions was invoked on component with id: ${componentId} before it is mounted, this can cause UI issues and should be avoided.\n Use static options instead.`);
@@ -80,6 +89,7 @@ class Commands {
80
89
  }
81
90
  dismissModal(componentId, mergeOptions) {
82
91
  const commandId = this.uniqueIdProvider.generate(CommandName_1.CommandName.DismissModal);
92
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.DismissModal, mergeOptions);
83
93
  const result = this.nativeCommandsSender.dismissModal(commandId, componentId, mergeOptions);
84
94
  this.commandsObserver.notify(CommandName_1.CommandName.DismissModal, {
85
95
  commandId,
@@ -90,6 +100,7 @@ class Commands {
90
100
  }
91
101
  dismissAllModals(mergeOptions) {
92
102
  const commandId = this.uniqueIdProvider.generate(CommandName_1.CommandName.DismissAllModals);
103
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.DismissAllModals, mergeOptions);
93
104
  const result = this.nativeCommandsSender.dismissAllModals(commandId, mergeOptions);
94
105
  this.commandsObserver.notify(CommandName_1.CommandName.DismissAllModals, { commandId, mergeOptions });
95
106
  return result;
@@ -107,24 +118,27 @@ class Commands {
107
118
  }
108
119
  pop(componentId, mergeOptions) {
109
120
  const commandId = this.uniqueIdProvider.generate(CommandName_1.CommandName.Pop);
121
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.Pop, mergeOptions);
110
122
  const result = this.nativeCommandsSender.pop(commandId, componentId, mergeOptions);
111
123
  this.commandsObserver.notify(CommandName_1.CommandName.Pop, { commandId, componentId, mergeOptions });
112
124
  return result;
113
125
  }
114
126
  popTo(componentId, mergeOptions) {
115
127
  const commandId = this.uniqueIdProvider.generate(CommandName_1.CommandName.PopTo);
128
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.PopTo, mergeOptions);
116
129
  const result = this.nativeCommandsSender.popTo(commandId, componentId, mergeOptions);
117
130
  this.commandsObserver.notify(CommandName_1.CommandName.PopTo, { commandId, componentId, mergeOptions });
118
131
  return result;
119
132
  }
120
133
  popToRoot(componentId, mergeOptions) {
121
134
  const commandId = this.uniqueIdProvider.generate(CommandName_1.CommandName.PopToRoot);
135
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.PopToRoot, mergeOptions);
122
136
  const result = this.nativeCommandsSender.popToRoot(commandId, componentId, mergeOptions);
123
137
  this.commandsObserver.notify(CommandName_1.CommandName.PopToRoot, { commandId, componentId, mergeOptions });
124
138
  return result;
125
139
  }
126
140
  setStackRoot(componentId, children) {
127
- const input = map_1.default(cloneLayout(children), (simpleApi) => {
141
+ const input = (0, map_1.default)(cloneLayout(children), (simpleApi) => {
128
142
  this.optionsCrawler.crawl(simpleApi);
129
143
  const layoutProcessed = this.layoutProcessor.process(simpleApi, CommandName_1.CommandName.SetStackRoot);
130
144
  const layout = this.layoutTreeParser.parse(layoutProcessed);
@@ -174,7 +188,7 @@ class Commands {
174
188
  }
175
189
  exports.Commands = Commands;
176
190
  function cloneLayout(layout) {
177
- return cloneDeepWith_1.default(layout, (value, key) => {
191
+ return (0, cloneDeepWith_1.default)(layout, (value, key) => {
178
192
  if (key === 'passProps' && typeof value === 'object' && value !== null)
179
193
  return { ...value };
180
194
  });
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Deprecations = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const once_1 = (0, tslib_1.__importDefault)(require("lodash/once"));
6
+ const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
7
+ const each_1 = (0, tslib_1.__importDefault)(require("lodash/each"));
8
+ const react_native_1 = require("react-native");
9
+ class Deprecations {
10
+ deprecatedOptions = [
11
+ {
12
+ key: 'topBar.searchBarHiddenWhenScrolling',
13
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
14
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
15
+ }),
16
+ },
17
+ {
18
+ key: 'topBar.searchBarPlaceholder',
19
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
20
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
21
+ }),
22
+ },
23
+ {
24
+ key: 'topBar.searchBarBackgroundColor',
25
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
26
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
27
+ }),
28
+ },
29
+ {
30
+ key: 'topBar.searchBarTintColor',
31
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
32
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
33
+ }),
34
+ },
35
+ {
36
+ key: 'topBar.hideNavBarOnFocusSearchBar',
37
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
38
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
39
+ }),
40
+ },
41
+ ];
42
+ checkForDeprecatedOptions(options) {
43
+ (0, each_1.default)(this.deprecatedOptions, (option) => {
44
+ if ((0, get_1.default)(options, option.key, null)) {
45
+ option.showWarning(option.key, options);
46
+ }
47
+ });
48
+ }
49
+ onProcessOptions(key, parentOptions, commandName) {
50
+ if (key === 'bottomTabs' &&
51
+ parentOptions[key]?.visible !== undefined &&
52
+ react_native_1.Platform.OS === 'ios' &&
53
+ commandName === 'mergeOptions') {
54
+ this.deprecateBottomTabsVisibility(parentOptions);
55
+ }
56
+ if (key === 'searchBar' && react_native_1.Platform.OS === 'ios' && typeof parentOptions[key] === 'boolean') {
57
+ this.deprecateSearchBarOptions(parentOptions);
58
+ }
59
+ if (key === 'interpolation' && typeof parentOptions[key] === 'string') {
60
+ this.deprecateInterpolationOptions(parentOptions);
61
+ }
62
+ if (key === 'showModal' || key === 'dismissModal') {
63
+ if (typeof parentOptions[key] === 'object' &&
64
+ !('enter' in parentOptions[key]) &&
65
+ !('exit' in parentOptions[key]))
66
+ console.warn(`${key} without enter/exit is deprecated, and will be changed in the next major version. For more information see https://wix.github.io/react-native-navigation/docs/style-animations#modal-animations`, parentOptions);
67
+ }
68
+ }
69
+ onProcessDefaultOptions(_key, _parentOptions) { }
70
+ deprecateSearchBarOptions = (0, once_1.default)((parentOptions) => {
71
+ console.warn(`toggling searchBar visibility using a boolean value will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
72
+ });
73
+ deprecateInterpolationOptions = (0, once_1.default)((parentOptions) => {
74
+ console.warn(`Using Interpolation types as strings has been deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/pull/6644`, parentOptions);
75
+ });
76
+ deprecateBottomTabsVisibility = (0, once_1.default)((parentOptions) => {
77
+ console.warn(`toggling bottomTabs visibility is deprecated on iOS. For more information see https://github.com/wix/react-native-navigation/issues/6416`, parentOptions);
78
+ });
79
+ }
80
+ exports.Deprecations = Deprecations;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LayoutTreeCrawler = void 0;
4
4
  const LayoutType_1 = require("./LayoutType");
5
5
  class LayoutTreeCrawler {
6
+ store;
7
+ optionsProcessor;
6
8
  constructor(store, optionsProcessor) {
7
9
  this.store = store;
8
10
  this.optionsProcessor = optionsProcessor;
@@ -12,7 +14,7 @@ class LayoutTreeCrawler {
12
14
  if (node.type === LayoutType_1.LayoutType.Component) {
13
15
  this.handleComponent(node);
14
16
  }
15
- this.optionsProcessor.processOptions(node.data.options, commandName);
17
+ this.optionsProcessor.processOptions(commandName, node.data.options);
16
18
  node.children.forEach((value) => this.crawl(value, commandName));
17
19
  }
18
20
  handleComponent(node) {
@@ -21,7 +23,7 @@ class LayoutTreeCrawler {
21
23
  node.data.passProps = undefined;
22
24
  }
23
25
  savePropsToStore(node) {
24
- this.store.updateProps(node.id, node.data.passProps);
26
+ this.store.setPendingProps(node.id, node.data.passProps);
25
27
  }
26
28
  assertComponentDataName(component) {
27
29
  if (!component.data.name) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LayoutTreeParser = void 0;
4
4
  const LayoutType_1 = require("./LayoutType");
5
5
  class LayoutTreeParser {
6
+ uniqueIdProvider;
6
7
  constructor(uniqueIdProvider) {
7
8
  this.uniqueIdProvider = uniqueIdProvider;
8
9
  this.parse = this.parse.bind(this);
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OptionsCrawler = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
6
- const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
5
+ const merge_1 = (0, tslib_1.__importDefault)(require("lodash/merge"));
6
+ const isFunction_1 = (0, tslib_1.__importDefault)(require("lodash/isFunction"));
7
7
  const LayoutType_1 = require("./LayoutType");
8
8
  class OptionsCrawler {
9
+ store;
10
+ uniqueIdProvider;
9
11
  constructor(store, uniqueIdProvider) {
10
12
  this.store = store;
11
13
  this.uniqueIdProvider = uniqueIdProvider;
@@ -63,13 +65,13 @@ class OptionsCrawler {
63
65
  }
64
66
  applyStaticOptions(layout) {
65
67
  const staticOptions = this.staticOptionsIfPossible(layout);
66
- layout.options = merge_1.default({}, staticOptions, layout.options);
68
+ layout.options = (0, merge_1.default)({}, staticOptions, layout.options);
67
69
  }
68
70
  staticOptionsIfPossible(layout) {
69
71
  const foundReactGenerator = this.store.getComponentClassForName(layout.name);
70
72
  const reactComponent = foundReactGenerator ? foundReactGenerator() : undefined;
71
73
  if (reactComponent && this.isComponentWithOptions(reactComponent)) {
72
- return isFunction_1.default(reactComponent.options)
74
+ return (0, isFunction_1.default)(reactComponent.options)
73
75
  ? reactComponent.options({ componentId: layout.id, ...layout.passProps } || {})
74
76
  : reactComponent.options;
75
77
  }
@@ -14,7 +14,7 @@ export declare class OptionsProcessor {
14
14
  private assetService;
15
15
  private deprecations;
16
16
  constructor(store: Store, uniqueIdProvider: UniqueIdProvider, optionProcessorsRegistry: OptionProcessorsStore, colorService: ColorService, assetService: AssetService, deprecations: Deprecations);
17
- processOptions(options: Options, commandName: CommandName, props?: any): void;
17
+ processOptions(commandName: CommandName, options?: Options, props?: any): void;
18
18
  processDefaultOptions(options: Options, commandName: CommandName): void;
19
19
  private processObject;
20
20
  private resolveObjectPath;
@@ -2,16 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OptionsProcessor = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const clone_1 = tslib_1.__importDefault(require("lodash/clone"));
6
- const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
7
- const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
8
- const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
9
- const isString_1 = tslib_1.__importDefault(require("lodash/isString"));
10
- const endsWith_1 = tslib_1.__importDefault(require("lodash/endsWith"));
11
- const forEach_1 = tslib_1.__importDefault(require("lodash/forEach"));
12
- const has_1 = tslib_1.__importDefault(require("lodash/has"));
5
+ const clone_1 = (0, tslib_1.__importDefault)(require("lodash/clone"));
6
+ const isEqual_1 = (0, tslib_1.__importDefault)(require("lodash/isEqual"));
7
+ const isObject_1 = (0, tslib_1.__importDefault)(require("lodash/isObject"));
8
+ const isArray_1 = (0, tslib_1.__importDefault)(require("lodash/isArray"));
9
+ const isString_1 = (0, tslib_1.__importDefault)(require("lodash/isString"));
10
+ const endsWith_1 = (0, tslib_1.__importDefault)(require("lodash/endsWith"));
11
+ const forEach_1 = (0, tslib_1.__importDefault)(require("lodash/forEach"));
12
+ const has_1 = (0, tslib_1.__importDefault)(require("lodash/has"));
13
13
  const react_native_1 = require("react-native");
14
14
  class OptionsProcessor {
15
+ store;
16
+ uniqueIdProvider;
17
+ optionProcessorsRegistry;
18
+ colorService;
19
+ assetService;
20
+ deprecations;
15
21
  constructor(store, uniqueIdProvider, optionProcessorsRegistry, colorService, assetService, deprecations) {
16
22
  this.store = store;
17
23
  this.uniqueIdProvider = uniqueIdProvider;
@@ -20,19 +26,21 @@ class OptionsProcessor {
20
26
  this.assetService = assetService;
21
27
  this.deprecations = deprecations;
22
28
  }
23
- processOptions(options, commandName, props) {
24
- this.processObject(options, clone_1.default(options), (key, parentOptions) => {
25
- this.deprecations.onProcessOptions(key, parentOptions, commandName);
26
- this.deprecations.checkForDeprecatedOptions(parentOptions);
27
- }, commandName, props);
29
+ processOptions(commandName, options, props) {
30
+ if (options) {
31
+ this.processObject(options, (0, clone_1.default)(options), (key, parentOptions) => {
32
+ this.deprecations.onProcessOptions(key, parentOptions, commandName);
33
+ this.deprecations.checkForDeprecatedOptions(parentOptions);
34
+ }, commandName, props);
35
+ }
28
36
  }
29
37
  processDefaultOptions(options, commandName) {
30
- this.processObject(options, clone_1.default(options), (key, parentOptions) => {
38
+ this.processObject(options, (0, clone_1.default)(options), (key, parentOptions) => {
31
39
  this.deprecations.onProcessDefaultOptions(key, parentOptions);
32
40
  }, commandName);
33
41
  }
34
42
  processObject(objectToProcess, parentOptions, onProcess, commandName, props, parentPath) {
35
- forEach_1.default(objectToProcess, (value, key) => {
43
+ (0, forEach_1.default)(objectToProcess, (value, key) => {
36
44
  const objectPath = this.resolveObjectPath(key, parentPath);
37
45
  this.processWithRegisteredProcessor(key, value, objectToProcess, objectPath, commandName, props);
38
46
  this.processColor(key, value, objectToProcess);
@@ -47,7 +55,7 @@ class OptionsProcessor {
47
55
  this.processAnimation(key, value, objectToProcess);
48
56
  onProcess(key, parentOptions);
49
57
  const processedValue = objectToProcess[key];
50
- if (!isEqual_1.default(key, 'passProps') && (isObject_1.default(processedValue) || isArray_1.default(processedValue))) {
58
+ if (!(0, isEqual_1.default)(key, 'passProps') && ((0, isObject_1.default)(processedValue) || (0, isArray_1.default)(processedValue))) {
51
59
  this.processObject(processedValue, parentOptions, onProcess, commandName, props, objectPath);
52
60
  }
53
61
  });
@@ -60,7 +68,7 @@ class OptionsProcessor {
60
68
  return path;
61
69
  }
62
70
  processColor(key, value, options) {
63
- if (isEqual_1.default(key, 'color') || endsWith_1.default(key, 'Color')) {
71
+ if ((0, isEqual_1.default)(key, 'color') || (0, endsWith_1.default)(key, 'Color')) {
64
72
  if (react_native_1.Platform.OS === 'ios')
65
73
  this.processColorIOS(key, value, options);
66
74
  else
@@ -77,13 +85,13 @@ class OptionsProcessor {
77
85
  options[key] = value;
78
86
  }
79
87
  else if ('dynamic' in value) {
80
- options[key] = react_native_1.DynamicColorIOS({
88
+ options[key] = (0, react_native_1.DynamicColorIOS)({
81
89
  light: this.colorService.toNativeColor(value.dynamic.light),
82
90
  dark: this.colorService.toNativeColor(value.dynamic.dark),
83
91
  });
84
92
  }
85
93
  else {
86
- options[key] = react_native_1.DynamicColorIOS({
94
+ options[key] = (0, react_native_1.DynamicColorIOS)({
87
95
  light: this.colorService.toNativeColor(value.light),
88
96
  dark: this.colorService.toNativeColor(value.dark),
89
97
  });
@@ -129,29 +137,29 @@ class OptionsProcessor {
129
137
  }
130
138
  }
131
139
  processImage(key, value, options) {
132
- if (isEqual_1.default(key, 'icon') ||
133
- isEqual_1.default(key, 'image') ||
134
- endsWith_1.default(key, 'Icon') ||
135
- endsWith_1.default(key, 'Image')) {
136
- options[key] = isString_1.default(value) ? value : this.assetService.resolveFromRequire(value);
140
+ if ((0, isEqual_1.default)(key, 'icon') ||
141
+ (0, isEqual_1.default)(key, 'image') ||
142
+ (0, endsWith_1.default)(key, 'Icon') ||
143
+ (0, endsWith_1.default)(key, 'Image')) {
144
+ options[key] = (0, isString_1.default)(value) ? value : this.assetService.resolveFromRequire(value);
137
145
  }
138
146
  }
139
147
  processButtonsPassProps(key, value) {
140
- if (endsWith_1.default(key, 'Buttons')) {
141
- forEach_1.default(value, (button) => {
148
+ if ((0, endsWith_1.default)(key, 'Buttons')) {
149
+ (0, forEach_1.default)(value, (button) => {
142
150
  if (button.passProps && button.id) {
143
- this.store.updateProps(button.id, button.passProps);
151
+ this.store.setPendingProps(button.id, button.passProps);
144
152
  button.passProps = undefined;
145
153
  }
146
154
  });
147
155
  }
148
156
  }
149
157
  processComponent(key, value, options) {
150
- if (isEqual_1.default(key, 'component')) {
158
+ if ((0, isEqual_1.default)(key, 'component')) {
151
159
  value.componentId = value.id ? value.id : this.uniqueIdProvider.generate('CustomComponent');
152
160
  this.store.ensureClassForName(value.name);
153
161
  if (value.passProps) {
154
- this.store.updateProps(value.componentId, value.passProps);
162
+ this.store.setPendingProps(value.componentId, value.passProps);
155
163
  }
156
164
  options[key].passProps = undefined;
157
165
  }
@@ -185,7 +193,7 @@ class OptionsProcessor {
185
193
  }
186
194
  }
187
195
  processInterpolation(key, value, options) {
188
- if (isEqual_1.default(key, 'interpolation')) {
196
+ if ((0, isEqual_1.default)(key, 'interpolation')) {
189
197
  if (typeof value === 'string') {
190
198
  this.deprecations.onProcessOptions(key, options, '');
191
199
  options[key] = {
@@ -210,19 +218,19 @@ class OptionsProcessor {
210
218
  this.convertDeprecatedViewAnimationApiToNewStackAnimationApi(animation, parentOptions);
211
219
  }
212
220
  isNewStackAnimationApi(animation) {
213
- return has_1.default(animation, 'content') || has_1.default(animation, 'topBar') || has_1.default(animation, 'bottomTabs');
221
+ return (0, has_1.default)(animation, 'content') || (0, has_1.default)(animation, 'topBar') || (0, has_1.default)(animation, 'bottomTabs');
214
222
  }
215
223
  convertDeprecatedViewAnimationApiToNewStackAnimationApi(animation, parentOptions) {
216
- if (!has_1.default(animation, 'content.enter') && !has_1.default(animation, 'content.exit')) {
224
+ if (!(0, has_1.default)(animation, 'content.enter') && !(0, has_1.default)(animation, 'content.exit')) {
217
225
  parentOptions.setStackRoot = {
218
226
  content: {
219
227
  enter: animation,
220
228
  },
221
229
  };
222
- if (has_1.default(animation, 'enabled')) {
230
+ if ((0, has_1.default)(animation, 'enabled')) {
223
231
  parentOptions.setStackRoot.enabled = animation.enabled;
224
232
  }
225
- if (has_1.default(animation, 'waitForRender')) {
233
+ if ((0, has_1.default)(animation, 'waitForRender')) {
226
234
  parentOptions.setStackRoot.waitForRender = animation.waitForRender;
227
235
  }
228
236
  }
@@ -230,19 +238,19 @@ class OptionsProcessor {
230
238
  processPop(key, animation, parentOptions) {
231
239
  if (key !== 'pop')
232
240
  return;
233
- if (animation.content && !has_1.default(animation, 'content.enter') && !has_1.default(animation, 'content.exit')) {
241
+ if (animation.content && !(0, has_1.default)(animation, 'content.enter') && !(0, has_1.default)(animation, 'content.exit')) {
234
242
  parentOptions.pop.content = {
235
243
  exit: animation.content,
236
244
  };
237
245
  }
238
- if (animation.topBar && !has_1.default(animation, 'topBar.enter') && !has_1.default(animation, 'topBar.exit')) {
246
+ if (animation.topBar && !(0, has_1.default)(animation, 'topBar.enter') && !(0, has_1.default)(animation, 'topBar.exit')) {
239
247
  parentOptions.pop.topBar = {
240
248
  exit: animation.topBar,
241
249
  };
242
250
  }
243
251
  if (animation.bottomTabs &&
244
- !has_1.default(animation, 'bottomTabs.enter') &&
245
- !has_1.default(animation, 'bottomTabs.exit')) {
252
+ !(0, has_1.default)(animation, 'bottomTabs.enter') &&
253
+ !(0, has_1.default)(animation, 'bottomTabs.exit')) {
246
254
  parentOptions.pop.bottomTabs = {
247
255
  exit: animation.bottomTabs,
248
256
  };
@@ -295,19 +303,19 @@ class OptionsProcessor {
295
303
  processPush(key, animation, parentOptions) {
296
304
  if (key !== 'push')
297
305
  return;
298
- if (animation.content && !has_1.default(animation, 'content.enter') && !has_1.default(animation, 'content.exit')) {
306
+ if (animation.content && !(0, has_1.default)(animation, 'content.enter') && !(0, has_1.default)(animation, 'content.exit')) {
299
307
  parentOptions.push.content = {
300
308
  enter: animation.content,
301
309
  };
302
310
  }
303
- if (animation.topBar && !has_1.default(animation, 'topBar.enter') && !has_1.default(animation, 'topBar.exit')) {
311
+ if (animation.topBar && !(0, has_1.default)(animation, 'topBar.enter') && !(0, has_1.default)(animation, 'topBar.exit')) {
304
312
  parentOptions.push.topBar = {
305
313
  enter: animation.topBar,
306
314
  };
307
315
  }
308
316
  if (animation.bottomTabs &&
309
- !has_1.default(animation, 'bottomTabs.enter') &&
310
- !has_1.default(animation, 'bottomTabs.exit')) {
317
+ !(0, has_1.default)(animation, 'bottomTabs.enter') &&
318
+ !(0, has_1.default)(animation, 'bottomTabs.exit')) {
311
319
  parentOptions.push.bottomTabs = {
312
320
  enter: animation.bottomTabs,
313
321
  };
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentRegistry = void 0;
4
4
  class ComponentRegistry {
5
+ store;
6
+ componentEventsObserver;
7
+ componentWrapper;
8
+ appRegistryService;
5
9
  constructor(store, componentEventsObserver, componentWrapper, appRegistryService) {
6
10
  this.store = store;
7
11
  this.componentEventsObserver = componentEventsObserver;
@@ -2,23 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentWrapper = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
5
+ const React = (0, tslib_1.__importStar)(require("react"));
6
6
  const react_lifecycles_compat_1 = require("react-lifecycles-compat");
7
- const hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics"));
7
+ const hoist_non_react_statics_1 = (0, tslib_1.__importDefault)(require("hoist-non-react-statics"));
8
8
  class ComponentWrapper {
9
9
  wrap(componentName, OriginalComponentGenerator, store, componentEventsObserver, concreteComponentProvider = OriginalComponentGenerator, ReduxProvider, reduxStore) {
10
10
  const GeneratedComponentClass = OriginalComponentGenerator();
11
11
  class WrappedComponent extends React.Component {
12
- constructor(props) {
13
- super(props);
14
- this._isMounted = false;
15
- this._assertComponentId();
16
- this.state = {
17
- componentId: props.componentId,
18
- allProps: {},
19
- };
20
- store.setComponentInstance(props.componentId, this);
21
- }
22
12
  static getDerivedStateFromProps(nextProps, prevState) {
23
13
  return {
24
14
  allProps: {
@@ -27,9 +17,19 @@ class ComponentWrapper {
27
17
  },
28
18
  };
29
19
  }
20
+ _isMounted = false;
30
21
  get isMounted() {
31
22
  return this._isMounted;
32
23
  }
24
+ constructor(props) {
25
+ super(props);
26
+ this._assertComponentId();
27
+ this.state = {
28
+ componentId: props.componentId,
29
+ allProps: {},
30
+ };
31
+ store.setComponentInstance(props.componentId, this);
32
+ }
33
33
  setProps(newProps, callback) {
34
34
  this.setState((prevState) => ({
35
35
  allProps: {
@@ -46,7 +46,7 @@ class ComponentWrapper {
46
46
  componentEventsObserver.unmounted(this.state.componentId);
47
47
  }
48
48
  render() {
49
- return (React.createElement(GeneratedComponentClass, Object.assign({}, this.state.allProps, { componentId: this.state.componentId })));
49
+ return (React.createElement(GeneratedComponentClass, { ...this.state.allProps, componentId: this.state.componentId }));
50
50
  }
51
51
  _assertComponentId() {
52
52
  if (!this.props.componentId) {
@@ -54,8 +54,8 @@ class ComponentWrapper {
54
54
  }
55
55
  }
56
56
  }
57
- react_lifecycles_compat_1.polyfill(WrappedComponent);
58
- hoist_non_react_statics_1.default(WrappedComponent, concreteComponentProvider === OriginalComponentGenerator
57
+ (0, react_lifecycles_compat_1.polyfill)(WrappedComponent);
58
+ (0, hoist_non_react_statics_1.default)(WrappedComponent, concreteComponentProvider === OriginalComponentGenerator
59
59
  ? GeneratedComponentClass
60
60
  : concreteComponentProvider());
61
61
  return ReduxProvider
@@ -66,10 +66,10 @@ class ComponentWrapper {
66
66
  class ReduxWrapper extends React.Component {
67
67
  render() {
68
68
  return (React.createElement(ReduxProvider, { store: reduxStore },
69
- React.createElement(WrappedComponent, Object.assign({}, this.props))));
69
+ React.createElement(WrappedComponent, { ...this.props })));
70
70
  }
71
71
  }
72
- hoist_non_react_statics_1.default(ReduxWrapper, WrappedComponent);
72
+ (0, hoist_non_react_statics_1.default)(ReduxWrapper, WrappedComponent);
73
73
  return ReduxWrapper;
74
74
  }
75
75
  }
@@ -2,17 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Modal = 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
  const react_native_1 = require("react-native");
7
- const RNNModalViewManager = react_native_1.requireNativeComponent('RNNModalViewManager');
7
+ const RNNModalViewManager = (0, react_native_1.requireNativeComponent)('RNNModalViewManager');
8
8
  class Modal extends react_1.default.Component {
9
+ static defaultProps = {
10
+ transparent: false,
11
+ blurOnUnmount: false,
12
+ animationType: 'slide',
13
+ };
9
14
  constructor(props) {
10
15
  super(props);
11
16
  }
12
17
  render() {
13
18
  const processed = this.proccessProps();
14
19
  if (this.props.visible) {
15
- return (react_1.default.createElement(RNNModalViewManager, Object.assign({}, processed),
20
+ return (react_1.default.createElement(RNNModalViewManager, { ...processed },
16
21
  react_1.default.createElement(react_native_1.View, { style: styles.container, collapsable: false }, this.props.children)));
17
22
  }
18
23
  else {
@@ -42,11 +47,6 @@ class Modal extends react_1.default.Component {
42
47
  }
43
48
  }
44
49
  exports.Modal = Modal;
45
- Modal.defaultProps = {
46
- transparent: false,
47
- blurOnUnmount: false,
48
- animationType: 'slide',
49
- };
50
50
  const height = Math.round(react_native_1.Dimensions.get('window').height);
51
51
  const SCREEN_ANIMATION_DURATION = 500;
52
52
  const showModalSlideEnterAnimations = {
@@ -4,10 +4,12 @@ import { IWrappedComponent } from './ComponentWrapper';
4
4
  export declare class Store {
5
5
  private componentsByName;
6
6
  private propsById;
7
+ private pendingPropsById;
7
8
  private componentsInstancesById;
8
9
  private wrappedComponents;
9
10
  private lazyRegistratorFn;
10
11
  updateProps(componentId: string, props: any, callback?: () => void): void;
12
+ setPendingProps(componentId: string, newProps: any): void;
11
13
  getPropsForId(componentId: string): any;
12
14
  mergeNewPropsForId(componentId: string, newProps: any): void;
13
15
  clearComponent(componentId: string): void;