@ohos-ports/react-native-navigation 8.9.0-beta.4 → 8.9.0-beta.5
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 +4 -8
- 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,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var Layout_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(Layout_exports);
|
|
@@ -0,0 +1,62 @@
|
|
|
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 NavigationComponent_exports = {};
|
|
30
|
+
__export(NavigationComponent_exports, {
|
|
31
|
+
NavigationComponent: () => NavigationComponent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(NavigationComponent_exports);
|
|
34
|
+
var import_react = __toESM(require("react"), 1);
|
|
35
|
+
class NavigationComponent extends import_react.default.Component {
|
|
36
|
+
/**
|
|
37
|
+
* Options used to apply a style configuration when the screen appears.
|
|
38
|
+
*
|
|
39
|
+
* This field can either contain the concrete options to be applied, or a generator function
|
|
40
|
+
* which accepts props and returns an Options object.
|
|
41
|
+
*/
|
|
42
|
+
componentWillAppear(_event) {
|
|
43
|
+
}
|
|
44
|
+
componentDidAppear(_event) {
|
|
45
|
+
}
|
|
46
|
+
componentDidDisappear(_event) {
|
|
47
|
+
}
|
|
48
|
+
navigationButtonPressed(_event) {
|
|
49
|
+
}
|
|
50
|
+
searchBarUpdated(_event) {
|
|
51
|
+
}
|
|
52
|
+
searchBarCancelPressed(_event) {
|
|
53
|
+
}
|
|
54
|
+
previewCompleted(_event) {
|
|
55
|
+
}
|
|
56
|
+
screenPopped(_event) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
NavigationComponent
|
|
62
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var NavigationComponentListener_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(NavigationComponentListener_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var NavigationFunctionComponent_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(NavigationFunctionComponent_exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
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 Options_exports = {};
|
|
20
|
+
__export(Options_exports, {
|
|
21
|
+
OptionsModalPresentationStyle: () => OptionsModalPresentationStyle,
|
|
22
|
+
OptionsModalTransitionStyle: () => OptionsModalTransitionStyle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Options_exports);
|
|
25
|
+
let OptionsModalPresentationStyle = /* @__PURE__ */ (function(OptionsModalPresentationStyle2) {
|
|
26
|
+
OptionsModalPresentationStyle2["formSheet"] = "formSheet";
|
|
27
|
+
OptionsModalPresentationStyle2["pageSheet"] = "pageSheet";
|
|
28
|
+
OptionsModalPresentationStyle2["overFullScreen"] = "overFullScreen";
|
|
29
|
+
OptionsModalPresentationStyle2["overCurrentContext"] = "overCurrentContext";
|
|
30
|
+
OptionsModalPresentationStyle2["currentContext"] = "currentContext";
|
|
31
|
+
OptionsModalPresentationStyle2["popover"] = "popover";
|
|
32
|
+
OptionsModalPresentationStyle2["fullScreen"] = "fullScreen";
|
|
33
|
+
OptionsModalPresentationStyle2["none"] = "none";
|
|
34
|
+
return OptionsModalPresentationStyle2;
|
|
35
|
+
})({});
|
|
36
|
+
let OptionsModalTransitionStyle = /* @__PURE__ */ (function(OptionsModalTransitionStyle2) {
|
|
37
|
+
OptionsModalTransitionStyle2["coverVertical"] = "coverVertical";
|
|
38
|
+
OptionsModalTransitionStyle2["crossDissolve"] = "crossDissolve";
|
|
39
|
+
OptionsModalTransitionStyle2["flipHorizontal"] = "flipHorizontal";
|
|
40
|
+
OptionsModalTransitionStyle2["partialCurl"] = "partialCurl";
|
|
41
|
+
return OptionsModalTransitionStyle2;
|
|
42
|
+
})({});
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
OptionsModalPresentationStyle,
|
|
46
|
+
OptionsModalTransitionStyle
|
|
47
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var Processors_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(Processors_exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
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 DeferredLinkQueue_exports = {};
|
|
20
|
+
__export(DeferredLinkQueue_exports, {
|
|
21
|
+
DeferredLinkQueue: () => DeferredLinkQueue
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(DeferredLinkQueue_exports);
|
|
24
|
+
class DeferredLinkQueue {
|
|
25
|
+
queue = [];
|
|
26
|
+
ready = false;
|
|
27
|
+
flushCallback = null;
|
|
28
|
+
setFlushCallback(callback) {
|
|
29
|
+
this.flushCallback = callback;
|
|
30
|
+
}
|
|
31
|
+
setReady(ready) {
|
|
32
|
+
const becameReady = !this.ready && ready;
|
|
33
|
+
this.ready = ready;
|
|
34
|
+
if (becameReady) {
|
|
35
|
+
this.flush();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
isReady() {
|
|
39
|
+
return this.ready;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Enqueue a URL for later processing. Should only be called when the
|
|
43
|
+
* queue is not ready; the handler decides when to enqueue vs process.
|
|
44
|
+
*/
|
|
45
|
+
enqueue(url) {
|
|
46
|
+
this.queue.push(url);
|
|
47
|
+
}
|
|
48
|
+
flush() {
|
|
49
|
+
if (!this.flushCallback) return;
|
|
50
|
+
const pending = [...this.queue];
|
|
51
|
+
this.queue = [];
|
|
52
|
+
for (const url of pending) {
|
|
53
|
+
this.flushCallback(url);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
clear() {
|
|
57
|
+
this.queue = [];
|
|
58
|
+
}
|
|
59
|
+
pending() {
|
|
60
|
+
return [...this.queue];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
DeferredLinkQueue
|
|
66
|
+
});
|
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
export class LinkingHandler {
|
|
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 LinkingHandler_exports = {};
|
|
20
|
+
__export(LinkingHandler_exports, {
|
|
21
|
+
LinkingHandler: () => LinkingHandler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LinkingHandler_exports);
|
|
24
|
+
var import_react_native = require("@ohos-ports/react-native");
|
|
25
|
+
var import_URLParser = require("./URLParser.js");
|
|
26
|
+
var import_RouteMatcher = require("./RouteMatcher.js");
|
|
27
|
+
var import_DeferredLinkQueue = require("./DeferredLinkQueue.js");
|
|
28
|
+
var import_ModalLayoutBuilder = require("./ModalLayoutBuilder.js");
|
|
29
|
+
class LinkingHandler {
|
|
32
30
|
config = null;
|
|
33
31
|
linkingSubscription = null;
|
|
34
32
|
rootReady = false;
|
|
35
33
|
userReadyOverride = null;
|
|
36
34
|
constructor(showModal, linkingAPI) {
|
|
37
|
-
this.urlParser = new URLParser();
|
|
38
|
-
this.routeMatcher = new RouteMatcher();
|
|
39
|
-
this.deferredQueue = new DeferredLinkQueue();
|
|
40
|
-
this.modalLayoutBuilder = new ModalLayoutBuilder();
|
|
35
|
+
this.urlParser = new import_URLParser.URLParser();
|
|
36
|
+
this.routeMatcher = new import_RouteMatcher.RouteMatcher();
|
|
37
|
+
this.deferredQueue = new import_DeferredLinkQueue.DeferredLinkQueue();
|
|
38
|
+
this.modalLayoutBuilder = new import_ModalLayoutBuilder.ModalLayoutBuilder();
|
|
41
39
|
this.showModal = showModal;
|
|
42
|
-
this.linkingAPI = linkingAPI || Linking;
|
|
43
|
-
this.deferredQueue.setFlushCallback(url => this.processURL(url));
|
|
40
|
+
this.linkingAPI = linkingAPI || import_react_native.Linking;
|
|
41
|
+
this.deferredQueue.setFlushCallback((url) => this.processURL(url));
|
|
44
42
|
}
|
|
45
43
|
configure(config) {
|
|
46
44
|
this.teardown();
|
|
@@ -50,7 +48,6 @@ export class LinkingHandler {
|
|
|
50
48
|
this.refreshReady();
|
|
51
49
|
this.subscribe();
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
/**
|
|
55
52
|
* Manually feed a URL into the pipeline as if it came from the OS.
|
|
56
53
|
* Useful for URLs received from push notifications or other sources.
|
|
@@ -63,7 +60,6 @@ export class LinkingHandler {
|
|
|
63
60
|
}
|
|
64
61
|
this.processURL(url);
|
|
65
62
|
}
|
|
66
|
-
|
|
67
63
|
/**
|
|
68
64
|
* Called by `NavigationRoot` after the first `setRoot` resolves. Subsequent
|
|
69
65
|
* calls are no-ops.
|
|
@@ -73,7 +69,6 @@ export class LinkingHandler {
|
|
|
73
69
|
this.rootReady = true;
|
|
74
70
|
this.refreshReady();
|
|
75
71
|
}
|
|
76
|
-
|
|
77
72
|
/**
|
|
78
73
|
* Public toggle for the app-supplied readiness gate. Overrides the
|
|
79
74
|
* `config.isReady` predicate from the moment it's first called.
|
|
@@ -82,7 +77,6 @@ export class LinkingHandler {
|
|
|
82
77
|
this.userReadyOverride = ready;
|
|
83
78
|
this.refreshReady();
|
|
84
79
|
}
|
|
85
|
-
|
|
86
80
|
/**
|
|
87
81
|
* Resolve a URL to a `RouteMatch` without side effects. Returns `null`
|
|
88
82
|
* when the URL doesn't match any configured prefix or route.
|
|
@@ -103,10 +97,10 @@ export class LinkingHandler {
|
|
|
103
97
|
this.userReadyOverride = null;
|
|
104
98
|
}
|
|
105
99
|
subscribe() {
|
|
106
|
-
this.linkingSubscription = this.linkingAPI.addEventListener(
|
|
100
|
+
this.linkingSubscription = this.linkingAPI.addEventListener("url", (event) => {
|
|
107
101
|
this.handleURL(event.url);
|
|
108
102
|
});
|
|
109
|
-
this.linkingAPI.getInitialURL().then(url => {
|
|
103
|
+
this.linkingAPI.getInitialURL().then((url) => {
|
|
110
104
|
if (url) this.handleURL(url);
|
|
111
105
|
});
|
|
112
106
|
}
|
|
@@ -136,4 +130,7 @@ export class LinkingHandler {
|
|
|
136
130
|
this.deferredQueue.setReady(this.isReady());
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
|
-
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
LinkingHandler
|
|
136
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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 ModalLayoutBuilder_exports = {};
|
|
20
|
+
__export(ModalLayoutBuilder_exports, {
|
|
21
|
+
ModalLayoutBuilder: () => ModalLayoutBuilder
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ModalLayoutBuilder_exports);
|
|
24
|
+
const RESERVED_PROP_NAMES = /* @__PURE__ */ new Set(["ref", "key"]);
|
|
25
|
+
class ModalLayoutBuilder {
|
|
26
|
+
build(match) {
|
|
27
|
+
return {
|
|
28
|
+
stack: {
|
|
29
|
+
children: match.path.map((segment) => ({
|
|
30
|
+
component: {
|
|
31
|
+
name: segment.screen,
|
|
32
|
+
passProps: this.mergeProps(segment, match.queryParams)
|
|
33
|
+
}
|
|
34
|
+
}))
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
mergeProps(segment, queryParams) {
|
|
39
|
+
const merged = {
|
|
40
|
+
...queryParams,
|
|
41
|
+
...segment.params
|
|
42
|
+
};
|
|
43
|
+
const safe = {};
|
|
44
|
+
for (const key of Object.keys(merged)) {
|
|
45
|
+
if (RESERVED_PROP_NAMES.has(key)) {
|
|
46
|
+
if (__DEV__) {
|
|
47
|
+
console.warn(`[RNN linking] Dropping reserved prop "${key}" from passProps for screen "${segment.screen}". Rename the URL parameter to avoid conflicting with React-reserved names.`);
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
safe[key] = merged[key];
|
|
52
|
+
}
|
|
53
|
+
return safe;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
ModalLayoutBuilder
|
|
59
|
+
});
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 RouteMatcher_exports = {};
|
|
20
|
+
__export(RouteMatcher_exports, {
|
|
21
|
+
RouteMatcher: () => RouteMatcher
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(RouteMatcher_exports);
|
|
24
|
+
class RouteMatcher {
|
|
11
25
|
routeTree = null;
|
|
12
26
|
buildRouteTree(screens) {
|
|
13
27
|
const nodes = [];
|
|
@@ -19,14 +33,13 @@ export class RouteMatcher {
|
|
|
19
33
|
setRouteTree(tree) {
|
|
20
34
|
this.routeTree = tree;
|
|
21
35
|
}
|
|
22
|
-
|
|
23
36
|
/**
|
|
24
37
|
* Match a parsed path (e.g. `"user/42"`) against the configured tree.
|
|
25
38
|
* Returns the matched chain or `null` when no route matches.
|
|
26
39
|
*/
|
|
27
40
|
match(path, url, queryParams) {
|
|
28
41
|
if (!this.routeTree) return null;
|
|
29
|
-
const pathSegments = path.split(
|
|
42
|
+
const pathSegments = path.split("/").filter((s) => s.length > 0);
|
|
30
43
|
const result = this.matchRecursive(pathSegments, 0, this.routeTree);
|
|
31
44
|
if (!result) return null;
|
|
32
45
|
return {
|
|
@@ -36,7 +49,7 @@ export class RouteMatcher {
|
|
|
36
49
|
};
|
|
37
50
|
}
|
|
38
51
|
buildNode(screenName, config) {
|
|
39
|
-
if (typeof config ===
|
|
52
|
+
if (typeof config === "string") {
|
|
40
53
|
return {
|
|
41
54
|
screen: screenName,
|
|
42
55
|
pattern: config,
|
|
@@ -53,7 +66,7 @@ export class RouteMatcher {
|
|
|
53
66
|
};
|
|
54
67
|
}
|
|
55
68
|
splitPattern(pattern) {
|
|
56
|
-
return pattern.split(
|
|
69
|
+
return pattern.split("/").filter((s) => s.length > 0);
|
|
57
70
|
}
|
|
58
71
|
matchRecursive(pathSegments, offset, nodes) {
|
|
59
72
|
for (const node of nodes) {
|
|
@@ -80,7 +93,7 @@ export class RouteMatcher {
|
|
|
80
93
|
for (let i = 0; i < patternSegments.length; i++) {
|
|
81
94
|
const pattern = patternSegments[i];
|
|
82
95
|
const actual = pathSegments[offset + i];
|
|
83
|
-
if (pattern.startsWith(
|
|
96
|
+
if (pattern.startsWith(":")) {
|
|
84
97
|
params[pattern.slice(1)] = actual;
|
|
85
98
|
} else if (pattern !== actual) {
|
|
86
99
|
return null;
|
|
@@ -101,4 +114,7 @@ export class RouteMatcher {
|
|
|
101
114
|
return null;
|
|
102
115
|
}
|
|
103
116
|
}
|
|
104
|
-
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
RouteMatcher
|
|
120
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
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 URLParser_exports = {};
|
|
20
|
+
__export(URLParser_exports, {
|
|
21
|
+
URLParser: () => URLParser
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(URLParser_exports);
|
|
24
|
+
class URLParser {
|
|
25
|
+
stripPrefix(url, prefixes) {
|
|
26
|
+
const sorted = [...prefixes].sort((a, b) => b.length - a.length);
|
|
27
|
+
for (const prefix of sorted) {
|
|
28
|
+
if (url.startsWith(prefix)) {
|
|
29
|
+
return url.slice(prefix.length);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
parse(url, prefixes) {
|
|
35
|
+
const stripped = this.stripPrefix(url, prefixes);
|
|
36
|
+
if (stripped === null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const withoutFragment = stripped.split("#", 1)[0];
|
|
40
|
+
const [pathPart, queryPart] = withoutFragment.split("?", 2);
|
|
41
|
+
const path = pathPart.split("/").filter((s) => s.length > 0).map((segment) => safeDecode(segment)).join("/");
|
|
42
|
+
const queryParams = {};
|
|
43
|
+
if (queryPart) {
|
|
44
|
+
for (const pair of queryPart.split("&")) {
|
|
45
|
+
if (!pair) continue;
|
|
46
|
+
const eqIndex = pair.indexOf("=");
|
|
47
|
+
const rawKey = eqIndex === -1 ? pair : pair.slice(0, eqIndex);
|
|
48
|
+
const rawValue = eqIndex === -1 ? "" : pair.slice(eqIndex + 1);
|
|
49
|
+
const key = safeDecode(rawKey);
|
|
50
|
+
if (!key) continue;
|
|
51
|
+
queryParams[key] = safeDecode(rawValue);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
path,
|
|
56
|
+
queryParams
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function safeDecode(value) {
|
|
61
|
+
try {
|
|
62
|
+
return decodeURIComponent(value);
|
|
63
|
+
} catch {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
URLParser
|
|
70
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,39 @@
|
|
|
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 LayoutProcessor_exports = {};
|
|
20
|
+
__export(LayoutProcessor_exports, {
|
|
21
|
+
LayoutProcessor: () => LayoutProcessor
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LayoutProcessor_exports);
|
|
24
|
+
class LayoutProcessor {
|
|
25
|
+
constructor(layoutProcessorsStore) {
|
|
26
|
+
this.layoutProcessorsStore = layoutProcessorsStore;
|
|
27
|
+
}
|
|
28
|
+
process(layout, commandName) {
|
|
29
|
+
const processors = this.layoutProcessorsStore.getProcessors();
|
|
30
|
+
processors.forEach((processor) => {
|
|
31
|
+
layout = processor(layout, commandName);
|
|
32
|
+
});
|
|
33
|
+
return layout;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
LayoutProcessor
|
|
39
|
+
});
|