@apexnative/navigation 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (242) hide show
  1. package/ApexNavigation.podspec +2 -1
  2. package/CHANGELOG.md +15 -0
  3. package/android/CLAUDE.md +19 -10
  4. package/android/CORE.md +3 -2
  5. package/android/consumer-rules.pro +6 -0
  6. package/android/src/main/java/dev/apexnative/navigation/options/BottomTabOptions.kt +1 -1
  7. package/android/src/main/java/dev/apexnative/navigation/options/ButtonOptions.kt +1 -1
  8. package/android/src/main/java/dev/apexnative/navigation/options/LargeTitleOptions.kt +1 -1
  9. package/android/src/main/java/dev/apexnative/navigation/options/LayoutAnimation.kt +1 -1
  10. package/android/src/main/java/dev/apexnative/navigation/options/OptionKey.kt +18 -0
  11. package/android/src/main/java/dev/apexnative/navigation/options/OptionPaths.kt +91 -0
  12. package/android/src/main/java/dev/apexnative/navigation/options/SheetOptions.kt +7 -4
  13. package/android/src/main/java/dev/apexnative/navigation/options/TitleOptions.kt +2 -2
  14. package/android/src/main/java/dev/apexnative/navigation/options/TopBarAppearanceOptions.kt +1 -1
  15. package/android/src/main/java/dev/apexnative/navigation/options/TopBarOptions.kt +16 -7
  16. package/android/src/main/java/dev/apexnative/navigation/react/ContentHeights.kt +95 -0
  17. package/android/src/main/java/dev/apexnative/navigation/react/ContentMounts.kt +66 -0
  18. package/android/src/main/java/dev/apexnative/navigation/react/NavigationTurboModule.kt +4 -0
  19. package/android/src/main/java/dev/apexnative/navigation/react/OptionsCommands.kt +41 -3
  20. package/android/src/main/java/dev/apexnative/navigation/react/ReactView.kt +16 -1
  21. package/android/src/main/java/dev/apexnative/navigation/slots/SlotScreenView.kt +27 -7
  22. package/android/src/main/java/dev/apexnative/navigation/slots/SlotView.kt +12 -1
  23. package/android/src/main/java/dev/apexnative/navigation/utils/MaterialTheme.kt +5 -6
  24. package/android/src/main/java/dev/apexnative/navigation/utils/SystemAnimations.kt +36 -0
  25. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalSheet.kt +329 -55
  26. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalViews.kt +26 -5
  27. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/SheetStops.kt +60 -2
  28. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/sidemenu/SideMenuMotion.kt +8 -2
  29. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/BackPreview.kt +32 -4
  30. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackController.kt +46 -7
  31. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackQueue.kt +15 -3
  32. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackViews.kt +7 -4
  33. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/fab/FabMotion.kt +142 -0
  34. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/fab/FabPresenter.kt +215 -43
  35. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/search/StackSearchPresenter.kt +25 -26
  36. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/BarRowTransition.kt +3 -2
  37. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/ButtonPlaces.kt +11 -5
  38. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/TopBarPresenter.kt +86 -39
  39. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/TopBarVisibility.kt +9 -2
  40. package/android/src/main/java/dev/apexnative/navigation/views/element/ElementTransitions.kt +124 -181
  41. package/android/src/main/java/dev/apexnative/navigation/views/element/TargetsWait.kt +8 -1
  42. package/android/src/main/java/dev/apexnative/navigation/views/element/TransitionLayer.kt +37 -112
  43. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ElementPictures.kt +56 -3
  44. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/FlightGeometry.kt +170 -153
  45. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ImageMorph.kt +199 -0
  46. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/SharedAnimatorFactory.kt +55 -45
  47. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/{TextChangeAnimator.kt → TextMorph.kt} +79 -129
  48. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ViewMorph.kt +108 -0
  49. package/android/src/main/java/dev/apexnative/navigation/views/stack/fab/FabCopy.kt +85 -0
  50. package/android/src/main/java/dev/apexnative/navigation/views/stack/fab/FabMenu.kt +13 -0
  51. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TitleBar.kt +5 -24
  52. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TopBar.kt +51 -34
  53. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/BarButtonComponentCell.kt +6 -6
  54. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/BarButtonView.kt +113 -0
  55. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/BarMenu.kt +219 -0
  56. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/ButtonBar.kt +121 -175
  57. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/ButtonMenus.kt +34 -64
  58. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/titlebar/ButtonRow.kt +216 -0
  59. package/android/src/main/jni/ANNContentHeights.cpp +82 -0
  60. package/android/src/main/res/drawable/apex_navigation_ic_arrow_right.xml +14 -0
  61. package/android/src/main/res/layout/apex_navigation_menu_header.xml +19 -0
  62. package/android/src/main/res/layout/apex_navigation_menu_item.xml +68 -0
  63. package/android/src/main/res/values/styles.xml +1 -1
  64. package/android/src/main/res/values-night/styles.xml +1 -1
  65. package/cli/doctor/checks/app.js +16 -1
  66. package/cli/project.js +4 -0
  67. package/cli/setup/index.js +5 -0
  68. package/cli/setup/steps/metro.js +46 -0
  69. package/docs-md/architecture/native-screens.md +4 -0
  70. package/docs-md/architecture/theme-and-context.md +131 -12
  71. package/docs-md/architecture/transitions.md +43 -4
  72. package/docs-md/flows/bottom-sheets.md +4 -2
  73. package/docs-md/fundamentals/screens-and-props.md +9 -1
  74. package/docs-md/guides/cli.md +3 -1
  75. package/docs-md/help/troubleshooting.md +1 -1
  76. package/docs-md/index.json +29 -1
  77. package/docs-md/screen-ui/back-and-gestures.md +3 -1
  78. package/docs-md/screen-ui/bar-buttons.md +1 -1
  79. package/docs-md/screen-ui/toolbar-and-fab.md +2 -0
  80. package/docs-md/start/installation.md +16 -1
  81. package/ios/Animations/ANNFrameDriver.h +55 -15
  82. package/ios/Animations/ANNFrameDriver.mm +214 -60
  83. package/ios/Animations/ANNTransitionAnimator.h +26 -5
  84. package/ios/Animations/ANNTransitionAnimator.mm +49 -3
  85. package/ios/Animations/ANNTransitionPlan.h +2 -2
  86. package/ios/Animations/ANNTransitionPlan.mm +10 -0
  87. package/ios/Animations/Elements/ANNElementFinder.h +2 -2
  88. package/ios/Animations/Elements/ANNElementFinder.mm +2 -2
  89. package/ios/Animations/Elements/ANNElementTransition.h +3 -3
  90. package/ios/Animations/Elements/ANNElementTransition.mm +2 -2
  91. package/ios/Animations/Elements/ANNSharedElementFlight.h +3 -3
  92. package/ios/Animations/Elements/ANNSharedElementFlight.mm +181 -43
  93. package/ios/Animations/Interpolators/ANNViewTracks.h +6 -5
  94. package/ios/Animations/Interpolators/ANNViewTracks.mm +51 -21
  95. package/ios/CLAUDE.md +19 -8
  96. package/ios/CORE.md +1 -1
  97. package/ios/Core/ANNAppDelegate.mm +0 -2
  98. package/ios/Core/ANNDeepLinkQueue.h +6 -5
  99. package/ios/Core/ANNDeepLinkQueue.mm +22 -10
  100. package/ios/Core/ANNSceneDelegate.mm +2 -2
  101. package/ios/Core/ANNUtils.h +7 -0
  102. package/ios/Core/ANNUtils.mm +10 -0
  103. package/ios/Core/ApexNavigation.mm +6 -2
  104. package/ios/Layouts/Overlay/ANNOverlayCoordinator.mm +1 -7
  105. package/ios/Layouts/Root/ANNRootCoordinator.mm +45 -15
  106. package/ios/Layouts/Screen/ANNComponentViewController.mm +4 -1
  107. package/ios/Layouts/Stack/ANNStackAnimatingDelegate.h +11 -2
  108. package/ios/Layouts/Stack/ANNStackAnimatingDelegate.mm +14 -7
  109. package/ios/Layouts/Stack/ANNStackController.h +8 -0
  110. package/ios/Layouts/Stack/ANNStackController.mm +153 -11
  111. package/ios/Layouts/Stack/ANNSwipePopInteraction.h +26 -0
  112. package/ios/Layouts/Stack/ANNSwipePopInteraction.mm +185 -0
  113. package/ios/Layouts/Stack/InteractivePopGestureDelegate.mm +28 -4
  114. package/ios/Layouts/Tabs/ANNTabsPreloadWindow.mm +2 -4
  115. package/ios/Options/ANNAnimationOptions.h +2 -1
  116. package/ios/Options/ANNAnimationOptions.mm +1 -1
  117. package/ios/Options/ANNOptions.h +7 -0
  118. package/ios/Options/ANNOptions.mm +45 -0
  119. package/ios/Options/ANNOptionsReader.mm +2 -4
  120. package/ios/Options/ANNStackPopAnimationOptions.h +13 -0
  121. package/ios/Options/ANNStackPopAnimationOptions.mm +11 -0
  122. package/ios/Options/Params/ColorParser.h +4 -3
  123. package/ios/Options/Params/ColorParser.mm +22 -4
  124. package/ios/React/ANNSurfaceHostingView.h +8 -0
  125. package/ios/React/ANNSurfaceHostingView.mm +28 -1
  126. package/ios/React/Slots/ANNSlotHost.mm +1 -3
  127. package/ios/React/Slots/ANNSlotScreenView.mm +8 -2
  128. package/ios/TurboModules/ANNTurboModule.mm +46 -0
  129. package/ios/cpp/react/renderer/components/ApexNavigationSpec/ANNSlotState.cpp +20 -0
  130. package/ios/cpp/react/renderer/components/ApexNavigationSpec/ANNSlotState.h +5 -14
  131. package/lib/module/ARCHITECTURE.md +9 -3
  132. package/lib/module/adapters/NativeANNTurboModule.js.map +1 -1
  133. package/lib/module/api/app/AppRegistry.js +14 -2
  134. package/lib/module/api/app/AppRegistry.js.map +1 -1
  135. package/lib/module/api/app/createNavigation.js +188 -66
  136. package/lib/module/api/app/createNavigation.js.map +1 -1
  137. package/lib/module/api/events/navigationEvents.js +6 -2
  138. package/lib/module/api/events/navigationEvents.js.map +1 -1
  139. package/lib/module/api/linking/linking.js +11 -0
  140. package/lib/module/api/linking/linking.js.map +1 -1
  141. package/lib/module/api/screens/defineScreen.js +45 -3
  142. package/lib/module/api/screens/defineScreen.js.map +1 -1
  143. package/lib/module/api/screens/nativeScreens.js +31 -6
  144. package/lib/module/api/screens/nativeScreens.js.map +1 -1
  145. package/lib/module/api/screens/registerScreens.js +193 -35
  146. package/lib/module/api/screens/registerScreens.js.map +1 -1
  147. package/lib/module/api/theme/theme.js +5 -0
  148. package/lib/module/api/theme/theme.js.map +1 -1
  149. package/lib/module/engine/commands.js +21 -1
  150. package/lib/module/engine/commands.js.map +1 -1
  151. package/lib/module/engine/layout.js +7 -2
  152. package/lib/module/engine/layout.js.map +1 -1
  153. package/lib/module/engine/nativeScreens.js +9 -0
  154. package/lib/module/engine/nativeScreens.js.map +1 -1
  155. package/lib/module/engine/options.js +5 -4
  156. package/lib/module/engine/options.js.map +1 -1
  157. package/lib/module/engine/optionsChange.js +102 -0
  158. package/lib/module/engine/optionsChange.js.map +1 -0
  159. package/lib/module/engine/refresh.js +85 -0
  160. package/lib/module/engine/refresh.js.map +1 -0
  161. package/lib/module/engine/rememberedOptions.js +60 -0
  162. package/lib/module/engine/rememberedOptions.js.map +1 -1
  163. package/lib/module/engine/screens.js +26 -0
  164. package/lib/module/engine/screens.js.map +1 -1
  165. package/lib/typescript/adapters/NativeANNTurboModule.d.ts +7 -0
  166. package/lib/typescript/adapters/NativeANNTurboModule.d.ts.map +1 -1
  167. package/lib/typescript/api/app/AppRegistry.d.ts.map +1 -1
  168. package/lib/typescript/api/app/createNavigation.d.ts +5 -0
  169. package/lib/typescript/api/app/createNavigation.d.ts.map +1 -1
  170. package/lib/typescript/api/events/navigationEvents.d.ts +2 -2
  171. package/lib/typescript/api/events/navigationEvents.d.ts.map +1 -1
  172. package/lib/typescript/api/index.d.ts +1 -1
  173. package/lib/typescript/api/index.d.ts.map +1 -1
  174. package/lib/typescript/api/linking/linking.d.ts +8 -0
  175. package/lib/typescript/api/linking/linking.d.ts.map +1 -1
  176. package/lib/typescript/api/screens/defineScreen.d.ts +23 -4
  177. package/lib/typescript/api/screens/defineScreen.d.ts.map +1 -1
  178. package/lib/typescript/api/screens/nativeScreens.d.ts +8 -1
  179. package/lib/typescript/api/screens/nativeScreens.d.ts.map +1 -1
  180. package/lib/typescript/api/screens/registerScreens.d.ts.map +1 -1
  181. package/lib/typescript/api/theme/theme.d.ts +2 -0
  182. package/lib/typescript/api/theme/theme.d.ts.map +1 -1
  183. package/lib/typescript/engine/commands.d.ts +5 -0
  184. package/lib/typescript/engine/commands.d.ts.map +1 -1
  185. package/lib/typescript/engine/layout.d.ts.map +1 -1
  186. package/lib/typescript/engine/nativeScreens.d.ts +5 -0
  187. package/lib/typescript/engine/nativeScreens.d.ts.map +1 -1
  188. package/lib/typescript/engine/optionsChange.d.ts +28 -0
  189. package/lib/typescript/engine/optionsChange.d.ts.map +1 -0
  190. package/lib/typescript/engine/refresh.d.ts +35 -0
  191. package/lib/typescript/engine/refresh.d.ts.map +1 -0
  192. package/lib/typescript/engine/rememberedOptions.d.ts +13 -0
  193. package/lib/typescript/engine/rememberedOptions.d.ts.map +1 -1
  194. package/lib/typescript/engine/screens.d.ts +7 -0
  195. package/lib/typescript/engine/screens.d.ts.map +1 -1
  196. package/lib/typescript/interfaces/ComponentEvents.d.ts +2 -2
  197. package/lib/typescript/interfaces/options/animations.d.ts +40 -15
  198. package/lib/typescript/interfaces/options/animations.d.ts.map +1 -1
  199. package/lib/typescript/interfaces/options/bottomTabs.d.ts +2 -2
  200. package/lib/typescript/interfaces/options/buttons.d.ts +2 -2
  201. package/lib/typescript/interfaces/options/modals.d.ts +6 -7
  202. package/lib/typescript/interfaces/options/modals.d.ts.map +1 -1
  203. package/lib/typescript/interfaces/options/stack.d.ts +8 -3
  204. package/lib/typescript/interfaces/options/stack.d.ts.map +1 -1
  205. package/lib/typescript/interfaces/options/topBar.d.ts +14 -0
  206. package/lib/typescript/interfaces/options/topBar.d.ts.map +1 -1
  207. package/metro/acceptPlugin.js +57 -0
  208. package/metro/babelTransformer.js +45 -0
  209. package/metro/index.js +36 -0
  210. package/package.json +3 -1
  211. package/src/ARCHITECTURE.md +9 -3
  212. package/src/adapters/NativeANNTurboModule.ts +7 -0
  213. package/src/api/app/AppRegistry.ts +16 -2
  214. package/src/api/app/createNavigation.ts +198 -66
  215. package/src/api/events/navigationEvents.ts +9 -3
  216. package/src/api/index.ts +1 -0
  217. package/src/api/linking/linking.ts +22 -1
  218. package/src/api/screens/defineScreen.ts +49 -5
  219. package/src/api/screens/nativeScreens.ts +40 -4
  220. package/src/api/screens/registerScreens.tsx +185 -42
  221. package/src/api/theme/theme.ts +5 -0
  222. package/src/engine/commands.ts +21 -0
  223. package/src/engine/layout.ts +11 -2
  224. package/src/engine/nativeScreens.ts +10 -1
  225. package/src/engine/options.ts +6 -8
  226. package/src/engine/optionsChange.ts +107 -0
  227. package/src/engine/refresh.ts +97 -0
  228. package/src/engine/rememberedOptions.ts +70 -0
  229. package/src/engine/screens.tsx +24 -0
  230. package/src/interfaces/ComponentEvents.ts +2 -2
  231. package/src/interfaces/options/animations.ts +40 -15
  232. package/src/interfaces/options/bottomTabs.ts +2 -2
  233. package/src/interfaces/options/buttons.ts +2 -2
  234. package/src/interfaces/options/modals.ts +6 -7
  235. package/src/interfaces/options/stack.ts +8 -3
  236. package/src/interfaces/options/topBar.ts +14 -0
  237. package/android/src/main/java/dev/apexnative/navigation/views/element/ElementStub.kt +0 -31
  238. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ImageMatrixAnimator.kt +0 -134
  239. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/PlainViewAnimator.kt +0 -78
  240. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/PropertyAnimatorCreator.kt +0 -33
  241. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ReactImageAnimator.kt +0 -57
  242. package/android/src/main/java/dev/apexnative/navigation/views/element/animators/ViewChangeAnimator.kt +0 -146
