@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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var NativeRNNTurboModule_exports = {};
|
|
20
|
+
__export(NativeRNNTurboModule_exports, {
|
|
21
|
+
default: () => NativeRNNTurboModule_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(NativeRNNTurboModule_exports);
|
|
24
|
+
var import_react_native = require("@ohos-ports/react-native");
|
|
25
|
+
const commands = import_react_native.TurboModuleRegistry.get("RNNTurboModule");
|
|
26
|
+
var NativeRNNTurboModule_default = commands;
|
|
@@ -0,0 +1,137 @@
|
|
|
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 TouchablePreview_exports = {};
|
|
30
|
+
__export(TouchablePreview_exports, {
|
|
31
|
+
TouchablePreview: () => TouchablePreview
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(TouchablePreview_exports);
|
|
34
|
+
var React = __toESM(require("react"), 1);
|
|
35
|
+
var PropTypes = __toESM(require("prop-types"), 1);
|
|
36
|
+
var import_react_native = require("@ohos-ports/react-native");
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
const PREVIEW_DELAY = 350;
|
|
39
|
+
const PREVIEW_MIN_FORCE = 0.1;
|
|
40
|
+
const PREVIEW_TIMEOUT = 1250;
|
|
41
|
+
class TouchablePreview extends React.PureComponent {
|
|
42
|
+
static propTypes = {
|
|
43
|
+
children: PropTypes.node,
|
|
44
|
+
touchableComponent: PropTypes.func,
|
|
45
|
+
onPress: PropTypes.func,
|
|
46
|
+
onPressIn: PropTypes.func,
|
|
47
|
+
onPeekIn: PropTypes.func,
|
|
48
|
+
onPeekOut: PropTypes.func,
|
|
49
|
+
label: PropTypes.string
|
|
50
|
+
};
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
touchableComponent: import_react_native.TouchableWithoutFeedback
|
|
53
|
+
};
|
|
54
|
+
static peeking = false;
|
|
55
|
+
touchStartedAt = 0;
|
|
56
|
+
onRef = /* @__PURE__ */ React.createRef();
|
|
57
|
+
onPress = () => {
|
|
58
|
+
const {
|
|
59
|
+
onPress
|
|
60
|
+
} = this.props;
|
|
61
|
+
if (typeof onPress !== "function" || TouchablePreview.peeking) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
return onPress();
|
|
65
|
+
};
|
|
66
|
+
onPressIn = () => {
|
|
67
|
+
if (import_react_native.Platform.OS === "ios") {
|
|
68
|
+
const {
|
|
69
|
+
onPressIn
|
|
70
|
+
} = this.props;
|
|
71
|
+
if (!onPressIn) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const reactTag = (0, import_react_native.findNodeHandle)(this.onRef.current);
|
|
75
|
+
return onPressIn({
|
|
76
|
+
reactTag
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
};
|
|
81
|
+
onTouchStart = (event) => {
|
|
82
|
+
this.touchStartedAt = event.nativeEvent.timestamp;
|
|
83
|
+
};
|
|
84
|
+
onTouchMove = (event) => {
|
|
85
|
+
clearTimeout(this.timeout);
|
|
86
|
+
const {
|
|
87
|
+
force,
|
|
88
|
+
timestamp
|
|
89
|
+
} = event.nativeEvent;
|
|
90
|
+
const diff = timestamp - this.touchStartedAt;
|
|
91
|
+
if (force > PREVIEW_MIN_FORCE && diff > PREVIEW_DELAY) {
|
|
92
|
+
TouchablePreview.peeking = true;
|
|
93
|
+
if (typeof this.props.onPeekIn === "function") {
|
|
94
|
+
this.props.onPeekIn();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
this.timeout = setTimeout(this.onTouchEnd, PREVIEW_TIMEOUT);
|
|
98
|
+
};
|
|
99
|
+
onTouchEnd = () => {
|
|
100
|
+
clearTimeout(this.timeout);
|
|
101
|
+
TouchablePreview.peeking = false;
|
|
102
|
+
if (typeof this.props.onPeekOut === "function") {
|
|
103
|
+
this.props.onPeekOut();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
render() {
|
|
107
|
+
const {
|
|
108
|
+
children,
|
|
109
|
+
touchableComponent,
|
|
110
|
+
...props
|
|
111
|
+
} = this.props;
|
|
112
|
+
const Touchable = import_react_native.Platform.OS === "ios" && touchableComponent instanceof import_react_native.TouchableNativeFeedback ? import_react_native.TouchableWithoutFeedback : touchableComponent;
|
|
113
|
+
return (
|
|
114
|
+
/**
|
|
115
|
+
* @TODO (Jin Shin 25 June 2020)
|
|
116
|
+
* Ignoring this for now so that it builds.
|
|
117
|
+
*/
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Touchable, {
|
|
120
|
+
...props,
|
|
121
|
+
ref: this.onRef,
|
|
122
|
+
onPress: this.onPress,
|
|
123
|
+
onPressIn: this.onPressIn,
|
|
124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
125
|
+
onTouchStart: this.onTouchStart,
|
|
126
|
+
onTouchMove: this.onTouchMove,
|
|
127
|
+
onTouchEnd: this.onTouchEnd,
|
|
128
|
+
children
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
135
|
+
0 && (module.exports = {
|
|
136
|
+
TouchablePreview
|
|
137
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
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 UniqueIdProvider_exports = {};
|
|
30
|
+
__export(UniqueIdProvider_exports, {
|
|
31
|
+
UniqueIdProvider: () => UniqueIdProvider
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(UniqueIdProvider_exports);
|
|
34
|
+
var import_uniqueId = __toESM(require("lodash/uniqueId.js"), 1);
|
|
35
|
+
class UniqueIdProvider {
|
|
36
|
+
generate(prefix) {
|
|
37
|
+
return (0, import_uniqueId.default)(prefix);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
UniqueIdProvider
|
|
43
|
+
});
|
|
@@ -0,0 +1,276 @@
|
|
|
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 Commands_exports = {};
|
|
30
|
+
__export(Commands_exports, {
|
|
31
|
+
Commands: () => Commands
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Commands_exports);
|
|
34
|
+
var import_cloneDeepWith = __toESM(require("lodash/cloneDeepWith.js"), 1);
|
|
35
|
+
var import_cloneDeep = __toESM(require("lodash/cloneDeep.js"), 1);
|
|
36
|
+
var import_map = __toESM(require("lodash/map.js"), 1);
|
|
37
|
+
var import_CommandName = require("../interfaces/CommandName.js");
|
|
38
|
+
var import_AndroidCustomRowForwarder = require("../adapters/AndroidCustomRowForwarder.js");
|
|
39
|
+
class Commands {
|
|
40
|
+
androidCustomRowForwarder = new import_AndroidCustomRowForwarder.AndroidCustomRowForwarder();
|
|
41
|
+
constructor(store, nativeCommandsSender, layoutTreeParser, layoutTreeCrawler, commandsObserver, uniqueIdProvider, optionsProcessor, layoutProcessor, optionsCrawler) {
|
|
42
|
+
this.store = store;
|
|
43
|
+
this.nativeCommandsSender = nativeCommandsSender;
|
|
44
|
+
this.layoutTreeParser = layoutTreeParser;
|
|
45
|
+
this.layoutTreeCrawler = layoutTreeCrawler;
|
|
46
|
+
this.commandsObserver = commandsObserver;
|
|
47
|
+
this.uniqueIdProvider = uniqueIdProvider;
|
|
48
|
+
this.optionsProcessor = optionsProcessor;
|
|
49
|
+
this.layoutProcessor = layoutProcessor;
|
|
50
|
+
this.optionsCrawler = optionsCrawler;
|
|
51
|
+
}
|
|
52
|
+
setRoot(simpleApi) {
|
|
53
|
+
const input = cloneLayout(simpleApi);
|
|
54
|
+
this.optionsCrawler.crawl(input.root);
|
|
55
|
+
const processedRoot = this.layoutProcessor.process(input.root, import_CommandName.CommandName.SetRoot);
|
|
56
|
+
const root = this.layoutTreeParser.parse(processedRoot);
|
|
57
|
+
const modals = (0, import_map.default)(input.modals, (modal) => {
|
|
58
|
+
this.optionsCrawler.crawl(modal);
|
|
59
|
+
const processedModal = this.layoutProcessor.process(modal, import_CommandName.CommandName.SetRoot);
|
|
60
|
+
return this.layoutTreeParser.parse(processedModal);
|
|
61
|
+
});
|
|
62
|
+
const overlays = (0, import_map.default)(input.overlays, (overlay) => {
|
|
63
|
+
this.optionsCrawler.crawl(overlay);
|
|
64
|
+
const processedOverlay = this.layoutProcessor.process(overlay, import_CommandName.CommandName.SetRoot);
|
|
65
|
+
return this.layoutTreeParser.parse(processedOverlay);
|
|
66
|
+
});
|
|
67
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.SetRoot);
|
|
68
|
+
this.commandsObserver.notify(import_CommandName.CommandName.SetRoot, {
|
|
69
|
+
commandId,
|
|
70
|
+
layout: {
|
|
71
|
+
root,
|
|
72
|
+
modals,
|
|
73
|
+
overlays
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
this.layoutTreeCrawler.crawl(root, import_CommandName.CommandName.SetRoot);
|
|
77
|
+
modals.forEach((modalLayout) => {
|
|
78
|
+
this.layoutTreeCrawler.crawl(modalLayout, import_CommandName.CommandName.SetRoot);
|
|
79
|
+
});
|
|
80
|
+
overlays.forEach((overlayLayout) => {
|
|
81
|
+
this.layoutTreeCrawler.crawl(overlayLayout, import_CommandName.CommandName.SetRoot);
|
|
82
|
+
});
|
|
83
|
+
this.androidCustomRowForwarder.forwardFromLayouts([root, ...modals, ...overlays]);
|
|
84
|
+
const result = this.nativeCommandsSender.setRoot(commandId, {
|
|
85
|
+
root,
|
|
86
|
+
modals,
|
|
87
|
+
overlays
|
|
88
|
+
});
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
setDefaultOptions(options) {
|
|
92
|
+
const input = (0, import_cloneDeep.default)(options);
|
|
93
|
+
this.optionsProcessor.processDefaultOptions(input, import_CommandName.CommandName.SetDefaultOptions);
|
|
94
|
+
this.androidCustomRowForwarder.forwardFromOptions(input);
|
|
95
|
+
this.nativeCommandsSender.setDefaultOptions(input);
|
|
96
|
+
this.commandsObserver.notify(import_CommandName.CommandName.SetDefaultOptions, {
|
|
97
|
+
options
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
mergeOptions(componentId, options) {
|
|
101
|
+
const input = (0, import_cloneDeep.default)(options);
|
|
102
|
+
const component = this.store.getComponentInstance(componentId);
|
|
103
|
+
const componentProps = this.store.getPropsForId(componentId) || void 0;
|
|
104
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.MergeOptions, input, componentProps);
|
|
105
|
+
if (component && !component.isMounted) console.warn(`Navigation.mergeOptions was invoked on component with id: ${componentId} before it is mounted, this can cause UI issues and should be avoided.
|
|
106
|
+
Use static options instead.`);
|
|
107
|
+
this.androidCustomRowForwarder.forwardFromOptions(input);
|
|
108
|
+
this.nativeCommandsSender.mergeOptions(componentId, input);
|
|
109
|
+
this.commandsObserver.notify(import_CommandName.CommandName.MergeOptions, {
|
|
110
|
+
componentId,
|
|
111
|
+
options
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
updateProps(componentId, props, callback) {
|
|
115
|
+
this.store.updateProps(componentId, props, callback);
|
|
116
|
+
this.commandsObserver.notify(import_CommandName.CommandName.UpdateProps, {
|
|
117
|
+
componentId,
|
|
118
|
+
props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
showModal(layout) {
|
|
122
|
+
const layoutCloned = cloneLayout(layout);
|
|
123
|
+
this.optionsCrawler.crawl(layoutCloned);
|
|
124
|
+
const layoutProcessed = this.layoutProcessor.process(layoutCloned, import_CommandName.CommandName.ShowModal);
|
|
125
|
+
const layoutNode = this.layoutTreeParser.parse(layoutProcessed);
|
|
126
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.ShowModal);
|
|
127
|
+
this.commandsObserver.notify(import_CommandName.CommandName.ShowModal, {
|
|
128
|
+
commandId,
|
|
129
|
+
layout: layoutNode
|
|
130
|
+
});
|
|
131
|
+
this.layoutTreeCrawler.crawl(layoutNode, import_CommandName.CommandName.ShowModal);
|
|
132
|
+
this.androidCustomRowForwarder.forwardFromLayout(layoutNode);
|
|
133
|
+
const result = this.nativeCommandsSender.showModal(commandId, layoutNode);
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
dismissModal(componentId, mergeOptions) {
|
|
137
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.DismissModal);
|
|
138
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.DismissModal, mergeOptions);
|
|
139
|
+
const result = this.nativeCommandsSender.dismissModal(commandId, componentId, mergeOptions);
|
|
140
|
+
this.commandsObserver.notify(import_CommandName.CommandName.DismissModal, {
|
|
141
|
+
commandId,
|
|
142
|
+
componentId,
|
|
143
|
+
mergeOptions
|
|
144
|
+
});
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
dismissAllModals(mergeOptions) {
|
|
148
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.DismissAllModals);
|
|
149
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.DismissAllModals, mergeOptions);
|
|
150
|
+
const result = this.nativeCommandsSender.dismissAllModals(commandId, mergeOptions);
|
|
151
|
+
this.commandsObserver.notify(import_CommandName.CommandName.DismissAllModals, {
|
|
152
|
+
commandId,
|
|
153
|
+
mergeOptions
|
|
154
|
+
});
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
push(componentId, simpleApi) {
|
|
158
|
+
const input = cloneLayout(simpleApi);
|
|
159
|
+
this.optionsCrawler.crawl(input);
|
|
160
|
+
const layoutProcessed = this.layoutProcessor.process(input, import_CommandName.CommandName.Push);
|
|
161
|
+
const layout = this.layoutTreeParser.parse(layoutProcessed);
|
|
162
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.Push);
|
|
163
|
+
this.commandsObserver.notify(import_CommandName.CommandName.Push, {
|
|
164
|
+
commandId,
|
|
165
|
+
componentId,
|
|
166
|
+
layout
|
|
167
|
+
});
|
|
168
|
+
this.layoutTreeCrawler.crawl(layout, import_CommandName.CommandName.Push);
|
|
169
|
+
this.androidCustomRowForwarder.forwardFromLayout(layout);
|
|
170
|
+
const result = this.nativeCommandsSender.push(commandId, componentId, layout);
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
pop(componentId, mergeOptions) {
|
|
174
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.Pop);
|
|
175
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.Pop, mergeOptions);
|
|
176
|
+
const result = this.nativeCommandsSender.pop(commandId, componentId, mergeOptions);
|
|
177
|
+
this.commandsObserver.notify(import_CommandName.CommandName.Pop, {
|
|
178
|
+
commandId,
|
|
179
|
+
componentId,
|
|
180
|
+
mergeOptions
|
|
181
|
+
});
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
popTo(componentId, mergeOptions) {
|
|
185
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.PopTo);
|
|
186
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.PopTo, mergeOptions);
|
|
187
|
+
const result = this.nativeCommandsSender.popTo(commandId, componentId, mergeOptions);
|
|
188
|
+
this.commandsObserver.notify(import_CommandName.CommandName.PopTo, {
|
|
189
|
+
commandId,
|
|
190
|
+
componentId,
|
|
191
|
+
mergeOptions
|
|
192
|
+
});
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
popToRoot(componentId, mergeOptions) {
|
|
196
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.PopToRoot);
|
|
197
|
+
this.optionsProcessor.processOptions(import_CommandName.CommandName.PopToRoot, mergeOptions);
|
|
198
|
+
const result = this.nativeCommandsSender.popToRoot(commandId, componentId, mergeOptions);
|
|
199
|
+
this.commandsObserver.notify(import_CommandName.CommandName.PopToRoot, {
|
|
200
|
+
commandId,
|
|
201
|
+
componentId,
|
|
202
|
+
mergeOptions
|
|
203
|
+
});
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
setStackRoot(componentId, children) {
|
|
207
|
+
const input = (0, import_map.default)(cloneLayout(children), (simpleApi) => {
|
|
208
|
+
this.optionsCrawler.crawl(simpleApi);
|
|
209
|
+
const layoutProcessed = this.layoutProcessor.process(simpleApi, import_CommandName.CommandName.SetStackRoot);
|
|
210
|
+
const layout = this.layoutTreeParser.parse(layoutProcessed);
|
|
211
|
+
return layout;
|
|
212
|
+
});
|
|
213
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.SetStackRoot);
|
|
214
|
+
this.commandsObserver.notify(import_CommandName.CommandName.SetStackRoot, {
|
|
215
|
+
commandId,
|
|
216
|
+
componentId,
|
|
217
|
+
layout: input
|
|
218
|
+
});
|
|
219
|
+
input.forEach((layoutNode) => {
|
|
220
|
+
this.layoutTreeCrawler.crawl(layoutNode, import_CommandName.CommandName.SetStackRoot);
|
|
221
|
+
});
|
|
222
|
+
this.androidCustomRowForwarder.forwardFromLayouts(input);
|
|
223
|
+
const result = this.nativeCommandsSender.setStackRoot(commandId, componentId, input);
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
showOverlay(simpleApi) {
|
|
227
|
+
const input = cloneLayout(simpleApi);
|
|
228
|
+
this.optionsCrawler.crawl(input);
|
|
229
|
+
const layoutProcessed = this.layoutProcessor.process(input, import_CommandName.CommandName.ShowOverlay);
|
|
230
|
+
const layout = this.layoutTreeParser.parse(layoutProcessed);
|
|
231
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.ShowOverlay);
|
|
232
|
+
this.commandsObserver.notify(import_CommandName.CommandName.ShowOverlay, {
|
|
233
|
+
commandId,
|
|
234
|
+
layout
|
|
235
|
+
});
|
|
236
|
+
this.layoutTreeCrawler.crawl(layout, import_CommandName.CommandName.ShowOverlay);
|
|
237
|
+
const result = this.nativeCommandsSender.showOverlay(commandId, layout);
|
|
238
|
+
return result;
|
|
239
|
+
}
|
|
240
|
+
dismissOverlay(componentId) {
|
|
241
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.DismissOverlay);
|
|
242
|
+
const result = this.nativeCommandsSender.dismissOverlay(commandId, componentId);
|
|
243
|
+
this.commandsObserver.notify(import_CommandName.CommandName.DismissOverlay, {
|
|
244
|
+
commandId,
|
|
245
|
+
componentId
|
|
246
|
+
});
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
dismissAllOverlays() {
|
|
250
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.DismissAllOverlays);
|
|
251
|
+
const result = this.nativeCommandsSender.dismissAllOverlays(commandId);
|
|
252
|
+
this.commandsObserver.notify(import_CommandName.CommandName.DismissAllOverlays, {
|
|
253
|
+
commandId
|
|
254
|
+
});
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
257
|
+
getLaunchArgs() {
|
|
258
|
+
const commandId = this.uniqueIdProvider.generate(import_CommandName.CommandName.GetLaunchArgs);
|
|
259
|
+
const result = this.nativeCommandsSender.getLaunchArgs(commandId);
|
|
260
|
+
this.commandsObserver.notify(import_CommandName.CommandName.GetLaunchArgs, {
|
|
261
|
+
commandId
|
|
262
|
+
});
|
|
263
|
+
return result;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function cloneLayout(layout) {
|
|
267
|
+
return (0, import_cloneDeepWith.default)(layout, (value, key) => {
|
|
268
|
+
if (key === "passProps" && typeof value === "object" && value !== null) return {
|
|
269
|
+
...value
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
274
|
+
0 && (module.exports = {
|
|
275
|
+
Commands
|
|
276
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
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 Deprecations_exports = {};
|
|
30
|
+
__export(Deprecations_exports, {
|
|
31
|
+
Deprecations: () => Deprecations
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Deprecations_exports);
|
|
34
|
+
var import_once = __toESM(require("lodash/once.js"), 1);
|
|
35
|
+
var import_get = __toESM(require("lodash/get.js"), 1);
|
|
36
|
+
var import_each = __toESM(require("lodash/each.js"), 1);
|
|
37
|
+
var import_react_native = require("@ohos-ports/react-native");
|
|
38
|
+
class Deprecations {
|
|
39
|
+
deprecatedOptions = [{
|
|
40
|
+
key: "topBar.searchBarHiddenWhenScrolling",
|
|
41
|
+
showWarning: (0, import_once.default)((_key, parentOptions) => {
|
|
42
|
+
console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
43
|
+
})
|
|
44
|
+
}, {
|
|
45
|
+
key: "topBar.searchBarPlaceholder",
|
|
46
|
+
showWarning: (0, import_once.default)((_key, parentOptions) => {
|
|
47
|
+
console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
48
|
+
})
|
|
49
|
+
}, {
|
|
50
|
+
key: "topBar.searchBarBackgroundColor",
|
|
51
|
+
showWarning: (0, import_once.default)((_key, parentOptions) => {
|
|
52
|
+
console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
53
|
+
})
|
|
54
|
+
}, {
|
|
55
|
+
key: "topBar.searchBarTintColor",
|
|
56
|
+
showWarning: (0, import_once.default)((_key, parentOptions) => {
|
|
57
|
+
console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
58
|
+
})
|
|
59
|
+
}, {
|
|
60
|
+
key: "topBar.hideNavBarOnFocusSearchBar",
|
|
61
|
+
showWarning: (0, import_once.default)((_key, parentOptions) => {
|
|
62
|
+
console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
63
|
+
})
|
|
64
|
+
}];
|
|
65
|
+
checkForDeprecatedOptions(options) {
|
|
66
|
+
(0, import_each.default)(this.deprecatedOptions, (option) => {
|
|
67
|
+
if ((0, import_get.default)(options, option.key, null)) {
|
|
68
|
+
option.showWarning(option.key, options);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
onProcessOptions(key, parentOptions, commandName) {
|
|
73
|
+
if (key === "bottomTabs" && parentOptions[key]?.visible !== void 0 && import_react_native.Platform.OS === "ios" && commandName === "mergeOptions") {
|
|
74
|
+
this.deprecateBottomTabsVisibility(parentOptions);
|
|
75
|
+
}
|
|
76
|
+
if (key === "searchBar" && import_react_native.Platform.OS === "ios" && typeof parentOptions[key] === "boolean") {
|
|
77
|
+
this.deprecateSearchBarOptions(parentOptions);
|
|
78
|
+
}
|
|
79
|
+
if (key === "interpolation" && typeof parentOptions[key] === "string") {
|
|
80
|
+
this.deprecateInterpolationOptions(parentOptions);
|
|
81
|
+
}
|
|
82
|
+
if (key === "showModal" || key === "dismissModal") {
|
|
83
|
+
if (typeof parentOptions[key] === "object" && !("enter" in parentOptions[key]) && !("exit" in parentOptions[key])) console.warn(`${key} without enter/exit is deprecated, and will be changed in the next major version. For more information see https://wix.github.io/react-native-navigation/docs/style-animations#modal-animations`, parentOptions);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
onProcessDefaultOptions(_key, _parentOptions) {
|
|
87
|
+
}
|
|
88
|
+
deprecateSearchBarOptions = (0, import_once.default)((parentOptions) => {
|
|
89
|
+
console.warn(`toggling searchBar visibility using a boolean value will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
|
|
90
|
+
});
|
|
91
|
+
deprecateInterpolationOptions = (0, import_once.default)((parentOptions) => {
|
|
92
|
+
console.warn(`Using Interpolation types as strings has been deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/pull/6644`, parentOptions);
|
|
93
|
+
});
|
|
94
|
+
deprecateBottomTabsVisibility = (0, import_once.default)((parentOptions) => {
|
|
95
|
+
console.warn(`toggling bottomTabs visibility is deprecated on iOS. For more information see https://github.com/wix/react-native-navigation/issues/6416`, parentOptions);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
Deprecations
|
|
101
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var LayoutTreeCrawler_exports = {};
|
|
20
|
+
__export(LayoutTreeCrawler_exports, {
|
|
21
|
+
LayoutTreeCrawler: () => LayoutTreeCrawler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LayoutTreeCrawler_exports);
|
|
24
|
+
var import_LayoutType = require("./LayoutType.js");
|
|
25
|
+
class LayoutTreeCrawler {
|
|
26
|
+
constructor(store, optionsProcessor) {
|
|
27
|
+
this.store = store;
|
|
28
|
+
this.optionsProcessor = optionsProcessor;
|
|
29
|
+
this.crawl = this.crawl.bind(this);
|
|
30
|
+
}
|
|
31
|
+
crawl(node, commandName) {
|
|
32
|
+
if (node.type === import_LayoutType.LayoutType.Component) {
|
|
33
|
+
this.handleComponent(node);
|
|
34
|
+
}
|
|
35
|
+
const componentProps = this.store.getPropsForId(node.id) || void 0;
|
|
36
|
+
this.optionsProcessor.processOptions(commandName, node.data.options, componentProps);
|
|
37
|
+
node.children.forEach((value) => this.crawl(value, commandName));
|
|
38
|
+
}
|
|
39
|
+
handleComponent(node) {
|
|
40
|
+
this.assertComponentDataName(node);
|
|
41
|
+
this.savePropsToStore(node);
|
|
42
|
+
node.data.passProps = void 0;
|
|
43
|
+
}
|
|
44
|
+
savePropsToStore(node) {
|
|
45
|
+
this.store.setPendingProps(node.id, node.data.passProps);
|
|
46
|
+
}
|
|
47
|
+
assertComponentDataName(component) {
|
|
48
|
+
if (!component.data.name) {
|
|
49
|
+
throw new Error("Missing component data.name");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
LayoutTreeCrawler
|
|
56
|
+
});
|