@ohos-ports/react-native-navigation 8.9.0-beta.11 → 8.9.0-beta.2
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 +13 -11
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +212 -0
- package/lib/module/ARCHITECTURE.md +331 -0
- package/lib/module/Mock/Application.js +33 -0
- package/lib/module/Mock/Application.js.map +1 -0
- package/lib/module/Mock/ComponentProps.js +4 -0
- package/lib/module/Mock/ComponentProps.js.map +1 -0
- package/lib/module/Mock/Components/BottomTabs.js +16 -0
- package/lib/module/Mock/Components/BottomTabs.js.map +1 -0
- package/lib/module/Mock/Components/ComponentScreen.js +101 -0
- package/lib/module/Mock/Components/ComponentScreen.js.map +1 -0
- package/lib/module/Mock/Components/LayoutComponent.js +50 -0
- package/lib/module/Mock/Components/LayoutComponent.js.map +1 -0
- package/lib/module/Mock/Components/Modals.js +22 -0
- package/lib/module/Mock/Components/Modals.js.map +1 -0
- package/lib/module/Mock/Components/NavigationButton.js +72 -0
- package/lib/module/Mock/Components/NavigationButton.js.map +1 -0
- package/lib/module/Mock/Components/Overlays.js +23 -0
- package/lib/module/Mock/Components/Overlays.js.map +1 -0
- package/lib/module/Mock/Components/SideMenu.js +29 -0
- package/lib/module/Mock/Components/SideMenu.js.map +1 -0
- package/lib/module/Mock/Components/Stack.js +18 -0
- package/lib/module/Mock/Components/Stack.js.map +1 -0
- package/lib/module/Mock/Components/TopBar.js +81 -0
- package/lib/module/Mock/Components/TopBar.js.map +1 -0
- package/lib/module/Mock/Layouts/BottomTabsNode.js +30 -0
- package/lib/module/Mock/Layouts/BottomTabsNode.js.map +1 -0
- package/lib/module/Mock/Layouts/ComponentNode.js +102 -0
- package/lib/module/Mock/Layouts/ComponentNode.js.map +1 -0
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js +28 -0
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js.map +1 -0
- package/lib/module/Mock/Layouts/Node.js +14 -0
- package/lib/module/Mock/Layouts/Node.js.map +1 -0
- package/lib/module/Mock/Layouts/ParentNode.js +66 -0
- package/lib/module/Mock/Layouts/ParentNode.js.map +1 -0
- package/lib/module/Mock/Layouts/SideMenu.js +72 -0
- package/lib/module/Mock/Layouts/SideMenu.js.map +1 -0
- package/lib/module/Mock/Layouts/StackNode.js +12 -0
- package/lib/module/Mock/Layouts/StackNode.js.map +1 -0
- package/lib/module/Mock/Stores/EventsStore.js +53 -0
- package/lib/module/Mock/Stores/EventsStore.js.map +1 -0
- package/lib/{cjs → module}/Mock/Stores/LayoutStore.js +24 -56
- package/lib/module/Mock/Stores/LayoutStore.js.map +1 -0
- package/lib/module/Mock/actions/layoutActions.js +19 -0
- package/lib/module/Mock/actions/layoutActions.js.map +1 -0
- package/lib/module/Mock/connect.js +8 -0
- package/lib/module/Mock/connect.js.map +1 -0
- package/lib/module/Mock/constants.js +5 -0
- package/lib/module/Mock/constants.js.map +1 -0
- package/lib/module/Mock/index.js +20 -0
- package/lib/module/Mock/index.js.map +1 -0
- package/lib/module/Mock/mocks/AppRegistryService.js +6 -0
- package/lib/module/Mock/mocks/AppRegistryService.js.map +1 -0
- package/lib/module/Mock/mocks/NativeCommandsSender.js +146 -0
- package/lib/module/Mock/mocks/NativeCommandsSender.js.map +1 -0
- package/lib/module/Mock/mocks/NativeEventsReceiver.js +103 -0
- package/lib/module/Mock/mocks/NativeEventsReceiver.js.map +1 -0
- package/lib/module/Navigation.js +250 -0
- package/lib/module/Navigation.js.map +1 -0
- package/lib/{cjs → module}/NavigationDelegate.js +34 -33
- package/lib/module/NavigationDelegate.js.map +1 -0
- package/lib/module/adapters/AndroidCustomRowForwarder.js +75 -0
- package/lib/module/adapters/AndroidCustomRowForwarder.js.map +1 -0
- package/lib/module/adapters/AppRegistryService.js +9 -0
- package/lib/module/adapters/AppRegistryService.js.map +1 -0
- package/lib/module/adapters/AssetResolver.js +9 -0
- package/lib/module/adapters/AssetResolver.js.map +1 -0
- package/lib/module/adapters/ColorService.js +9 -0
- package/lib/module/adapters/ColorService.js.map +1 -0
- package/lib/module/adapters/Constants.js +19 -0
- package/lib/module/adapters/Constants.js.map +1 -0
- package/lib/{cjs → module}/adapters/NativeCommandsSender.js +5 -39
- package/lib/module/adapters/NativeCommandsSender.js.map +1 -0
- package/lib/module/adapters/NativeEventsReceiver.js +65 -0
- package/lib/module/adapters/NativeEventsReceiver.js.map +1 -0
- package/lib/module/adapters/NativeEventsReceiver.mock.js +6 -0
- package/lib/module/adapters/NativeEventsReceiver.mock.js.map +1 -0
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js +7 -0
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js.map +1 -0
- package/lib/module/adapters/NativeRNNTurboModule.js +6 -0
- package/lib/module/adapters/NativeRNNTurboModule.js.map +1 -0
- package/lib/module/adapters/TouchablePreview.js +115 -0
- package/lib/module/adapters/TouchablePreview.js.map +1 -0
- package/lib/module/adapters/UniqueIdProvider.js +9 -0
- package/lib/module/adapters/UniqueIdProvider.js.map +1 -0
- package/lib/module/commands/Commands.js +241 -0
- package/lib/module/commands/Commands.js.map +1 -0
- package/lib/module/commands/Commands.test.js +759 -0
- package/lib/module/commands/Commands.test.js.map +1 -0
- package/lib/module/commands/Deprecations.js +66 -0
- package/lib/module/commands/Deprecations.js.map +1 -0
- package/lib/module/commands/LayoutTreeCrawler.js +32 -0
- package/lib/module/commands/LayoutTreeCrawler.js.map +1 -0
- package/lib/module/commands/LayoutTreeCrawler.test.js +82 -0
- package/lib/module/commands/LayoutTreeCrawler.test.js.map +1 -0
- package/lib/module/commands/LayoutTreeParser.js +130 -0
- package/lib/module/commands/LayoutTreeParser.js.map +1 -0
- package/lib/module/commands/LayoutTreeParser.test.js +359 -0
- package/lib/module/commands/LayoutTreeParser.test.js.map +1 -0
- package/lib/module/commands/LayoutType.js +16 -0
- package/lib/module/commands/LayoutType.js.map +1 -0
- package/lib/module/commands/LayoutType.test.js +12 -0
- package/lib/module/commands/LayoutType.test.js.map +1 -0
- package/lib/module/commands/OptionsCrawler.js +72 -0
- package/lib/module/commands/OptionsCrawler.js.map +1 -0
- package/lib/module/commands/OptionsCrawler.test.js +351 -0
- package/lib/module/commands/OptionsCrawler.test.js.map +1 -0
- package/lib/{cjs → module}/commands/OptionsProcessor.js +67 -102
- package/lib/module/commands/OptionsProcessor.js.map +1 -0
- package/lib/module/commands/OptionsProcessor.test.js +1234 -0
- package/lib/module/commands/OptionsProcessor.test.js.map +1 -0
- package/lib/{cjs → module}/components/ComponentRegistry.js +3 -27
- package/lib/module/components/ComponentRegistry.js.map +1 -0
- package/lib/module/components/ComponentRegistry.test.js +57 -0
- package/lib/module/components/ComponentRegistry.test.js.map +1 -0
- package/lib/module/components/ComponentWrapper.js +80 -0
- package/lib/module/components/ComponentWrapper.js.map +1 -0
- package/lib/module/components/ComponentWrapper.test.js +333 -0
- package/lib/module/components/ComponentWrapper.test.js.map +1 -0
- package/lib/module/components/Modal.js +125 -0
- package/lib/module/components/Modal.js.map +1 -0
- package/lib/{cjs → module}/components/Store.js +3 -27
- package/lib/module/components/Store.js.map +1 -0
- package/lib/module/components/Store.test.js +148 -0
- package/lib/module/components/Store.test.js.map +1 -0
- package/lib/module/events/CommandsObserver.js +19 -0
- package/lib/module/events/CommandsObserver.js.map +1 -0
- package/lib/module/events/CommandsObserver.test.js +43 -0
- package/lib/module/events/CommandsObserver.test.js.map +1 -0
- package/lib/module/events/ComponentEventsObserver.js +94 -0
- package/lib/module/events/ComponentEventsObserver.js.map +1 -0
- package/lib/module/events/ComponentEventsObserver.test.js +391 -0
- package/lib/module/events/ComponentEventsObserver.test.js.map +1 -0
- package/lib/{cjs → module}/events/EventsRegistry.js +3 -27
- package/lib/module/events/EventsRegistry.js.map +1 -0
- package/lib/module/events/EventsRegistry.test.js +131 -0
- package/lib/module/events/EventsRegistry.test.js.map +1 -0
- package/lib/module/index.js +22 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interfaces/CommandName.js +22 -0
- package/lib/module/interfaces/CommandName.js.map +1 -0
- package/lib/module/interfaces/ComponentEvents.js +2 -0
- package/lib/module/interfaces/ComponentEvents.js.map +1 -0
- package/lib/module/interfaces/EventSubscription.js +2 -0
- package/lib/module/interfaces/EventSubscription.js.map +1 -0
- package/lib/module/interfaces/Events.js +2 -0
- package/lib/module/interfaces/Events.js.map +1 -0
- package/lib/module/interfaces/Layout.js +4 -0
- package/lib/module/interfaces/Layout.js.map +1 -0
- package/lib/module/interfaces/NavigationComponent.js +21 -0
- package/lib/module/interfaces/NavigationComponent.js.map +1 -0
- package/lib/module/interfaces/NavigationComponentListener.js +4 -0
- package/lib/module/interfaces/NavigationComponentListener.js.map +1 -0
- package/lib/module/interfaces/NavigationComponentProps.js +2 -0
- package/lib/module/interfaces/NavigationComponentProps.js.map +1 -0
- package/lib/module/interfaces/NavigationFunctionComponent.js +4 -0
- package/lib/module/interfaces/NavigationFunctionComponent.js.map +1 -0
- package/lib/module/interfaces/Options.js +47 -0
- package/lib/module/interfaces/Options.js.map +1 -0
- package/lib/module/interfaces/ProcessorSubscription.js +2 -0
- package/lib/module/interfaces/ProcessorSubscription.js.map +1 -0
- package/lib/module/interfaces/Processors.js +4 -0
- package/lib/module/interfaces/Processors.js.map +1 -0
- package/lib/module/linking/DeferredLinkQueue.js +52 -0
- package/lib/module/linking/DeferredLinkQueue.js.map +1 -0
- package/lib/module/linking/DeferredLinkQueue.test.js +54 -0
- package/lib/module/linking/DeferredLinkQueue.test.js.map +1 -0
- package/lib/{cjs → module}/linking/LinkingHandler.js +43 -40
- package/lib/module/linking/LinkingHandler.js.map +1 -0
- package/lib/module/linking/LinkingHandler.test.js +384 -0
- package/lib/module/linking/LinkingHandler.test.js.map +1 -0
- package/lib/module/linking/ModalLayoutBuilder.js +56 -0
- package/lib/module/linking/ModalLayoutBuilder.js.map +1 -0
- package/lib/module/linking/ModalLayoutBuilder.test.js +154 -0
- package/lib/module/linking/ModalLayoutBuilder.test.js.map +1 -0
- package/lib/{cjs → module}/linking/RouteMatcher.js +15 -31
- package/lib/module/linking/RouteMatcher.js.map +1 -0
- package/lib/module/linking/RouteMatcher.test.js +164 -0
- package/lib/module/linking/RouteMatcher.test.js.map +1 -0
- package/lib/module/linking/URLParser.js +56 -0
- package/lib/module/linking/URLParser.js.map +1 -0
- package/lib/module/linking/URLParser.test.js +100 -0
- package/lib/module/linking/URLParser.test.js.map +1 -0
- package/lib/module/linking/types.js +4 -0
- package/lib/module/linking/types.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/processors/LayoutProcessor.js +15 -0
- package/lib/module/processors/LayoutProcessor.js.map +1 -0
- package/lib/module/processors/LayoutProcessor.test.js +53 -0
- package/lib/module/processors/LayoutProcessor.test.js.map +1 -0
- package/lib/module/processors/LayoutProcessorsStore.js +18 -0
- package/lib/module/processors/LayoutProcessorsStore.js.map +1 -0
- package/lib/module/processors/LayoutProcessorsStore.test.js +31 -0
- package/lib/module/processors/LayoutProcessorsStore.test.js.map +1 -0
- package/lib/module/processors/OptionProcessorsStore.js +19 -0
- package/lib/module/processors/OptionProcessorsStore.js.map +1 -0
- package/lib/module/processors/OptionProcessorsStore.test.js +31 -0
- package/lib/module/processors/OptionProcessorsStore.test.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/package.json +7 -12
- package/lib/cjs/Mock/Application.js +0 -67
- package/lib/cjs/Mock/ComponentProps.js +0 -16
- package/lib/cjs/Mock/Components/BottomTabs.js +0 -50
- package/lib/cjs/Mock/Components/ComponentScreen.js +0 -135
- package/lib/cjs/Mock/Components/LayoutComponent.js +0 -85
- package/lib/cjs/Mock/Components/Modals.js +0 -56
- package/lib/cjs/Mock/Components/NavigationButton.js +0 -104
- package/lib/cjs/Mock/Components/Overlays.js +0 -57
- package/lib/cjs/Mock/Components/SideMenu.js +0 -69
- package/lib/cjs/Mock/Components/Stack.js +0 -52
- package/lib/cjs/Mock/Components/TopBar.js +0 -115
- package/lib/cjs/Mock/Layouts/BottomTabsNode.js +0 -60
- package/lib/cjs/Mock/Layouts/ComponentNode.js +0 -132
- package/lib/cjs/Mock/Layouts/LayoutNodeFactory.js +0 -59
- package/lib/cjs/Mock/Layouts/Node.js +0 -32
- package/lib/cjs/Mock/Layouts/ParentNode.js +0 -99
- package/lib/cjs/Mock/Layouts/SideMenu.js +0 -112
- package/lib/cjs/Mock/Layouts/StackNode.js +0 -42
- package/lib/cjs/Mock/Stores/EventsStore.js +0 -85
- package/lib/cjs/Mock/actions/layoutActions.js +0 -47
- package/lib/cjs/Mock/connect.js +0 -31
- package/lib/cjs/Mock/constants.js +0 -31
- package/lib/cjs/Mock/index.js +0 -48
- package/lib/cjs/Mock/mocks/AppRegistryService.js +0 -31
- package/lib/cjs/Mock/mocks/NativeCommandsSender.js +0 -181
- package/lib/cjs/Mock/mocks/NativeEventsReceiver.js +0 -146
- package/lib/cjs/Navigation.js +0 -259
- package/lib/cjs/adapters/AndroidCustomRowForwarder.js +0 -84
- package/lib/cjs/adapters/AppRegistryService.js +0 -33
- package/lib/cjs/adapters/AssetResolver.js +0 -33
- package/lib/cjs/adapters/ColorService.js +0 -33
- package/lib/cjs/adapters/Constants.js +0 -43
- package/lib/cjs/adapters/NativeEventsReceiver.js +0 -99
- package/lib/cjs/adapters/NativeEventsReceiver.mock.js +0 -30
- package/lib/cjs/adapters/NativeRNNTurboEventEmitter.js +0 -27
- package/lib/cjs/adapters/NativeRNNTurboModule.js +0 -26
- package/lib/cjs/adapters/TouchablePreview.js +0 -137
- package/lib/cjs/adapters/UniqueIdProvider.js +0 -43
- package/lib/cjs/commands/Commands.js +0 -276
- package/lib/cjs/commands/Deprecations.js +0 -101
- package/lib/cjs/commands/LayoutTreeCrawler.js +0 -56
- package/lib/cjs/commands/LayoutTreeParser.js +0 -154
- package/lib/cjs/commands/LayoutType.js +0 -40
- package/lib/cjs/commands/OptionsCrawler.js +0 -106
- package/lib/cjs/components/ComponentWrapper.js +0 -114
- package/lib/cjs/components/Modal.js +0 -159
- package/lib/cjs/events/CommandsObserver.js +0 -43
- package/lib/cjs/events/ComponentEventsObserver.js +0 -128
- package/lib/cjs/index.js +0 -63
- package/lib/cjs/interfaces/CommandName.js +0 -46
- package/lib/cjs/interfaces/ComponentEvents.js +0 -1
- package/lib/cjs/interfaces/EventSubscription.js +0 -1
- package/lib/cjs/interfaces/Events.js +0 -1
- package/lib/cjs/interfaces/Layout.js +0 -16
- package/lib/cjs/interfaces/NavigationComponent.js +0 -62
- package/lib/cjs/interfaces/NavigationComponentListener.js +0 -16
- package/lib/cjs/interfaces/NavigationComponentProps.js +0 -1
- package/lib/cjs/interfaces/NavigationFunctionComponent.js +0 -16
- package/lib/cjs/interfaces/Options.js +0 -47
- package/lib/cjs/interfaces/ProcessorSubscription.js +0 -1
- package/lib/cjs/interfaces/Processors.js +0 -16
- package/lib/cjs/linking/DeferredLinkQueue.js +0 -66
- package/lib/cjs/linking/ModalLayoutBuilder.js +0 -59
- package/lib/cjs/linking/URLParser.js +0 -70
- package/lib/cjs/linking/types.js +0 -16
- package/lib/cjs/processors/LayoutProcessor.js +0 -39
- package/lib/cjs/processors/LayoutProcessorsStore.js +0 -42
- package/lib/cjs/processors/OptionProcessorsStore.js +0 -43
- package/lib/cjs/types.js +0 -1
- package/postinstall.js +0 -53
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,154 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,106 +0,0 @@
|
|
|
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,114 +0,0 @@
|
|
|
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 ComponentWrapper_exports = {};
|
|
30
|
-
__export(ComponentWrapper_exports, {
|
|
31
|
-
ComponentWrapper: () => ComponentWrapper
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(ComponentWrapper_exports);
|
|
34
|
-
var React = __toESM(require("react"), 1);
|
|
35
|
-
var import_react_lifecycles_compat = require("react-lifecycles-compat");
|
|
36
|
-
var import_hoist_non_react_statics = __toESM(require("hoist-non-react-statics"), 1);
|
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
class ComponentWrapper {
|
|
39
|
-
wrap(componentName, OriginalComponentGenerator, store, componentEventsObserver, concreteComponentProvider = OriginalComponentGenerator, ReduxProvider, reduxStore) {
|
|
40
|
-
const GeneratedComponentClass = OriginalComponentGenerator();
|
|
41
|
-
class WrappedComponent extends React.Component {
|
|
42
|
-
static getDerivedStateFromProps(nextProps, prevState) {
|
|
43
|
-
return {
|
|
44
|
-
allProps: {
|
|
45
|
-
...nextProps,
|
|
46
|
-
...store.getPropsForId(prevState.componentId)
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
_isMounted = false;
|
|
51
|
-
get isMounted() {
|
|
52
|
-
return this._isMounted;
|
|
53
|
-
}
|
|
54
|
-
constructor(props) {
|
|
55
|
-
super(props);
|
|
56
|
-
this._assertComponentId();
|
|
57
|
-
this.state = {
|
|
58
|
-
componentId: props.componentId,
|
|
59
|
-
allProps: {}
|
|
60
|
-
};
|
|
61
|
-
store.setComponentInstance(props.componentId, this);
|
|
62
|
-
}
|
|
63
|
-
setProps(newProps, callback) {
|
|
64
|
-
this.setState((prevState) => ({
|
|
65
|
-
allProps: {
|
|
66
|
-
...prevState.allProps,
|
|
67
|
-
...newProps
|
|
68
|
-
}
|
|
69
|
-
}), callback);
|
|
70
|
-
}
|
|
71
|
-
componentDidMount() {
|
|
72
|
-
this._isMounted = true;
|
|
73
|
-
store.consumePendingProps(this.state.componentId);
|
|
74
|
-
}
|
|
75
|
-
componentWillUnmount() {
|
|
76
|
-
store.clearComponent(this.state.componentId);
|
|
77
|
-
componentEventsObserver.unmounted(this.state.componentId);
|
|
78
|
-
}
|
|
79
|
-
render() {
|
|
80
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GeneratedComponentClass, {
|
|
81
|
-
...this.state.allProps,
|
|
82
|
-
componentId: this.state.componentId,
|
|
83
|
-
componentName
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
_assertComponentId() {
|
|
87
|
-
if (!this.props.componentId) {
|
|
88
|
-
throw new Error(`Component ${componentName} does not have a componentId!`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
(0, import_react_lifecycles_compat.polyfill)(WrappedComponent);
|
|
93
|
-
(0, import_hoist_non_react_statics.default)(WrappedComponent, concreteComponentProvider === OriginalComponentGenerator ? GeneratedComponentClass : concreteComponentProvider());
|
|
94
|
-
return ReduxProvider ? this.wrapWithRedux(WrappedComponent, ReduxProvider, reduxStore) : WrappedComponent;
|
|
95
|
-
}
|
|
96
|
-
wrapWithRedux(WrappedComponent, ReduxProvider, reduxStore) {
|
|
97
|
-
class ReduxWrapper extends React.Component {
|
|
98
|
-
render() {
|
|
99
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReduxProvider, {
|
|
100
|
-
store: reduxStore,
|
|
101
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WrappedComponent, {
|
|
102
|
-
...this.props
|
|
103
|
-
})
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
(0, import_hoist_non_react_statics.default)(ReduxWrapper, WrappedComponent);
|
|
108
|
-
return ReduxWrapper;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
-
0 && (module.exports = {
|
|
113
|
-
ComponentWrapper
|
|
114
|
-
});
|