@apexnative/navigation 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (226) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/android/CLAUDE.md +38 -9
  3. package/android/CORE.md +11 -4
  4. package/android/RECIPES.md +9 -3
  5. package/android/src/main/java/dev/apexnative/navigation/NavigationActivity.kt +29 -1
  6. package/android/src/main/java/dev/apexnative/navigation/NavigationApplication.kt +34 -13
  7. package/android/src/main/java/dev/apexnative/navigation/layout/LayoutChecks.kt +5 -1
  8. package/android/src/main/java/dev/apexnative/navigation/layout/LayoutNode.kt +6 -2
  9. package/android/src/main/java/dev/apexnative/navigation/nativescreen/NativeScreenContext.kt +2 -2
  10. package/android/src/main/java/dev/apexnative/navigation/options/ButtonMenuOptions.kt +2 -2
  11. package/android/src/main/java/dev/apexnative/navigation/options/ButtonOptions.kt +2 -2
  12. package/android/src/main/java/dev/apexnative/navigation/options/OptionsCache.kt +8 -4
  13. package/android/src/main/java/dev/apexnative/navigation/options/StatusBarOptions.kt +7 -3
  14. package/android/src/main/java/dev/apexnative/navigation/options/UserChoices.kt +159 -0
  15. package/android/src/main/java/dev/apexnative/navigation/react/CommandAnswer.kt +2 -24
  16. package/android/src/main/java/dev/apexnative/navigation/react/CommandContract.kt +59 -0
  17. package/android/src/main/java/dev/apexnative/navigation/react/Hinge.kt +27 -19
  18. package/android/src/main/java/dev/apexnative/navigation/react/NavigationTurboModule.kt +5 -4
  19. package/android/src/main/java/dev/apexnative/navigation/react/PendingCalls.kt +48 -0
  20. package/android/src/main/java/dev/apexnative/navigation/react/events/AppearanceDispatcher.kt +17 -7
  21. package/android/src/main/java/dev/apexnative/navigation/slots/SlotContainers.kt +10 -7
  22. package/android/src/main/java/dev/apexnative/navigation/slots/SlotView.kt +4 -3
  23. package/android/src/main/java/dev/apexnative/navigation/slots/SlotViews.kt +40 -0
  24. package/android/src/main/java/dev/apexnative/navigation/utils/ImageKey.kt +66 -0
  25. package/android/src/main/java/dev/apexnative/navigation/utils/ImageLoader.kt +7 -89
  26. package/android/src/main/java/dev/apexnative/navigation/utils/ImageRequests.kt +76 -0
  27. package/android/src/main/java/dev/apexnative/navigation/utils/OptionImages.kt +262 -0
  28. package/android/src/main/java/dev/apexnative/navigation/utils/ViewController.kt +3 -1
  29. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/arrangement/SecondaryScreenPresenter.kt +13 -5
  30. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/AppliedTabCalls.kt +49 -0
  31. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/BottomTabsController.kt +92 -19
  32. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +25 -24
  33. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ComponentPresenter.kt +28 -7
  34. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ContentReadiness.kt +1 -1
  35. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/RenderWait.kt +27 -7
  36. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ScreenFrame.kt +1 -1
  37. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalAnimations.kt +22 -24
  38. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalCoordinator.kt +79 -13
  39. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalRecord.kt +21 -6
  40. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalSheet.kt +29 -12
  41. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalViews.kt +22 -18
  42. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/BackCallbackState.kt +4 -0
  43. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/Navigator.kt +45 -6
  44. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/RootCoordinator.kt +35 -9
  45. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/overlay/OverlayCoordinator.kt +10 -8
  46. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/Capabilities.kt +11 -4
  47. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/ContainerBackground.kt +3 -3
  48. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/ParentController.kt +3 -0
  49. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/sidemenu/SideMenuController.kt +5 -1
  50. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/splitview/SplitPanes.kt +23 -0
  51. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/splitview/SplitViewController.kt +72 -16
  52. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/BackPreview.kt +287 -0
  53. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackCommands.kt +28 -18
  54. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackController.kt +164 -13
  55. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackDisplay.kt +26 -1
  56. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackQueue.kt +136 -40
  57. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackTransitions.kt +26 -8
  58. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackViews.kt +107 -4
  59. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/fab/FabPresenter.kt +7 -5
  60. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/search/StackSearchPresenter.kt +3 -3
  61. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/MenuChecks.kt +13 -56
  62. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/TopBarPresenter.kt +131 -9
  63. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/viewcontroller/ViewController.kt +75 -21
  64. package/android/src/main/java/dev/apexnative/navigation/views/animations/Curves.kt +29 -11
  65. package/android/src/main/java/dev/apexnative/navigation/views/bottomtabs/BottomTabs.kt +4 -2
  66. package/android/src/main/java/dev/apexnative/navigation/views/stack/ScreenEdge.kt +15 -0
  67. package/android/src/main/java/dev/apexnative/navigation/views/stack/StackLayout.kt +137 -1
  68. package/android/src/main/java/dev/apexnative/navigation/views/stack/fab/Fab.kt +14 -10
  69. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TitleBar.kt +8 -1
  70. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TopBar.kt +26 -4
  71. package/cli/doctor/checks/app.js +61 -13
  72. package/cli/migrate/native.js +18 -0
  73. package/cli/setup/source.js +2 -1
  74. package/cli/setup/steps/mainApplication.js +134 -19
  75. package/docs-md/architecture/transitions.md +12 -7
  76. package/docs-md/containers/modals.md +4 -2
  77. package/docs-md/containers/overlays.md +3 -1
  78. package/docs-md/containers/side-menu.md +4 -2
  79. package/docs-md/containers/tabs.md +2 -0
  80. package/docs-md/flows/forms-in-a-modal.md +1 -1
  81. package/docs-md/help/glossary.md +2 -2
  82. package/docs-md/help/troubleshooting.md +20 -3
  83. package/docs-md/index.json +12 -0
  84. package/docs-md/migration/from-react-native-navigation.md +8 -2
  85. package/docs-md/screen-ui/back-and-gestures.md +8 -2
  86. package/docs-md/screen-ui/system-ui.md +1 -1
  87. package/docs-md/start/installation.md +3 -1
  88. package/ios/CLAUDE.md +17 -5
  89. package/ios/CORE.md +13 -8
  90. package/ios/Contract/ANNCommandAnswer.mm +5 -20
  91. package/ios/Contract/ANNCommandContract.h +15 -0
  92. package/ios/Contract/ANNCommandContract.mm +78 -0
  93. package/ios/Core/ANNAppearanceDispatcher.mm +1 -1
  94. package/ios/Core/ANNErrorHandler.h +1 -1
  95. package/ios/Core/ANNErrorHandler.mm +3 -1
  96. package/ios/Core/ANNEventEmitter.h +1 -1
  97. package/ios/Core/ANNEventEmitter.mm +2 -2
  98. package/ios/Core/ANNJavaScriptCalls.h +34 -0
  99. package/ios/Core/ANNJavaScriptCalls.mm +61 -0
  100. package/ios/Core/ANNNavigationState.h +7 -3
  101. package/ios/Core/ANNNavigationState.mm +10 -5
  102. package/ios/Core/ANNNodeHelper.h +32 -12
  103. package/ios/Core/ANNNodeHelper.mm +100 -3
  104. package/ios/Core/ANNRenderWait.h +15 -1
  105. package/ios/Core/ANNRenderWait.mm +119 -17
  106. package/ios/Core/UIViewController+LayoutProtocol.h +9 -2
  107. package/ios/Core/UIViewController+LayoutProtocol.mm +8 -0
  108. package/ios/Layouts/Modal/ANNModalCoordinator.h +1 -1
  109. package/ios/Layouts/Modal/ANNModalCoordinator.mm +55 -14
  110. package/ios/Layouts/Screen/ANNComponentViewController.h +8 -0
  111. package/ios/Layouts/Screen/ANNComponentViewController.mm +32 -5
  112. package/ios/Layouts/Screen/ANNScreenPlace.h +41 -0
  113. package/ios/Layouts/Screen/ANNScreenPlace.mm +175 -0
  114. package/ios/Layouts/SplitView/ANNSplitViewCommands.h +3 -2
  115. package/ios/Layouts/SplitView/ANNSplitViewCommands.mm +105 -39
  116. package/ios/Layouts/SplitView/ANNSplitViewController.mm +4 -2
  117. package/ios/Layouts/Stack/ANNStackCommands.mm +1 -0
  118. package/ios/Layouts/Stack/ANNStackController.mm +26 -3
  119. package/ios/Layouts/Stack/ANNStackQueue.h +3 -1
  120. package/ios/Layouts/Stack/ANNStackQueue.mm +56 -43
  121. package/ios/Layouts/Stack/UINavigationController+ANNCommands.h +4 -2
  122. package/ios/Layouts/Stack/UINavigationController+ANNCommands.mm +2 -3
  123. package/ios/Layouts/Tabs/ANNBottomTabItemBuilder.h +4 -0
  124. package/ios/Layouts/Tabs/ANNBottomTabItemBuilder.mm +11 -0
  125. package/ios/Layouts/Tabs/ANNBottomTabsController.mm +13 -5
  126. package/ios/Layouts/Tabs/ANNBottomTabsPresenter.h +2 -2
  127. package/ios/Layouts/Tabs/ANNBottomTabsPresenter.mm +109 -7
  128. package/ios/Options/ANNOptionsCache.h +7 -6
  129. package/ios/Options/ANNSearchBarOptions.h +4 -3
  130. package/ios/Options/ANNUserChoice.h +57 -0
  131. package/ios/Options/ANNUserChoice.mm +44 -0
  132. package/ios/Options/Params/ANNImageSource.h +61 -0
  133. package/ios/Options/Params/ANNImageSource.mm +101 -0
  134. package/ios/Options/Params/ANNOptionImages.h +37 -0
  135. package/ios/Options/Params/ANNOptionImages.mm +284 -0
  136. package/ios/Options/Params/Image.h +11 -2
  137. package/ios/Options/Params/Image.mm +15 -2
  138. package/ios/Options/Params/ImageParser.h +5 -5
  139. package/ios/Options/Params/ImageParser.mm +28 -46
  140. package/ios/Public/ApexNavigation/ApexNavigation.h +1 -1
  141. package/ios/RECIPES.md +11 -5
  142. package/ios/React/Slots/ANNSlotComponentView.mm +24 -17
  143. package/ios/React/Slots/ANNSlotContainers.h +14 -6
  144. package/ios/React/Slots/ANNSlotContainers.mm +75 -2
  145. package/ios/TopBar/ANNBarButtons.h +9 -5
  146. package/ios/TopBar/ANNBarButtons.mm +211 -63
  147. package/ios/TopBar/ANNIconButtonImage.h +1 -0
  148. package/ios/TopBar/ANNIconButtonImage.mm +34 -1
  149. package/ios/TopBar/ANNLargeTitlePresenter.h +13 -0
  150. package/ios/TopBar/ANNLargeTitlePresenter.mm +26 -3
  151. package/ios/TopBar/ANNSearchPresenter.mm +170 -19
  152. package/ios/TopBar/ANNTopBarPresenter.h +5 -0
  153. package/ios/TopBar/ANNTopBarPresenter.mm +60 -11
  154. package/ios/TurboModules/ANNTurboModule.mm +39 -21
  155. package/lib/module/ARCHITECTURE.md +18 -18
  156. package/lib/module/adapters/NativeANNTurboModule.js.map +1 -1
  157. package/lib/module/api/hooks/useNavigation.js +8 -3
  158. package/lib/module/api/hooks/useNavigation.js.map +1 -1
  159. package/lib/module/api/navigation.js.map +1 -1
  160. package/lib/module/engine/commands.js +9 -7
  161. package/lib/module/engine/commands.js.map +1 -1
  162. package/lib/module/engine/layout.js +13 -9
  163. package/lib/module/engine/layout.js.map +1 -1
  164. package/lib/module/engine/options.js +44 -11
  165. package/lib/module/engine/options.js.map +1 -1
  166. package/lib/module/engine/places.js +44 -7
  167. package/lib/module/engine/places.js.map +1 -1
  168. package/lib/module/engine/props.js +30 -1
  169. package/lib/module/engine/props.js.map +1 -1
  170. package/lib/module/engine/rememberedOptions.js +1 -1
  171. package/lib/module/engine/rememberedOptions.js.map +1 -1
  172. package/lib/module/engine/screens.js +22 -12
  173. package/lib/module/engine/screens.js.map +1 -1
  174. package/lib/module/interfaces/contract/commands.json +101 -0
  175. package/lib/typescript/adapters/NativeANNTurboModule.d.ts +5 -2
  176. package/lib/typescript/adapters/NativeANNTurboModule.d.ts.map +1 -1
  177. package/lib/typescript/api/events/navigationEvents.d.ts +1 -1
  178. package/lib/typescript/api/events/navigationEvents.d.ts.map +1 -1
  179. package/lib/typescript/api/hooks/useNavigation.d.ts +1 -1
  180. package/lib/typescript/api/hooks/useNavigation.d.ts.map +1 -1
  181. package/lib/typescript/api/navigation.d.ts +4 -1
  182. package/lib/typescript/api/navigation.d.ts.map +1 -1
  183. package/lib/typescript/engine/commands.d.ts.map +1 -1
  184. package/lib/typescript/engine/options.d.ts +5 -2
  185. package/lib/typescript/engine/options.d.ts.map +1 -1
  186. package/lib/typescript/engine/places.d.ts +5 -2
  187. package/lib/typescript/engine/places.d.ts.map +1 -1
  188. package/lib/typescript/engine/props.d.ts +8 -1
  189. package/lib/typescript/engine/props.d.ts.map +1 -1
  190. package/lib/typescript/engine/rememberedOptions.d.ts.map +1 -1
  191. package/lib/typescript/engine/screens.d.ts.map +1 -1
  192. package/lib/typescript/interfaces/ComponentEvents.d.ts +2 -2
  193. package/lib/typescript/interfaces/ComponentEvents.d.ts.map +1 -1
  194. package/lib/typescript/interfaces/Events.d.ts +19 -10
  195. package/lib/typescript/interfaces/Events.d.ts.map +1 -1
  196. package/lib/typescript/interfaces/options/animations.d.ts +15 -7
  197. package/lib/typescript/interfaces/options/animations.d.ts.map +1 -1
  198. package/lib/typescript/interfaces/options/buttons.d.ts +13 -5
  199. package/lib/typescript/interfaces/options/buttons.d.ts.map +1 -1
  200. package/lib/typescript/interfaces/options/modals.d.ts +18 -13
  201. package/lib/typescript/interfaces/options/modals.d.ts.map +1 -1
  202. package/lib/typescript/interfaces/options/system.d.ts +6 -3
  203. package/lib/typescript/interfaces/options/system.d.ts.map +1 -1
  204. package/lib/typescript/interfaces/options/topBar.d.ts +22 -9
  205. package/lib/typescript/interfaces/options/topBar.d.ts.map +1 -1
  206. package/package.json +1 -1
  207. package/src/ARCHITECTURE.md +18 -18
  208. package/src/adapters/NativeANNTurboModule.ts +5 -2
  209. package/src/api/events/navigationEvents.ts +1 -1
  210. package/src/api/hooks/useNavigation.ts +9 -4
  211. package/src/api/navigation.ts +4 -1
  212. package/src/engine/commands.ts +19 -7
  213. package/src/engine/layout.ts +16 -9
  214. package/src/engine/options.ts +39 -11
  215. package/src/engine/places.ts +56 -7
  216. package/src/engine/props.ts +30 -1
  217. package/src/engine/rememberedOptions.ts +4 -1
  218. package/src/engine/screens.tsx +23 -13
  219. package/src/interfaces/ComponentEvents.ts +2 -2
  220. package/src/interfaces/Events.ts +19 -10
  221. package/src/interfaces/contract/commands.json +101 -0
  222. package/src/interfaces/options/animations.ts +15 -7
  223. package/src/interfaces/options/buttons.ts +13 -5
  224. package/src/interfaces/options/modals.ts +18 -13
  225. package/src/interfaces/options/system.ts +6 -3
  226. package/src/interfaces/options/topBar.ts +22 -9
