@ohos-ports/react-native-navigation 8.9.0-beta.1 → 8.9.0-beta.11
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/README.md +27 -27
- package/lib/cjs/Mock/Application.js +67 -0
- package/lib/cjs/Mock/ComponentProps.js +16 -0
- package/lib/cjs/Mock/Components/BottomTabs.js +50 -0
- package/lib/cjs/Mock/Components/ComponentScreen.js +135 -0
- package/lib/cjs/Mock/Components/LayoutComponent.js +85 -0
- package/lib/cjs/Mock/Components/Modals.js +56 -0
- package/lib/cjs/Mock/Components/NavigationButton.js +104 -0
- package/lib/cjs/Mock/Components/Overlays.js +57 -0
- package/lib/cjs/Mock/Components/SideMenu.js +69 -0
- package/lib/cjs/Mock/Components/Stack.js +52 -0
- package/lib/cjs/Mock/Components/TopBar.js +115 -0
- package/lib/cjs/Mock/Layouts/BottomTabsNode.js +60 -0
- package/lib/cjs/Mock/Layouts/ComponentNode.js +132 -0
- package/lib/cjs/Mock/Layouts/LayoutNodeFactory.js +59 -0
- package/lib/cjs/Mock/Layouts/Node.js +32 -0
- package/lib/cjs/Mock/Layouts/ParentNode.js +99 -0
- package/lib/cjs/Mock/Layouts/SideMenu.js +112 -0
- package/lib/cjs/Mock/Layouts/StackNode.js +42 -0
- package/lib/cjs/Mock/Stores/EventsStore.js +85 -0
- package/lib/{module → cjs}/Mock/Stores/LayoutStore.js +56 -24
- package/lib/cjs/Mock/actions/layoutActions.js +47 -0
- package/lib/cjs/Mock/connect.js +31 -0
- package/lib/cjs/Mock/constants.js +31 -0
- package/lib/cjs/Mock/index.js +48 -0
- package/lib/cjs/Mock/mocks/AppRegistryService.js +31 -0
- package/lib/cjs/Mock/mocks/NativeCommandsSender.js +181 -0
- package/lib/cjs/Mock/mocks/NativeEventsReceiver.js +146 -0
- package/lib/cjs/Navigation.js +259 -0
- package/lib/{module → cjs}/NavigationDelegate.js +33 -34
- package/lib/cjs/adapters/AndroidCustomRowForwarder.js +84 -0
- package/lib/cjs/adapters/AppRegistryService.js +33 -0
- package/lib/cjs/adapters/AssetResolver.js +33 -0
- package/lib/cjs/adapters/ColorService.js +33 -0
- package/lib/cjs/adapters/Constants.js +43 -0
- package/lib/{module → cjs}/adapters/NativeCommandsSender.js +39 -5
- package/lib/cjs/adapters/NativeEventsReceiver.js +99 -0
- package/lib/cjs/adapters/NativeEventsReceiver.mock.js +30 -0
- package/lib/cjs/adapters/NativeRNNTurboEventEmitter.js +27 -0
- package/lib/cjs/adapters/NativeRNNTurboModule.js +26 -0
- package/lib/cjs/adapters/TouchablePreview.js +137 -0
- package/lib/cjs/adapters/UniqueIdProvider.js +43 -0
- package/lib/cjs/commands/Commands.js +276 -0
- package/lib/cjs/commands/Deprecations.js +101 -0
- package/lib/cjs/commands/LayoutTreeCrawler.js +56 -0
- package/lib/cjs/commands/LayoutTreeParser.js +154 -0
- package/lib/cjs/commands/LayoutType.js +40 -0
- package/lib/cjs/commands/OptionsCrawler.js +106 -0
- package/lib/{module → cjs}/commands/OptionsProcessor.js +102 -67
- package/lib/{module → cjs}/components/ComponentRegistry.js +27 -3
- package/lib/cjs/components/ComponentWrapper.js +114 -0
- package/lib/cjs/components/Modal.js +159 -0
- package/lib/{module → cjs}/components/Store.js +27 -3
- package/lib/cjs/events/CommandsObserver.js +43 -0
- package/lib/cjs/events/ComponentEventsObserver.js +128 -0
- package/lib/{module → cjs}/events/EventsRegistry.js +27 -3
- package/lib/cjs/index.js +63 -0
- package/lib/cjs/interfaces/CommandName.js +46 -0
- package/lib/cjs/interfaces/ComponentEvents.js +1 -0
- package/lib/cjs/interfaces/EventSubscription.js +1 -0
- package/lib/cjs/interfaces/Events.js +1 -0
- package/lib/cjs/interfaces/Layout.js +16 -0
- package/lib/cjs/interfaces/NavigationComponent.js +62 -0
- package/lib/cjs/interfaces/NavigationComponentListener.js +16 -0
- package/lib/cjs/interfaces/NavigationComponentProps.js +1 -0
- package/lib/cjs/interfaces/NavigationFunctionComponent.js +16 -0
- package/lib/cjs/interfaces/Options.js +47 -0
- package/lib/cjs/interfaces/ProcessorSubscription.js +1 -0
- package/lib/cjs/interfaces/Processors.js +16 -0
- package/lib/cjs/linking/DeferredLinkQueue.js +66 -0
- package/lib/{module → cjs}/linking/LinkingHandler.js +40 -43
- package/lib/cjs/linking/ModalLayoutBuilder.js +59 -0
- package/lib/{module → cjs}/linking/RouteMatcher.js +31 -15
- package/lib/cjs/linking/URLParser.js +70 -0
- package/lib/cjs/linking/types.js +16 -0
- package/lib/cjs/processors/LayoutProcessor.js +39 -0
- package/lib/cjs/processors/LayoutProcessorsStore.js +42 -0
- package/lib/cjs/processors/OptionProcessorsStore.js +43 -0
- package/lib/cjs/types.js +1 -0
- package/package.json +10 -9
- package/postinstall.js +53 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +0 -212
- package/lib/module/ARCHITECTURE.md +0 -331
- package/lib/module/Mock/Application.js +0 -33
- package/lib/module/Mock/Application.js.map +0 -1
- package/lib/module/Mock/ComponentProps.js +0 -4
- package/lib/module/Mock/ComponentProps.js.map +0 -1
- package/lib/module/Mock/Components/BottomTabs.js +0 -16
- package/lib/module/Mock/Components/BottomTabs.js.map +0 -1
- package/lib/module/Mock/Components/ComponentScreen.js +0 -101
- package/lib/module/Mock/Components/ComponentScreen.js.map +0 -1
- package/lib/module/Mock/Components/LayoutComponent.js +0 -50
- package/lib/module/Mock/Components/LayoutComponent.js.map +0 -1
- package/lib/module/Mock/Components/Modals.js +0 -22
- package/lib/module/Mock/Components/Modals.js.map +0 -1
- package/lib/module/Mock/Components/NavigationButton.js +0 -72
- package/lib/module/Mock/Components/NavigationButton.js.map +0 -1
- package/lib/module/Mock/Components/Overlays.js +0 -23
- package/lib/module/Mock/Components/Overlays.js.map +0 -1
- package/lib/module/Mock/Components/SideMenu.js +0 -29
- package/lib/module/Mock/Components/SideMenu.js.map +0 -1
- package/lib/module/Mock/Components/Stack.js +0 -18
- package/lib/module/Mock/Components/Stack.js.map +0 -1
- package/lib/module/Mock/Components/TopBar.js +0 -81
- package/lib/module/Mock/Components/TopBar.js.map +0 -1
- package/lib/module/Mock/Layouts/BottomTabsNode.js +0 -30
- package/lib/module/Mock/Layouts/BottomTabsNode.js.map +0 -1
- package/lib/module/Mock/Layouts/ComponentNode.js +0 -102
- package/lib/module/Mock/Layouts/ComponentNode.js.map +0 -1
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js +0 -28
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js.map +0 -1
- package/lib/module/Mock/Layouts/Node.js +0 -14
- package/lib/module/Mock/Layouts/Node.js.map +0 -1
- package/lib/module/Mock/Layouts/ParentNode.js +0 -66
- package/lib/module/Mock/Layouts/ParentNode.js.map +0 -1
- package/lib/module/Mock/Layouts/SideMenu.js +0 -72
- package/lib/module/Mock/Layouts/SideMenu.js.map +0 -1
- package/lib/module/Mock/Layouts/StackNode.js +0 -12
- package/lib/module/Mock/Layouts/StackNode.js.map +0 -1
- package/lib/module/Mock/Stores/EventsStore.js +0 -53
- package/lib/module/Mock/Stores/EventsStore.js.map +0 -1
- package/lib/module/Mock/Stores/LayoutStore.js.map +0 -1
- package/lib/module/Mock/actions/layoutActions.js +0 -19
- package/lib/module/Mock/actions/layoutActions.js.map +0 -1
- package/lib/module/Mock/connect.js +0 -8
- package/lib/module/Mock/connect.js.map +0 -1
- package/lib/module/Mock/constants.js +0 -5
- package/lib/module/Mock/constants.js.map +0 -1
- package/lib/module/Mock/index.js +0 -20
- package/lib/module/Mock/index.js.map +0 -1
- package/lib/module/Mock/mocks/AppRegistryService.js +0 -6
- package/lib/module/Mock/mocks/AppRegistryService.js.map +0 -1
- package/lib/module/Mock/mocks/NativeCommandsSender.js +0 -146
- package/lib/module/Mock/mocks/NativeCommandsSender.js.map +0 -1
- package/lib/module/Mock/mocks/NativeEventsReceiver.js +0 -103
- package/lib/module/Mock/mocks/NativeEventsReceiver.js.map +0 -1
- package/lib/module/Navigation.js +0 -250
- package/lib/module/Navigation.js.map +0 -1
- package/lib/module/NavigationDelegate.js.map +0 -1
- package/lib/module/adapters/AndroidCustomRowForwarder.js +0 -75
- package/lib/module/adapters/AndroidCustomRowForwarder.js.map +0 -1
- package/lib/module/adapters/AppRegistryService.js +0 -9
- package/lib/module/adapters/AppRegistryService.js.map +0 -1
- package/lib/module/adapters/AssetResolver.js +0 -9
- package/lib/module/adapters/AssetResolver.js.map +0 -1
- package/lib/module/adapters/ColorService.js +0 -9
- package/lib/module/adapters/ColorService.js.map +0 -1
- package/lib/module/adapters/Constants.js +0 -19
- package/lib/module/adapters/Constants.js.map +0 -1
- package/lib/module/adapters/NativeCommandsSender.js.map +0 -1
- package/lib/module/adapters/NativeEventsReceiver.js +0 -65
- package/lib/module/adapters/NativeEventsReceiver.js.map +0 -1
- package/lib/module/adapters/NativeEventsReceiver.mock.js +0 -6
- package/lib/module/adapters/NativeEventsReceiver.mock.js.map +0 -1
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js +0 -7
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js.map +0 -1
- package/lib/module/adapters/NativeRNNTurboModule.js +0 -6
- package/lib/module/adapters/NativeRNNTurboModule.js.map +0 -1
- package/lib/module/adapters/TouchablePreview.js +0 -115
- package/lib/module/adapters/TouchablePreview.js.map +0 -1
- package/lib/module/adapters/UniqueIdProvider.js +0 -9
- package/lib/module/adapters/UniqueIdProvider.js.map +0 -1
- package/lib/module/commands/Commands.js +0 -241
- package/lib/module/commands/Commands.js.map +0 -1
- package/lib/module/commands/Commands.test.js +0 -759
- package/lib/module/commands/Commands.test.js.map +0 -1
- package/lib/module/commands/Deprecations.js +0 -66
- package/lib/module/commands/Deprecations.js.map +0 -1
- package/lib/module/commands/LayoutTreeCrawler.js +0 -32
- package/lib/module/commands/LayoutTreeCrawler.js.map +0 -1
- package/lib/module/commands/LayoutTreeCrawler.test.js +0 -82
- package/lib/module/commands/LayoutTreeCrawler.test.js.map +0 -1
- package/lib/module/commands/LayoutTreeParser.js +0 -130
- package/lib/module/commands/LayoutTreeParser.js.map +0 -1
- package/lib/module/commands/LayoutTreeParser.test.js +0 -359
- package/lib/module/commands/LayoutTreeParser.test.js.map +0 -1
- package/lib/module/commands/LayoutType.js +0 -16
- package/lib/module/commands/LayoutType.js.map +0 -1
- package/lib/module/commands/LayoutType.test.js +0 -12
- package/lib/module/commands/LayoutType.test.js.map +0 -1
- package/lib/module/commands/OptionsCrawler.js +0 -72
- package/lib/module/commands/OptionsCrawler.js.map +0 -1
- package/lib/module/commands/OptionsCrawler.test.js +0 -351
- package/lib/module/commands/OptionsCrawler.test.js.map +0 -1
- package/lib/module/commands/OptionsProcessor.js.map +0 -1
- package/lib/module/commands/OptionsProcessor.test.js +0 -1234
- package/lib/module/commands/OptionsProcessor.test.js.map +0 -1
- package/lib/module/components/ComponentRegistry.js.map +0 -1
- package/lib/module/components/ComponentRegistry.test.js +0 -57
- package/lib/module/components/ComponentRegistry.test.js.map +0 -1
- package/lib/module/components/ComponentWrapper.js +0 -80
- package/lib/module/components/ComponentWrapper.js.map +0 -1
- package/lib/module/components/ComponentWrapper.test.js +0 -333
- package/lib/module/components/ComponentWrapper.test.js.map +0 -1
- package/lib/module/components/Modal.js +0 -125
- package/lib/module/components/Modal.js.map +0 -1
- package/lib/module/components/Store.js.map +0 -1
- package/lib/module/components/Store.test.js +0 -148
- package/lib/module/components/Store.test.js.map +0 -1
- package/lib/module/events/CommandsObserver.js +0 -19
- package/lib/module/events/CommandsObserver.js.map +0 -1
- package/lib/module/events/CommandsObserver.test.js +0 -43
- package/lib/module/events/CommandsObserver.test.js.map +0 -1
- package/lib/module/events/ComponentEventsObserver.js +0 -94
- package/lib/module/events/ComponentEventsObserver.js.map +0 -1
- package/lib/module/events/ComponentEventsObserver.test.js +0 -391
- package/lib/module/events/ComponentEventsObserver.test.js.map +0 -1
- package/lib/module/events/EventsRegistry.js.map +0 -1
- package/lib/module/events/EventsRegistry.test.js +0 -131
- package/lib/module/events/EventsRegistry.test.js.map +0 -1
- package/lib/module/index.js +0 -22
- package/lib/module/index.js.map +0 -1
- package/lib/module/interfaces/CommandName.js +0 -22
- package/lib/module/interfaces/CommandName.js.map +0 -1
- package/lib/module/interfaces/ComponentEvents.js +0 -2
- package/lib/module/interfaces/ComponentEvents.js.map +0 -1
- package/lib/module/interfaces/EventSubscription.js +0 -2
- package/lib/module/interfaces/EventSubscription.js.map +0 -1
- package/lib/module/interfaces/Events.js +0 -2
- package/lib/module/interfaces/Events.js.map +0 -1
- package/lib/module/interfaces/Layout.js +0 -4
- package/lib/module/interfaces/Layout.js.map +0 -1
- package/lib/module/interfaces/NavigationComponent.js +0 -21
- package/lib/module/interfaces/NavigationComponent.js.map +0 -1
- package/lib/module/interfaces/NavigationComponentListener.js +0 -4
- package/lib/module/interfaces/NavigationComponentListener.js.map +0 -1
- package/lib/module/interfaces/NavigationComponentProps.js +0 -2
- package/lib/module/interfaces/NavigationComponentProps.js.map +0 -1
- package/lib/module/interfaces/NavigationFunctionComponent.js +0 -4
- package/lib/module/interfaces/NavigationFunctionComponent.js.map +0 -1
- package/lib/module/interfaces/Options.js +0 -47
- package/lib/module/interfaces/Options.js.map +0 -1
- package/lib/module/interfaces/ProcessorSubscription.js +0 -2
- package/lib/module/interfaces/ProcessorSubscription.js.map +0 -1
- package/lib/module/interfaces/Processors.js +0 -4
- package/lib/module/interfaces/Processors.js.map +0 -1
- package/lib/module/linking/DeferredLinkQueue.js +0 -52
- package/lib/module/linking/DeferredLinkQueue.js.map +0 -1
- package/lib/module/linking/DeferredLinkQueue.test.js +0 -54
- package/lib/module/linking/DeferredLinkQueue.test.js.map +0 -1
- package/lib/module/linking/LinkingHandler.js.map +0 -1
- package/lib/module/linking/LinkingHandler.test.js +0 -384
- package/lib/module/linking/LinkingHandler.test.js.map +0 -1
- package/lib/module/linking/ModalLayoutBuilder.js +0 -56
- package/lib/module/linking/ModalLayoutBuilder.js.map +0 -1
- package/lib/module/linking/ModalLayoutBuilder.test.js +0 -154
- package/lib/module/linking/ModalLayoutBuilder.test.js.map +0 -1
- package/lib/module/linking/RouteMatcher.js.map +0 -1
- package/lib/module/linking/RouteMatcher.test.js +0 -164
- package/lib/module/linking/RouteMatcher.test.js.map +0 -1
- package/lib/module/linking/URLParser.js +0 -56
- package/lib/module/linking/URLParser.js.map +0 -1
- package/lib/module/linking/URLParser.test.js +0 -100
- package/lib/module/linking/URLParser.test.js.map +0 -1
- package/lib/module/linking/types.js +0 -4
- package/lib/module/linking/types.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/processors/LayoutProcessor.js +0 -15
- package/lib/module/processors/LayoutProcessor.js.map +0 -1
- package/lib/module/processors/LayoutProcessor.test.js +0 -53
- package/lib/module/processors/LayoutProcessor.test.js.map +0 -1
- package/lib/module/processors/LayoutProcessorsStore.js +0 -18
- package/lib/module/processors/LayoutProcessorsStore.js.map +0 -1
- package/lib/module/processors/LayoutProcessorsStore.test.js +0 -31
- package/lib/module/processors/LayoutProcessorsStore.test.js.map +0 -1
- package/lib/module/processors/OptionProcessorsStore.js +0 -19
- package/lib/module/processors/OptionProcessorsStore.js.map +0 -1
- package/lib/module/processors/OptionProcessorsStore.test.js +0 -31
- package/lib/module/processors/OptionProcessorsStore.test.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/module/types.js.map +0 -1
- package/scripts/setup-esm-shim.js +0 -101
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var NativeCommandsSender_exports = {};
|
|
30
|
+
__export(NativeCommandsSender_exports, {
|
|
31
|
+
NativeCommandsSender: () => NativeCommandsSender
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(NativeCommandsSender_exports);
|
|
34
|
+
var import_LayoutStore = require("../Stores/LayoutStore.js");
|
|
35
|
+
var import_LayoutNodeFactory = __toESM(require("../Layouts/LayoutNodeFactory.js"), 1);
|
|
36
|
+
var import_EventsStore = require("../Stores/EventsStore.js");
|
|
37
|
+
var import_lodash = __toESM(require("lodash"), 1);
|
|
38
|
+
var import_CommandName = require("../../interfaces/CommandName.js");
|
|
39
|
+
class NativeCommandsSender {
|
|
40
|
+
constructor() {
|
|
41
|
+
}
|
|
42
|
+
setRoot(commandId, layout) {
|
|
43
|
+
return new Promise((resolve) => {
|
|
44
|
+
if (import_LayoutStore.LayoutStore.getVisibleLayout()) {
|
|
45
|
+
import_LayoutStore.LayoutStore.getVisibleLayout().componentDidDisappear();
|
|
46
|
+
import_LayoutStore.LayoutStore.setRoot({});
|
|
47
|
+
}
|
|
48
|
+
const layoutNode = import_LayoutNodeFactory.default.create(layout.root);
|
|
49
|
+
import_LayoutStore.LayoutStore.setRoot(layoutNode);
|
|
50
|
+
layoutNode.getVisibleLayout().componentDidAppear();
|
|
51
|
+
resolve(layout.root.nodeId);
|
|
52
|
+
this.reportCommandCompletion(import_CommandName.CommandName.SetRoot, commandId);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
setDefaultOptions(options) {
|
|
56
|
+
import_LayoutStore.LayoutStore.setDefaultOptions(options);
|
|
57
|
+
}
|
|
58
|
+
mergeOptions(componentId, options) {
|
|
59
|
+
import_LayoutStore.LayoutStore.mergeOptions(componentId, options);
|
|
60
|
+
}
|
|
61
|
+
push(commandId, onComponentId, layout) {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
const stack = import_LayoutStore.LayoutStore.getLayoutById(onComponentId).getStack();
|
|
64
|
+
const layoutNode = import_LayoutNodeFactory.default.create(layout, stack);
|
|
65
|
+
stack.getVisibleLayout().componentDidDisappear();
|
|
66
|
+
import_LayoutStore.LayoutStore.push(layoutNode, stack);
|
|
67
|
+
import_LayoutStore.LayoutStore.applyOptions(layoutNode.nodeId, layoutNode.data.options);
|
|
68
|
+
stack.getVisibleLayout().componentDidAppear();
|
|
69
|
+
resolve(stack.getVisibleLayout().nodeId);
|
|
70
|
+
this.reportCommandCompletion(import_CommandName.CommandName.Push, commandId);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
pop(commandId, componentId, _options) {
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
if (!import_LayoutStore.LayoutStore.getLayoutById(componentId)) {
|
|
76
|
+
reject(`Popping component failed - componentId '${componentId}' not found`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const poppedChild = import_lodash.default.last(import_LayoutStore.LayoutStore.getLayoutById(componentId).getStack().children);
|
|
80
|
+
import_LayoutStore.LayoutStore.pop(componentId);
|
|
81
|
+
import_EventsStore.events.invokeScreenPopped({
|
|
82
|
+
componentId
|
|
83
|
+
});
|
|
84
|
+
resolve(poppedChild.nodeId);
|
|
85
|
+
this.reportCommandCompletion(import_CommandName.CommandName.Pop, commandId);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
popTo(commandId, componentId, _options) {
|
|
89
|
+
return new Promise((resolve) => {
|
|
90
|
+
import_LayoutStore.LayoutStore.popTo(componentId);
|
|
91
|
+
resolve(componentId);
|
|
92
|
+
this.reportCommandCompletion(import_CommandName.CommandName.PopTo, commandId);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
popToRoot(commandId, componentId, _options) {
|
|
96
|
+
import_LayoutStore.LayoutStore.popToRoot(componentId);
|
|
97
|
+
this.reportCommandCompletion(import_CommandName.CommandName.PopToRoot, commandId);
|
|
98
|
+
}
|
|
99
|
+
setStackRoot(commandId, onComponentId, layout) {
|
|
100
|
+
import_LayoutStore.LayoutStore.setStackRoot(onComponentId, layout);
|
|
101
|
+
this.reportCommandCompletion(import_CommandName.CommandName.SetStackRoot, commandId);
|
|
102
|
+
}
|
|
103
|
+
showModal(commandId, layout) {
|
|
104
|
+
return new Promise((resolve) => {
|
|
105
|
+
const layoutNode = import_LayoutNodeFactory.default.create(layout);
|
|
106
|
+
import_LayoutStore.LayoutStore.getVisibleLayout().componentDidDisappear();
|
|
107
|
+
import_LayoutStore.LayoutStore.showModal(layoutNode);
|
|
108
|
+
layoutNode.componentDidAppear();
|
|
109
|
+
resolve(layoutNode.nodeId);
|
|
110
|
+
this.reportCommandCompletion(import_CommandName.CommandName.ShowModal, commandId);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
dismissModal(commandId, componentId, _options) {
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
const modal = import_LayoutStore.LayoutStore.getModalById(componentId);
|
|
116
|
+
if (modal) {
|
|
117
|
+
const modalTopParent = modal.getTopParent();
|
|
118
|
+
modalTopParent.componentDidDisappear();
|
|
119
|
+
import_LayoutStore.LayoutStore.dismissModal(componentId);
|
|
120
|
+
import_EventsStore.events.invokeModalDismissed({
|
|
121
|
+
componentName: modalTopParent.data.name,
|
|
122
|
+
componentId: modalTopParent.nodeId,
|
|
123
|
+
modalsDismissed: 1
|
|
124
|
+
});
|
|
125
|
+
resolve(modalTopParent.nodeId);
|
|
126
|
+
import_LayoutStore.LayoutStore.getVisibleLayout().componentDidAppear();
|
|
127
|
+
this.reportCommandCompletion(import_CommandName.CommandName.DismissModal, commandId);
|
|
128
|
+
} else {
|
|
129
|
+
reject(`component with id: ${componentId} is not a modal`);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
dismissAllModals(commandId, _options) {
|
|
134
|
+
import_LayoutStore.LayoutStore.dismissAllModals();
|
|
135
|
+
this.reportCommandCompletion(import_CommandName.CommandName.DismissAllModals, commandId);
|
|
136
|
+
}
|
|
137
|
+
showOverlay(commandId, layout) {
|
|
138
|
+
const layoutNode = import_LayoutNodeFactory.default.create(layout);
|
|
139
|
+
import_LayoutStore.LayoutStore.showOverlay(layoutNode);
|
|
140
|
+
layoutNode.componentDidAppear();
|
|
141
|
+
this.reportCommandCompletion(import_CommandName.CommandName.ShowOverlay, commandId);
|
|
142
|
+
}
|
|
143
|
+
dismissOverlay(commandId, componentId) {
|
|
144
|
+
import_LayoutStore.LayoutStore.dismissOverlay(componentId);
|
|
145
|
+
this.reportCommandCompletion(import_CommandName.CommandName.DismissOverlay, commandId);
|
|
146
|
+
}
|
|
147
|
+
dismissAllOverlays(commandId) {
|
|
148
|
+
import_LayoutStore.LayoutStore.dismissAllOverlays();
|
|
149
|
+
this.reportCommandCompletion(import_CommandName.CommandName.DismissAllOverlays, commandId);
|
|
150
|
+
}
|
|
151
|
+
getLaunchArgs(commandId) {
|
|
152
|
+
this.reportCommandCompletion(import_CommandName.CommandName.GetLaunchArgs, commandId);
|
|
153
|
+
}
|
|
154
|
+
getNavigationConstants() {
|
|
155
|
+
return Promise.resolve({
|
|
156
|
+
topBarHeight: 0,
|
|
157
|
+
backButtonId: "RNN.back",
|
|
158
|
+
bottomTabsHeight: 0,
|
|
159
|
+
statusBarHeight: 0
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
getNavigationConstantsSync() {
|
|
163
|
+
return {
|
|
164
|
+
topBarHeight: 0,
|
|
165
|
+
backButtonId: "RNN.back",
|
|
166
|
+
bottomTabsHeight: 0,
|
|
167
|
+
statusBarHeight: 0
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
reportCommandCompletion(commandName, commandId) {
|
|
171
|
+
import_EventsStore.events.invokeCommandCompleted({
|
|
172
|
+
commandName,
|
|
173
|
+
commandId,
|
|
174
|
+
completionTime: 0
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
179
|
+
0 && (module.exports = {
|
|
180
|
+
NativeCommandsSender
|
|
181
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var NativeEventsReceiver_exports = {};
|
|
30
|
+
__export(NativeEventsReceiver_exports, {
|
|
31
|
+
NativeEventsReceiver: () => NativeEventsReceiver
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(NativeEventsReceiver_exports);
|
|
34
|
+
var import_lodash = __toESM(require("lodash"), 1);
|
|
35
|
+
var import_EventsStore = require("../Stores/EventsStore.js");
|
|
36
|
+
class NativeEventsReceiver {
|
|
37
|
+
registerAppLaunchedListener(callback) {
|
|
38
|
+
callback();
|
|
39
|
+
return {
|
|
40
|
+
remove: () => {
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
registerComponentWillAppearListener(callback) {
|
|
45
|
+
import_EventsStore.events.componentWillAppear.push(callback);
|
|
46
|
+
return {
|
|
47
|
+
remove: () => {
|
|
48
|
+
import_lodash.default.remove(import_EventsStore.events.componentWillAppear, (value) => value === callback);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
registerComponentDidAppearListener(callback) {
|
|
53
|
+
import_EventsStore.events.componentDidAppear.push(callback);
|
|
54
|
+
return {
|
|
55
|
+
remove: () => {
|
|
56
|
+
import_lodash.default.remove(import_EventsStore.events.componentDidAppear, (value) => value === callback);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
registerComponentDidDisappearListener(callback) {
|
|
61
|
+
import_EventsStore.events.componentDidDisappear.push(callback);
|
|
62
|
+
return {
|
|
63
|
+
remove: () => {
|
|
64
|
+
import_lodash.default.remove(import_EventsStore.events.componentDidDisappear, (value) => value === callback);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
registerNavigationButtonPressedListener(callback) {
|
|
69
|
+
import_EventsStore.events.navigationButtonPressed.push(callback);
|
|
70
|
+
return {
|
|
71
|
+
remove: () => {
|
|
72
|
+
import_lodash.default.remove(import_EventsStore.events.navigationButtonPressed, (value) => value === callback);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
registerBottomTabPressedListener(callback) {
|
|
77
|
+
import_EventsStore.events.bottomTabPressed.push(callback);
|
|
78
|
+
return {
|
|
79
|
+
remove: () => {
|
|
80
|
+
import_lodash.default.remove(import_EventsStore.events.bottomTabPressed, (value) => value === callback);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
registerModalDismissedListener(callback) {
|
|
85
|
+
import_EventsStore.events.modalDismissed.push(callback);
|
|
86
|
+
return {
|
|
87
|
+
remove: () => {
|
|
88
|
+
import_lodash.default.remove(import_EventsStore.events.modalDismissed, (value) => value === callback);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
registerModalAttemptedToDismissListener(_callback) {
|
|
93
|
+
return {
|
|
94
|
+
remove: () => {
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
registerSearchBarUpdatedListener(_callback) {
|
|
99
|
+
return {
|
|
100
|
+
remove: () => {
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
registerSearchBarCancelPressedListener(_callback) {
|
|
105
|
+
return {
|
|
106
|
+
remove: () => {
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
registerPreviewCompletedListener(_callback) {
|
|
111
|
+
return {
|
|
112
|
+
remove: () => {
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
registerCommandCompletedListener(callback) {
|
|
117
|
+
import_EventsStore.events.commandCompleted.push(callback);
|
|
118
|
+
return {
|
|
119
|
+
remove: () => {
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
registerBottomTabSelectedListener(_callback) {
|
|
124
|
+
return {
|
|
125
|
+
remove: () => {
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
registerBottomTabLongPressedListener(_callback) {
|
|
130
|
+
return {
|
|
131
|
+
remove: () => {
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
registerScreenPoppedListener(callback) {
|
|
136
|
+
import_EventsStore.events.screenPopped.push(callback);
|
|
137
|
+
return {
|
|
138
|
+
remove: () => {
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
NativeEventsReceiver
|
|
146
|
+
});
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Navigation_exports = {};
|
|
30
|
+
__export(Navigation_exports, {
|
|
31
|
+
NavigationRoot: () => NavigationRoot
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Navigation_exports);
|
|
34
|
+
var import_isArray = __toESM(require("lodash/isArray.js"), 1);
|
|
35
|
+
var import_UniqueIdProvider = require("./adapters/UniqueIdProvider.js");
|
|
36
|
+
var import_Store = require("./components/Store.js");
|
|
37
|
+
var import_OptionProcessorsStore = require("./processors/OptionProcessorsStore.js");
|
|
38
|
+
var import_ComponentRegistry = require("./components/ComponentRegistry.js");
|
|
39
|
+
var import_Commands = require("./commands/Commands.js");
|
|
40
|
+
var import_LayoutTreeParser = require("./commands/LayoutTreeParser.js");
|
|
41
|
+
var import_LayoutTreeCrawler = require("./commands/LayoutTreeCrawler.js");
|
|
42
|
+
var import_EventsRegistry = require("./events/EventsRegistry.js");
|
|
43
|
+
var import_CommandsObserver = require("./events/CommandsObserver.js");
|
|
44
|
+
var import_Constants = require("./adapters/Constants.js");
|
|
45
|
+
var import_ComponentEventsObserver = require("./events/ComponentEventsObserver.js");
|
|
46
|
+
var import_TouchablePreview = require("./adapters/TouchablePreview.js");
|
|
47
|
+
var import_ComponentWrapper = require("./components/ComponentWrapper.js");
|
|
48
|
+
var import_OptionsProcessor = require("./commands/OptionsProcessor.js");
|
|
49
|
+
var import_ColorService = require("./adapters/ColorService.js");
|
|
50
|
+
var import_AssetResolver = require("./adapters/AssetResolver.js");
|
|
51
|
+
var import_Deprecations = require("./commands/Deprecations.js");
|
|
52
|
+
var import_LayoutProcessor = require("./processors/LayoutProcessor.js");
|
|
53
|
+
var import_LayoutProcessorsStore = require("./processors/LayoutProcessorsStore.js");
|
|
54
|
+
var import_OptionsCrawler = require("./commands/OptionsCrawler.js");
|
|
55
|
+
var import_LinkingHandler = require("./linking/LinkingHandler.js");
|
|
56
|
+
class NavigationRoot {
|
|
57
|
+
TouchablePreview = import_TouchablePreview.TouchablePreview;
|
|
58
|
+
constructor(nativeCommandsSender, nativeEventsReceiver, appRegistryService) {
|
|
59
|
+
this.nativeCommandsSender = nativeCommandsSender;
|
|
60
|
+
this.nativeEventsReceiver = nativeEventsReceiver;
|
|
61
|
+
this.appRegistryService = appRegistryService;
|
|
62
|
+
this.componentWrapper = new import_ComponentWrapper.ComponentWrapper();
|
|
63
|
+
this.store = new import_Store.Store();
|
|
64
|
+
this.optionProcessorsStore = new import_OptionProcessorsStore.OptionProcessorsStore();
|
|
65
|
+
this.layoutProcessorsStore = new import_LayoutProcessorsStore.LayoutProcessorsStore();
|
|
66
|
+
this.uniqueIdProvider = new import_UniqueIdProvider.UniqueIdProvider();
|
|
67
|
+
this.componentEventsObserver = new import_ComponentEventsObserver.ComponentEventsObserver(this.nativeEventsReceiver, this.store);
|
|
68
|
+
this.componentRegistry = new import_ComponentRegistry.ComponentRegistry(this.store, this.componentEventsObserver, this.componentWrapper, this.appRegistryService);
|
|
69
|
+
this.layoutTreeParser = new import_LayoutTreeParser.LayoutTreeParser(this.uniqueIdProvider);
|
|
70
|
+
const optionsProcessor = new import_OptionsProcessor.OptionsProcessor(this.store, this.uniqueIdProvider, this.optionProcessorsStore, new import_ColorService.ColorService(), new import_AssetResolver.AssetService(), new import_Deprecations.Deprecations());
|
|
71
|
+
const layoutProcessor = new import_LayoutProcessor.LayoutProcessor(this.layoutProcessorsStore);
|
|
72
|
+
this.layoutTreeCrawler = new import_LayoutTreeCrawler.LayoutTreeCrawler(this.store, optionsProcessor);
|
|
73
|
+
this.commandsObserver = new import_CommandsObserver.CommandsObserver(this.uniqueIdProvider);
|
|
74
|
+
this.optionsCrawler = new import_OptionsCrawler.OptionsCrawler(this.store, this.uniqueIdProvider);
|
|
75
|
+
this.commands = new import_Commands.Commands(this.store, this.nativeCommandsSender, this.layoutTreeParser, this.layoutTreeCrawler, this.commandsObserver, this.uniqueIdProvider, optionsProcessor, layoutProcessor, this.optionsCrawler);
|
|
76
|
+
this.eventsRegistry = new import_EventsRegistry.EventsRegistry(this.nativeEventsReceiver, this.commandsObserver, this.componentEventsObserver);
|
|
77
|
+
this.linkingHandler = new import_LinkingHandler.LinkingHandler((layout) => this.commands.showModal(layout));
|
|
78
|
+
this.componentEventsObserver.registerOnceForAllComponentEvents();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Every navigation component in your app must be registered with a unique name.
|
|
82
|
+
* The component itself is a traditional React component extending React.Component.
|
|
83
|
+
*/
|
|
84
|
+
registerComponent(componentName, componentProvider, concreteComponentProvider) {
|
|
85
|
+
return this.componentRegistry.registerComponent(componentName, componentProvider, concreteComponentProvider);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Adds an option processor which allows option interpolation by optionPath.
|
|
89
|
+
*/
|
|
90
|
+
addOptionProcessor(optionPath, processor) {
|
|
91
|
+
return this.optionProcessorsStore.addProcessor(optionPath, processor);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Method to be invoked when a layout is processed and is about to be created. This can be used to change layout options or even inject props to components.
|
|
95
|
+
*/
|
|
96
|
+
addLayoutProcessor(processor) {
|
|
97
|
+
return this.layoutProcessorsStore.addProcessor(processor);
|
|
98
|
+
}
|
|
99
|
+
setLazyComponentRegistrator(lazyRegistratorFn) {
|
|
100
|
+
this.store.setLazyComponentRegistrator(lazyRegistratorFn);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Utility helper function like registerComponent,
|
|
104
|
+
* wraps the provided component with a react-redux Provider with the passed redux store
|
|
105
|
+
* @deprecated
|
|
106
|
+
*/
|
|
107
|
+
registerComponentWithRedux(componentName, getComponentClassFunc, ReduxProvider, reduxStore) {
|
|
108
|
+
console.warn("registerComponentWithRedux is deprecated and will be removed in the next version! Please use Navigation.registerComponent instead. Visit the docs for more information https://wix.github.io/react-native-navigation/api/component#registering-a-component-wrapped-with-providers");
|
|
109
|
+
return this.componentRegistry.registerComponent(componentName, getComponentClassFunc, void 0, ReduxProvider, reduxStore);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Reset the app to a new layout
|
|
113
|
+
*/
|
|
114
|
+
setRoot(layout) {
|
|
115
|
+
const result = this.commands.setRoot(layout);
|
|
116
|
+
result.then(() => this.linkingHandler.setRootReady()).catch(() => {
|
|
117
|
+
});
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Set default options to all screens. Useful for declaring a consistent style across the app.
|
|
122
|
+
*/
|
|
123
|
+
setDefaultOptions(options) {
|
|
124
|
+
this.commands.setDefaultOptions(options);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Change a component's navigation options
|
|
128
|
+
*/
|
|
129
|
+
mergeOptions(componentId, options) {
|
|
130
|
+
this.commands.mergeOptions(componentId, options);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Update a mounted component's props
|
|
134
|
+
*/
|
|
135
|
+
updateProps(componentId, props, callback) {
|
|
136
|
+
this.commands.updateProps(componentId, props, callback);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Show a screen as a modal.
|
|
140
|
+
*/
|
|
141
|
+
showModal(layout) {
|
|
142
|
+
return this.commands.showModal(layout);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack.
|
|
146
|
+
*/
|
|
147
|
+
dismissModal(componentId, mergeOptions) {
|
|
148
|
+
return this.commands.dismissModal(componentId, mergeOptions);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Dismiss all Modals
|
|
152
|
+
*/
|
|
153
|
+
dismissAllModals(mergeOptions) {
|
|
154
|
+
return this.commands.dismissAllModals(mergeOptions);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Push a new layout into this screen's navigation stack.
|
|
158
|
+
*/
|
|
159
|
+
push(componentId, layout) {
|
|
160
|
+
return this.commands.push(componentId, layout);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Pop a component from the stack, regardless of it's position.
|
|
164
|
+
*/
|
|
165
|
+
pop(componentId, mergeOptions) {
|
|
166
|
+
return this.commands.pop(componentId, mergeOptions);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Pop the stack to a given component
|
|
170
|
+
*/
|
|
171
|
+
popTo(componentId, mergeOptions) {
|
|
172
|
+
return this.commands.popTo(componentId, mergeOptions);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Pop the component's stack to root.
|
|
176
|
+
*/
|
|
177
|
+
popToRoot(componentId, mergeOptions) {
|
|
178
|
+
return this.commands.popToRoot(componentId, mergeOptions);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Sets new root component to stack.
|
|
182
|
+
*/
|
|
183
|
+
setStackRoot(componentId, layout) {
|
|
184
|
+
const children = (0, import_isArray.default)(layout) ? layout : [layout];
|
|
185
|
+
return this.commands.setStackRoot(componentId, children);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Show overlay on top of the entire app
|
|
189
|
+
*/
|
|
190
|
+
showOverlay(layout) {
|
|
191
|
+
return this.commands.showOverlay(layout);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* dismiss overlay by componentId
|
|
195
|
+
*/
|
|
196
|
+
dismissOverlay(componentId) {
|
|
197
|
+
return this.commands.dismissOverlay(componentId);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* dismiss all overlays
|
|
201
|
+
*/
|
|
202
|
+
dismissAllOverlays() {
|
|
203
|
+
return this.commands.dismissAllOverlays();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Resolves arguments passed on launch
|
|
207
|
+
*/
|
|
208
|
+
getLaunchArgs() {
|
|
209
|
+
return this.commands.getLaunchArgs();
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Configure deep link handling. Maps URL prefixes and path patterns to
|
|
213
|
+
* RNN components. By default each matched link is presented as a modal
|
|
214
|
+
* (wrapped in a stack so a topBar close button can be configured); supply
|
|
215
|
+
* `getModal` to customize the modal layout or `onLink` to bypass the
|
|
216
|
+
* default behavior entirely.
|
|
217
|
+
*/
|
|
218
|
+
setLinking(config) {
|
|
219
|
+
this.linkingHandler.configure(config);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Manually run a URL through the deep link pipeline as if it had been
|
|
223
|
+
* delivered by the OS. Useful for URLs received from push notifications
|
|
224
|
+
* or other non-`Linking` sources.
|
|
225
|
+
*/
|
|
226
|
+
handleDeepLink(url) {
|
|
227
|
+
this.linkingHandler.handleURL(url);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Signal that the app is ready to process deep links (e.g. after the
|
|
231
|
+
* user has authenticated). When set to `true`, any links that were
|
|
232
|
+
* queued while not ready are replayed in order.
|
|
233
|
+
*/
|
|
234
|
+
setLinkingReady(ready) {
|
|
235
|
+
this.linkingHandler.setLinkingReady(ready);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Obtain the events registry instance
|
|
239
|
+
*/
|
|
240
|
+
events() {
|
|
241
|
+
return this.eventsRegistry;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Constants coming from native
|
|
245
|
+
*/
|
|
246
|
+
async constants() {
|
|
247
|
+
return await import_Constants.Constants.get(this.nativeCommandsSender);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Constants coming from native (synchronized call)
|
|
251
|
+
*/
|
|
252
|
+
constantsSync() {
|
|
253
|
+
return import_Constants.Constants.getSync(this.nativeCommandsSender);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
+
0 && (module.exports = {
|
|
258
|
+
NavigationRoot
|
|
259
|
+
});
|