@@ -82,20 +82,11 @@ class ANNSlotContentHeights final {
82
82
  }
83
83
 
84
84
  private:
85
- static std::mutex &mutex() {
86
- static std::mutex value;
87
- return value;
88
- }
89
-
90
- static std::unordered_map<std::string, Float> &heights() {
91
- static std::unordered_map<std::string, Float> value;
92
- return value;
93
- }
94
-
95
- static std::atomic<int> &requested() {
96
- static std::atomic<int> value{0};
97
- return value;
98
- }
85
+ // One store for the whole app, in ANNSlotState.cpp: on Android the slot's layout runs in the app's library and the
86
+ // native side reads the heights from the library's own, and an inline static would give each its own copy.
87
+ static std::mutex &mutex();
88
+ static std::unordered_map<std::string, Float> &heights();
89
+ static std::atomic<int> &requested();
99
90
  };
100
91
 
101
92
  } // namespace facebook::react
@@ -89,8 +89,8 @@ form of `src/api/events/navigationEvents.ts`. Everything in `src/engine` is inte
89
89
  | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
90
90
  | `native.ts` | `commands`: the TurboModule (`src/adapters/NativeANNTurboModule.ts`). `onNativeEvent(name, listener)`: one native event, `ANN.<name>`. iOS sends events through `ANNTurboEventEmitter`; Android without a module. `getLaunchLink()`: the URL that launched the native side, null without the native side (Jest). `getStartInfo()`: `{ coldStart, splashLogo, arrangements }`, asked once; without the native side a cold start without a logo and without arrangements. |
