react-native-navigation 8.7.4 → 8.7.5-snapshot.2301

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 (312) hide show
  1. package/android/ARCHITECTURE.md +458 -0
  2. package/android/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/IconBackgroundDrawable.kt +20 -17
  3. package/ios/ARCHITECTURE.md +416 -0
  4. package/ios/BottomTabsAfterInitialTabAttacher.mm +31 -0
  5. package/ios/RNNNavigationOptions.h +1 -0
  6. package/ios/RNNNavigationOptions.mm +4 -0
  7. package/ios/RNNOverlayManager.mm +4 -0
  8. package/ios/RNNScrollEdgeAppearanceOptions.h +2 -0
  9. package/ios/RNNScrollEdgeAppearanceOptions.mm +2 -0
  10. package/ios/ScreenAnimationController.mm +29 -24
  11. package/ios/StackControllerDelegate.mm +21 -3
  12. package/ios/TopBarAppearancePresenter.mm +35 -0
  13. package/lib/module/ARCHITECTURE.md +301 -0
  14. package/lib/module/Mock/Application.js +33 -0
  15. package/lib/module/Mock/Application.js.map +1 -0
  16. package/lib/module/Mock/ComponentProps.js +4 -0
  17. package/lib/module/Mock/ComponentProps.js.map +1 -0
  18. package/lib/module/Mock/Components/BottomTabs.js +16 -0
  19. package/lib/module/Mock/Components/BottomTabs.js.map +1 -0
  20. package/lib/module/Mock/Components/ComponentScreen.js +101 -0
  21. package/lib/module/Mock/Components/ComponentScreen.js.map +1 -0
  22. package/lib/module/Mock/Components/LayoutComponent.js +50 -0
  23. package/lib/module/Mock/Components/LayoutComponent.js.map +1 -0
  24. package/lib/module/Mock/Components/Modals.js +22 -0
  25. package/lib/module/Mock/Components/Modals.js.map +1 -0
  26. package/lib/module/Mock/Components/NavigationButton.js +72 -0
  27. package/lib/module/Mock/Components/NavigationButton.js.map +1 -0
  28. package/lib/module/Mock/Components/Overlays.js +23 -0
  29. package/lib/module/Mock/Components/Overlays.js.map +1 -0
  30. package/lib/module/Mock/Components/SideMenu.js +29 -0
  31. package/lib/module/Mock/Components/SideMenu.js.map +1 -0
  32. package/lib/module/Mock/Components/Stack.js +18 -0
  33. package/lib/module/Mock/Components/Stack.js.map +1 -0
  34. package/lib/module/Mock/Components/TopBar.js +81 -0
  35. package/lib/module/Mock/Components/TopBar.js.map +1 -0
  36. package/lib/module/Mock/Layouts/BottomTabsNode.js +30 -0
  37. package/lib/module/Mock/Layouts/BottomTabsNode.js.map +1 -0
  38. package/lib/module/Mock/Layouts/ComponentNode.js +102 -0
  39. package/lib/module/Mock/Layouts/ComponentNode.js.map +1 -0
  40. package/lib/module/Mock/Layouts/LayoutNodeFactory.js +28 -0
  41. package/lib/module/Mock/Layouts/LayoutNodeFactory.js.map +1 -0
  42. package/lib/module/Mock/Layouts/Node.js +14 -0
  43. package/lib/module/Mock/Layouts/Node.js.map +1 -0
  44. package/lib/module/Mock/Layouts/ParentNode.js +66 -0
  45. package/lib/module/Mock/Layouts/ParentNode.js.map +1 -0
  46. package/lib/module/Mock/Layouts/SideMenu.js +72 -0
  47. package/lib/module/Mock/Layouts/SideMenu.js.map +1 -0
  48. package/lib/module/Mock/Layouts/StackNode.js +12 -0
  49. package/lib/module/Mock/Layouts/StackNode.js.map +1 -0
  50. package/lib/module/Mock/Stores/EventsStore.js +53 -0
  51. package/lib/module/Mock/Stores/EventsStore.js.map +1 -0
  52. package/lib/module/Mock/Stores/LayoutStore.js +176 -0
  53. package/lib/module/Mock/Stores/LayoutStore.js.map +1 -0
  54. package/lib/module/Mock/actions/layoutActions.js +19 -0
  55. package/lib/module/Mock/actions/layoutActions.js.map +1 -0
  56. package/lib/module/Mock/connect.js +8 -0
  57. package/lib/module/Mock/connect.js.map +1 -0
  58. package/lib/module/Mock/constants.js +5 -0
  59. package/lib/module/Mock/constants.js.map +1 -0
  60. package/lib/module/Mock/index.js +20 -0
  61. package/lib/module/Mock/index.js.map +1 -0
  62. package/lib/module/Mock/mocks/AppRegistryService.js +6 -0
  63. package/lib/module/Mock/mocks/AppRegistryService.js.map +1 -0
  64. package/lib/module/Mock/mocks/NativeCommandsSender.js +146 -0
  65. package/lib/module/Mock/mocks/NativeCommandsSender.js.map +1 -0
  66. package/lib/module/Mock/mocks/NativeEventsReceiver.js +103 -0
  67. package/lib/module/Mock/mocks/NativeEventsReceiver.js.map +1 -0
  68. package/lib/module/interfaces/Options.js.map +1 -1
  69. package/lib/typescript/Mock/Application.d.ts.map +1 -1
  70. package/lib/typescript/Mock/ComponentProps.d.ts.map +1 -1
  71. package/lib/typescript/Mock/Components/BottomTabs.d.ts.map +1 -1
  72. package/lib/typescript/Mock/Components/ComponentScreen.d.ts.map +1 -1
  73. package/lib/typescript/Mock/Components/LayoutComponent.d.ts.map +1 -1
  74. package/lib/typescript/Mock/Components/Modals.d.ts.map +1 -1
  75. package/lib/typescript/Mock/Components/NavigationButton.d.ts +1 -1
  76. package/lib/typescript/Mock/Components/NavigationButton.d.ts.map +1 -1
  77. package/lib/typescript/Mock/Components/Overlays.d.ts.map +1 -1
  78. package/lib/typescript/Mock/Components/SideMenu.d.ts.map +1 -1
  79. package/lib/typescript/Mock/Components/Stack.d.ts.map +1 -1
  80. package/lib/typescript/Mock/Components/TopBar.d.ts +1 -1
  81. package/lib/typescript/Mock/Components/TopBar.d.ts.map +1 -1
  82. package/lib/typescript/Mock/Layouts/BottomTabsNode.d.ts +1 -1
  83. package/lib/typescript/Mock/Layouts/BottomTabsNode.d.ts.map +1 -1
  84. package/lib/typescript/Mock/Layouts/ComponentNode.d.ts +1 -1
  85. package/lib/typescript/Mock/Layouts/ComponentNode.d.ts.map +1 -1
  86. package/lib/typescript/Mock/Layouts/LayoutNodeFactory.d.ts.map +1 -1
  87. package/lib/typescript/Mock/Layouts/Node.d.ts +1 -1
  88. package/lib/typescript/Mock/Layouts/Node.d.ts.map +1 -1
  89. package/lib/typescript/Mock/Layouts/ParentNode.d.ts +2 -2
  90. package/lib/typescript/Mock/Layouts/ParentNode.d.ts.map +1 -1
  91. package/lib/typescript/Mock/Layouts/SideMenu.d.ts +1 -1
  92. package/lib/typescript/Mock/Layouts/SideMenu.d.ts.map +1 -1
  93. package/lib/typescript/Mock/Layouts/StackNode.d.ts.map +1 -1
  94. package/lib/typescript/Mock/Stores/EventsStore.d.ts +3 -3
  95. package/lib/typescript/Mock/Stores/EventsStore.d.ts.map +1 -1
  96. package/lib/typescript/Mock/Stores/LayoutStore.d.ts.map +1 -1
  97. package/lib/typescript/Mock/actions/layoutActions.d.ts.map +1 -1
  98. package/lib/typescript/Mock/connect.d.ts.map +1 -1
  99. package/lib/typescript/Mock/constants.d.ts.map +1 -1
  100. package/lib/typescript/Mock/index.d.ts.map +1 -1
  101. package/lib/typescript/Mock/mocks/AppRegistryService.d.ts.map +1 -1
  102. package/lib/typescript/Mock/mocks/NativeCommandsSender.d.ts +2 -2
  103. package/lib/typescript/Mock/mocks/NativeCommandsSender.d.ts.map +1 -1
  104. package/lib/typescript/Mock/mocks/NativeEventsReceiver.d.ts +2 -2
  105. package/lib/typescript/Mock/mocks/NativeEventsReceiver.d.ts.map +1 -1
  106. package/lib/typescript/Navigation.d.ts.map +1 -0
  107. package/lib/typescript/NavigationDelegate.d.ts.map +1 -0
  108. package/lib/typescript/adapters/AppRegistryService.d.ts.map +1 -0
  109. package/lib/typescript/adapters/AssetResolver.d.ts.map +1 -0
  110. package/lib/typescript/adapters/ColorService.d.ts.map +1 -0
  111. package/lib/typescript/adapters/Constants.d.ts.map +1 -0
  112. package/lib/typescript/adapters/NativeCommandsSender.d.ts.map +1 -0
  113. package/lib/typescript/adapters/NativeEventsReceiver.d.ts.map +1 -0
  114. package/lib/typescript/adapters/NativeEventsReceiver.mock.d.ts.map +1 -0
  115. package/lib/typescript/adapters/NativeRNNTurboEventEmitter.d.ts.map +1 -0
  116. package/lib/typescript/adapters/NativeRNNTurboModule.d.ts.map +1 -0
  117. package/lib/typescript/adapters/TouchablePreview.d.ts.map +1 -0
  118. package/lib/typescript/adapters/UniqueIdProvider.d.ts.map +1 -0
  119. package/lib/typescript/commands/Commands.d.ts.map +1 -0
  120. package/lib/typescript/commands/Commands.test.d.ts.map +1 -0
  121. package/lib/typescript/commands/Deprecations.d.ts.map +1 -0
  122. package/lib/typescript/commands/LayoutTreeCrawler.d.ts.map +1 -0
  123. package/lib/typescript/commands/LayoutTreeCrawler.test.d.ts.map +1 -0
  124. package/lib/typescript/commands/LayoutTreeParser.d.ts.map +1 -0
  125. package/lib/typescript/commands/LayoutTreeParser.test.d.ts.map +1 -0
  126. package/lib/typescript/commands/LayoutType.d.ts.map +1 -0
  127. package/lib/typescript/commands/LayoutType.test.d.ts.map +1 -0
  128. package/lib/typescript/commands/OptionsCrawler.d.ts.map +1 -0
  129. package/lib/typescript/commands/OptionsCrawler.test.d.ts.map +1 -0
  130. package/lib/typescript/commands/OptionsProcessor.d.ts.map +1 -0
  131. package/lib/typescript/commands/OptionsProcessor.test.d.ts.map +1 -0
  132. package/lib/typescript/components/ComponentRegistry.d.ts.map +1 -0
  133. package/lib/typescript/components/ComponentRegistry.test.d.ts.map +1 -0
  134. package/lib/typescript/components/ComponentWrapper.d.ts.map +1 -0
  135. package/lib/typescript/components/ComponentWrapper.test.d.ts.map +1 -0
  136. package/lib/typescript/components/Modal.d.ts.map +1 -0
  137. package/lib/typescript/components/Store.d.ts.map +1 -0
  138. package/lib/typescript/components/Store.test.d.ts.map +1 -0
  139. package/lib/typescript/events/CommandsObserver.d.ts.map +1 -0
  140. package/lib/typescript/events/CommandsObserver.test.d.ts.map +1 -0
  141. package/lib/typescript/events/ComponentEventsObserver.d.ts.map +1 -0
  142. package/lib/typescript/events/ComponentEventsObserver.test.d.ts.map +1 -0
  143. package/lib/typescript/events/EventsRegistry.d.ts.map +1 -0
  144. package/lib/typescript/events/EventsRegistry.test.d.ts.map +1 -0
  145. package/lib/typescript/index.d.ts.map +1 -0
  146. package/lib/typescript/interfaces/CommandName.d.ts.map +1 -0
  147. package/lib/typescript/interfaces/ComponentEvents.d.ts.map +1 -0
  148. package/lib/typescript/interfaces/EventSubscription.d.ts.map +1 -0
  149. package/lib/typescript/interfaces/Events.d.ts.map +1 -0
  150. package/lib/typescript/interfaces/Layout.d.ts.map +1 -0
  151. package/lib/typescript/interfaces/NavigationComponent.d.ts.map +1 -0
  152. package/lib/typescript/interfaces/NavigationComponentListener.d.ts.map +1 -0
  153. package/lib/typescript/interfaces/NavigationComponentProps.d.ts.map +1 -0
  154. package/lib/typescript/interfaces/NavigationFunctionComponent.d.ts.map +1 -0
  155. package/lib/typescript/{src/interfaces → interfaces}/Options.d.ts +29 -0
  156. package/lib/typescript/interfaces/Options.d.ts.map +1 -0
  157. package/lib/typescript/interfaces/ProcessorSubscription.d.ts.map +1 -0
  158. package/lib/typescript/interfaces/Processors.d.ts.map +1 -0
  159. package/lib/typescript/processors/LayoutProcessor.d.ts.map +1 -0
  160. package/lib/typescript/processors/LayoutProcessor.test.d.ts.map +1 -0
  161. package/lib/typescript/processors/LayoutProcessorsStore.d.ts.map +1 -0
  162. package/lib/typescript/processors/LayoutProcessorsStore.test.d.ts.map +1 -0
  163. package/lib/typescript/processors/OptionProcessorsStore.d.ts.map +1 -0
  164. package/lib/typescript/processors/OptionProcessorsStore.test.d.ts.map +1 -0
  165. package/lib/typescript/types.d.ts.map +1 -0
  166. package/package.json +12 -6
  167. package/src/ARCHITECTURE.md +301 -0
  168. package/src/Mock/Application.tsx +30 -0
  169. package/src/Mock/ComponentProps.tsx +6 -0
  170. package/src/Mock/Components/BottomTabs.tsx +14 -0
  171. package/src/Mock/Components/ComponentScreen.tsx +107 -0
  172. package/src/Mock/Components/LayoutComponent.tsx +37 -0
  173. package/src/Mock/Components/Modals.tsx +22 -0
  174. package/src/Mock/Components/NavigationButton.tsx +86 -0
  175. package/src/Mock/Components/Overlays.tsx +23 -0
  176. package/src/Mock/Components/SideMenu.tsx +27 -0
  177. package/src/Mock/Components/Stack.tsx +16 -0
  178. package/src/Mock/Components/TopBar.tsx +96 -0
  179. package/src/Mock/Layouts/BottomTabsNode.ts +34 -0
  180. package/src/Mock/Layouts/ComponentNode.ts +124 -0
  181. package/src/Mock/Layouts/LayoutNodeFactory.ts +31 -0
  182. package/src/Mock/Layouts/Node.ts +35 -0
  183. package/src/Mock/Layouts/ParentNode.ts +86 -0
  184. package/src/Mock/Layouts/SideMenu.ts +87 -0
  185. package/src/Mock/Layouts/StackNode.ts +11 -0
  186. package/src/Mock/Stores/EventsStore.ts +68 -0
  187. package/src/Mock/Stores/LayoutStore.ts +200 -0
  188. package/src/Mock/actions/layoutActions.ts +21 -0
  189. package/src/Mock/connect.ts +6 -0
  190. package/src/Mock/constants.ts +2 -0
  191. package/src/Mock/index.ts +16 -0
  192. package/src/Mock/mocks/AppRegistryService.ts +5 -0
  193. package/src/Mock/mocks/NativeCommandsSender.tsx +168 -0
  194. package/src/Mock/mocks/NativeEventsReceiver.ts +162 -0
  195. package/src/interfaces/Options.ts +30 -0
  196. package/lib/typescript/src/Navigation.d.ts.map +0 -1
  197. package/lib/typescript/src/NavigationDelegate.d.ts.map +0 -1
  198. package/lib/typescript/src/adapters/AppRegistryService.d.ts.map +0 -1
  199. package/lib/typescript/src/adapters/AssetResolver.d.ts.map +0 -1
  200. package/lib/typescript/src/adapters/ColorService.d.ts.map +0 -1
  201. package/lib/typescript/src/adapters/Constants.d.ts.map +0 -1
  202. package/lib/typescript/src/adapters/NativeCommandsSender.d.ts.map +0 -1
  203. package/lib/typescript/src/adapters/NativeEventsReceiver.d.ts.map +0 -1
  204. package/lib/typescript/src/adapters/NativeEventsReceiver.mock.d.ts.map +0 -1
  205. package/lib/typescript/src/adapters/NativeRNNTurboEventEmitter.d.ts.map +0 -1
  206. package/lib/typescript/src/adapters/NativeRNNTurboModule.d.ts.map +0 -1
  207. package/lib/typescript/src/adapters/TouchablePreview.d.ts.map +0 -1
  208. package/lib/typescript/src/adapters/UniqueIdProvider.d.ts.map +0 -1
  209. package/lib/typescript/src/commands/Commands.d.ts.map +0 -1
  210. package/lib/typescript/src/commands/Commands.test.d.ts.map +0 -1
  211. package/lib/typescript/src/commands/Deprecations.d.ts.map +0 -1
  212. package/lib/typescript/src/commands/LayoutTreeCrawler.d.ts.map +0 -1
  213. package/lib/typescript/src/commands/LayoutTreeCrawler.test.d.ts.map +0 -1
  214. package/lib/typescript/src/commands/LayoutTreeParser.d.ts.map +0 -1
  215. package/lib/typescript/src/commands/LayoutTreeParser.test.d.ts.map +0 -1
  216. package/lib/typescript/src/commands/LayoutType.d.ts.map +0 -1
  217. package/lib/typescript/src/commands/LayoutType.test.d.ts.map +0 -1
  218. package/lib/typescript/src/commands/OptionsCrawler.d.ts.map +0 -1
  219. package/lib/typescript/src/commands/OptionsCrawler.test.d.ts.map +0 -1
  220. package/lib/typescript/src/commands/OptionsProcessor.d.ts.map +0 -1
  221. package/lib/typescript/src/commands/OptionsProcessor.test.d.ts.map +0 -1
  222. package/lib/typescript/src/components/ComponentRegistry.d.ts.map +0 -1
  223. package/lib/typescript/src/components/ComponentRegistry.test.d.ts.map +0 -1
  224. package/lib/typescript/src/components/ComponentWrapper.d.ts.map +0 -1
  225. package/lib/typescript/src/components/ComponentWrapper.test.d.ts.map +0 -1
  226. package/lib/typescript/src/components/Modal.d.ts.map +0 -1
  227. package/lib/typescript/src/components/Store.d.ts.map +0 -1
  228. package/lib/typescript/src/components/Store.test.d.ts.map +0 -1
  229. package/lib/typescript/src/events/CommandsObserver.d.ts.map +0 -1
  230. package/lib/typescript/src/events/CommandsObserver.test.d.ts.map +0 -1
  231. package/lib/typescript/src/events/ComponentEventsObserver.d.ts.map +0 -1
  232. package/lib/typescript/src/events/ComponentEventsObserver.test.d.ts.map +0 -1
  233. package/lib/typescript/src/events/EventsRegistry.d.ts.map +0 -1
  234. package/lib/typescript/src/events/EventsRegistry.test.d.ts.map +0 -1
  235. package/lib/typescript/src/index.d.ts.map +0 -1
  236. package/lib/typescript/src/interfaces/CommandName.d.ts.map +0 -1
  237. package/lib/typescript/src/interfaces/ComponentEvents.d.ts.map +0 -1
  238. package/lib/typescript/src/interfaces/EventSubscription.d.ts.map +0 -1
  239. package/lib/typescript/src/interfaces/Events.d.ts.map +0 -1
  240. package/lib/typescript/src/interfaces/Layout.d.ts.map +0 -1
  241. package/lib/typescript/src/interfaces/NavigationComponent.d.ts.map +0 -1
  242. package/lib/typescript/src/interfaces/NavigationComponentListener.d.ts.map +0 -1
  243. package/lib/typescript/src/interfaces/NavigationComponentProps.d.ts.map +0 -1
  244. package/lib/typescript/src/interfaces/NavigationFunctionComponent.d.ts.map +0 -1
  245. package/lib/typescript/src/interfaces/Options.d.ts.map +0 -1
  246. package/lib/typescript/src/interfaces/ProcessorSubscription.d.ts.map +0 -1
  247. package/lib/typescript/src/interfaces/Processors.d.ts.map +0 -1
  248. package/lib/typescript/src/processors/LayoutProcessor.d.ts.map +0 -1
  249. package/lib/typescript/src/processors/LayoutProcessor.test.d.ts.map +0 -1
  250. package/lib/typescript/src/processors/LayoutProcessorsStore.d.ts.map +0 -1
  251. package/lib/typescript/src/processors/LayoutProcessorsStore.test.d.ts.map +0 -1
  252. package/lib/typescript/src/processors/OptionProcessorsStore.d.ts.map +0 -1
  253. package/lib/typescript/src/processors/OptionProcessorsStore.test.d.ts.map +0 -1
  254. package/lib/typescript/src/types.d.ts.map +0 -1
  255. /package/lib/typescript/{src/Navigation.d.ts → Navigation.d.ts} +0 -0
  256. /package/lib/typescript/{src/NavigationDelegate.d.ts → NavigationDelegate.d.ts} +0 -0
  257. /package/lib/typescript/{src/adapters → adapters}/AppRegistryService.d.ts +0 -0
  258. /package/lib/typescript/{src/adapters → adapters}/AssetResolver.d.ts +0 -0
  259. /package/lib/typescript/{src/adapters → adapters}/ColorService.d.ts +0 -0
  260. /package/lib/typescript/{src/adapters → adapters}/Constants.d.ts +0 -0
  261. /package/lib/typescript/{src/adapters → adapters}/NativeCommandsSender.d.ts +0 -0
  262. /package/lib/typescript/{src/adapters → adapters}/NativeEventsReceiver.d.ts +0 -0
  263. /package/lib/typescript/{src/adapters → adapters}/NativeEventsReceiver.mock.d.ts +0 -0
  264. /package/lib/typescript/{src/adapters → adapters}/NativeRNNTurboEventEmitter.d.ts +0 -0
  265. /package/lib/typescript/{src/adapters → adapters}/NativeRNNTurboModule.d.ts +0 -0
  266. /package/lib/typescript/{src/adapters → adapters}/TouchablePreview.d.ts +0 -0
  267. /package/lib/typescript/{src/adapters → adapters}/UniqueIdProvider.d.ts +0 -0
  268. /package/lib/typescript/{src/commands → commands}/Commands.d.ts +0 -0
  269. /package/lib/typescript/{src/commands → commands}/Commands.test.d.ts +0 -0
  270. /package/lib/typescript/{src/commands → commands}/Deprecations.d.ts +0 -0
  271. /package/lib/typescript/{src/commands → commands}/LayoutTreeCrawler.d.ts +0 -0
  272. /package/lib/typescript/{src/commands → commands}/LayoutTreeCrawler.test.d.ts +0 -0
  273. /package/lib/typescript/{src/commands → commands}/LayoutTreeParser.d.ts +0 -0
  274. /package/lib/typescript/{src/commands → commands}/LayoutTreeParser.test.d.ts +0 -0
  275. /package/lib/typescript/{src/commands → commands}/LayoutType.d.ts +0 -0
  276. /package/lib/typescript/{src/commands → commands}/LayoutType.test.d.ts +0 -0
  277. /package/lib/typescript/{src/commands → commands}/OptionsCrawler.d.ts +0 -0
  278. /package/lib/typescript/{src/commands → commands}/OptionsCrawler.test.d.ts +0 -0
  279. /package/lib/typescript/{src/commands → commands}/OptionsProcessor.d.ts +0 -0
  280. /package/lib/typescript/{src/commands → commands}/OptionsProcessor.test.d.ts +0 -0
  281. /package/lib/typescript/{src/components → components}/ComponentRegistry.d.ts +0 -0
  282. /package/lib/typescript/{src/components → components}/ComponentRegistry.test.d.ts +0 -0
  283. /package/lib/typescript/{src/components → components}/ComponentWrapper.d.ts +0 -0
  284. /package/lib/typescript/{src/components → components}/ComponentWrapper.test.d.ts +0 -0
  285. /package/lib/typescript/{src/components → components}/Modal.d.ts +0 -0
  286. /package/lib/typescript/{src/components → components}/Store.d.ts +0 -0
  287. /package/lib/typescript/{src/components → components}/Store.test.d.ts +0 -0
  288. /package/lib/typescript/{src/events → events}/CommandsObserver.d.ts +0 -0
  289. /package/lib/typescript/{src/events → events}/CommandsObserver.test.d.ts +0 -0
  290. /package/lib/typescript/{src/events → events}/ComponentEventsObserver.d.ts +0 -0
  291. /package/lib/typescript/{src/events → events}/ComponentEventsObserver.test.d.ts +0 -0
  292. /package/lib/typescript/{src/events → events}/EventsRegistry.d.ts +0 -0
  293. /package/lib/typescript/{src/events → events}/EventsRegistry.test.d.ts +0 -0
  294. /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
  295. /package/lib/typescript/{src/interfaces → interfaces}/CommandName.d.ts +0 -0
  296. /package/lib/typescript/{src/interfaces → interfaces}/ComponentEvents.d.ts +0 -0
  297. /package/lib/typescript/{src/interfaces → interfaces}/EventSubscription.d.ts +0 -0
  298. /package/lib/typescript/{src/interfaces → interfaces}/Events.d.ts +0 -0
  299. /package/lib/typescript/{src/interfaces → interfaces}/Layout.d.ts +0 -0
  300. /package/lib/typescript/{src/interfaces → interfaces}/NavigationComponent.d.ts +0 -0
  301. /package/lib/typescript/{src/interfaces → interfaces}/NavigationComponentListener.d.ts +0 -0
  302. /package/lib/typescript/{src/interfaces → interfaces}/NavigationComponentProps.d.ts +0 -0
  303. /package/lib/typescript/{src/interfaces → interfaces}/NavigationFunctionComponent.d.ts +0 -0
  304. /package/lib/typescript/{src/interfaces → interfaces}/ProcessorSubscription.d.ts +0 -0
  305. /package/lib/typescript/{src/interfaces → interfaces}/Processors.d.ts +0 -0
  306. /package/lib/typescript/{src/processors → processors}/LayoutProcessor.d.ts +0 -0
  307. /package/lib/typescript/{src/processors → processors}/LayoutProcessor.test.d.ts +0 -0
  308. /package/lib/typescript/{src/processors → processors}/LayoutProcessorsStore.d.ts +0 -0
  309. /package/lib/typescript/{src/processors → processors}/LayoutProcessorsStore.test.d.ts +0 -0
  310. /package/lib/typescript/{src/processors → processors}/OptionProcessorsStore.d.ts +0 -0
  311. /package/lib/typescript/{src/processors → processors}/OptionProcessorsStore.test.d.ts +0 -0
  312. /package/lib/typescript/{src/types.d.ts → types.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Processors.d.ts","sourceRoot":"","sources":["../../../src/interfaces/Processors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG;IAC1C,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutProcessor.d.ts","sourceRoot":"","sources":["../../../src/processors/LayoutProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAEzD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM;CAQtE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutProcessor.test.d.ts","sourceRoot":"","sources":["../../../src/processors/LayoutProcessor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutProcessorsStore.d.ts","sourceRoot":"","sources":["../../../src/processors/LayoutProcessorsStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,gBAAgB,CAAyB;IAE1C,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,qBAAqB;IAM/D,aAAa,IAAI,eAAe,EAAE;IAIzC,OAAO,CAAC,eAAe;CAGxB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutProcessorsStore.test.d.ts","sourceRoot":"","sources":["../../../src/processors/LayoutProcessorsStore.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionProcessorsStore.d.ts","sourceRoot":"","sources":["../../../src/processors/OptionProcessorsStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,6BAA6B,CAA+C;IAE7E,YAAY,CAAC,CAAC,EACnB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC7B,qBAAqB;IASjB,aAAa,CAAC,UAAU,EAAE,MAAM;IAIvC,OAAO,CAAC,eAAe;CAKxB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionProcessorsStore.test.d.ts","sourceRoot":"","sources":["../../../src/processors/OptionProcessorsStore.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,yBAAyB,CAAC;IACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;IAE/B,SAAgB,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACtE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "8.7.4",
3
+ "version": "8.7.5-snapshot.2301",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,
@@ -20,14 +20,20 @@
20
20
  "rnn-link": "./autolink/postlink/run.js"
21
21
  },
