70 lines
2.9 KiB
JavaScript
70 lines
2.9 KiB
JavaScript
// Module ID: 1597
|
|
// Function ID: 1598
|
|
// Name: createStandardNavigationFactories
|
|
// Dependencies: [109, 19, 21, 1502, 1598, 1600]
|
|
// Exports: createStandardNavigationFactories
|
|
|
|
// Module 1597 (createStandardNavigationFactories)
|
|
import _objectWithoutProperties from "_objectWithoutProperties";
|
|
import noop from "noop";
|
|
import { jsx } from "jsxProd";
|
|
|
|
const require = arg1;
|
|
let closure_2 = ["children", "id", "initialRouteName", "layout", "screenLayout", "screenListeners", "screenOptions", "UNSTABLE_routeNamesChangeBehavior", "UNSTABLE_router"];
|
|
|
|
export const createStandardNavigationFactories = function createStandardNavigationFactories(arg0, arg1, arg2) {
|
|
let closure_2;
|
|
let type;
|
|
let version;
|
|
const _require = arg1;
|
|
let dependencyMap = arg2;
|
|
({ type, version, NavigatorContent: closure_2 } = arg0);
|
|
if ("standard" !== type) {
|
|
let str3 = "unknown type.";
|
|
if (typeof type === "string") {
|
|
const _HermesInternal2 = HermesInternal;
|
|
str3 = "type \"" + type + "\".";
|
|
}
|
|
const error = new Error("createStandardNavigationFactories only works with standard navigator objects, but got navigator of " + str3);
|
|
throw error;
|
|
} else if (1 !== version) {
|
|
const _Error = Error;
|
|
const _HermesInternal = HermesInternal;
|
|
const error1 = new Error("createStandardNavigationFactories only works with version 1 of standard navigator objects, but got version " + version + ".");
|
|
throw error1;
|
|
} else {
|
|
let obj = { createNavigator: null, createScreen: null };
|
|
obj[0] = _require(1502).createNavigatorFactory(function StandardNavigationNavigator(UNSTABLE_routeNamesChangeBehavior) {
|
|
let obj = callback(1502);
|
|
navigationBuilder = obj.useNavigationBuilder(navigationBuilder, UNSTABLE_routeNamesChangeBehavior);
|
|
const dependencyMap = callback(1598).useBuildHref();
|
|
let tmp2 = callback(1600);
|
|
let flag = tmp2.useMemoArray;
|
|
if (!("preloadedRoutes" in navigationBuilder.state)) {
|
|
let routes = navigationBuilder.state.routes;
|
|
const flagResult = flag(routes.map((key) => {
|
|
const tmp = callback(key.name, key.params);
|
|
const items = [{ key: key.key, name: key.name, params: key.params, href: tmp }, ];
|
|
const items1 = [, , , ];
|
|
({ key: arr2[0], name: arr2[1], params: arr2[2] } = key);
|
|
items1[3] = tmp;
|
|
items[1] = items1;
|
|
return items;
|
|
}));
|
|
let closure_2 = flagResult;
|
|
let items = [navigationBuilder.state.index, flagResult];
|
|
obj = {};
|
|
const routes2 = outer1_4.useMemo(() => ({ index: navigationBuilder.state.index, routes: closure_2 }), items).routes;
|
|
tmp2 = routes2[Symbol.iterator]();
|
|
flag = true;
|
|
} else {
|
|
const _Array = Array;
|
|
}
|
|
routes = navigationBuilder.state.routes;
|
|
routes = routes.concat(navigationBuilder.state.preloadedRoutes);
|
|
});
|
|
const obj2 = _require(1502);
|
|
obj[1] = _require(1502).createScreenFactory();
|
|
return obj;
|
|
}
|
|
};
|