@@ -7,6 +7,11 @@ const watchers = new Map<string, Set<() => void>>();
7
7
  const none = {};
8
8
  // The roots that are the components of bar buttons: their wrapper centers the content in the button's slot.
9
9
  const buttonRoots = new Set<string>();
10
+ // The ids the library gave components in options, by the node whose options they are in. Such an id stays the same
11
+ // for every show of the node and may have several roots at once (a component of the default or a stack's options):
12
+ // its props go with the node, not with a root.
13
+ const optionComponents = new Map<string, Set<string>>();
14
+ const optionComponentIds = new Set<string>();
10
15
 
11
16
  export function setProps(id: string, props: object | undefined): void {
12
17
  if (props === undefined) byId.delete(id);
@@ -38,8 +43,32 @@ export function isButtonRoot(id: string): boolean {
38
43
  return buttonRoots.has(id);
39
44
  }
40
45
 
41
- /** The view is gone: its props, and whether it is a button's root, are not needed again. */
46
+ /** Notes an id the library gave a component in the options of the node `owner`. */
47
+ export function rememberOptionsComponent(owner: string, id: string): void {
48
+ let ids = optionComponents.get(owner);
49
+ if (!ids) optionComponents.set(owner, (ids = new Set()));
50
+ ids.add(id);
51
+ optionComponentIds.add(id);
52
+ }
53
+
54
+ /** Whether the library gave the id to a component in options: its props go with the node, not with a root. */
55
+ export function isOptionsComponent(id: string): boolean {
56
+ return optionComponentIds.has(id);
57
+ }
58
+
59
+ /**
60
+ * The view is gone: its props, and whether it is a button's root, are not needed again; nor are those of the
61
+ * components the library named in its options.
62
+ */
42
63
  export function forgetProps(id: string): void {
43
64
  byId.delete(id);
44
65
  buttonRoots.delete(id);
66
+ const ids = optionComponents.get(id);
67
+ if (!ids) return;
68
+ optionComponents.delete(id);
69
+ for (const component of ids) {
70
+ byId.delete(component);
71
+ buttonRoots.delete(component);
72
+ optionComponentIds.delete(component);
73
+ }
45
74
  }
@@ -60,7 +60,10 @@ export function rootGoesOut(nodes: LayoutNode[], again: SentRoot | undefined): v
60
60
  pairNodes(before.nodes, nodes, (old, node) => {
61
61
  const options = remembered.get(old.id);
62
62
  if (!options) return;
63
- node.data.options = mergeNativeOptions(node.data.options ?? {}, toNativeOptions(options));
63
+ node.data.options = mergeNativeOptions(
64
+ node.data.options ?? {},
65
+ toNativeOptions(options, node.id)
66
+ );
64
67
  moved.set(node.id, options);
65
68
  });
66
69
  }
