repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 7.82 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"linking\"];\nimport { createComponentForStaticNavigation, createPathConfigForStaticNavigation } from '@react-navigation/core';\nimport * as React from 'react';\nimport { NavigationContainer } from \"./NavigationContainer.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function createStaticNavigation(tree) {\n const Component = createComponentForStaticNavigation(tree, 'RootNavigator');\n function Navigation(_ref, ref) {\n let {\n linking\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const linkingConfig = React.useMemo(() => {\n const screens = createPathConfigForStaticNavigation(tree, {\n initialRouteName: linking?.config?.initialRouteName\n }, linking?.enabled === 'auto');\n if (!screens) return;\n return {\n path: linking?.config?.path,\n initialRouteName: linking?.config?.initialRouteName,\n screens\n };\n }, [linking?.enabled, linking?.config?.path, linking?.config?.initialRouteName]);\n const memoizedLinking = React.useMemo(() => {\n if (!linking) {\n return undefined;\n }\n const enabled = typeof linking.enabled === 'boolean' ? linking.enabled : linkingConfig?.screens != null;\n return Object.assign({}, linking, {\n enabled,\n config: linkingConfig\n });\n }, [linking, linkingConfig]);\n if (linking?.enabled === true && linkingConfig?.screens == null) {\n throw new Error('Linking is enabled but no linking configuration was found for the screens.\\n\\n' + 'To solve this:\\n' + \"- Specify a 'linking' property for the screens you want to link to.\\n\" + \"- Or set 'linking.enabled' to 'auto' to generate paths automatically.\\n\\n\" + 'See usage guide: https://reactnavigation.org/docs/static-configuration#linking');\n }\n return _jsx(NavigationContainer, Object.assign({}, rest, {\n ref: ref,\n linking: memoizedLinking,\n children: _jsx(Component, {})\n }));\n }\n return React.forwardRef(Navigation);\n}","map":{"version":3,"names":["createComponentForStaticNavigation","createPathConfigForStaticNavigation","React","NavigationContainer","jsx","_jsx","createStaticNavigation","tree","Component","Navigation","_ref","ref","linking","rest","_objectWithoutPropertiesLoose","_excluded","linkingConfig","useMemo","screens","initialRouteName","config","enabled","path","memoizedLinking","undefined","Object","assign","Error","children","forwardRef"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/native/src/createStaticNavigation.tsx"],"sourcesContent":["import {\n createComponentForStaticNavigation,\n createPathConfigForStaticNavigation,\n type NavigationContainerRef,\n type ParamListBase,\n type StaticNavigation,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport { NavigationContainer } from './NavigationContainer';\nimport type { LinkingOptions } from './types';\n\ntype Props = Omit<\n React.ComponentProps<typeof NavigationContainer>,\n 'linking' | 'children'\n> & {\n /**\n * Options for deep linking.\n */\n linking?: Omit<LinkingOptions<ParamListBase>, 'config' | 'enabled'> & {\n /**\n * Whether deep link handling should be enabled.\n * Defaults to `true` if any `linking` options are specified, `false` otherwise.\n *\n * When 'auto' is specified, all leaf screens will get a autogenerated path.\n * The generated path will be a kebab-case version of the screen name.\n * This can be overridden for specific screens by specifying `linking` for the screen.\n */\n enabled?: 'auto' | true | false;\n /**\n * Additional configuration\n */\n config?: Omit<\n NonNullable<LinkingOptions<ParamListBase>['config']>,\n 'screens'\n >;\n };\n};\n\n/**\n * Create a navigation component from a static navigation config.\n * The returned component is a wrapper around `NavigationContainer`.\n *\n * @param tree Static navigation config.\n * @returns Navigation component to use in your app.\n */\nexport function createStaticNavigation(tree: StaticNavigation<any, any, any>) {\n const Component = createComponentForStaticNavigation(tree, 'RootNavigator');\n\n function Navigation(\n { linking, ...rest }: Props,\n ref: React.Ref<NavigationContainerRef<ParamListBase>>\n ) {\n const linkingConfig = React.useMemo(() => {\n const screens = createPathConfigForStaticNavigation(\n tree,\n { initialRouteName: linking?.config?.initialRouteName },\n linking?.enabled === 'auto'\n );\n\n if (!screens) return;\n\n return {\n path: linking?.config?.path,\n initialRouteName: linking?.config?.initialRouteName,\n screens,\n };\n }, [\n linking?.enabled,\n linking?.config?.path,\n linking?.config?.initialRouteName,\n ]);\n\n const memoizedLinking = React.useMemo(() => {\n if (!linking) {\n return undefined;\n }\n\n const enabled =\n typeof linking.enabled === 'boolean'\n ? linking.enabled\n : linkingConfig?.screens != null;\n\n return {\n ...linking,\n enabled,\n config: linkingConfig,\n };\n }, [linking, linkingConfig]);\n\n if (linking?.enabled === true && linkingConfig?.screens == null) {\n throw new Error(\n 'Linking is enabled but no linking configuration was found for the screens.\\n\\n' +\n 'To solve this:\\n' +\n \"- Specify a 'linking' property for the screens you want to link to.\\n\" +\n \"- Or set 'linking.enabled' to 'auto' to generate paths automatically.\\n\\n\" +\n 'See usage guide: https://reactnavigation.org/docs/static-configuration#linking'\n );\n }\n\n return (\n <NavigationContainer {...rest} ref={ref} linking={memoizedLinking}>\n <Component />\n </NavigationContainer>\n );\n }\n\n return React.forwardRef(Navigation);\n}\n"],"mappings":";;;;AAAA,SACEA,kCAAkC,EAClCC,mCAAmC,QAI9B,wBAAwB;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB;AAAgC,SAAAC,GAAA,IAAAC,IAAA;AAqC5D,OAAO,SAASC,sBAAsBA,CAACC,IAAqC,EAAE;EAC5E,MAAMC,SAAS,GAAGR,kCAAkC,CAACO,IAAI,EAAE,eAAe,CAAC;EAE3E,SAASE,UAAUA,CAAAC,IAAA,EAEjBC,GAAqD,EACrD;IAAA,IAFA;QAAEC;MAAwB,CAAC,GAAAF,IAAA;MAAbG,IAAA,GAAAC,6BAAA,CAAAJ,IAAA,EAAAK,SAAA;IAGd,MAAMC,aAAa,GAAGd,KAAK,CAACe,OAAO,CAAC,MAAM;MACxC,MAAMC,OAAO,GAAGjB,mCAAmC,CACjDM,IAAI,EACJ;QAAEY,gBAAgB,EAAEP,OAAO,EAAEQ,MAAM,EAAED;MAAiB,CAAC,EACvDP,OAAO,EAAES,OAAO,KAAK,MACvB,CAAC;MAED,IAAI,CAACH,OAAO,EAAE;MA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