@ohos-ports/react-native-navigation 8.9.0-beta.4 → 8.9.0-beta.6
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 +7 -20
- 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 +6 -9
- 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 -53
|
@@ -0,0 +1,154 @@
|
|
|
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 LayoutTreeParser_exports = {};
|
|
20
|
+
__export(LayoutTreeParser_exports, {
|
|
21
|
+
LayoutTreeParser: () => LayoutTreeParser
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LayoutTreeParser_exports);
|
|
24
|
+
var import_LayoutType = require("./LayoutType.js");
|
|
25
|
+
class LayoutTreeParser {
|
|
26
|
+
constructor(uniqueIdProvider) {
|
|
27
|
+
this.uniqueIdProvider = uniqueIdProvider;
|
|
28
|
+
this.parse = this.parse.bind(this);
|
|
29
|
+
}
|
|
30
|
+
parse(api) {
|
|
31
|
+
if (api.topTabs) {
|
|
32
|
+
return this.topTabs(api.topTabs);
|
|
33
|
+
} else if (api.sideMenu) {
|
|
34
|
+
return this.sideMenu(api.sideMenu);
|
|
35
|
+
} else if (api.bottomTabs) {
|
|
36
|
+
return this.bottomTabs(api.bottomTabs);
|
|
37
|
+
} else if (api.stack) {
|
|
38
|
+
return this.stack(api.stack);
|
|
39
|
+
} else if (api.component) {
|
|
40
|
+
return this.component(api.component);
|
|
41
|
+
} else if (api.externalComponent) {
|
|
42
|
+
return this.externalComponent(api.externalComponent);
|
|
43
|
+
} else if (api.splitView) {
|
|
44
|
+
return this.splitView(api.splitView);
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`unknown LayoutType "${Object.keys(api)}"`);
|
|
47
|
+
}
|
|
48
|
+
topTabs(api) {
|
|
49
|
+
return {
|
|
50
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.TopTabs),
|
|
51
|
+
type: import_LayoutType.LayoutType.TopTabs,
|
|
52
|
+
data: {
|
|
53
|
+
options: api.options
|
|
54
|
+
},
|
|
55
|
+
children: api.children ? api.children.map(this.parse) : []
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
sideMenu(api) {
|
|
59
|
+
return {
|
|
60
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.SideMenuRoot),
|
|
61
|
+
type: import_LayoutType.LayoutType.SideMenuRoot,
|
|
62
|
+
data: {
|
|
63
|
+
options: api.options
|
|
64
|
+
},
|
|
65
|
+
children: this.sideMenuChildren(api)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
sideMenuChildren(api) {
|
|
69
|
+
const children = [];
|
|
70
|
+
if (api.left) {
|
|
71
|
+
children.push({
|
|
72
|
+
id: this.uniqueIdProvider.generate(import_LayoutType.LayoutType.SideMenuLeft),
|
|
73
|
+
type: import_LayoutType.LayoutType.SideMenuLeft,
|
|
74
|
+
data: {},
|
|
75
|
+
children: [this.parse(api.left)]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
children.push({
|
|
79
|
+
id: this.uniqueIdProvider.generate(import_LayoutType.LayoutType.SideMenuCenter),
|
|
80
|
+
type: import_LayoutType.LayoutType.SideMenuCenter,
|
|
81
|
+
data: {},
|
|
82
|
+
children: [this.parse(api.center)]
|
|
83
|
+
});
|
|
84
|
+
if (api.right) {
|
|
85
|
+
children.push({
|
|
86
|
+
id: this.uniqueIdProvider.generate(import_LayoutType.LayoutType.SideMenuRight),
|
|
87
|
+
type: import_LayoutType.LayoutType.SideMenuRight,
|
|
88
|
+
data: {},
|
|
89
|
+
children: [this.parse(api.right)]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return children;
|
|
93
|
+
}
|
|
94
|
+
bottomTabs(api) {
|
|
95
|
+
return {
|
|
96
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.BottomTabs),
|
|
97
|
+
type: import_LayoutType.LayoutType.BottomTabs,
|
|
98
|
+
data: {
|
|
99
|
+
options: api.options
|
|
100
|
+
},
|
|
101
|
+
children: api.children ? api.children.map(this.parse) : []
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
stack(api) {
|
|
105
|
+
return {
|
|
106
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.Stack),
|
|
107
|
+
type: import_LayoutType.LayoutType.Stack,
|
|
108
|
+
data: {
|
|
109
|
+
options: api.options
|
|
110
|
+
},
|
|
111
|
+
children: api.children ? api.children.map(this.parse) : []
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
component(api) {
|
|
115
|
+
return {
|
|
116
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.Component),
|
|
117
|
+
type: import_LayoutType.LayoutType.Component,
|
|
118
|
+
data: {
|
|
119
|
+
name: api.name.toString(),
|
|
120
|
+
options: api.options,
|
|
121
|
+
passProps: api.passProps
|
|
122
|
+
},
|
|
123
|
+
children: []
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
externalComponent(api) {
|
|
127
|
+
return {
|
|
128
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.ExternalComponent),
|
|
129
|
+
type: import_LayoutType.LayoutType.ExternalComponent,
|
|
130
|
+
data: {
|
|
131
|
+
name: api.name.toString(),
|
|
132
|
+
options: api.options,
|
|
133
|
+
passProps: api.passProps
|
|
134
|
+
},
|
|
135
|
+
children: []
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
splitView(api) {
|
|
139
|
+
const master = api.master ? this.parse(api.master) : void 0;
|
|
140
|
+
const detail = api.detail ? this.parse(api.detail) : void 0;
|
|
141
|
+
return {
|
|
142
|
+
id: api.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.SplitView),
|
|
143
|
+
type: import_LayoutType.LayoutType.SplitView,
|
|
144
|
+
data: {
|
|
145
|
+
options: api.options
|
|
146
|
+
},
|
|
147
|
+
children: master && detail ? [master, detail] : []
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
LayoutTreeParser
|
|
154
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
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 LayoutType_exports = {};
|
|
20
|
+
__export(LayoutType_exports, {
|
|
21
|
+
LayoutType: () => LayoutType
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LayoutType_exports);
|
|
24
|
+
let LayoutType = /* @__PURE__ */ (function(LayoutType2) {
|
|
25
|
+
LayoutType2["Component"] = "Component";
|
|
26
|
+
LayoutType2["Stack"] = "Stack";
|
|
27
|
+
LayoutType2["BottomTabs"] = "BottomTabs";
|
|
28
|
+
LayoutType2["SideMenuRoot"] = "SideMenuRoot";
|
|
29
|
+
LayoutType2["SideMenuCenter"] = "SideMenuCenter";
|
|
30
|
+
LayoutType2["SideMenuLeft"] = "SideMenuLeft";
|
|
31
|
+
LayoutType2["SideMenuRight"] = "SideMenuRight";
|
|
32
|
+
LayoutType2["TopTabs"] = "TopTabs";
|
|
33
|
+
LayoutType2["ExternalComponent"] = "ExternalComponent";
|
|
34
|
+
LayoutType2["SplitView"] = "SplitView";
|
|
35
|
+
return LayoutType2;
|
|
36
|
+
})({});
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
LayoutType
|
|
40
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
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 OptionsCrawler_exports = {};
|
|
30
|
+
__export(OptionsCrawler_exports, {
|
|
31
|
+
OptionsCrawler: () => OptionsCrawler
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(OptionsCrawler_exports);
|
|
34
|
+
var import_merge = __toESM(require("lodash/merge.js"), 1);
|
|
35
|
+
var import_isFunction = __toESM(require("lodash/isFunction.js"), 1);
|
|
36
|
+
var import_LayoutType = require("./LayoutType.js");
|
|
37
|
+
class OptionsCrawler {
|
|
38
|
+
constructor(store, uniqueIdProvider) {
|
|
39
|
+
this.store = store;
|
|
40
|
+
this.uniqueIdProvider = uniqueIdProvider;
|
|
41
|
+
this.crawl = this.crawl.bind(this);
|
|
42
|
+
}
|
|
43
|
+
crawl(api) {
|
|
44
|
+
if (!api) return;
|
|
45
|
+
if (api.topTabs) {
|
|
46
|
+
this.topTabs(api.topTabs);
|
|
47
|
+
} else if (api.sideMenu) {
|
|
48
|
+
return this.sideMenu(api.sideMenu);
|
|
49
|
+
} else if (api.bottomTabs) {
|
|
50
|
+
return this.bottomTabs(api.bottomTabs);
|
|
51
|
+
} else if (api.stack) {
|
|
52
|
+
return this.stack(api.stack);
|
|
53
|
+
} else if (api.component) {
|
|
54
|
+
return this.component(api.component);
|
|
55
|
+
} else if (api.splitView) {
|
|
56
|
+
return this.splitView(api.splitView);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
topTabs(api) {
|
|
60
|
+
api.children?.map(this.crawl);
|
|
61
|
+
}
|
|
62
|
+
sideMenu(sideMenu) {
|
|
63
|
+
this.crawl(sideMenu.center);
|
|
64
|
+
this.crawl(sideMenu.left);
|
|
65
|
+
this.crawl(sideMenu.right);
|
|
66
|
+
}
|
|
67
|
+
bottomTabs(bottomTabs) {
|
|
68
|
+
bottomTabs.children?.map(this.crawl);
|
|
69
|
+
}
|
|
70
|
+
stack(stack) {
|
|
71
|
+
stack.children?.map(this.crawl);
|
|
72
|
+
}
|
|
73
|
+
splitView(splitView) {
|
|
74
|
+
splitView.detail && this.crawl(splitView.detail);
|
|
75
|
+
splitView.master && this.crawl(splitView.master);
|
|
76
|
+
}
|
|
77
|
+
component(component) {
|
|
78
|
+
this.applyComponentId(component);
|
|
79
|
+
this.applyStaticOptions(component);
|
|
80
|
+
}
|
|
81
|
+
applyComponentId(component) {
|
|
82
|
+
component.id = component.id || this.uniqueIdProvider.generate(import_LayoutType.LayoutType.Component);
|
|
83
|
+
}
|
|
84
|
+
isComponentWithOptions(component) {
|
|
85
|
+
return component.options !== void 0;
|
|
86
|
+
}
|
|
87
|
+
applyStaticOptions(layout) {
|
|
88
|
+
const staticOptions = this.staticOptionsIfPossible(layout);
|
|
89
|
+
layout.options = (0, import_merge.default)({}, staticOptions, layout.options);
|
|
90
|
+
}
|
|
91
|
+
staticOptionsIfPossible(layout) {
|
|
92
|
+
const foundReactGenerator = this.store.getComponentClassForName(layout.name);
|
|
93
|
+
const reactComponent = foundReactGenerator ? foundReactGenerator() : void 0;
|
|
94
|
+
if (reactComponent && this.isComponentWithOptions(reactComponent)) {
|
|
95
|
+
return (0, import_isFunction.default)(reactComponent.options) ? reactComponent.options({
|
|
96
|
+
componentId: layout.id,
|
|
97
|
+
...layout.passProps
|
|
98
|
+
}) : reactComponent.options;
|
|
99
|
+
}
|
|
100
|
+
return {};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
OptionsCrawler
|
|
106
|
+
});
|
|
@@ -1,15 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 OptionsProcessor_exports = {};
|
|
30
|
+
__export(OptionsProcessor_exports, {
|
|
31
|
+
OptionsProcessor: () => OptionsProcessor
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(OptionsProcessor_exports);
|
|
34
|
+
var import_clone = __toESM(require("lodash/clone.js"), 1);
|
|
35
|
+
var import_isEqual = __toESM(require("lodash/isEqual.js"), 1);
|
|
36
|
+
var import_isObject = __toESM(require("lodash/isObject.js"), 1);
|
|
37
|
+
var import_isArray = __toESM(require("lodash/isArray.js"), 1);
|
|
38
|
+
var import_isString = __toESM(require("lodash/isString.js"), 1);
|
|
39
|
+
var import_endsWith = __toESM(require("lodash/endsWith.js"), 1);
|
|
40
|
+
var import_forEach = __toESM(require("lodash/forEach.js"), 1);
|
|
41
|
+
var import_has = __toESM(require("lodash/has.js"), 1);
|
|
42
|
+
var import_react_native = require("@ohos-ports/react-native");
|
|
43
|
+
class OptionsProcessor {
|
|
13
44
|
constructor(store, uniqueIdProvider, optionProcessorsRegistry, colorService, assetService, deprecations) {
|
|
14
45
|
this.store = store;
|
|
15
46
|
this.uniqueIdProvider = uniqueIdProvider;
|
|
@@ -20,19 +51,19 @@ export class OptionsProcessor {
|
|
|
20
51
|
}
|
|
21
52
|
processOptions(commandName, options, props) {
|
|
22
53
|
if (options) {
|
|
23
|
-
this.processObject(options,
|
|
54
|
+
this.processObject(options, (0, import_clone.default)(options), (key, parentOptions) => {
|
|
24
55
|
this.deprecations.onProcessOptions(key, parentOptions, commandName);
|
|
25
56
|
this.deprecations.checkForDeprecatedOptions(parentOptions);
|
|
26
57
|
}, commandName, props);
|
|
27
58
|
}
|
|
28
59
|
}
|
|
29
60
|
processDefaultOptions(options, commandName) {
|
|
30
|
-
this.processObject(options,
|
|
61
|
+
this.processObject(options, (0, import_clone.default)(options), (key, parentOptions) => {
|
|
31
62
|
this.deprecations.onProcessDefaultOptions(key, parentOptions);
|
|
32
63
|
}, commandName);
|
|
33
64
|
}
|
|
34
65
|
processObject(objectToProcess, parentOptions, onProcess, commandName, props, parentPath) {
|
|
35
|
-
|
|
66
|
+
(0, import_forEach.default)(objectToProcess, (value, key) => {
|
|
36
67
|
const objectPath = this.resolveObjectPath(key, parentPath);
|
|
37
68
|
this.processWithRegisteredProcessor(key, value, objectToProcess, objectPath, commandName, props);
|
|
38
69
|
this.processColor(key, value, objectToProcess);
|
|
@@ -47,34 +78,36 @@ export class OptionsProcessor {
|
|
|
47
78
|
this.processAnimation(key, value, objectToProcess);
|
|
48
79
|
onProcess(key, parentOptions);
|
|
49
80
|
const processedValue = objectToProcess[key];
|
|
50
|
-
if (!
|
|
81
|
+
if (!(0, import_isEqual.default)(key, "passProps") && ((0, import_isObject.default)(processedValue) || (0, import_isArray.default)(processedValue))) {
|
|
51
82
|
this.processObject(processedValue, parentOptions, onProcess, commandName, props, objectPath);
|
|
52
83
|
}
|
|
53
84
|
});
|
|
54
85
|
}
|
|
55
86
|
resolveObjectPath(key, path) {
|
|
56
|
-
if (!path) path = key;
|
|
87
|
+
if (!path) path = key;
|
|
88
|
+
else path += `.${key}`;
|
|
57
89
|
return path;
|
|
58
90
|
}
|
|
59
91
|
processColor(key, value, options) {
|
|
60
|
-
if ((
|
|
61
|
-
if (Platform.OS ===
|
|
92
|
+
if (((0, import_isEqual.default)(key, "color") || (0, import_endsWith.default)(key, "Color")) && !(0, import_isEqual.default)(key, "bkgColor")) {
|
|
93
|
+
if (import_react_native.Platform.OS === "ios") this.processColorIOS(key, value, options);
|
|
94
|
+
else this.processColorAndroid(key, value, options);
|
|
62
95
|
}
|
|
63
96
|
}
|
|
64
97
|
processColorIOS(key, value, options) {
|
|
65
|
-
if (value !==
|
|
98
|
+
if (value !== void 0) {
|
|
66
99
|
if (value === null) {
|
|
67
|
-
options[key] =
|
|
100
|
+
options[key] = "NoColor";
|
|
68
101
|
} else if (value instanceof Object) {
|
|
69
|
-
if (
|
|
102
|
+
if ("semantic" in value) {
|
|
70
103
|
options[key] = value;
|
|
71
|
-
} else if (
|
|
72
|
-
options[key] = DynamicColorIOS({
|
|
104
|
+
} else if ("dynamic" in value) {
|
|
105
|
+
options[key] = (0, import_react_native.DynamicColorIOS)({
|
|
73
106
|
light: this.colorService.toNativeColor(value.dynamic.light),
|
|
74
107
|
dark: this.colorService.toNativeColor(value.dynamic.dark)
|
|
75
108
|
});
|
|
76
109
|
} else {
|
|
77
|
-
options[key] = DynamicColorIOS({
|
|
110
|
+
options[key] = (0, import_react_native.DynamicColorIOS)({
|
|
78
111
|
light: this.colorService.toNativeColor(value.light),
|
|
79
112
|
dark: this.colorService.toNativeColor(value.dark)
|
|
80
113
|
});
|
|
@@ -85,15 +118,15 @@ export class OptionsProcessor {
|
|
|
85
118
|
}
|
|
86
119
|
}
|
|
87
120
|
processColorAndroid(key, value, options) {
|
|
88
|
-
if (value !==
|
|
121
|
+
if (value !== void 0) {
|
|
89
122
|
const newColorObj = {
|
|
90
|
-
dark:
|
|
91
|
-
light:
|
|
123
|
+
dark: "NoColor",
|
|
124
|
+
light: "NoColor"
|
|
92
125
|
};
|
|
93
126
|
if (value === null) {
|
|
94
127
|
options[key] = newColorObj;
|
|
95
128
|
} else if (value instanceof Object) {
|
|
96
|
-
if (
|
|
129
|
+
if ("semantic" in value || "resource_paths" in value) {
|
|
97
130
|
options[key] = value;
|
|
98
131
|
return;
|
|
99
132
|
} else {
|
|
@@ -113,38 +146,38 @@ export class OptionsProcessor {
|
|
|
113
146
|
processWithRegisteredProcessor(key, value, options, path, commandName, passProps) {
|
|
114
147
|
const registeredProcessors = this.optionProcessorsRegistry.getProcessors(path);
|
|
115
148
|
if (registeredProcessors) {
|
|
116
|
-
registeredProcessors.forEach(processor => {
|
|
149
|
+
registeredProcessors.forEach((processor) => {
|
|
117
150
|
options[key] = processor(value, commandName, passProps);
|
|
118
151
|
});
|
|
119
152
|
}
|
|
120
153
|
}
|
|
121
154
|
processImage(key, value, options) {
|
|
122
|
-
if (
|
|
123
|
-
options[key] =
|
|
155
|
+
if ((0, import_isEqual.default)(key, "icon") || (0, import_isEqual.default)(key, "image") || (0, import_endsWith.default)(key, "Icon") || (0, import_endsWith.default)(key, "Image")) {
|
|
156
|
+
options[key] = (0, import_isString.default)(value) ? value : this.assetService.resolveFromRequire(value);
|
|
124
157
|
}
|
|
125
158
|
}
|
|
126
159
|
processButtonsPassProps(key, value) {
|
|
127
|
-
if (
|
|
128
|
-
|
|
160
|
+
if ((0, import_endsWith.default)(key, "Buttons")) {
|
|
161
|
+
(0, import_forEach.default)(value, (button) => {
|
|
129
162
|
if (button.passProps && button.id) {
|
|
130
163
|
this.store.setPendingProps(button.id, button.passProps);
|
|
131
|
-
button.passProps =
|
|
164
|
+
button.passProps = void 0;
|
|
132
165
|
}
|
|
133
166
|
});
|
|
134
167
|
}
|
|
135
168
|
}
|
|
136
169
|
processComponent(key, value, options) {
|
|
137
|
-
if (
|
|
138
|
-
value.componentId = value.id ? value.id : this.uniqueIdProvider.generate(
|
|
170
|
+
if ((0, import_isEqual.default)(key, "component")) {
|
|
171
|
+
value.componentId = value.id ? value.id : this.uniqueIdProvider.generate("CustomComponent");
|
|
139
172
|
this.store.ensureClassForName(value.name);
|
|
140
173
|
if (value.passProps) {
|
|
141
174
|
this.store.setPendingProps(value.componentId, value.passProps);
|
|
142
175
|
}
|
|
143
|
-
options[key].passProps =
|
|
176
|
+
options[key].passProps = void 0;
|
|
144
177
|
}
|
|
145
178
|
}
|
|
146
179
|
processSearchBar(key, value, options) {
|
|
147
|
-
if (key !==
|
|
180
|
+
if (key !== "searchBar") {
|
|
148
181
|
return;
|
|
149
182
|
}
|
|
150
183
|
const deprecatedSearchBarOptions = {
|
|
@@ -154,11 +187,10 @@ export class OptionsProcessor {
|
|
|
154
187
|
obscuresBackgroundDuringPresentation: false,
|
|
155
188
|
backgroundColor: options.searchBarBackgroundColor,
|
|
156
189
|
tintColor: options.searchBarTintColor,
|
|
157
|
-
placeholder: options.searchBarPlaceholder ??
|
|
190
|
+
placeholder: options.searchBarPlaceholder ?? ""
|
|
158
191
|
};
|
|
159
|
-
if (typeof value ===
|
|
160
|
-
|
|
161
|
-
this.deprecations.onProcessOptions(key, options, '');
|
|
192
|
+
if (typeof value === "boolean") {
|
|
193
|
+
this.deprecations.onProcessOptions(key, options, "");
|
|
162
194
|
options[key] = {
|
|
163
195
|
...deprecatedSearchBarOptions,
|
|
164
196
|
visible: value
|
|
@@ -171,9 +203,9 @@ export class OptionsProcessor {
|
|
|
171
203
|
}
|
|
172
204
|
}
|
|
173
205
|
processInterpolation(key, value, options) {
|
|
174
|
-
if (
|
|
175
|
-
if (typeof value ===
|
|
176
|
-
this.deprecations.onProcessOptions(key, options,
|
|
206
|
+
if ((0, import_isEqual.default)(key, "interpolation")) {
|
|
207
|
+
if (typeof value === "string") {
|
|
208
|
+
this.deprecations.onProcessOptions(key, options, "");
|
|
177
209
|
options[key] = {
|
|
178
210
|
type: options[key]
|
|
179
211
|
};
|
|
@@ -189,59 +221,59 @@ export class OptionsProcessor {
|
|
|
189
221
|
this.processDismissModal(key, value, options);
|
|
190
222
|
}
|
|
191
223
|
processSetStackRoot(key, animation, parentOptions) {
|
|
192
|
-
if (key !==
|
|
224
|
+
if (key !== "setStackRoot") return;
|
|
193
225
|
if (this.isNewStackAnimationApi(animation)) return;
|
|
194
226
|
this.convertDeprecatedViewAnimationApiToNewStackAnimationApi(animation, parentOptions);
|
|
195
227
|
}
|
|
196
228
|
isNewStackAnimationApi(animation) {
|
|
197
|
-
return
|
|
229
|
+
return (0, import_has.default)(animation, "content") || (0, import_has.default)(animation, "topBar") || (0, import_has.default)(animation, "bottomTabs");
|
|
198
230
|
}
|
|
199
231
|
convertDeprecatedViewAnimationApiToNewStackAnimationApi(animation, parentOptions) {
|
|
200
|
-
if (!
|
|
232
|
+
if (!(0, import_has.default)(animation, "content.enter") && !(0, import_has.default)(animation, "content.exit")) {
|
|
201
233
|
parentOptions.setStackRoot = {
|
|
202
234
|
content: {
|
|
203
235
|
enter: animation
|
|
204
236
|
}
|
|
205
237
|
};
|
|
206
|
-
if (
|
|
238
|
+
if ((0, import_has.default)(animation, "enabled")) {
|
|
207
239
|
parentOptions.setStackRoot.enabled = animation.enabled;
|
|
208
240
|
}
|
|
209
|
-
if (
|
|
241
|
+
if ((0, import_has.default)(animation, "waitForRender")) {
|
|
210
242
|
parentOptions.setStackRoot.waitForRender = animation.waitForRender;
|
|
211
243
|
}
|
|
212
244
|
}
|
|
213
245
|
}
|
|
214
246
|
processPop(key, animation, parentOptions) {
|
|
215
|
-
if (key !==
|
|
216
|
-
if (animation.content && !
|
|
247
|
+
if (key !== "pop") return;
|
|
248
|
+
if (animation.content && !(0, import_has.default)(animation, "content.enter") && !(0, import_has.default)(animation, "content.exit")) {
|
|
217
249
|
parentOptions.pop.content = {
|
|
218
250
|
exit: animation.content
|
|
219
251
|
};
|
|
220
252
|
}
|
|
221
|
-
if (animation.topBar && !
|
|
253
|
+
if (animation.topBar && !(0, import_has.default)(animation, "topBar.enter") && !(0, import_has.default)(animation, "topBar.exit")) {
|
|
222
254
|
parentOptions.pop.topBar = {
|
|
223
255
|
exit: animation.topBar
|
|
224
256
|
};
|
|
225
257
|
}
|
|
226
|
-
if (animation.bottomTabs && !
|
|
258
|
+
if (animation.bottomTabs && !(0, import_has.default)(animation, "bottomTabs.enter") && !(0, import_has.default)(animation, "bottomTabs.exit")) {
|
|
227
259
|
parentOptions.pop.bottomTabs = {
|
|
228
260
|
exit: animation.bottomTabs
|
|
229
261
|
};
|
|
230
262
|
}
|
|
231
263
|
}
|
|
232
264
|
processSetRootAnimation(key, animation, parentOptions) {
|
|
233
|
-
if (key !==
|
|
234
|
-
if (Platform.OS ===
|
|
265
|
+
if (key !== "setRoot") return;
|
|
266
|
+
if (import_react_native.Platform.OS === "android" && !("enter" in animation)) {
|
|
235
267
|
parentOptions.setRoot = {
|
|
236
268
|
enter: animation
|
|
237
269
|
};
|
|
238
|
-
} else if (Platform.OS ===
|
|
270
|
+
} else if (import_react_native.Platform.OS === "ios" && "enter" in animation) {
|
|
239
271
|
parentOptions.setRoot = animation;
|
|
240
272
|
}
|
|
241
273
|
}
|
|
242
274
|
processShowModal(key, animation, parentOptions) {
|
|
243
|
-
if (key !==
|
|
244
|
-
if (!(
|
|
275
|
+
if (key !== "showModal") return;
|
|
276
|
+
if (!("enter" in animation)) {
|
|
245
277
|
const elementTransitions = animation.elementTransitions;
|
|
246
278
|
const sharedElementTransitions = animation.sharedElementTransitions;
|
|
247
279
|
const enter = {
|
|
@@ -257,8 +289,8 @@ export class OptionsProcessor {
|
|
|
257
289
|
}
|
|
258
290
|
}
|
|
259
291
|
processDismissModal(key, animation, parentOptions) {
|
|
260
|
-
if (key !==
|
|
261
|
-
if (!(
|
|
292
|
+
if (key !== "dismissModal") return;
|
|
293
|
+
if (!("exit" in animation)) {
|
|
262
294
|
const elementTransitions = animation.elementTransitions;
|
|
263
295
|
const sharedElementTransitions = animation.sharedElementTransitions;
|
|
264
296
|
const exit = {
|
|
@@ -274,27 +306,30 @@ export class OptionsProcessor {
|
|
|
274
306
|
}
|
|
275
307
|
}
|
|
276
308
|
processPush(key, animation, parentOptions) {
|
|
277
|
-
if (key !==
|
|
278
|
-
if (animation.content && !
|
|
309
|
+
if (key !== "push") return;
|
|
310
|
+
if (animation.content && !(0, import_has.default)(animation, "content.enter") && !(0, import_has.default)(animation, "content.exit")) {
|
|
279
311
|
parentOptions.push.content = {
|
|
280
312
|
enter: animation.content
|
|
281
313
|
};
|
|
282
314
|
}
|
|
283
|
-
if (animation.topBar && !
|
|
315
|
+
if (animation.topBar && !(0, import_has.default)(animation, "topBar.enter") && !(0, import_has.default)(animation, "topBar.exit")) {
|
|
284
316
|
parentOptions.push.topBar = {
|
|
285
317
|
enter: animation.topBar
|
|
286
318
|
};
|
|
287
319
|
}
|
|
288
|
-
if (animation.statusBar && !
|
|
320
|
+
if (animation.statusBar && !(0, import_has.default)(animation, "statusBar.enter") && !(0, import_has.default)(animation, "statusBar.exit")) {
|
|
289
321
|
parentOptions.push.statusBar = {
|
|
290
322
|
enter: animation.statusBar
|
|
291
323
|
};
|
|
292
324
|
}
|
|
293
|
-
if (animation.bottomTabs && !
|
|
325
|
+
if (animation.bottomTabs && !(0, import_has.default)(animation, "bottomTabs.enter") && !(0, import_has.default)(animation, "bottomTabs.exit")) {
|
|
294
326
|
parentOptions.push.bottomTabs = {
|
|
295
327
|
enter: animation.bottomTabs
|
|
296
328
|
};
|
|
297
329
|
}
|
|
298
330
|
}
|
|
299
331
|
}
|
|
300
|
-
|
|
332
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
333
|
+
0 && (module.exports = {
|
|
334
|
+
OptionsProcessor
|
|
335
|
+
});
|