@@ -2,7 +2,7 @@ import React, { type ComponentType, useCallback, useEffect, useSyncExternalStore
2
2
  import { AppRegistry } from 'react-native';
3
3
  import type { Options } from '../interfaces/Options';
4
4
  import { forgetPlace } from './places';
5
- import { forgetProps, propsOf, watchProps } from './props';
5
+ import { forgetProps, isOptionsComponent, propsOf, watchProps } from './props';
6
6
  import { forgetMergedOptions } from './rememberedOptions';
7
7
  import { hasSlot } from './slots';
8
8
  import type { NativeControllerProps } from './nativeScreens';
@@ -55,11 +55,12 @@ export type ScreenRootProps = { componentId: string } & Record<string, unknown>;
55
55
  const screens = new Map<string, EngineScreen>();
56
56
  const roots = new Map<string, ComponentType<{ componentId: string; rootTag?: number }>>();
57
57
  let unmounted: ((screenId: string) => void) | undefined;
58
- // The React root that shows each screen, by its root tag. After a JavaScript reload React Native starts the roots of
59
- // the old screens again in the new runtime, under the ids the new screens get too, and unmounts them once the new ones
60
- // show; their root tags are older, as the native side counts them up for as long as the app runs. A slot of the app's
61
- // one tree has no tag: while the one tree shows a screen with the id, no root of that id lets it go.
62
- const owners = new Map<string, number>();
58
+ // The React roots mounted under each id, by their root tags. One id can have several: after a JavaScript reload React
59
+ // Native starts the roots of the old screens again in the new runtime, under the ids the new screens get too, and
60
+ // unmounts them once the new ones show; a component of the default or a stack's options has one id and a root in the
61
+ // bar of every screen that shows it. The id lets its props go only with the last of them. A slot of the app's one tree
62
+ // has no tag: while the one tree shows a screen with the id, no root of that id lets it go.
63
+ const owners = new Map<string, Set<number>>();
63
64
 
64
65
  /** What runs when the root of a screen unmounts: the screen is gone. */
65
66
  export function onScreenUnmounted(listener: (screenId: string) => void): void {
@@ -214,17 +215,26 @@ export function screenRoot(
214
215
  );
215
216
  const props = useSyncExternalStore(watch, () => propsOf(componentId));
216
217
  useEffect(() => {
217
- if (rootTag !== undefined && rootTag > (owners.get(componentId) ?? -1)) {
218
- owners.set(componentId, rootTag);
218
+ if (rootTag !== undefined) {
219
+ const tags = owners.get(componentId) ?? new Set<number>();
220
+ tags.add(rootTag);
221
+ owners.set(componentId, tags);
219
222
  }
220
223
  return () => {
221
- // An old root of the same id leaves the screen alone, and so does any root while the one tree still has a slot
222
- // with the id: a later screen under the id, the restarted root of a screen after a reload into the one tree
223
- // (its slot may mount only once the app's provider lets it), the screen rendering again under the provider.
224
- if (rootTag !== undefined && owners.get(componentId) !== rootTag) return;
224
+ // A root while another root of the id is mounted leaves the screen alone, and so does any root while the one
225
+ // tree still has a slot with the id: a later screen under the id, the restarted root of a screen after a
226
+ // reload into the one tree (its slot may mount only once the app's provider lets it), the screen rendering
227
+ // again under the provider.
228
+ const tags = owners.get(componentId);
229
+ if (rootTag !== undefined && tags) {
230
+ tags.delete(rootTag);
231
+ if (tags.size > 0) return;
232
+ }
225
233
  if (hasSlot(componentId)) return;
226
234
  owners.delete(componentId);
227
- forgetProps(componentId);
235
+ // A component the library named in options keeps its props for the next root under its id (the node shows
236
+ // it again, or another screen shows the same default): they go with the node.
237
+ if (!isOptionsComponent(componentId)) forgetProps(componentId);
228
238
  forgetPlace(componentId);
229
239
  forgetMergedOptions(componentId);
230
240
  unmounted?.(componentId);
@@ -10,7 +10,7 @@ export type ComponentType =
10
10
 
11
11
  /** The fields every appearance event has. */
12
12
  interface ComponentAppearanceEvent {
13
- /** The id of the component: the screen, or the screen the bar component belongs to. */
13
+ /** The id of the component: of the screen, or the bar component's own id. */
14
14
  componentId: string;
15
15
  /** The name of the component: for a screen, its name without any internal prefix. */
16
16
  componentName: string;
@@ -60,7 +60,7 @@ export interface NavigationButtonPressedEvent {
60
60
  * `ApexNavigation.back`; the hardware back of a modal has `ApexNavigation.hardwareBackButton`.
61
61
  */
62
62
  buttonId: string;
63
- /** (iOS) For a button with `toggle`: its new state, already written into the options of the screen. */
63
+ /** (iOS) For a button with `toggle`: its new state, which the screen keeps. */
64
64
  selected?: boolean;
65
65
  }
66
66
 
@@ -54,8 +54,12 @@ export interface NavigationStateChangedEvent {
54
54
 
55
55
  /**
56
56
  * A tab was selected by the user: a press on the tab, a pick from the "More" list or a press on "More" that showed a
57
- * tab (iOS). It is sent after the selection, and only when the tab changed; a press on the current tab is reported by
58
- * `BottomTabPressedEvent` alone. Selecting a tab from code sends nothing.
57
+ * tab (iOS). It goes right after the `ComponentDidAppear` of the new tab's screen, before the navigation state and
58
+ * before the tab that was left goes back to its first screen (`popToRootOnBlur`), and only when the tab changed: a
59
+ * press on the selected tab or on a `selectTabOnPress: false` tab is reported by `BottomTabPressedEvent` alone.
60
+ * Selecting a tab from code sends nothing. A switch still running when another press, long press or choice from code
61
+ * comes ends first, with this event, so the events of one press never mix with the next; when that tab's screen
62
+ * hasn't drawn yet, this event goes before its held `ComponentDidAppear`.
59
63
  */
60
64
  export interface BottomTabSelectedEvent {
61
65
  /** The index of the tab that is now selected. */
@@ -67,24 +71,28 @@ export interface BottomTabSelectedEvent {
67
71
  }
68
72
 
69
73
  /**
70
- * A tab was pressed, the selected one too. It is sent before the tab is selected; with `selectTabOnPress: false` it is
71
- * the only thing that happens. A long press sends `BottomTabLongPressedEvent` instead.
74
+ * A tab was pressed, on the bar or on a cell of `bottomTabs.customRow`, the selected one too. It goes first, before
75
+ * anything the press does. Another tab: then the switch's `ComponentWillAppear`, `ComponentDidDisappear` and
76
+ * `ComponentDidAppear`, then `BottomTabSelectedEvent`. The selected tab again (`wasSelected: true`): its stack goes
77
+ * back to its first screen with the events of the user's back (`ScreenPopped`), or, on the first screen, its content
78
+ * scrolls to the top; with `popToRootOnPress: false` nothing follows. With `selectTabOnPress: false` it is the only
79
+ * event and the selection stays. A long press sends `BottomTabLongPressedEvent` instead.
72
80
  */
73
81
  export interface BottomTabPressedEvent {
74
82
  /** The index of the tab that was pressed. */
75
83
  tabIndex: number;
76
84
  /** The id of the tabs. */
77
85
  bottomTabsId: string;
78
- /** The id of the screen the tab shows: the top of its stack. */
86
+ /** The id of the screen the tab shows: the top of its stack, or the tab itself when it is a screen. */
79
87
  screenId?: string;
80
88
  /** Whether the tab was the selected one already; a press on the selected tab scrolls its content to the top. */
81
89
  wasSelected: boolean;
82
90
  }
83
91
 
84
92
  /**
85
- * A tab was pressed and held. The tab is not selected and gets no press event. On iOS it is not sent for the tabs
86
- * that are components (`bottomTab.component`, `bottomTabs.customRow`), for "More", or for the tab strip at the top of an
87
- * iPad. On Android it replaces the tooltip of the tab.
93
+ * A tab was pressed and held, on the bar or on a cell of `bottomTabs.customRow`. The tab is not selected and gets no
94
+ * press event. On iOS it is not sent for "More" or for the tab strip at the top of an iPad. On Android it replaces the
95
+ * tooltip of the tab.
88
96
  */
89
97
  export interface BottomTabLongPressedEvent {
90
98
  /** The index of the tab that was pressed. */
@@ -195,11 +203,12 @@ export type HingeState = 'closed' | 'partiallyOpen' | 'fullyOpen' | 'unknown';
195
203
  */
196
204
  export interface HingeChangedEvent {
197
205
  /**
198
- * The state of the hinge. On Android `closed` means the device has no fold, or its angle is below 90 degrees.
206
+ * The state of the hinge. On Android `closed` means the app's window has no fold, or the angle is below 90 degrees,
207
+ * so a device open flat with a window off the fold (split screen) reports `closed`; Android never gives `unknown`.
199
208
  */
200
209
  state?: HingeState;
201
210
  /**
202
- * The angle of the hinge in degrees (on iOS to tenths). Missing when the state is `unknown` and where the system
211
+ * The angle of the hinge in degrees, to tenths. Missing when the state is `unknown` and where the system
203
212
  * gives no angle.
204
213
  */
205
214
  angle?: number;
@@ -0,0 +1,101 @@
1
+ {
2
+ "description": "Every command with a promise (an async method of src/adapters/NativeANNTurboModule.ts): what it resolves with, whether the navigation state goes before its answer (`state`), and whether `ANN.CommandCompleted` follows the answer (`completed`). scripts/contract.mjs makes ios/Contract/ANNCommandContract.{h,mm} and android/.../react/CommandContract.kt from it, and fails when a command of the spec is missing here or a command here is not in the spec.",
3
+ "commands": [
4
+ {
5
+ "name": "setRoot",
6
+ "resolves": "the id of the root, once the root and the layout's modals and overlays show",
7
+ "state": true,
8
+ "completed": true
9
+ },
10
+ {
11
+ "name": "push",
12
+ "resolves": "the id of the screen that shows; of a pair, the pair's id",
13
+ "state": true,
14
+ "completed": true
15
+ },
16
+ {
17
+ "name": "preparePush",
18
+ "resolves": "the frame `{ width, height, padding }` of the prepared screen, or null; always null on iOS",
19
+ "state": false,
20
+ "completed": false
21
+ },
22
+ {
23
+ "name": "pop",
24
+ "resolves": "the id of the screen that went",
25
+ "state": true,
26
+ "completed": true
27
+ },
28
+ {
29
+ "name": "popTo",
30
+ "resolves": "the id of the screen it went back to",
31
+ "state": true,
32
+ "completed": true
33
+ },
34
+ {
35
+ "name": "popToRoot",
36
+ "resolves": "the id of the first screen of the stack",
37
+ "state": true,
38
+ "completed": true
39
+ },
40
+ {
41
+ "name": "setStackRoot",
42
+ "resolves": "the id of the new top screen",
43
+ "state": true,
44
+ "completed": true
45
+ },
46
+ {
47
+ "name": "showModal",
48
+ "resolves": "the id of the modal's root",
49
+ "state": true,
50
+ "completed": true
51
+ },
52
+ {
53
+ "name": "dismissModal",
54
+ "resolves": "the id of the modal's root",
55
+ "state": true,
56
+ "completed": true
57
+ },
58
+ {
59
+ "name": "dismissAllModals",
60
+ "resolves": "an empty string",
61
+ "state": true,
62
+ "completed": true
63
+ },
64
+ {
65
+ "name": "showOverlay",
66
+ "resolves": "the id of the overlay's root",
67
+ "state": true,
68
+ "completed": true
69
+ },
70
+ {
71
+ "name": "dismissOverlay",
72
+ "resolves": "the id of the overlay's root",
73
+ "state": true,
74
+ "completed": true
75
+ },
76
+ {
77
+ "name": "dismissAllOverlays",
78
+ "resolves": "an empty string",
79
+ "state": true,
80
+ "completed": true
81
+ },
82
+ {
83
+ "name": "showInColumn",
84
+ "resolves": "the id of the screen that shows",
85
+ "state": true,
86
+ "completed": true
87
+ },
88
+ {
89
+ "name": "setColumnShown",
90
+ "resolves": "nothing once the columns stopped moving (`undefined` on iOS, `null` on Android)",
91
+ "state": true,
92
+ "completed": false
93
+ },
94
+ {
95
+ "name": "getLaunchLink",
96
+ "resolves": "the link that launched the app, or null",
97
+ "state": false,
98
+ "completed": false
99
+ }
100
+ ]
101
+ }
@@ -354,22 +354,28 @@ export interface StackAnimationOptions {
354
354
  enabled?: boolean;
355
355
  /**
356
356
  * Whether to wait for the new top screen to be drawn before the transition. Without it, the transition waits for the
357
- * content of a screen with an animation of its own for half a second at most, `true` waits as long as it takes,
358
- * `false` starts at once, also with an animation of its own.
357
+ * first mount of the new top's content, half a second at most, with the platform's transition as with an animation
358
+ * of its own; on a push the options the screen sets as it renders for the first time (`useScreenOptions`, such as
359
+ * its title) are in its bar from the first frame. `true` waits as long as it takes, `false` starts at once, the
360
+ * content drawing as it comes ((Android) a push with `appProvider` still renders the screen first). (iOS) The
361
+ * components of the bar are waited for too, each to its own limit.
359
362
  */
360
363
  waitForRender?: boolean;
361
364
  /**
362
365
  * The animation of the screens: `enter` for the screen that comes (on a pop, the one that was below), `exit` for the
363
366
  * one that goes. A property with a `from` or a `to` makes it an animation of its own, which replaces the platform's
364
- * transition; the side left out stays still. (Android) With one of its own, the title and buttons of the bar and the
365
- * tab bar don't travel with the screens. (Android) When the transition has elements, a push plays only `enter` and a
367
+ * transition; the side left out stays still. With one of its own, (Android) the top bar goes with its screen: the
368
+ * bar of the screen that goes leaves with it, and the bar of the screen that comes moves, scales and fades with it;
369
+ * (iOS) UIKit keeps the bar in place and changes its title and buttons at once. (Android) The tab bar doesn't travel
370
+ * with the screens. (Android) When the transition has elements, a push plays only `enter` and a
366
371
  * pop only `exit`, and only when that side is a single `alpha`; any other side is not played, and the screen fades in
367
372
  * or out in 300 ms around the elements instead. iOS plays the sides as they are set.
368
373
  */
369
374
  content?: EnterExitAnimationOptions;
370
375
  /**
371
376
  * (Android) The animation of the top bar when it shows or hides because the screens differ in `topBar.visible`.
372
- * Without it, the bar slides up by its height and back in 300 ms. iOS animates the bar with UIKit.
377
+ * Without it, the bar slides up by its height and back in 300 ms; with a `content` of its own it shows or hides
378
+ * with its screen. iOS animates the bar with UIKit.
373
379
  */
374
380
  topBar?: EnterExitAnimationOptions<TopBarAnimationOptions>;
375
381
  /**
@@ -420,8 +426,10 @@ export interface SetStackRootAnimationOptions extends StackAnimationOptions {
420
426
  * screen under it. The screen under a modal takes part (iOS) only under a modal that covers the full screen.
421
427
  *
422
428
  * A sheet keeps the system's sheet motion on both platforms: (iOS) a modal shown as `'pageSheet'`, `'formSheet'` or
423
- * without a style, (Android) a Material bottom sheet. The sides `enter` and `exit` and the lists of elements set here
424
- * don't apply to it.
429
+ * without a style, (Android) the Material bottom sheet of `'pageSheet'`, `'formSheet'`, `'popover'`, or of
430
+ * `modal.sheet` without a style. The sides `enter` and `exit` and the lists of elements set here don't apply to it.
431
+ * Without them a modal over the whole screen comes up from the bottom: on iOS by UIKit's `modalTransitionStyle`, on
432
+ * Android with the system's motion of a window over another, 300 ms up and 250 ms down, without a fade.
425
433
  *
426
434
  * (Android) When the modal has elements, `enter` of a show and `exit` of a dismiss play only when that side is a single
427
435
  * `alpha`; any other side is not played, and the modal fades in or out in 300 ms around the elements instead.
@@ -138,8 +138,10 @@ export type OptionsTopBarButtonMenuElement =
138
138
  /**
139
139
  * A menu of the top bar: the menu of a button, the overflow menu, the menu of the title. A list of `items` sent with
140
140
  * `mergeOptions` replaces the earlier list as a whole, and `items: []` removes the menu; `title` and
141
- * `singleSelection` merge field by field (iOS). What the user picks in a `singleSelection` menu is written back into
142
- * the options of the screen and survives the screen showing again.
141
+ * `singleSelection` merge field by field (iOS). What the user picks in a `singleSelection` menu stays with the screen,
142
+ * through it showing again, a `mergeOptions` that sends the same items again and `setDefaultOptions`; a `mergeOptions`
143
+ * into the screen that changes the checks of that menu's level, or takes the item away, replaces it. A merge into the
144
+ * stack or the tabs around the screen doesn't.
143
145
  */
144
146
  export interface OptionsTopBarButtonMenu {
145
147
  /** The title above the items. (iOS) Android doesn't show it. */
@@ -285,8 +287,10 @@ export interface OptionsTopBarButton {
285
287
  badgeTextColor?: Color;
286
288
  /**
287
289
  * (iOS) Whether the button is a toggle: every press flips `selected` and sends a press with the new state. The state
288
- * is written into the options of the screen under the button's id, so it survives the screen showing again, and a
289
- * button set again without `selected` takes the state of the button with the same id. Not for component buttons,
290
+ * stays with the screen under the button's id, through it showing again, a `mergeOptions` that sends the same
291
+ * buttons again and `setDefaultOptions`; a `mergeOptions` into the screen that changes `selected` replaces it (a merge
292
+ * into the stack around it doesn't). A button set again
293
+ * without `selected` takes the state of the button with the same id. Not for component buttons,
290
294
  * buttons with `iconBackground`, and `showText` buttons.
291
295
  */
292
296
  toggle?: boolean;
@@ -351,7 +355,11 @@ export interface OptionsTopBarButton {
351
355
  * replaces it.
352
356
  */
353
357
  export interface OptionsTopBarButtonComponent {
354
- /** The id of the component. Without it, the library gives one. The same `name` and `id` mean the same component. */
358
+ /**
359
+ * The id of the component. Without it, the library gives one made of the screen, the component's place in the
360
+ * options and its `name`: it stays the same for every `mergeOptions` of the screen, so the mounted component stays
361
+ * and only its props change. The same `name` and `id` mean the same component.
362
+ */
355
363
  id?: string;
356
364
  /** The name of the registered component. */
357
365
  name: string;
@@ -3,21 +3,25 @@
3
3
  * `'overCurrentContext'`, `'currentContext'` or `'popover'`. It is read once, when the modal shows, from the modal's
4
4
  * final options; `mergeOptions` afterwards doesn't change it, and neither does a change of theme or a rotation. Without
5
5
  * it the platform decides: on iOS the automatic style of UIKit (a sheet on iPhone, a card on iPad), on Android the
6
- * whole screen. An unknown string shows a full-screen modal on iOS and counts as not set on Android.
6
+ * whole screen, or the Material bottom sheet when `modal.sheet` is set. An unknown string shows a full-screen modal on
7
+ * iOS and counts as not set on Android.
7
8
  *
8
- * - `'pageSheet'`: (iOS) a sheet that leaves the screen below visible and pushed back; on iPad a wide card. Android
9
- * shows the whole screen, or the Material bottom sheet when `modal.sheet` is set.
10
- * - `'formSheet'`: (iOS) a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. Android
11
- * shows the whole screen, or the bottom sheet when `modal.sheet` is set.
12
- * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off. Both platforms treat the two
13
- * alike.
14
- * - `'overFullScreen'`, `'overCurrentContext'`: the whole screen with the screen below kept in place. It shows
15
- * through only where the modal screen is transparent (`layout.backgroundColor` and `layout.componentBackgroundColor`
16
- * both `'transparent'`); the style does not make anything transparent by itself.
9
+ * - `'pageSheet'`: a sheet that leaves the screen below visible. On iOS the screen below is pushed back, and on iPad
10
+ * the sheet is a wide card. On Android it is the Material modal bottom sheet over a dimmed screen, at the full height
11
+ * under the status bar (`modal.sheet` changes its stops), at most 640 dp wide and in the middle of a wider window.
12
+ * - `'formSheet'`: on iOS a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. On Android
13
+ * the same bottom sheet as `'pageSheet'`; `modal.contentSize` does nothing there.
14
+ * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off once the modal has come in.
15
+ * Both platforms treat the two alike. The modal comes up from the bottom: on Android with the system's motion of a
16
+ * window over another (300 ms up, 250 ms down), without a fade.
17
+ * - `'overFullScreen'`, `'overCurrentContext'`: the same, with the screen below kept in place under the modal. It
18
+ * shows through only where the modal screen is transparent (`layout.backgroundColor` and
19
+ * `layout.componentBackgroundColor` both `'transparent'`); the style does not make anything transparent by itself.
17
20
  * - `'popover'`: (iOS) a popover with an arrow on iPad, a sheet on iPhone unless `modal.popover.adaptive` is `false`.
18
- * Android has no popovers and shows the whole screen.
21
+ * Android has no popovers and shows the bottom sheet of `'pageSheet'`.
19
22
  *
20
- * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style.
23
+ * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style, and on
24
+ * Android with `'popover'` too.
21
25
  */
22
26
  export type OptionsModalPresentationStyle =
23
27
  | 'pageSheet'
@@ -55,7 +59,8 @@ export type OptionsModalSheetDetent = 'medium' | 'large' | 'content' | number;
55
59
  /**
56
60
  * The settings of a sheet: a modal that comes from below and rests on one of several heights, its stops (detents). On
57
61
  * iOS they configure the system sheet of a modal presented as `'pageSheet'`, `'formSheet'` or without a style. On
58
- * Android any one of them turns the modal into a Material bottom sheet, again for those styles only. They are read when
62
+ * Android they configure the Material bottom sheet of `'pageSheet'`, `'formSheet'` and `'popover'`, and without a style
63
+ * any one of them turns the modal into that sheet. They are read when
59
64
  * the modal shows, and a `mergeOptions` on any screen of the modal changes them while it is shown, with an animation.
60
65
  * Objects merge key by key; `detents` is replaced as a whole.
61
66
  */
@@ -46,8 +46,9 @@ export interface OptionsLayout {
46
46
  * The color of the screen, also under its React content. On iOS it is the background of the screen's view (the
47
47
  * system background without it); stacks, tabs and side menus paint their view with the color of the screen that
48
48
  * shows, seen behind transparent bars and around screens during transitions. On Android it fills the screen and
49
- * its containers but leaves room at the top for the status bar while it shows. `null` makes the background
50
- * transparent. Without it, Android shows the window's background (the app theme).
49
+ * its containers but leaves room at the top for the status bar while it shows; without it a React screen takes
50
+ * `android:colorBackground` of the app's theme (in a sheet it shows the sheet's surface, and a native screen paints
51
+ * its own view), so the screen below never shows through. `null` makes the background transparent.
51
52
  */
52
53
  backgroundColor?: Color;
53
54
  /**
@@ -152,7 +153,9 @@ export interface OptionsStatusBar {
152
153
  * and buttons sits below the bar), and a screen without a top bar starts below the bar. `true` lets a screen without
153
154
  * a top bar start at the top of the window, with its safe area keeping content below. `false` starts the top bar
154
155
  * below the status bar, which keeps its own color. A sheet modal has no status bar above it, so this does not apply
155
- * there. On iOS the screen is always under the status bar and the safe area keeps the content below.
156
+ * there. An overlay covers the whole window, so its screens go under the status bar without it (a dimmed backdrop
157
+ * dims the status bar too), and `false`, in its options or in the default options, starts them below. On iOS the
158
+ * screen is always under the status bar and the safe area keeps the content below.
156
159
  */
157
160
  drawBehind?: boolean;
158
161
  /**
@@ -11,7 +11,11 @@ import type { Color, FontFamily, FontStyle, FontWeight, ImageResource } from './
11
11
  * `name` replaces it.
12
12
  */
13
13
  export interface OptionsTopBarTitleComponent {
14
- /** The id of the component. Without it, the library gives one. The same `name` and `id` mean the same component. */
14
+ /**
15
+ * The id of the component. Without it, the library gives one made of the screen, the component's place in the
16
+ * options and its `name`: it stays the same for every `mergeOptions` of the screen, so the mounted component stays
17
+ * and only its props change. The same `name` and `id` mean the same component.
18
+ */
15
19
  id?: string;
16
20
  /** The name of the registered component. */
17
21
  name: string;
@@ -276,7 +280,11 @@ export interface OptionsTopBarBackground {
276
280
 
277
281
  /** The React component that is the background of the bar. */
278
282
  export interface OptionsTopBarBackgroundComponent {
279
- /** The id of the component. Without it, the library gives one. The same `name` and `id` mean the same component. */
283
+ /**
284
+ * The id of the component. Without it, the library gives one made of the screen, the component's place in the
285
+ * options and its `name`: it stays the same for every `mergeOptions` of the screen, so the mounted component stays
286
+ * and only its props change. The same `name` and `id` mean the same component.
287
+ */
280
288
  id?: string;
281
289
  /** The name of the registered component. */
282
290
  name: string;
@@ -432,7 +440,11 @@ export interface OptionsSearchBarSuggestion {
432
440
  * component; a different `id` or `name` replaces the component, and so the search.
433
441
  */
434
442
  export interface OptionsSearchBarResultsComponent {
435
- /** The id of the component. Without it, the library gives one. The same `name` and `id` mean the same component. */
443
+ /**
444
+ * The id of the component. Without it, the library gives one made of the screen, the component's place in the
445
+ * options and its `name`: it stays the same for every `mergeOptions` of the screen, so the mounted component stays
446
+ * and only its props change. The same `name` and `id` mean the same component.
447
+ */
436
448
  id?: string;
437
449
  /** The name of the registered component. */
438
450
  name: string;
@@ -518,8 +530,9 @@ export interface OptionsSearchBar {
518
530
  */
519
531
  scopes?: OptionsSearchBarScope[];
520
532
  /**
521
- * The id of the selected scope; without it, or with an unknown id, the first. The user's pick is written into the
522
- * options of the screen and stays after coming back. `mergeOptions` switches the scope without an event.
533
+ * The id of the selected scope; without it, or with an unknown id, the first. The user's pick stays with the screen,
534
+ * after coming back, through a `mergeOptions` that sends the same value again and `setDefaultOptions`. A
535
+ * `mergeOptions` into the screen with another value switches the scope without an event.
523
536
  */
524
537
  selectedScope?: string;
525
538
  /**
@@ -531,15 +544,15 @@ export interface OptionsSearchBar {
531
544
  scopeBarActivation?: 'automatic' | 'onTextEntry' | 'onSearchActivation';
532
545
  /**
533
546
  * (iOS) Tokens in front of the text of the field. The search events carry the ids of the tokens in the field as
534
- * `tokens`; deleting a token sends a search-updated event, and the deleted tokens (and ones brought back with Undo)
535
- * are written to the options of the screen. Closing the search clears the field and its tokens. An empty list removes
547
+ * `tokens`; deleting a token sends a search-updated event, and what the user deleted (or brought back with Undo)
548
+ * stays with the screen until a `mergeOptions` gives other tokens. Closing the search clears the field and its tokens. An empty list removes
536
549
  * them all.
537
550
  */
538
551
  tokens?: OptionsSearchBarToken[];
539
552
  /**
540
553
  * (iOS 16+, Android) The suggestions shown while searching. Picking one sends a suggestion-picked event with its id
541
- * to the screen; the text stays and the list goes. They also go when the user types on, and new ones come with
542
- * `mergeOptions`, usually on a search-updated event. An empty list removes them.
554
+ * to the screen; the text stays and the list goes. They also go when the user types on; the list a `mergeOptions`
555
+ * gives shows again, the same one too, usually on a search-updated event. An empty list removes them.
543
556
  */
544
557
  suggestions?: OptionsSearchBarSuggestion[];
545
558
  /**