22
22
  "main": "./lib/module/index.js",
23
- "types": "./lib/typescript/src/index.d.ts",
23
+ "types": "./lib/typescript/index.d.ts",
24
24
  "react-native": "./src/index.ts",
25
25
  "exports": {
26
26
  ".": {
27
- "react-native": "./src/index.ts",
27
+ "types": "./lib/typescript/index.d.ts",
28
+ "default": "./lib/module/index.js",
28
29
  "source": "./src/index.ts",
29
- "types": "./lib/typescript/src/index.d.ts",
30
- "default": "./lib/module/index.js"
30
+ "react-native": "./src/index.ts"
31
+ },
32
+ "./Mock": {
33
+ "types": "./lib/typescript/Mock/index.d.ts",
34
+ "default": "./lib/module/Mock/index.js",
35
+ "source": "./src/Mock/index.ts",
36
+ "react-native": "./src/Mock/index.ts"
31
37
  },
32
38
  "./package.json": "./package.json"
33
39
  },
@@ -76,7 +82,7 @@
76
82
  },
77
83
  "dependencies": {
78
84
  "hoist-non-react-statics": "3.3.2",
79
- "lodash": "4.17.21",
85
+ "lodash": "4.17.23",
80
86
  "prop-types": "15.x.x",
81
87
  "react-lifecycles-compat": "^3.0.4",
82
88
  "tslib": "1.9.3"
@@ -0,0 +1,301 @@
1
+ # JavaScript/TypeScript Architecture
2
+
3
+ The JavaScript layer provides the public API and orchestrates communication between React components and native navigation implementations.
4
+
5
+ ## Entry Point
6
+
7
+ `index.ts` exports the `Navigation` singleton (a `NavigationDelegate` instance) along with re-exports from `Modal`, `EventsRegistry`, `Constants`, and all interfaces. Applications use `Navigation.*` for commands and `Navigation.events().*` for event subscriptions.
8
+
9
+ ## Module Structure
10
+
11
+ ```
12
+ src/
13
+ ├── index.ts # Main entry point, exports Navigation singleton
14
+ ├── Navigation.ts # NavigationRoot - core orchestrator
15
+ ├── NavigationDelegate.ts # Public API facade
16
+ ├── adapters/ # Native bridge layer
17
+ ├── commands/ # Command processing
18
+ ├── components/ # React component management
19
+ ├── events/ # Event system
20
+ ├── interfaces/ # TypeScript type definitions
21
+ └── processors/ # Extensibility hooks
22
+ ```
23
+
24
+ ## Core Classes
25
+
26
+ ### NavigationDelegate (Public API)
27
+ **File**: `NavigationDelegate.ts`
28
+
29
+ Facade providing the public `Navigation` API. All methods proxy to `NavigationRoot`.
30
+
31
+ ```typescript
32
+ // Usage
33
+ import { Navigation } from 'react-native-navigation';
34
+ Navigation.setRoot({ root: { stack: { children: [...] } } });
35
+ ```
36
+
37
+ ### NavigationRoot (Core Orchestrator)
38
+ **File**: `Navigation.ts`
39
+
40
+ Coordinates all subsystems. Constructed with dependencies:
41
+ - `NativeCommandsSender` - sends commands to native
42
+ - `NativeEventsReceiver` - receives events from native
43
+ - `AppRegistryService` - manages React Native component registry
44
+
45
+ Initializes and coordinates:
46
+ - `Store` - component instance & props storage
47
+ - `ComponentRegistry` - component registration
48
+ - `LayoutTreeParser` - converts layouts to internal nodes
49
+ - `LayoutTreeCrawler` - processes layout trees
50
+ - `Commands` - command execution
51
+ - `EventsRegistry` - event subscriptions
52
+ - `OptionsProcessor` - option processing
53
+ - `LayoutProcessor` - layout transformations
54
+
55
+ ## Adapters Layer
56
+
57
+ Bridge between JavaScript and native/React Native APIs.
58
+
59
+ | Adapter | Purpose |
60
+ |---------|---------|
61
+ | `NativeCommandsSender` | Wraps TurboModule for command dispatch |
62
+ | `NativeEventsReceiver` | Wraps NativeEventEmitter for events |
63
+ | `NativeRNNTurboModule` | TurboModule spec interface |
64
+ | `NativeRNNTurboEventEmitter` | TurboModule event emitter spec |
65
+ | `UniqueIdProvider` | Generates unique component/command IDs |
66
+ | `ColorService` | Converts colors to native format |
67
+ | `AssetResolver` | Resolves require() image assets (class: AssetService) |
68
+ | `AppRegistryService` | Registers components with React Native |
69
+ | `Constants` | Platform dimension constants |
70
+ | `TouchablePreview` | 3D Touch / Haptic preview handling |
71
+
72
+ ## Commands Layer
73
+
74
+ ### Commands Class
75
+ **File**: `commands/Commands.ts`
76
+
77
+ Central command dispatcher. Each navigation command:
78
+ 1. Validates input
79
+ 2. Processes layout through pipeline
80
+ 3. Sends to native via adapter
81
+ 4. Returns promise with result
82
+
83
+ ### Processing Pipeline
84
+
85
+ The pipeline executes in this exact order:
86
+
87
+ ```
88
+ Input Layout (from API)
89
+
90
+ 1. OptionsCrawler.crawl() # Extract static options from component classes
91
+
92
+ 2. LayoutProcessor.process() # Apply registered layout processors
93
+
94
+ 3. LayoutTreeParser.parse() # Convert to internal LayoutNode tree
95
+
96
+ 4. LayoutTreeCrawler.crawl() # Process options, save props to Store
97
+
98
+ 5. OptionsProcessor (during crawl) # Resolve colors, assets, custom processors
99
+
100
+ 6. NativeCommandsSender # Send to native module
101
+ ```
102
+
103
+ ### LayoutNode (Internal Tree)
104
+ ```typescript
105
+ interface LayoutNode {
106
+ id: string; // Unique identifier
107
+ type: LayoutType; // Component|Stack|BottomTabs|etc
108
+ data: {
109
+ name?: string; // Component name
110
+ options?: any; // Processed options
111
+ passProps?: any; // Component props (cleared before native)
112
+ };
113
+ children: LayoutNode[];
114
+ }
115
+ ```
116
+
117
+ ### LayoutType Enum
118
+ ```typescript
119
+ enum LayoutType {
120
+ Component = 'Component',
121
+ Stack = 'Stack',
122
+ BottomTabs = 'BottomTabs',
123
+ SideMenuRoot = 'SideMenuRoot',
124
+ SideMenuCenter = 'SideMenuCenter',
125
+ SideMenuLeft = 'SideMenuLeft',
126
+ SideMenuRight = 'SideMenuRight',
127
+ TopTabs = 'TopTabs',
128
+ ExternalComponent = 'ExternalComponent',
129
+ SplitView = 'SplitView',
130
+ }
131
+ ```
132
+
133
+ ## Components Layer
134
+
135
+ ### ComponentRegistry
136
+ **File**: `components/ComponentRegistry.ts`
137
+
138
+ Manages React component registration and wrapping.
139
+
140
+ ```typescript
141
+ Navigation.registerComponent('ScreenName', () => MyComponent);
142
+ ```
143
+
144
+ ### ComponentWrapper
145
+ **File**: `components/ComponentWrapper.tsx`
146
+
147
+ Higher-order component that:
148
+ - Wraps original component with lifecycle management
149
+ - Stores instance in `Store` for event dispatch
150
+ - Injects `componentId` and `componentName` props
151
+
152
+ ### Store
153
+ **File**: `components/Store.ts`
154
+
155
+ Centralized storage for:
156
+ - `componentsByName` - registered component providers
157
+ - `componentsInstancesById` - mounted component instances
158
+ - `propsById` - static props by component ID
159
+ - `pendingPropsById` - props awaiting component mount
160
+ - `wrappedComponents` - cached wrapped components
161
+ - `lazyRegistratorFn` - function for lazy component registration
162
+
163
+ ## Events Layer
164
+
165
+ ### EventsRegistry
166
+ **File**: `events/EventsRegistry.ts`
167
+
168
+ Public API for event subscriptions:
169
+
170
+ ```typescript
171
+ Navigation.events().registerComponentDidAppearListener(({ componentId }) => {});
172
+ Navigation.events().registerCommandCompletedListener(({ commandId }) => {});
173
+ ```
174
+
175
+ ### ComponentEventsObserver
176
+ **File**: `events/ComponentEventsObserver.ts`
177
+
178
+ Dispatches events to component instance methods:
179
+ - `componentWillAppear()`
180
+ - `componentDidAppear()`
181
+ - `componentDidDisappear()`
182
+ - `navigationButtonPressed()`
183
+ - `screenPopped()`
184
+
185
+ ### CommandsObserver
186
+ **File**: `events/CommandsObserver.ts`
187
+
188
+ Notifies listeners of command lifecycle (start, complete).
189
+
190
+ ## Events (Native → JS)
191
+
192
+ | Event | Description |
193
+ |-------|-------------|
194
+ | `RNN.AppLaunched` | App initialization complete |
195
+ | `RNN.ComponentWillAppear` | Component about to appear |
196
+ | `RNN.ComponentDidAppear` | Component now visible |
197
+ | `RNN.ComponentDidDisappear` | Component hidden |
198
+ | `RNN.NavigationButtonPressed` | TopBar button tapped |
199
+ | `RNN.BottomTabPressed` | Tab pressed (even if selected) |
200
+ | `RNN.BottomTabSelected` | Tab selection changed |
201
+ | `RNN.BottomTabLongPressed` | Tab long-pressed |
202
+ | `RNN.ModalDismissed` | Modal was dismissed |
203
+ | `RNN.ModalAttemptedToDismiss` | Swipe-to-dismiss attempted |
204
+ | `RNN.ScreenPopped` | Screen removed from stack |
205
+ | `RNN.SearchBarUpdated` | Search text changed |
206
+ | `RNN.SearchBarCancelPressed` | Search cancelled |
207
+ | `RNN.PreviewCompleted` | 3D Touch preview completed |
208
+ | `RNN.CommandCompleted` | Navigation command finished |
209
+
210
+ ## Processors Layer
211
+
212
+ ### OptionProcessorsStore
213
+ **File**: `processors/OptionProcessorsStore.ts`
214
+
215
+ Registers custom option processors:
216
+
217
+ ```typescript
218
+ Navigation.addOptionProcessor('topBar.title.text', (value, commandName) => {
219
+ return value.toUpperCase(); // Transform all titles
220
+ });
221
+ ```
222
+
223
+ ### LayoutProcessorsStore
224
+ **File**: `processors/LayoutProcessorsStore.ts`
225
+
226
+ Registers layout transformers:
227
+
228
+ ```typescript
229
+ Navigation.addLayoutProcessor((layout, commandName) => {
230
+ // Add default options to all components
231
+ return layout;
232
+ });
233
+ ```
234
+
235
+ ## Interfaces
236
+
237
+ ### Layout Types
238
+ **File**: `interfaces/Layout.ts`
239
+
240
+ ```typescript
241
+ interface LayoutRoot {
242
+ root: Layout;
243
+ modals?: any[];
244
+ overlays?: any[];
245
+ }
246
+
247
+ type Layout = {
248
+ component?: LayoutComponent;
249
+ stack?: LayoutStack;
250
+ bottomTabs?: LayoutBottomTabs;
251
+ sideMenu?: LayoutSideMenu;
252
+ splitView?: LayoutSplitView;
253
+ topTabs?: LayoutTopTabs;
254
+ externalComponent?: ExternalComponent;
255
+ }
256
+ ```
257
+
258
+ ### Options Interface
259
+ **File**: `interfaces/Options.ts` (comprehensive)
260
+
261
+ Contains all configuration options for:
262
+ - Status bar, navigation bars
263
+ - Top bar (buttons, title, search)
264
+ - Bottom tabs
265
+ - Side menus
266
+ - Modals, overlays
267
+ - Animations
268
+ - Layout parameters
269
+
270
+ ### NavigationComponent
271
+ **File**: `interfaces/NavigationComponent.ts`
272
+
273
+ Base class for navigation-aware components:
274
+
275
+ ```typescript
276
+ class MyScreen extends NavigationComponent<Props> {
277
+ static options: Options = { ... };
278
+
279
+ componentDidAppear(event) { }
280
+ navigationButtonPressed(event) { }
281
+ }
282
+ ```
283
+
284
+ ## Dependencies
285
+
286
+ **Production**:
287
+ - `lodash` - utility functions
288
+ - `hoist-non-react-statics` - HOC support
289
+ - `react-lifecycles-compat` - lifecycle polyfill
290
+ - `tslib` - TypeScript helpers
291
+
292
+ **Peer**:
293
+ - `react`, `react-native` (required)
294
+ - `remx` (optional state management)
295
+
296
+ ## Build Output
297
+
298
+ Uses `react-native-builder-bob`:
299
+ - **Source**: `src/`
300
+ - **Output**: `lib/`
301
+ - **Targets**: ESM modules + TypeScript declarations
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { View } from 'react-native';
3
+ import { connect } from './connect';
4
+
5
+ interface ApplicationProps {
6
+ entryPoint: () => void;
7
+ }
8
+
9
+ export const Application = connect(
10
+ class extends React.Component<ApplicationProps> {
11
+ constructor(props: ApplicationProps) {
12
+ super(props);
13
+ props.entryPoint();
14
+ }
15
+
16
+ render() {
17
+ const { LayoutComponent } = require('./Components/LayoutComponent');
18
+ const { LayoutStore } = require('./Stores/LayoutStore');
19
+ const { Modals } = require('./Components/Modals');
20
+ const { Overlays } = require('./Components/Overlays');
21
+ return (
22
+ <View testID={'Application'}>
23
+ <LayoutComponent layoutNode={LayoutStore.getLayout()} />
24
+ <Modals />
25
+ <Overlays />
26
+ </View>
27
+ );
28
+ }
29
+ }
30
+ );
@@ -0,0 +1,6 @@
1
+ import ParentNode from './Layouts/ParentNode';
2
+
3
+ export interface ComponentProps {
4
+ layoutNode: ParentNode;
5
+ backButton?: boolean;
6
+ }
@@ -0,0 +1,14 @@
1
+ import React, { Component } from 'react';
2
+ import { LayoutComponent } from './LayoutComponent';
3
+ import { ComponentProps } from '../ComponentProps';
4
+ import { connect } from '../connect';
5
+
6
+ export const BottomTabs = connect(
7
+ class extends Component<ComponentProps> {
8
+ render() {
9
+ return this.props.layoutNode.children.map((child) => {
10
+ return <LayoutComponent key={child.nodeId} layoutNode={child} />;
11
+ });
12
+ }
13
+ }
14
+ );
@@ -0,0 +1,107 @@
1
+ import React, { Component } from 'react';
2
+ import { View, Text, TouchableOpacity, Image, ImageURISource } from 'react-native';
3
+ import { Navigation, ImageResource } from 'react-native-navigation';
4
+ import { ComponentProps } from '../ComponentProps';
5
+ import { VISIBLE_SCREEN_TEST_ID } from '../constants';
6
+ import { LayoutStore } from '../Stores/LayoutStore';
7
+ import { connect } from '../connect';
8
+ import { TopBar } from './TopBar';
9
+ import { events } from '../Stores/EventsStore';
10
+ import _ from 'lodash';
11
+ import { switchTabByIndex } from '../actions/layoutActions';
12
+
13
+ function isURISource(src: ImageResource | undefined): src is ImageURISource {
14
+ return !!src && typeof src === 'object' && 'uri' in src;
15
+ }
16
+
17
+ export const ComponentScreen = connect(
18
+ class extends Component<ComponentProps> {
19
+ constructor(props: ComponentProps) {
20
+ super(props);
21
+ }
22
+
23
+ componentDidMount() {
24
+ this.props.layoutNode.componentDidMount();
25
+ }
26
+
27
+ isVisible(): boolean {
28
+ const isVisible = LayoutStore.isVisibleLayout(this.props.layoutNode);
29
+ return isVisible;
30
+ }
31
+
32
+ renderTabBar() {
33
+ const bottomTabs = this.props.layoutNode.getBottomTabs();
34
+ if (!bottomTabs) return null;
35
+ const bottomTabsOptions = bottomTabs.resolveOptions().bottomTabs;
36
+ if (bottomTabsOptions?.visible === false) return null;
37
+ const buttons = bottomTabs!.children!.map((child, i) => {
38
+ const bottomTabOptions = child.resolveOptions().bottomTab;
39
+ const icon =
40
+ (bottomTabs as any).selectedIndex === i
41
+ ? bottomTabOptions?.selectedIcon
42
+ : bottomTabOptions?.icon;
43
+ const iconURI = isURISource(icon) ? icon.uri : undefined;
44
+ return (
45
+ <View key={`tab-${i}`}>
46
+ <TouchableOpacity
47
+ style={{ padding: 10 }}
48
+ testID={bottomTabOptions?.testID}
49
+ onPress={() => {
50
+ events.invokeBottomTabPressed({
51
+ tabIndex: i,
52
+ });
53
+ if (_.defaultTo(bottomTabOptions?.selectTabOnPress, true))
54
+ switchTabByIndex(this.props.layoutNode.getBottomTabs(), i);
55
+ }}
56
+ >
57
+ <View style={{ justifyContent: 'center', alignItems: 'center' }}>
58
+ <Text>{bottomTabOptions?.badge}</Text>
59
+ {iconURI && (
60
+ <Image
61
+ style={{ width: 18, height: 18, marginBottom: 5 }}
62
+ source={{ uri: iconURI }}
63
+ />
64
+ )}
65
+ <Text style={{ fontSize: 12 }}>{bottomTabOptions?.text || ''}</Text>
66
+ </View>
67
+ </TouchableOpacity>
68
+ </View>
69
+ );
70
+ });
71
+
72
+ return (
73
+ <View
74
+ testID={bottomTabsOptions?.testID}
75
+ style={{
76
+ flexDirection: 'row',
77
+ justifyContent: 'center',
78
+ width: '100%',
79
+ backgroundColor: '#F0F2F5',
80
+ }}
81
+ >
82
+ {buttons}
83
+ </View>
84
+ );
85
+ }
86
+
87
+ render() {
88
+ const Component = Navigation.mock.store.getWrappedComponent(this.props.layoutNode.data.name);
89
+ if (!Component)
90
+ throw new Error(`${this.props.layoutNode.data.name} has not been registered.`);
91
+
92
+ return (
93
+ <View testID={this.isVisible() ? VISIBLE_SCREEN_TEST_ID : undefined}>
94
+ {this.props.layoutNode.getStack() && (
95
+ <TopBar
96
+ layoutNode={this.props.layoutNode}
97
+ topBarOptions={this.props.layoutNode.resolveOptions().topBar}
98
+ backButtonOptions={this.props.layoutNode.resolveOptions().topBar?.backButton}
99
+ />
100
+ )}
101
+ <Component componentId={this.props.layoutNode.nodeId} />
102
+ {this.renderTabBar()}
103
+ </View>
104
+ );
105
+ }
106
+ }
107
+ );
@@ -0,0 +1,37 @@
1
+ import React, { Component } from 'react';
2
+ import { View } from 'react-native';
3
+ import { BottomTabs } from './BottomTabs';
4
+ import { ComponentProps } from '../ComponentProps';
5
+ import { ComponentScreen } from './ComponentScreen';
6
+ import { Stack } from './Stack';
7
+ import { SideMenuRoot, SideMenuCenter, SideMenuLeft, SideMenuRight } from './SideMenu';
8
+
9
+ export const LayoutComponent = class extends Component<ComponentProps> {
10
+ render() {
11
+ switch (this.props.layoutNode.type) {
12
+ case 'BottomTabs':
13
+ return <BottomTabs layoutNode={this.props.layoutNode} />;
14
+ case 'Stack':
15
+ return <Stack layoutNode={this.props.layoutNode} />;
16
+ case 'Component':
17
+ return <ComponentScreen layoutNode={this.props.layoutNode} />;
18
+ case 'SideMenuRoot':
19
+ return <SideMenuRoot layoutNode={this.props.layoutNode} />;
20
+ case 'SideMenuLeft':
21
+ return <SideMenuLeft layoutNode={this.props.layoutNode} />;
22
+ case 'SideMenuCenter':
23
+ return <SideMenuCenter layoutNode={this.props.layoutNode} />;
24
+ case 'SideMenuRight':
25
+ return <SideMenuRight layoutNode={this.props.layoutNode} />;
26
+ }
27
+
28
+ return <View />;
29
+ }
30
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
31
+ const err = new Error(
32
+ `Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`
33
+ );
34
+ (err as any).cause = error;
35
+ throw err;
36
+ }
37
+ };
@@ -0,0 +1,22 @@
1
+ import React, { Component } from 'react';
2
+ import { View } from 'react-native';
3
+ import { ComponentProps } from '../ComponentProps';
4
+ import { LayoutComponent } from './LayoutComponent';
5
+ import ParentNode from '../Layouts/ParentNode';
6
+ import { LayoutStore } from '../Stores/LayoutStore';
7
+ import { connect } from '../connect';
8
+
9
+ export const Modals = connect(
10
+ class extends Component<ComponentProps> {
11
+ render() {
12
+ const children = LayoutStore.getModals();
13
+ return (
14
+ <View testID={'MODALS'}>
15
+ {children.map((child: ParentNode) => {
16
+ return <LayoutComponent key={child.nodeId} layoutNode={child} />;
17
+ })}
18
+ </View>
19
+ );
20
+ }
21
+ }
22
+ );
@@ -0,0 +1,86 @@
1
+ import React, { Component } from 'react';
2
+ import { Button, TouchableOpacity } from 'react-native';
3
+ import { Navigation, OptionsTopBarButton } from 'react-native-navigation';
4
+ import { events } from '../Stores/EventsStore';
5
+
6
+ interface ButtonProps {
7
+ button: OptionsTopBarButton;
8
+ componentId: string;
9
+ }
10
+
11
+ export const NavigationButton = class extends Component<ButtonProps> {
12
+ ref = undefined;
13
+ render() {
14
+ const { button, componentId } = this.props;
15
+ if (button.component) return this.renderButtonComponent();
16
+ return (
17
+ <Button
18
+ testID={button.testID}
19
+ key={button.id}
20
+ title={button.text || ''}
21
+ disabled={button.enabled === false}
22
+ onPress={() =>
23
+ button.enabled !== false &&
24
+ events.invokeNavigationButtonPressed({
25
+ buttonId: button.id,
26
+ componentId,
27
+ })
28
+ }
29
+ />
30
+ );
31
+ }
32
+
33
+ renderButtonComponent() {
34
+ const { button, componentId } = this.props;
35
+ // @ts-ignore
36
+ const buttonComponentId = button.component!.componentId;
37
+ // @ts-ignore
38
+ const ComponentClass = Navigation.mock.store.getComponentClassForName(button.component.name);
39
+ if (!ComponentClass) {
40
+ throw new Error(`Cannot find registered component for: ${button.component?.name}`);
41
+ }
42
+ const ButtonComponent = ComponentClass();
43
+ const props = Navigation.mock.store.getPropsForId(buttonComponentId);
44
+ return (
45
+ <TouchableOpacity
46
+ onPress={() => {
47
+ if (this.ref) {
48
+ this.invokeOnClick(
49
+ // @ts-ignore
50
+ (this.ref!._reactInternalFiber || this.ref!._reactInternals).return.stateNode
51
+ );
52
+ }
53
+
54
+ events.invokeNavigationButtonPressed({
55
+ buttonId: button.id,
56
+ componentId: componentId,
57
+ });
58
+ }}
59
+ testID={button.testID}
60
+ >
61
+ <ButtonComponent
62
+ key={buttonComponentId}
63
+ {...props}
64
+ componentId={buttonComponentId}
65
+ ref={(ref: any) => (this.ref = ref)}
66
+ />
67
+ </TouchableOpacity>
68
+ );
69
+ }
70
+
71
+ invokeOnClick(stateNode: any) {
72
+ if (stateNode.children) {
73
+ // @ts-ignore
74
+ stateNode.children.forEach((instance) => {
75
+ if (
76
+ instance.internalInstanceHandle &&
77
+ instance.internalInstanceHandle.stateNode.props.onClick
78
+ ) {
79
+ instance.internalInstanceHandle.stateNode.props.onClick();
80
+ }
81
+
82
+ this.invokeOnClick(instance);
83
+ });
84
+ }
85
+ }
86
+ };