91
91
  | `layout.ts` | `toNativeLayout(layout)`: a `LayoutNode`, `{ id, type, data: { name, options, passProps?, functions?, key?, columns? }, children }`. For a screen, in this order: a name that shows a pair becomes an `Arrangement` node (see Pairs, regions and the hinge), an unknown name fails, its id, its own options under those of the show, the press handlers of its buttons taken out; then a native screen goes as an external component (`showNativeScreen`), a React screen with its `key`, its props kept here, as a slot in one tree. |
92
- | `options.ts` | `toNativeOptions(options, owner)`: colors (iOS: a number, `DynamicColorIOS` or `'NoColor'`; Android: `{ light, dark }`), images (`require` resolved), components in options (`componentId`, their props kept here; without an `id` of their own, `<owner>/<place>/<name>`, e.g. `Component12/topBar.title/Clock`, a list item by its id where it has one (`topBar.rightButtons[Save]`), the same on every `mergeOptions` of the node, so the native side keeps the mounted root), the props of buttons with a component, the roots of the bar buttons' components (`*Buttons`, the toolbar's `buttons`) remembered. Options come in their own form only. |
93
- | `commands.ts` | `setRoot`, `push`, `pop`, `popTo`, `popToRoot`, `setStackRoot`, `showInColumn`, `setColumnShown`, `showModal`, `dismissModal`, `dismissAllModals`, `showOverlay`, `dismissOverlay`, `dismissAllOverlays`, `mergeOptions`, `setDefaultOptions`. One that shows screens waits for lazy ones (`afterLoading`), checks the ids (`checkIds`), notes the places and waits for the hooks of native screens (`whenNativeScreensReady`). On Android, in one tree, a push goes through `preparePush` first (see One command). |
92
+ | `options.ts` | `toNativeOptions(options, owner)`: colors (iOS: a number, `{ light, dark }` or `'NoColor'`; Android: always `{ light, dark }`), images (`require` resolved), components in options (`componentId`, their props kept here; without an `id` of their own, `<owner>/<place>/<name>`, e.g. `Component12/topBar.title/Clock`, a list item by its id where it has one (`topBar.rightButtons[Save]`), the same on every `mergeOptions` of the node, so the native side keeps the mounted root), the props of buttons with a component, the roots of the bar buttons' components (`*Buttons`, the toolbar's `buttons`) remembered. Options come in their own form only. |
93
+ | `commands.ts` | `setRoot`, `push`, `pop`, `popTo`, `popToRoot`, `setStackRoot`, `showInColumn`, `setColumnShown`, `showModal`, `dismissModal`, `dismissAllModals`, `showOverlay`, `dismissOverlay`, `dismissAllOverlays`, `mergeOptions`, `clearOptions` (Fast Refresh, development), `setDefaultOptions`. One that shows screens waits for lazy ones (`afterLoading`), checks the ids (`checkIds`), notes the places and waits for the hooks of native screens (`whenNativeScreensReady`). On Android, in one tree, a push goes through `preparePush` first (see One command). |
94
94
  | `screens.tsx` | The screens by name: a React component with its options, `key`, `load` (a lazy screen) and `arrangement` (its pair, if it has a secondary), a native screen (`nativeName`, the controller of its `useProps`, `arrangement`), or a pair entry of `defineArrangement` (`pair`). `arrangementOf(name)`: the pair a name shows; `checkArrangements` at registration, `checkArrangement` when a lazy screen's pair shows. `loadScreens`/`afterLoading`: a command goes once its lazy screens loaded, at once when none waits. A React screen is registered with `AppRegistry` as a root (`screenRoot`) that renders it with the props left for its id. After a JavaScript reload React Native starts the old roots again under the new screens' ids: a root that unmounts while another root of the id is mounted leaves the screen alone. The props of a component the library named in options go with its node, not with a root (several roots may show one default). |
95
95
  | `nativeScreens.ts` | The native screens shown, by id. Data props go as JSON (`passProps`); functions stay here, their names in `data.functions`, and the native side calls them (`ANN.NativeScreenCall`, answered with `resolveNativeScreenCall`). With `useProps`: the hidden host runs the hook (`startHost`, 5 s to start), the command waits for its first result, later changes go with `updateNativeScreenProps`. `ANN.NativeScreenReleased` forgets one. |
96
96
  | `props.ts` | The props of screens and of components in options, by id: a command puts them here before the native side creates the view; React Native passes a root only its id. Also which roots are the components of bar buttons (`isButtonRoot`): on iOS their wrapper centers the content in the slot. |
@@ -99,6 +99,8 @@ form of `src/api/events/navigationEvents.ts`. Everything in `src/engine` is inte
99
99
  | `buttons.ts` | The `onPress` handlers of the buttons of each screen and of their menu items, called on `NavigationButtonPressed`; the API gives the event its form (`setPressEvent`). |
100
100
  | `tabs.ts` | The press handlers of `Tab().onPress()`: they come with the tabs' layout, stay under the id the tabs are shown with, and go once every React screen shown in the tabs (pushed ones too) unmounted. |
101
101
  | `slots.ts` | One tree (`appProvider`): `slotName` sends a React screen as `slot:<name>`, the native side gives it an empty container, and the slot with its id in `SlotHost` renders it. `withSlots` takes back the slots of a failed command; `ANN.SlotDestroyed` removes one. For a push on Android: `holdSlot` (nothing renders until the native side laid the screen out), `showSlot` (at its `SlotFrame`; resolves once React committed it, `slotCommitted`), `preparedPadding` (the first padding of its safe area view). |
102
+ | `refresh.ts` | Development only. Fast Refresh runs an edited module again and every export is a new function; `familyOf` and the newest-version lookup read React Refresh's family of a component (Metro registers each export under its module and name), so what the library keeps of a screen (options, `key`, `arrangement`) follows an edit without a reload. Nothing in a release build. |
103
+ | `optionsChange.ts` | `optionsChange(previous, next)`: what an edit of a screen's options changes: the options to merge (objects compare key by key, arrays and other values as a whole, functions by source) and the paths taken out, which go to the native `clearOptions`. |
102
104
  | `launchState.ts` | The last root and default options: Android destroys the activity while JavaScript lives on and sends `AppLaunched` again; the app sets them again. |
