@apexnative/navigation 1.0.0-alpha.3 → 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.
- package/CHANGELOG.md +9 -0
- package/android/CLAUDE.md +17 -7
- package/android/CORE.md +8 -3
- package/android/RECIPES.md +9 -3
- package/android/src/main/java/dev/apexnative/navigation/NavigationApplication.kt +34 -13
- package/android/src/main/java/dev/apexnative/navigation/layout/LayoutChecks.kt +5 -1
- package/android/src/main/java/dev/apexnative/navigation/layout/LayoutNode.kt +6 -2
- package/android/src/main/java/dev/apexnative/navigation/nativescreen/NativeScreenContext.kt +2 -2
- package/android/src/main/java/dev/apexnative/navigation/options/ButtonMenuOptions.kt +2 -2
- package/android/src/main/java/dev/apexnative/navigation/options/ButtonOptions.kt +2 -2
- package/android/src/main/java/dev/apexnative/navigation/options/OptionsCache.kt +8 -4
- package/android/src/main/java/dev/apexnative/navigation/options/UserChoices.kt +159 -0
- package/android/src/main/java/dev/apexnative/navigation/react/CommandAnswer.kt +2 -24
- package/android/src/main/java/dev/apexnative/navigation/react/CommandContract.kt +59 -0
- package/android/src/main/java/dev/apexnative/navigation/react/Hinge.kt +27 -19
- package/android/src/main/java/dev/apexnative/navigation/react/NavigationTurboModule.kt +5 -4
- package/android/src/main/java/dev/apexnative/navigation/react/PendingCalls.kt +48 -0
- package/android/src/main/java/dev/apexnative/navigation/react/events/AppearanceDispatcher.kt +17 -7
- package/android/src/main/java/dev/apexnative/navigation/slots/SlotContainers.kt +10 -7
- package/android/src/main/java/dev/apexnative/navigation/slots/SlotView.kt +4 -3
- package/android/src/main/java/dev/apexnative/navigation/slots/SlotViews.kt +40 -0
- package/android/src/main/java/dev/apexnative/navigation/utils/ImageKey.kt +66 -0
- package/android/src/main/java/dev/apexnative/navigation/utils/ImageLoader.kt +7 -89
- package/android/src/main/java/dev/apexnative/navigation/utils/ImageRequests.kt +76 -0
- package/android/src/main/java/dev/apexnative/navigation/utils/OptionImages.kt +262 -0
- package/android/src/main/java/dev/apexnative/navigation/utils/ViewController.kt +3 -1
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/AppliedTabCalls.kt +49 -0
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/BottomTabsController.kt +16 -6
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +25 -24
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ContentReadiness.kt +1 -1
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/RenderWait.kt +27 -7
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalCoordinator.kt +5 -5
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/Navigator.kt +4 -3
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/RootCoordinator.kt +6 -3
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/overlay/OverlayCoordinator.kt +8 -8
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/Capabilities.kt +11 -4
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/sidemenu/SideMenuController.kt +1 -1
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/splitview/SplitPanes.kt +23 -0
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/splitview/SplitViewController.kt +58 -15
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackCommands.kt +28 -18
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackController.kt +16 -7
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackDisplay.kt +2 -1
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackQueue.kt +85 -29
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackViews.kt +2 -2
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/fab/FabPresenter.kt +7 -5
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/search/StackSearchPresenter.kt +3 -3
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/MenuChecks.kt +13 -56
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/TopBarPresenter.kt +10 -2
- package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/viewcontroller/ViewController.kt +56 -21
- package/android/src/main/java/dev/apexnative/navigation/views/bottomtabs/BottomTabs.kt +4 -2
- package/android/src/main/java/dev/apexnative/navigation/views/stack/fab/Fab.kt +14 -10
- package/cli/doctor/checks/app.js +61 -13
- package/cli/migrate/native.js +18 -0
- package/cli/setup/source.js +2 -1
- package/cli/setup/steps/mainApplication.js +134 -19
- package/docs-md/architecture/transitions.md +6 -7
- package/docs-md/help/glossary.md +1 -1
- package/docs-md/help/troubleshooting.md +20 -3
- package/docs-md/index.json +4 -0
- package/docs-md/migration/from-react-native-navigation.md +8 -2
- package/docs-md/screen-ui/back-and-gestures.md +2 -2
- package/docs-md/start/installation.md +3 -1
- package/ios/CLAUDE.md +17 -5
- package/ios/CORE.md +13 -8
- package/ios/Contract/ANNCommandAnswer.mm +5 -20
- package/ios/Contract/ANNCommandContract.h +15 -0
- package/ios/Contract/ANNCommandContract.mm +78 -0
- package/ios/Core/ANNAppearanceDispatcher.mm +1 -1
- package/ios/Core/ANNErrorHandler.h +1 -1
- package/ios/Core/ANNErrorHandler.mm +3 -1
- package/ios/Core/ANNEventEmitter.h +1 -1
- package/ios/Core/ANNEventEmitter.mm +2 -2
- package/ios/Core/ANNJavaScriptCalls.h +34 -0
- package/ios/Core/ANNJavaScriptCalls.mm +61 -0
- package/ios/Core/ANNNavigationState.h +7 -3
- package/ios/Core/ANNNavigationState.mm +10 -5
- package/ios/Core/ANNNodeHelper.h +32 -12
- package/ios/Core/ANNNodeHelper.mm +100 -3
- package/ios/Core/ANNRenderWait.h +15 -1
- package/ios/Core/ANNRenderWait.mm +119 -17
- package/ios/Core/UIViewController+LayoutProtocol.h +9 -2
- package/ios/Core/UIViewController+LayoutProtocol.mm +8 -0
- package/ios/Layouts/Modal/ANNModalCoordinator.h +1 -1
- package/ios/Layouts/Modal/ANNModalCoordinator.mm +55 -14
- package/ios/Layouts/Screen/ANNComponentViewController.h +8 -0
- package/ios/Layouts/Screen/ANNComponentViewController.mm +32 -5
- package/ios/Layouts/Screen/ANNScreenPlace.h +41 -0
- package/ios/Layouts/Screen/ANNScreenPlace.mm +175 -0
- package/ios/Layouts/SplitView/ANNSplitViewCommands.h +3 -2
- package/ios/Layouts/SplitView/ANNSplitViewCommands.mm +105 -39
- package/ios/Layouts/SplitView/ANNSplitViewController.mm +4 -2
- package/ios/Layouts/Stack/ANNStackCommands.mm +1 -0
- package/ios/Layouts/Stack/ANNStackController.mm +26 -3
- package/ios/Layouts/Stack/ANNStackQueue.h +3 -1
- package/ios/Layouts/Stack/ANNStackQueue.mm +56 -43
- package/ios/Layouts/Stack/UINavigationController+ANNCommands.h +4 -2
- package/ios/Layouts/Stack/UINavigationController+ANNCommands.mm +2 -3
- package/ios/Layouts/Tabs/ANNBottomTabItemBuilder.h +4 -0
- package/ios/Layouts/Tabs/ANNBottomTabItemBuilder.mm +11 -0
- package/ios/Layouts/Tabs/ANNBottomTabsController.mm +13 -5
- package/ios/Layouts/Tabs/ANNBottomTabsPresenter.h +2 -2
- package/ios/Layouts/Tabs/ANNBottomTabsPresenter.mm +109 -7
- package/ios/Options/ANNOptionsCache.h +7 -6
- package/ios/Options/ANNSearchBarOptions.h +4 -3
- package/ios/Options/ANNUserChoice.h +57 -0
- package/ios/Options/ANNUserChoice.mm +44 -0
- package/ios/Options/Params/ANNImageSource.h +61 -0
- package/ios/Options/Params/ANNImageSource.mm +101 -0
- package/ios/Options/Params/ANNOptionImages.h +37 -0
- package/ios/Options/Params/ANNOptionImages.mm +284 -0
- package/ios/Options/Params/Image.h +11 -2
- package/ios/Options/Params/Image.mm +15 -2
- package/ios/Options/Params/ImageParser.h +5 -5
- package/ios/Options/Params/ImageParser.mm +28 -46
- package/ios/Public/ApexNavigation/ApexNavigation.h +1 -1
- package/ios/RECIPES.md +11 -5
- package/ios/React/Slots/ANNSlotComponentView.mm +24 -17
- package/ios/React/Slots/ANNSlotContainers.h +14 -6
- package/ios/React/Slots/ANNSlotContainers.mm +75 -2
- package/ios/TopBar/ANNBarButtons.h +9 -5
- package/ios/TopBar/ANNBarButtons.mm +211 -63
- package/ios/TopBar/ANNIconButtonImage.h +1 -0
- package/ios/TopBar/ANNIconButtonImage.mm +34 -1
- package/ios/TopBar/ANNLargeTitlePresenter.h +13 -0
- package/ios/TopBar/ANNLargeTitlePresenter.mm +26 -3
- package/ios/TopBar/ANNSearchPresenter.mm +170 -19
- package/ios/TopBar/ANNTopBarPresenter.h +5 -0
- package/ios/TopBar/ANNTopBarPresenter.mm +60 -11
- package/ios/TurboModules/ANNTurboModule.mm +39 -21
- package/lib/module/ARCHITECTURE.md +18 -18
- package/lib/module/adapters/NativeANNTurboModule.js.map +1 -1
- package/lib/module/api/navigation.js.map +1 -1
- package/lib/module/engine/commands.js +9 -7
- package/lib/module/engine/commands.js.map +1 -1
- package/lib/module/engine/layout.js +13 -9
- package/lib/module/engine/layout.js.map +1 -1
- package/lib/module/engine/options.js +44 -11
- package/lib/module/engine/options.js.map +1 -1
- package/lib/module/engine/places.js +44 -7
- package/lib/module/engine/places.js.map +1 -1
- package/lib/module/engine/props.js +30 -1
- package/lib/module/engine/props.js.map +1 -1
- package/lib/module/engine/rememberedOptions.js +1 -1
- package/lib/module/engine/rememberedOptions.js.map +1 -1
- package/lib/module/engine/screens.js +22 -12
- package/lib/module/engine/screens.js.map +1 -1
- package/lib/module/interfaces/contract/commands.json +101 -0
- package/lib/typescript/adapters/NativeANNTurboModule.d.ts +5 -2
- package/lib/typescript/adapters/NativeANNTurboModule.d.ts.map +1 -1
- package/lib/typescript/api/events/navigationEvents.d.ts +1 -1
- package/lib/typescript/api/events/navigationEvents.d.ts.map +1 -1
- package/lib/typescript/api/hooks/useNavigation.d.ts +1 -1
- package/lib/typescript/api/hooks/useNavigation.d.ts.map +1 -1
- package/lib/typescript/api/navigation.d.ts +4 -1
- package/lib/typescript/api/navigation.d.ts.map +1 -1
- package/lib/typescript/engine/commands.d.ts.map +1 -1
- package/lib/typescript/engine/options.d.ts +5 -2
- package/lib/typescript/engine/options.d.ts.map +1 -1
- package/lib/typescript/engine/places.d.ts +5 -2
- package/lib/typescript/engine/places.d.ts.map +1 -1
- package/lib/typescript/engine/props.d.ts +8 -1
- package/lib/typescript/engine/props.d.ts.map +1 -1
- package/lib/typescript/engine/rememberedOptions.d.ts.map +1 -1
- package/lib/typescript/engine/screens.d.ts.map +1 -1
- package/lib/typescript/interfaces/ComponentEvents.d.ts +2 -2
- package/lib/typescript/interfaces/ComponentEvents.d.ts.map +1 -1
- package/lib/typescript/interfaces/Events.d.ts +19 -10
- package/lib/typescript/interfaces/Events.d.ts.map +1 -1
- package/lib/typescript/interfaces/options/animations.d.ts +5 -2
- package/lib/typescript/interfaces/options/animations.d.ts.map +1 -1
- package/lib/typescript/interfaces/options/buttons.d.ts +13 -5
- package/lib/typescript/interfaces/options/buttons.d.ts.map +1 -1
- package/lib/typescript/interfaces/options/topBar.d.ts +22 -9
- package/lib/typescript/interfaces/options/topBar.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ARCHITECTURE.md +18 -18
- package/src/adapters/NativeANNTurboModule.ts +5 -2
- package/src/api/events/navigationEvents.ts +1 -1
- package/src/api/hooks/useNavigation.ts +1 -1
- package/src/api/navigation.ts +4 -1
- package/src/engine/commands.ts +19 -7
- package/src/engine/layout.ts +16 -9
- package/src/engine/options.ts +39 -11
- package/src/engine/places.ts +56 -7
- package/src/engine/props.ts +30 -1
- package/src/engine/rememberedOptions.ts +4 -1
- package/src/engine/screens.tsx +23 -13
- package/src/interfaces/ComponentEvents.ts +2 -2
- package/src/interfaces/Events.ts +19 -10
- package/src/interfaces/contract/commands.json +101 -0
- package/src/interfaces/options/animations.ts +5 -2
- package/src/interfaces/options/buttons.ts +13 -5
- package/src/interfaces/options/topBar.ts +22 -9
|
@@ -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,8 +354,11 @@ 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
|
-
*
|
|
358
|
-
*
|
|
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
|
/**
|
|
@@ -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
|
|
142
|
-
*
|
|
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
|
-
*
|
|
289
|
-
*
|
|
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
|
-
/**
|
|
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;
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
522
|
-
*
|
|
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
|
|
535
|
-
*
|
|
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
|
|
542
|
-
*
|
|
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
|
/**
|