103
105
  | `backListeners.ts` | Android: wraps `BackHandler.addEventListener` at the launch to count the listeners, and tells the native side whether there is one (`setBackListeners`): the navigation takes the back button only while it can go back or JavaScript listens. A listener added before the launch isn't counted. |
104
106
  | `reactMeasures.ts` | Development only: every command that shows or closes screens drops React's `performance.measure` entries of component renders (named after the component with U+200B in front). React Native keeps them without a limit, and a long session ran out of memory; the app's own measures stay. |
@@ -136,6 +138,10 @@ form of `src/api/events/navigationEvents.ts`. Everything in `src/engine` is inte
136
138
  `launchState.root`, as it was passed (functions in props included), is set again. Then, with `linking`, the new
137
139
  activity's link runs as in a running app (`linksRelaunched`).
138
140
 
141
+ ## Hot update
142
+
143
+ `@apexnative/navigation/metro` (`withApexNavigation`) wraps the Metro config: it applies React Refresh's Babel plugin that React Native 0.87's transformer skips, and makes the module that imports `createNavigation` accept hot updates. When that module runs again, `createNavigation` meets a running navigation and updates it instead of starting: the screens (`registerScreens` again; a defined screen's options through `optionsChange` become `mergeOptions` and `clearOptions` on the screens that show; `key` and `arrangement` apply from the next show), the default options when `theme` or `options` changed, the roots, the listeners and the link routes. What only the start reads (the first root, `willMount`, the splash, the context) isn't run again. `defineScreen` returns the component, so a file that exports only screens is a Fast Refresh boundary; a native screen's component runs its `useProps`, and a change of its native name or of having `useProps` restarts the app.
144
+
139
145
  ## Links
140
146
 
141
147
  `linking` of `createNavigation` (`src/api/linking/`) turns URLs into commands; the native side keeps no routes.
@@ -260,7 +266,7 @@ first press never mounted a root, so the engine forgets what the push noted for
260
266
  ## The native side's contract
261
267
 
262
268
  - Commands: the methods of `ANNTurboModule` (`src/adapters/NativeANNTurboModule.ts`), with the JSON above: those of
263
- `commands.ts`, each but `mergeOptions` and `setDefaultOptions` with a command id and a promise. A command that changed
269
+ `commands.ts`, each but `mergeOptions`, `clearOptions` and `setDefaultOptions` with a command id and a promise. A command that changed
264
270
  what the user sees sends `ANN.NavigationStateChanged` right before its promise resolves, so `getState()` after
265
271
  `await` shows its result and the next command acts from there. Besides them: `setBackListeners` (Android: whether
266
272
  JavaScript has `BackHandler` listeners; iOS does nothing), `preparePush` and `cancelPreparedPush` (Android, one
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["adapters/NativeANNTurboModule.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA6C,cAAc;;AAEvF;AACA;AACA;AACA;AACA;;AA+FA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["adapters/NativeANNTurboModule.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA6C,cAAc;;AAEvF;AACA;AACA;AACA;AACA;;AAsGA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,gBAAgB,CAAC","ignoreList":[]}
@@ -2,9 +2,10 @@
2
2
 
3
3
  import { AppRegistry as ReactNativeAppRegistry } from 'react-native';
4
4
  import { onNativeEvent } from "../../engine/native.js";
5
+ import { familyOf } from "../../engine/refresh.js";
5
6
  import { SLOT_HOST_MODULE } from "../../engine/slots.js";
6
7
  import { SlotHost } from "../slots/SlotHost.js";
7
- import { isNavigationApp, startApp } from "./createNavigation.js";
8
+ import { isNavigationApp, noteReplacingApp, startApp } from "./createNavigation.js";
8
9
  let appKey;
9
10
  let registered;
10
11
  let app;
@@ -28,7 +29,18 @@ function onAppLaunched() {
28
29
  */
29
30
  function registerComponent(key, navigation) {
30
31
  if (__DEV__ && registered) {
31
- console.warn(`[navigation] '${key}' replaces the app registered as '${appKey}'`);
32
+ // The entry file running again after an edit (Fast Refresh) registers its new version of the same app under the
33
+ // same name; Metro puts one it exports in the family of the old one once the file ran.
34
+ if (key === appKey) noteReplacingApp(navigation);
35
+ const before = {
36
+ key: appKey,
37
+ app: registered
38
+ };
39
+ Promise.resolve().then(() => {
40
+ const family = familyOf(before.app);
41
+ if (key === before.key || family && family === familyOf(navigation)) return;
42
+ console.warn(`[navigation] '${key}' replaces the app registered as '${before.key}'`);
43
+ });
32
44
  }
33
45
  appKey = key;
34
46
  registered = navigation;
@@ -1 +1 @@
1
- {"version":3,"names":["AppRegistry","ReactNativeAppRegistry","onNativeEvent","SLOT_HOST_MODULE","SlotHost","isNavigationApp","startApp","appKey","registered","app","listening","onAppLaunched","created","Error","catch","error","console","registerComponent","key","navigation","__DEV__","warn"],"sourceRoot":"../../../../src","sources":["api/app/AppRegistry.ts"],"mappings":";;AAAA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,cAAc;AACpE,SAASC,aAAa,QAAQ,wBAAqB;AACnD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,QAAQ,QAAQ,sBAAmB;AAC5C,SAASC,eAAe,EAAsBC,QAAQ,QAAQ,uBAAoB;AAIlF,IAAIC,MAA0B;AAC9B,IAAIC,UAAuE;AAC3E,IAAIC,GAA8B;AAClC,IAAIC,SAAS,GAAG,KAAK;AAErB,SAASC,aAAaA,CAAA,EAAG;EACvB,IAAI,CAACH,UAAU,EAAE;EACjB,IAAI,CAACC,GAAG,EAAE;IACR;IACA,MAAMG,OAAO,GAAG,OAAOJ,UAAU,KAAK,UAAU,GAAGA,UAAU,CAAC,CAAC,GAAGA,UAAU;IAC5E,IAAI,CAACH,eAAe,CAACO,OAAO,CAAC,EAAE;MAC7B,MAAM,IAAIC,KAAK,CACb,+CAA+CN,MAAM,qFACvD,CAAC;IACH;IACAE,GAAG,GAAGG,OAAO;EACf;EACAN,QAAQ,CAACG,GAAG,CAAC,CAACK,KAAK,CAAEC,KAAK,IAAKC,OAAO,CAACD,KAAK,CAAC,sCAAsC,EAAEA,KAAK,CAAC,CAAC;AAC9F;;AAEA;AACA;AACA;AACA;AACA,SAASE,iBAAiBA,CACxBC,GAAW,EACXC,UAA2D,EACnD;EACR,IAAIC,OAAO,IAAIZ,UAAU,EAAE;IACzBQ,OAAO,CAACK,IAAI,CAAC,iBAAiBH,GAAG,qCAAqCX,MAAM,GAAG,CAAC;EAClF;EACAA,MAAM,GAAGW,GAAG;EACZV,UAAU,GAAGW,UAAU;EACvB,IAAI,CAACT,SAAS,EAAE;IACdA,SAAS,GAAG,IAAI;IAChB;IACA;IACAT,sBAAsB,CAACgB,iBAAiB,CAACd,gBAAgB,EAAE,MAAMC,QAAQ,CAAC;IAC1E;IACA;IACAF,aAAa,CAAC,aAAa,EAAES,aAAa,CAAC;EAC7C;EACA,OAAOO,GAAG;AACZ;;AAEA;AACA,OAAO,MAAMlB,WAEZ,GAAG;EAAE,GAAGC,sBAAsB;EAAEgB;AAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["AppRegistry","ReactNativeAppRegistry","onNativeEvent","familyOf","SLOT_HOST_MODULE","SlotHost","isNavigationApp","noteReplacingApp","startApp","appKey","registered","app","listening","onAppLaunched","created","Error","catch","error","console","registerComponent","key","navigation","__DEV__","before","Promise","resolve","then","family","warn"],"sourceRoot":"../../../../src","sources":["api/app/AppRegistry.ts"],"mappings":";;AAAA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,cAAc;AACpE,SAASC,aAAa,QAAQ,wBAAqB;AACnD,SAASC,QAAQ,QAAQ,yBAAsB;AAC/C,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,QAAQ,QAAQ,sBAAmB;AAC5C,SACEC,eAAe,EAEfC,gB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GW,GAAG;EACZV,UAAU,GAAGW,UAAU;EACvB,IAAI,CAACT,SAAS,EAAE;IACdA,SAAS,GAAG,IAAI;IAChB;IACA;IACAX,sBAAsB,CAACkB,iBAAiB,CAACf,gBAAgB,EAAE,MAAMC,QAAQ,CAAC;IAC1E;IACA;IACAH,aAAa,CAAC,aAAa,EAAEW,aAAa,CAAC;EAC7C;EACA,OAAOO,GAAG;AACZ;;AAEA;AACA,OAAO,MAAMpB,WAEZ,GAAG;EAAE,GAAGC,sBAAsB;EAAEkB;AAAkB,CAAC","ignoreList":[]}
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ import { DevSettings } from 'react-native';
3
4
  import { setDefaultOptions, setRoot } from "../../engine/commands.js";
4
5
  import { enableSlots, withSlots } from "../../engine/slots.js";
5
6
  import { listenToNativeScreens, startHost } from "../../engine/nativeScreens.js";
7
+ import { sameValue } from "../../engine/optionsChange.js";
8
+ import { familyOf, keepStateOf, refreshRuns } from "../../engine/refresh.js";
6
9
  import { listenToSplitViews } from "../../engine/places.js";
7
10
  import { hasNativeScreenHooks } from "../../engine/screens.js";
8
11
  import { addNavigationListeners } from "../events/navigationEvents.js";
@@ -12,7 +15,7 @@ import { listenToNativeScreenCalls } from "../screens/nativeScreenCalls.js";
12
15
  import { buildRoot, withDefaultTransition } from "../layout/Root.js";
13
16
  import { registerScreens } from "../screens/registerScreens.js";
14
17
  import { getAppContext, setAppContext } from "../context/appContext.js";
15
- import { initTheme, themedDefaultOptions } from "../theme/theme.js";
18
+ import { getDirection, getTheme, initTheme, setTheme, themedDefaultOptions } from "../theme/theme.js";
16
19
  import { setActiveApp } from "./activeApp.js";
17
20
  import { setStartFailure, START_FAILURE_SCREEN, startFailureScreen } from "./startFailure.js";
18
21
  import { releaseSplash, showsSplash, showSplash, SPLASH_ROOT, SPLASH_SCREEN, splashDone } from "./splash.js";
@@ -20,7 +23,7 @@ import { launchState } from "../../engine/launchState.js";
20
23
  import { watchBackListeners } from "../../engine/backListeners.js";
21
24
  import { resolveRoot } from "./roots.js";
22
25
  import { listenToDispatchedLinks } from "../linking/dispatchedLinks.js";
23
- import { launchLink, launchRoot, linksRelaunched, linksStarted, reportLink, setupLinking } from "../linking/linking.js";
26
+ import { launchLink, launchRoot, linksRelaunched, linksStarted, reportLink, setupLinking, updateLinking } from "../linking/linking.js";
24
27
  const NAVIGATION_APP = Symbol('apexnative.navigation.app');
25
28
 
26
29
  /** Where an error that goes to `onError` came from. */
@@ -32,6 +35,9 @@ const starts = new WeakMap();
32
35
 
33
36
  /** Starts the app, or brings back its root when the native side launches again. */
34
37
  export function startApp(app) {
38
+ // An app made after another launched knows once its module ran whether it is that app's next version.
39
+ const waiting = pending.get(app);
40
+ if (waiting) return waiting.then(() => startApp(app));
35
41
  const start = starts.get(app);
36
42
  if (!start) throw new Error('[navigation] Not an app made by createNavigation');
37
43
  return start();
@@ -55,7 +61,7 @@ export function startApp(app) {
55
61
  */
56
62
 
57
63
  export function isNavigationApp(value) {
58
- return typeof value === 'object' && value !== null && starts.has(value);
64
+ return typeof value === 'object' && value !== null && (starts.has(value) || pending.has(value));
59
65
  }
60
66
 
61
67
  /**
@@ -70,14 +76,18 @@ export function isNavigationApp(value) {
70
76
  * });
71
77
  */
72
78
  export function createNavigation(config) {
79
+ // The app that launched before, when this call may be its module running again after an edit (Fast Refresh): what
80
+ // the call starts waits until that is known.
81
+ const launched = __DEV__ ? hotCandidate() : undefined;
73
82
  // Counted from here: a "back again to leave" listener of the app's entry file comes after this call.
74
- watchBackListeners();
83
+ if (!launched) watchBackListeners();
75
84
  // idle: not started yet, or the last start failed. mounting: the first root is on its way. mounted: it is shown.
76
85
  let phase = 'idle';
77
86
  let screensRegistered = false;
78
87
  // The splash shows at the first start of this runtime only: a start that failed and runs again goes without it.
79
88
  let splashChecked = false;
80
89
  let listening = false;
90
+ let removeListeners;
81
91
  let prepared;
82
92
  let markMounted;
83
93
  // A new activity came while the first root was on its way (Android): its link is taken once that root is shown.
@@ -118,6 +128,56 @@ export function createNavigation(config) {
118
128
  } = config;
119
129
  return buildRoot(typeof root === 'function' ? root(context) : root);
120
130
  }
131
+
132
+ // The screens of the app, its groups, the screen of a failed start and the splash, with what wraps each of them.
133
+ function registerAppScreens() {
134
+ const wrapper = {
135
+ errorFallback: config.errorFallback,
136
+ loadingFallback: config.loadingFallback,
137
+ onError: config.onError && ((error, screen, componentStack) => config.onError?.(error, {
138
+ type: 'screen',
139
+ screen,
140
+ componentStack
141
+ }))
142
+ };
143
+ registerScreens([{
144
+ source: 'screens',
145
+ screens: config.screens ?? {}
146
+ }, ...Object.entries(config.groups ?? {}).map(([group, {
147
+ screens,
148
+ options
149
+ }]) => ({
150
+ source: `the group '${group}'`,
151
+ screens,
152
+ options
153
+ })), ...(config.errorFallback ? [{
154
+ source: 'the start',
155
+ screens: {
156
+ [START_FAILURE_SCREEN]: startFailureScreen(config.errorFallback)
157
+ }
158
+ }] : [])], {
159
+ ...wrapper,
160
+ provider: config.screenProvider
161
+ });
162
+ // The splash renders before willMount ends: a root of its own, without the app's providers, which may need what
163
+ // willMount prepares.
164
+ if (config.splash) {
165
+ registerScreens([{
166
+ source: 'the splash',
167
+ screens: {
168
+ [SPLASH_SCREEN]: config.splash.component
169
+ },
170
+ ownRoot: true
171
+ }], {
172
+ ...wrapper,
173
+ // A splash that failed to render can't call hide(): the start goes on without waiting for it.
174
+ onError: (error, screen, componentStack) => {
175
+ releaseSplash();
176
+ wrapper.onError?.(error, screen, componentStack);
177
+ }
178
+ });
179
+ }
180
+ }
121
181
  async function mount() {
122
182
  phase = 'mounting';
123
183
  // The state before the first root: the links wait for a newer one, which tells the screen they act from.
@@ -126,52 +186,7 @@ export function createNavigation(config) {
126
186
  let linkHandled = false;
127
187
  try {
128
188
  if (!screensRegistered) {
129
- const wrapper = {
130
- errorFallback: config.errorFallback,
131
- loadingFallback: config.loadingFallback,
132
- onError: config.onError && ((error, screen, componentStack) => config.onError?.(error, {
133
- type: 'screen',
134
- screen,
135
- componentStack
136
- }))
137
- };
138
- registerScreens([{
139
- source: 'screens',
140
- screens: config.screens ?? {}
141
- }, ...Object.entries(config.groups ?? {}).map(([group, {
142
- screens,
143
- options
144
- }]) => ({
145
- source: `the group '${group}'`,
146
- screens,
147
- options
148
- })), ...(config.errorFallback ? [{
149
- source: 'the start',
150
- screens: {
151
- [START_FAILURE_SCREEN]: startFailureScreen(config.errorFallback)
152
- }
153
- }] : [])], {
154
- ...wrapper,
155
- provider: config.screenProvider
156
- });
157
- // The splash renders before willMount ends: a root of its own, without the app's providers, which may need what
158
- // willMount prepares.
159
- if (config.splash) {
160
- registerScreens([{
161
- source: 'the splash',
162
- screens: {
163
- [SPLASH_SCREEN]: config.splash.component
164
- },
165
- ownRoot: true
166
- }], {
167
- ...wrapper,
168
- // A splash that failed to render can't call hide(): the start goes on without waiting for it.
169
- onError: (error, screen, componentStack) => {
170
- releaseSplash();
171
- wrapper.onError?.(error, screen, componentStack);
172
- }
173
- });
174
- }
189
+ registerAppScreens();
175
190
  screensRegistered = true;
176
191
  }
177
192
  // The link that launched the app is asked for first: on iOS the first React content to appear (the host below,
@@ -280,6 +295,7 @@ export function createNavigation(config) {
280
295
  }
281
296
  }
282
297
  async function launch() {
298
+ if (__DEV__) launchedApp = app;
283
299
  setActiveApp({
284
300
  roots: config.roots,
285
301
  presentation: config.presentation,
@@ -289,17 +305,7 @@ export function createNavigation(config) {
289
305
  listening = true;
290
306
  // The edges of `safeArea` go under the app's options; the window's color goes with them, as the native side
291
307
  // takes it from the default options.
292
- initTheme(config.theme, {
293
- under: config.safeArea && {
294
- layout: {
295
- safeAreaEdges: config.safeArea.edges
296
- }
297
- },
298
- options: config.options,
299
- over: config.window && {
300
- window: config.window
301
- }
302
- }, config.direction);
308
+ initTheme(config.theme, appDefaults(), config.direction);
303
309
  if (config.context !== undefined) setAppContext(config.context);
304
310
  if (config.appProvider) enableSlots(config.appProvider);
305
311
  listenToNavigationState();
@@ -308,7 +314,7 @@ export function createNavigation(config) {
308
314
  listenToNativeScreens();
309
315
  listenToSplitViews();
310
316
  listenToNativeScreenCalls();
311
- if (config.listeners) addNavigationListeners(config.listeners);
317
+ if (config.listeners) removeListeners = addNavigationListeners(config.listeners);
312
318
  }
313
319
  launchState.launch++;
314
320
  // A new activity has no default options: the last ones set come back, else the theme's and the app's.
@@ -328,23 +334,139 @@ export function createNavigation(config) {
328
334
  relaunchWaiters.splice(0).forEach(resume => resume());
329
335
  }
330
336
 
331
- // The links listen from now on: one that comes before the native side launches waits for the first root.
332
- if (config.linking) {
333
- setupLinking(config.linking, {
337
+ // The routes of the links, the roots they name and where their errors go.
338
+ function linkingOptions() {
339
+ return {
334
340
  roots: config.roots,
335
341
  onError: config.onError && ((error, url) => config.onError?.(error, {
336
342
  type: 'link',
337
343
  url
338
344
  }))
345
+ };
346
+ }
347
+
348
+ // Fast Refresh ran the module that makes the app again (development): its new config takes the place of the old.
349
+ // What only the start reads (the first root, willMount, the splash, the context) has done its part; the screens, the
350
+ // default options, the roots, the listeners and the links take the new one. A theme the same as before leaves the one
351
+ // the app set since. The providers and fallbacks are in the families of the ones before (`keepStateOf`): React
352
+ // Refresh puts the new ones in place, with the state of what they wrap.
353
+ function update(next) {
354
+ const before = config;
355
+ // The app's one tree is set up at the start, or not: a provider added or taken out starts the app again.
356
+ if (!before.appProvider !== !next.appProvider) {
357
+ DevSettings.reload('[navigation] appProvider was added or taken out');
358
+ return;
359
+ }
360
+ config = next;
361
+ if (screensRegistered) registerAppScreens();
362
+ setActiveApp({
363
+ roots: config.roots,
364
+ presentation: config.presentation,
365
+ mounted
339
366
  });
367
+ // A direction the app set since stays too, unless the edit changes the config's.
368
+ const defaultsBefore = themedDefaultOptions();
369
+ const direction = sameValue(before.direction, next.direction) ? getDirection() : next.direction;
370
+ initTheme(getTheme(), appDefaults(), direction);
371
+ if (!sameValue(before.theme, next.theme)) {
372
+ setTheme(next.theme ?? {});
373
+ } else {
374
+ const defaults = themedDefaultOptions();
375
+ if (!sameValue(defaultsBefore, defaults)) setDefaultOptions(defaults ?? {});
376
+ }
377
+ if (listening) {
378
+ removeListeners?.();
379
+ removeListeners = config.listeners && addNavigationListeners(config.listeners);
380
+ }
381
+ if (config.linking && linkingStarted) updateLinking(config.linking, linkingOptions());else startLinking();
382
+ }
383
+
384
+ // The default options of the app, under and over the theme's.
385
+ function appDefaults() {
386
+ return {
387
+ under: config.safeArea && {
388
+ layout: {
389
+ safeAreaEdges: config.safeArea.edges
390
+ }
391
+ },
392
+ options: config.options,
393
+ over: config.window && {
394
+ window: config.window
395
+ }
396
+ };
397
+ }
398
+
399
+ // The links listen from now on: one that comes before the native side launches waits for the first root.
400
+ let linkingStarted = false;
401
+ function startLinking() {
402
+ if (!config.linking || linkingStarted) return;
403
+ linkingStarted = true;
404
+ setupLinking(config.linking, linkingOptions());
405
+ }
406
+
407
+ // The components of the app keep their state across Fast Refresh, as the screens' do.
408
+ function keepComponentsState() {
409
+ if (!__DEV__) return;
410
+ keepStateOf(app, config.appProvider, 'appProvider');
411
+ keepStateOf(app, config.screenProvider, 'screenProvider');
412
+ keepStateOf(app, config.errorFallback, 'errorFallback');
413
+ keepStateOf(app, config.loadingFallback, 'loadingFallback');
414
+ keepStateOf(app, config.splash?.component, 'splash');
340
415
  }
341
416
  const app = {
342
417
  [NAVIGATION_APP]: true
343
418
  };
344
- starts.set(app, () => reportStart(launch));
419
+ keepComponentsState();
420
+ const start = () => {
421
+ startLinking();
422
+ starts.set(app, () => reportStart(launch));
423
+ if (__DEV__) updates.set(app, update);
424
+ };
425
+ if (!launched) {
426
+ start();
427
+ return app;
428
+ }
429
+ // Once the module ran, Metro has put its exports in the families of the ones of its run before: the same family as
430
+ // the app that launched, or the app's entry registering it under the app's name again (an app it doesn't export),
431
+ // means this is its module again, and the app that runs takes the new config.
432
+ pending.set(app, Promise.resolve().then(() => {
433
+ pending.delete(app);
434
+ const family = familyOf(app);
435
+ if (family && family === familyOf(launched) || replacing.delete(app)) {
436
+ updates.get(launched)?.(config);
437
+ starts.set(app, starts.get(launched));
438
+ updates.set(app, updates.get(launched));
439
+ return;
440
+ }
441
+ watchBackListeners();
442
+ start();
443
+ }));
345
444
  return app;
346
445
  }
347
446
 
447
+ // The app that launched in this runtime, and what takes the config of its module when it runs again (development).
448
+ let launchedApp;
449
+ const updates = new WeakMap();
450
+ // The apps made after the launch until their module ran, and those the app's entry registered again under its name.
451
+ const pending = new WeakMap();
452
+ const replacing = new WeakSet();
453
+
454
+ /**
455
+ * Notes an app the entry file registers under the name of the app that launched: the entry ran again after an edit
456
+ * (development), and the new app is the old one's next version.
457
+ */
458
+ export function noteReplacingApp(app) {
459
+ if (__DEV__ && launchedApp && typeof app === 'object' && app !== null && NAVIGATION_APP in app) {
460
+ replacing.add(app);
461
+ }
462
+ }
463
+
464
+ // The app that launched, when React Refresh runs and a new app may be its module running again: one its module
465
+ // exports (Metro gives it a family), or one the entry registers again under the app's name.
466
+ function hotCandidate() {
467
+ return launchedApp && refreshRuns() ? launchedApp : undefined;
468
+ }
469
+
348
470
  // A willMount that never ends keeps the splash screen for good: in development the app hears of it.
349
471
  function warnIfLong(willMount) {
350
472
  const timer = setTimeout(() => console.warn('[navigation] willMount: still running after 10 s; the splash stays until it ends'), 10_000);
@@ -1 +1 @@
1
- {"version":3,"names":["setDefaultOptions","setRoot","enableSlots","withSlots","listenToNativeScreens","startHost","listenToSplitViews","hasNativeScreenHooks","addNavigationListeners","getNavigationState","listenToNavigationState","watchSideMenus","listenToNativeScreenCalls","buildRoot","withDefaultTransition","registerScreens","getAppContext","setAppContext","initTheme","themedDefaultOptions","setActiveApp","setStartFailure","START_FAILURE_SCREEN","startFailureScreen","releaseSplash","showsSplash","showSplash","SPLASH_ROOT","SPLASH_SCREEN","splashDone","launchState","watchBackListeners","resolveRoot","listenToDispatchedLinks","launchLink","launchRoot","linksRelaunched","linksStarted","reportLink","setupLinking","NAVIGATION_APP","Symbol","starts","WeakMap","startApp","app","start","get","Error","isNavigationApp","value","has","createNavigation","config","phase","screensRegistered","splashChecked","listening","prepared","markMounted","relaunchedWhileMounting","relaunchWaiters","relaunchedAfter","launch","Promise","resolve","push","mounted","prepare","then","willMount","catch","undefined","__DEV__","warnIfLong","firstRoot","context","roots","initialRoot","target","name","param","Array","isArray","root","mount","stateBefore","link","linkHandled","wrapper","errorFallback","loadingFallback","onError","error","screen","componentStack","type","source","screens","Object","entries","groups","map","group","options","provider","screenProvider","splash","component","ownRoot","linkTaken","linking","splashLeaves","id","linked","handled","sent","afterSplash","withTransition","transition","rootLaunch","rootId","setLinkedRoot","url","sentIn","shown","restoreRoot","didMount","showStartFailure","failureShown","retry","reportStart","run","presentation","theme","under","safeArea","layout","safeAreaEdges","edges","over","window","direction","appProvider","listeners","defaultOptions","splice","forEach","resume","set","timer","setTimeout","console","warn","clear","clearTimeout"],"sourceRoot":"../../../../src","sources":["api/app/createNavigation.ts"],"mappings":";;AACA,SAASA,iBAAiB,EAAEC,OAAO,QAAQ,0BAAuB;AAClE,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,uBAAoB;AAC7E,SAASC,qBAAqB,EAAEC,SAAS,QAAQ,+BAA4B;AAC7E,SAASC,kBAAkB,QAAQ,wBAAqB;AACxD,SAASC,oBAAoB,QAAQ,yBAAsB;AAI3D,SAASC,sBAAsB,QAAkC,+BAA4B;AAC7F,SAASC,kBAAkB,EAAEC,uBAAuB,QAAQ,6BAA0B;AACtF,SAASC,cAAc,QAAQ,0BAAuB;AACtD,SAASC,yBAAyB,QAAQ,iCAA8B;AACxE,SAASC,SAAS,EAAmBC,qBAAqB,QAAQ,mBAAgB;AAClF,SAEEC,eAAe,QAKV,+BAA4B;AAEnC,SAASC,aAAa,EAAEC,aAAa,QAAQ,0BAAuB;AACpE,SAEEC,SAAS,EAGTC,oBAAoB,QACf,mBAAgB;AACvB,SAASC,YAAY,QAAQ,gBAAa;AAC1C,SAASC,eAAe,EAAEC,oBAAoB,EAAEC,kBAAkB,QAAQ,mBAAgB;AAC1F,SACEC,aAAa,EACbC,WAAW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GC,UAAU,CACtB,MACEC,OAAO,CAACC,IAAI,CACV,kFACF,CAAC,EACH,MACF,CAAC;EACD,MAAMC,KAAK,GAAGA,CAAA,KAAMC,YAAY,CAACL,KAAK,CAAC;EACvChF,SAAS,CAACD,IAAI,CAACqF,KAAK,EAAEA,KAAK,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA,eAAe5B,WAAWA,CAAA,EAAgC;EACxD,IAAIb,EAAsB;EAC1B,OAAOnF,WAAW,CAACsD,IAAI,IAAItD,WAAW,CAAC0F,UAAU,KAAK1F,WAAW,CAACiC,MAAM,EAAE;IACxE,MAAMqB,IAAI,GAAGtD,WAAW,CAACsD,IAAI;IAC7B6B,EAAE,GAAG,MAAM9G,SAAS,CAAC,MAAMF,OAAO,CAACmF,IAAI,CAAC,CAAC;EAC3C;EACA,OAAO6B,EAAE;AACX","ignoreList":[]}
1
+ {"version":3,"names":["DevSettings","setDefaultOptions","setRoot","enableSlots","withSlots","listenToNativeScreens","startHost","sameValue","familyOf","keepStateOf","refreshRuns","listenToSplitViews","hasNativeScreenHooks","addNavigationListeners","getNavigationState","listenToNavigationState","watchSideMenus","listenToNativeScreenCalls","buildRoot","withDefaultTransition","registerScreens","getAppContext","setAppContext","getDirection","getTheme","initTheme","setTheme","themedDefaultOptions","setActiveApp","setStartFailure","START_FAILURE_SCREEN","startFailureScreen","releaseSplash","showsSplash","showSplash","SPLASH_ROOT","SPLASH_SCREEN","splashDone","launchState","watchBackListeners","resolveRoot","listenToDispatchedLinks","launchLink","launchRoot","linksRelaunched","linksStarted","reportLink","setupLinking","updateLinking","NAVIGATION_APP","Symbol","starts","WeakMap","startApp","app","waiting","pending","get","then","start","Error","isNavigationApp","value","has","createNavigation","config","launched","__DEV__","hotCandidate","undefined","phase","screensRegistered","splashChecked","listening","removeListeners","prepared","markMounted","relaunchedWhileMounting","relaunchWaiters","relaunchedAfter","launch","Promise","resolve","push","mounted","prepare","willMount","catch","warnIfLong","firstRoot","context","roots","initialRoot","target","name","param","Array","isArray","root","registerAppScreens","wrapper","errorFallback","loadingFallback","onError","error","screen","componentStack","type","source","screens","Object","entries","groups","map","group","options","provider","screenProvider","splash","component","ownRoot","mount","stateBefore","link","linkHandled","linkTaken","linking","splashLeaves","id","linked","handled","sent","afterSplash","withTransition","transition","rootLaunch","rootId","setLinkedRoot","url","sentIn","shown","restoreRoot","didMount","showStartFailure","failureShown","retry","reportStart","run","launchedApp","presentation","theme","appDefaults","direction","appProvider","listeners","defaultOptions","splice","forEach","resume","linkingOptions","update","next","before","reload","defaultsBefore","defaults","linkingStarted","startLinking","under","safeArea","layout","safeAreaEdges","edges","over","window","keepComponentsState","set","updates","delete","family","replacing","WeakSet","noteReplacingApp","add","timer","setTimeout","console","warn","clear","clearTimeout"],"sourceRoot":"../../../../src","sources":["api/app/createNavigation.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,SAASC,iBAAiB,EAAEC,OAAO,QAAQ,0BAAuB;AAClE,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,uBAAoB;AAC7E,SAASC,qBAAqB,EAAEC,SAAS,QAAQ,+BAA4B;AAC7E,SAASC,SAAS,QAAQ,+BAA4B;AACtD,SAASC,QAAQ,EAAEC,WAAW,EAAEC,WAAW,QAAQ,yBAAsB;AACzE,SAASC,kBAAkB,QAAQ,wBAAqB;AACxD,SAASC,oBAAoB,QAAQ,yBAAsB;AAI3D,SAASC,sBAAsB,QAAkC,+BAA4B;AAC7F,SAASC,kBAAkB,EAAEC,uBAAuB,QAAQ,6BAA0B;AACtF,SAASC,cAAc,QAAQ,0BAAuB;AACtD,SAASC,yBAAyB,QAAQ,iCAA8B;AACxE,SAASC,SAAS,EAAmBC,qBAAqB,QAAQ,mBAAgB;AAClF,SAEEC,eAAe,QAKV,+BAA4B;AAEnC,SAASC,aAAa,EAAEC,aAAa,QAAQ,0BAAuB;AACpE,SAEEC,YAAY,EACZC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EAGRC,oBA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G,IAAI7H,OAAO,CAAqD,CAAC;AACjF;AACA,MAAMI,OAAO,GAAG,IAAIJ,OAAO,CAAyC,CAAC;AACrE,MAAMgI,SAAS,GAAG,IAAIC,OAAO,CAA0B,CAAC;;AAExD;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAChI,GAAY,EAAQ;EACnD,IAAIa,OAAO,IAAIiF,WAAW,IAAI,OAAO9F,GAAG,KAAK,QAAQ,IAAIA,GAAG,KAAK,IAAI,IAAIL,cAAc,IAAIK,GAAG,EAAE;IAC9F8H,SAAS,CAACG,GAAG,CAACjI,GAA8B,CAAC;EAC/C;AACF;;AAEA;AACA;AACA,SAASc,YAAYA,CAAA,EAAwC;EAC3D,OAAOgF,WAAW,IAAI1I,WAAW,CAAC,CAAC,GAAG0I,WAAW,GAAG/E,SAAS;AAC/D;;AAEA;AACA,SAASmB,UAAUA,CAACF,SAAwB,EAAE;EAC5C,MAAMkG,KAAK,GAAGC,UAAU,CACtB,MACEC,OAAO,CAACC,IAAI,CACV,kFACF,CAAC,EACH,MACF,CAAC;EACD,MAAMC,KAAK,GAAGA,CAAA,KAAMC,YAAY,CAACL,KAAK,CAAC;EACvClG,SAAS,CAAC5B,IAAI,CAACkI,KAAK,EAAEA,KAAK,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA,eAAe/C,WAAWA,CAAA,EAAgC;EACxD,IAAIb,EAAsB;EAC1B,OAAO1F,WAAW,CAAC4D,IAAI,IAAI5D,WAAW,CAACiG,UAAU,KAAKjG,WAAW,CAAC0C,MAAM,EAAE;IACxE,MAAMkB,IAAI,GAAG5D,WAAW,CAAC4D,IAAI;IAC7B8B,EAAE,GAAG,MAAM5H,SAAS,CAAC,MAAMF,OAAO,CAACgG,IAAI,CAAC,CAAC;EAC3C;EACA,OAAO8B,EAAE;AACX","ignoreList":[]}
@@ -59,11 +59,15 @@ export function onNavigationEvent(name, handler) {
59
59
  return onNativeEvent(nativeName, deliver);
60
60
  }
61
61
 
62
- /** Listens to the events of `listeners`, for as long as the app runs. */
62
+ /** Listens to the events of `listeners` until the function it gives is called. */
63
63
  export function addNavigationListeners(listeners) {
64
+ const removers = [];
64
65
  for (const name of Object.keys(listeners)) {
65
66
  const handler = listeners[name];
66
- if (handler) onNavigationEvent(name, handler);
67
+ if (handler) {
68
+ removers.push(onNavigationEvent(name, handler));
69
+ }
67
70
  }
71
+ return () => removers.forEach(remove => remove());
68
72
  }
69
73
  //# sourceMappingURL=navigationEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["toScreenEvent","onNativeEvent","onNavigationStateChange","SCREEN_EVENTS","Set","NATIVE_EVENTS","screenWillAppear","screenDidAppear","screenDidDisappear","screenPopped","buttonPressed","tabSelected","tabPressed","tabLongPressed","modalDismissed","modalDismissAttempted","searchChanged","searchSubmitted","searchCancelled","searchSuggestionPicked","sheetDetentChanged","splitViewDisplayModeChanged","keyCommandPressed","titleRenamed","accessoryPlacementChanged","previewCompleted","SCREEN_APPEARANCE","onNavigationEvent","name","handler","deliver","nativeName","has","event","componentType","addNavigationListeners","listeners","Object","keys"],"sourceRoot":"../../../../src","sources":["api/events/navigationEvents.ts"],"mappings":";;AAAA,SAA6BA,aAAa,QAAQ,wBAAqB;AACvE,SAASC,aAAa,QAAQ,wBAAqB;AAyBnD,SAA+BC,uBAAuB,QAAQ,6BAA0B;;AAExF;;AAuCA;;AAsBA;AACA,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAsB,CACjD,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,CACnB,CAAC;;AAEF;;AAKA;AACA,MAAMC,aAAiF,GAAG;EACxFC,gBAAgB,EAAE,qBAAqB;EACvCC,eAAe,EAAE,oBAAoB;EACrCC,kBAAkB,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B,aAAa,CAACiC,KAAK,CAAC,CAC9B,CAAC;EACH;EACA,OAAOhC,aAAa,CAAC8B,UAAU,EAAED,OAAO,CAAC;AAC3C;;AAEA;AACA,OAAO,SAASK,sBAAsBA,CAACC,SAA8B,EAAE;EACrE,KAAK,MAAMR,IAAI,IAAIS,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC,EAA2B;IAClE,MAAMP,OAAO,GAAGO,SAAS,CAACR,IAAI,CAAC;IAC/B,IAAIC,OAAO,EAAEF,iBAAiB,CAACC,IAAI,EAAEC,OAAyD,CAAC;EACjG;AACF","ignoreList":[]}
1
+ {"version":3,"names":["toScreenEvent","onNativeEvent","onNavigationStateChange","SCREEN_EVENTS","Set","NATIVE_EVENTS","screenWillAppear","screenDidAppear","screenDidDisappear","screenPopped","buttonPressed","tabSelected","tabPressed","tabLongPressed","modalDismissed","modalDismissAttempted","searchChanged","searchSubmitted","searchCancelled","searchSuggestionPicked","sheetDetentChanged","splitViewDisplayModeChanged","keyCommandPressed","titleRenamed","accessoryPlacementChanged","previewCompleted","SCREEN_APPEARANCE","onNavigationEvent","name","handler","deliver","nativeName","has","event","componentType","addNavigationListeners","listeners","removers","Object","keys","push","forEach","remove"],"sourceRoot":"../../../../src","sources":["api/events/navigationEvents.ts"],"mappings":";;AAAA,SAA6BA,aAAa,QAAQ,wBAAqB;AACvE,SAASC,aAAa,QAAQ,wBAAqB;AAyBnD,SAA+BC,uBAAuB,QAAQ,6BAA0B;;AAExF;;AAuCA;;AAsBA;AACA,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAsB,CACjD,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,CACnB,CAAC;;AAEF;;AAKA;AACA,MAAMC,aAAiF,GAAG;E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;IAC3B,OAAO3B,aAAa,CAA0B8B,UAAU,EAAGE,KAAK,IAC9DH,OAAO,CAAC9B,aAAa,CAACiC,KAAK,CAAC,CAC9B,CAAC;EACH;EACA,OAAOhC,aAAa,CAAC8B,UAAU,EAAED,OAAO,CAAC;AAC3C;;AAEA;AACA,OAAO,SAASK,sBAAsBA,CAACC,SAA8B,EAAc;EACjF,MAAMC,QAAwB,GAAG,EAAE;EACnC,KAAK,MAAMT,IAAI,IAAIU,MAAM,CAACC,IAAI,CAACH,SAAS,CAAC,EAA2B;IAClE,MAAMP,OAAO,GAAGO,SAAS,CAACR,IAAI,CAAC;IAC/B,IAAIC,OAAO,EAAE;MACXQ,QAAQ,CAACG,IAAI,CACXb,iBAAiB,CAACC,IAAI,EAAEC,OAAyD,CACnF,CAAC;IACH;EACF;EACA,OAAO,MAAMQ,QAAQ,CAACI,OAAO,CAAEC,MAAM,IAAKA,MAAM,CAAC,CAAC,CAAC;AACrD","ignoreList":[]}
@@ -48,6 +48,17 @@ export function setupLinking(linking, options) {
48
48
  setPendingLinkOpener(link => run(link, routeOf(link), false));
49
49
  }
50
50
 
51
+ /**
52
+ * Takes the routes, the roots and `onError` of an app whose module ran again after an edit (Fast Refresh, development):
53
+ * the links that come from now on find the new routes.
54
+ */
55
+ export function updateLinking(linking, options) {
56
+ config = linking;
57
+ roots = options.roots;
58
+ onError = options.onError;
59
+ routes = compileRoutes(Object.keys(linking.routes));
60
+ }
61
+
51
62
  /**
52
63
  * The link that launched the app, matched as the app starts (`unmatched` may run commands then); the same one for
53
64
  * every try of the first start.