@react-navigation/native 8.0.0-alpha.4 → 8.0.0-alpha.41
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/android/build.gradle +4 -6
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +20 -9
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +61 -18
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +39 -14
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +14 -7
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- package/assets/fonts/MaterialSymbolsOutlined.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
- package/ios/ReactNavigationCornerInsetView.h +14 -0
- package/ios/ReactNavigationCornerInsetView.mm +182 -0
- package/ios/ReactNavigationCornerInsetView.swift +193 -0
- package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
- package/ios/ReactNavigationCornerInsetViewState.h +19 -0
- package/ios/ReactNavigationSFSymbolView.mm +22 -9
- package/ios/ReactNavigationSFSymbolView.swift +355 -65
- package/lib/module/Link.js +80 -24
- package/lib/module/Link.js.map +1 -1
- package/lib/module/Link.native.js +72 -0
- package/lib/module/Link.native.js.map +1 -0
- package/lib/module/NavigationContainer.js +77 -33
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/__stubs__/createStackNavigator.js +10 -4
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -1
- package/lib/module/checkSerializable.js +180 -0
- package/lib/module/checkSerializable.js.map +1 -0
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/constants.native.js +6 -0
- package/lib/module/constants.native.js.map +1 -0
- package/lib/module/createMemoryHistory.js +23 -7
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStandardNavigationFactories.js +99 -0
- package/lib/module/createStandardNavigationFactories.js.map +1 -0
- package/lib/module/createStaticNavigation.js +5 -4
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/extractPathFromURL.js +2 -2
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/getStateBreadcrumb.js +37 -0
- package/lib/module/getStateBreadcrumb.js.map +1 -0
- package/lib/module/getStateFromHref.js +2 -2
- package/lib/module/getStateFromHref.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +69 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +12 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/MaterialSymbol.android.js +7 -16
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbol.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +7 -4
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/lib/module/native/SFSymbol.ios.js +37 -18
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbol.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +31 -15
- package/lib/module/server/ServerContext.js.map +1 -0
- package/lib/module/server/index.js +21 -0
- package/lib/module/server/index.js.map +1 -0
- package/lib/module/theming/DarkTheme.js +5 -5
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/LightTheme.js +16 -0
- package/lib/module/theming/LightTheme.js.map +1 -0
- package/lib/module/theming/MaterialFallbackTheme.js +28 -0
- package/lib/module/theming/MaterialFallbackTheme.js.map +1 -0
- package/lib/module/theming/MaterialTheme.android.js +33 -0
- package/lib/module/theming/MaterialTheme.android.js.map +1 -0
- package/lib/module/theming/MaterialTheme.js +4 -0
- package/lib/module/theming/MaterialTheme.js.map +1 -0
- package/lib/module/theming/fonts.js +15 -54
- package/lib/module/theming/fonts.js.map +1 -1
- package/lib/module/theming/fonts.native.js +42 -0
- package/lib/module/theming/fonts.native.js.map +1 -0
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useBackButton.native.js +4 -1
- package/lib/module/useBackButton.native.js.map +1 -1
- package/lib/module/useDeepStableValue.js +12 -0
- package/lib/module/useDeepStableValue.js.map +1 -0
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useLinkBuilder.js +8 -15
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +150 -68
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +1 -1
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +203 -32
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +25 -8
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useLocale.js +1 -1
- package/lib/module/useLocale.js.map +1 -1
- package/lib/module/useMemoArray.js +25 -0
- package/lib/module/useMemoArray.js.map +1 -0
- package/lib/module/useRoutePath.js +1 -1
- package/lib/module/useRoutePath.js.map +1 -1
- package/lib/module/useScrollToTop.js +3 -8
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +8 -6
- package/lib/module/useThenable.js.map +1 -1
- package/lib/typescript/src/Link.d.ts +17 -9
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/Link.native.d.ts +4 -0
- package/lib/typescript/src/Link.native.d.ts.map +1 -0
- package/lib/typescript/src/LinkingContext.d.ts +1 -1
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +19 -8
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +6 -9
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/checkSerializable.d.ts +12 -0
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +4 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/constants.native.d.ts +4 -0
- package/lib/typescript/src/constants.native.d.ts.map +1 -0
- package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
- package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
- package/lib/typescript/src/createStandardNavigationFactories.d.ts +33 -0
- package/lib/typescript/src/createStandardNavigationFactories.d.ts.map +1 -0
- package/lib/typescript/src/createStaticNavigation.d.ts +7 -7
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
- package/lib/typescript/src/getStateBreadcrumb.d.ts +3 -0
- package/lib/typescript/src/getStateBreadcrumb.d.ts.map +1 -0
- package/lib/typescript/src/getStateFromHref.d.ts +3 -3
- package/lib/typescript/src/getStateFromHref.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -14
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +32 -0
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts +9 -4
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +8 -3
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +3 -3
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/native/SFSymbol.d.ts +8 -3
- package/lib/typescript/src/native/SFSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbol.ios.d.ts +9 -4
- package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +27 -14
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/types.d.ts +241 -45
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/{ServerContext.d.ts → server/ServerContext.d.ts} +1 -4
- package/lib/typescript/src/server/ServerContext.d.ts.map +1 -0
- package/lib/typescript/src/server/index.d.ts +10 -0
- package/lib/typescript/src/server/index.d.ts.map +1 -0
- package/lib/typescript/src/theming/DarkTheme.d.ts +4 -38
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/LightTheme.d.ts +30 -0
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/{DefaultTheme.d.ts → MaterialFallbackTheme.d.ts} +25 -30
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +115 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts +2 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/fonts.d.ts +0 -34
- package/lib/typescript/src/theming/fonts.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.native.d.ts +36 -0
- package/lib/typescript/src/theming/fonts.native.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +27 -21
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.d.ts +1 -1
- package/lib/typescript/src/useBackButton.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.native.d.ts.map +1 -1
- package/lib/typescript/src/useDeepStableValue.d.ts +2 -0
- package/lib/typescript/src/useDeepStableValue.d.ts.map +1 -0
- package/lib/typescript/src/useDocumentTitle.d.ts +2 -2
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +56 -68
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts +36 -12
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +7 -45
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +9 -83
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useLocale.d.ts +1 -1
- package/lib/typescript/src/useMemoArray.d.ts +2 -0
- package/lib/typescript/src/useMemoArray.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts +0 -2
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
- package/lib/typescript/src/useThenable.d.ts +1 -1
- package/lib/typescript/src/useThenable.d.ts.map +1 -1
- package/package.json +48 -23
- package/src/Link.native.tsx +69 -0
- package/src/Link.tsx +126 -37
- package/src/NavigationContainer.tsx +134 -64
- package/src/__stubs__/createStackNavigator.tsx +19 -17
- package/src/checkSerializable.tsx +246 -0
- package/src/constants.native.tsx +10 -0
- package/src/constants.tsx +5 -0
- package/src/createMemoryHistory.tsx +28 -7
- package/src/createStandardNavigationFactories.tsx +219 -0
- package/src/createStaticNavigation.tsx +13 -17
- package/src/extractPathFromURL.tsx +5 -3
- package/src/getStateBreadcrumb.tsx +44 -0
- package/src/getStateFromHref.tsx +8 -3
- package/src/index.tsx +11 -2
- package/src/native/CornerInset.ios.tsx +87 -0
- package/src/native/CornerInset.tsx +44 -0
- package/src/native/MaterialSymbol.android.tsx +11 -22
- package/src/native/MaterialSymbol.tsx +7 -2
- package/src/native/MaterialSymbolData.tsx +166 -0
- package/src/native/MaterialSymbolViewNativeComponent.ts +7 -4
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/src/native/SFSymbol.ios.tsx +80 -18
- package/src/native/SFSymbol.tsx +7 -2
- package/src/native/SFSymbolViewNativeComponent.ts +31 -15
- package/src/native/types.tsx +297 -47
- package/src/{ServerContext.tsx → server/ServerContext.tsx} +1 -4
- package/src/server/index.tsx +19 -0
- package/src/theming/DarkTheme.tsx +4 -4
- package/src/theming/{DefaultTheme.tsx → LightTheme.tsx} +4 -4
- package/src/theming/MaterialFallbackTheme.tsx +29 -0
- package/src/theming/MaterialTheme.android.tsx +45 -0
- package/src/theming/MaterialTheme.tsx +4 -0
- package/src/theming/fonts.native.tsx +41 -0
- package/src/theming/fonts.tsx +15 -54
- package/src/types.tsx +52 -45
- package/src/useBackButton.native.tsx +2 -0
- package/src/useBackButton.tsx +2 -2
- package/src/useDeepStableValue.tsx +12 -0
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +16 -23
- package/src/useLinkProps.tsx +379 -126
- package/src/useLinkTo.tsx +1 -1
- package/src/useLinking.native.tsx +64 -35
- package/src/useLinking.tsx +323 -47
- package/src/useLocale.tsx +1 -1
- package/src/useMemoArray.tsx +41 -0
- package/src/useRoutePath.tsx +1 -1
- package/src/useScrollToTop.tsx +3 -9
- package/src/useThenable.tsx +9 -7
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/results.bin +0 -1
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/results.bin +0 -1
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/BuildConfig.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$WhenMappings.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$getImageSource$1.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypeface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypefaceResult.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolView.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/ReactNavigationPackage.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/org/reactnavigation/BuildConfig.java +0 -10
- package/android/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.java +0 -39
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +0 -45
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.java +0 -22
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +0 -39
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -20
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec-generated.cpp +0 -32
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec.h +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.cpp +0 -23
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.h +0 -25
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.cpp +0 -17
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.h +0 -30
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.cpp +0 -106
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -118
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI.h +0 -71
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.cpp +0 -18
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.h +0 -43
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.cpp +0 -16
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.h +0 -22
- package/android/build/generated/source/codegen/schema.json +0 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/lib/module/ServerContainer.js +0 -55
- package/lib/module/ServerContainer.js.map +0 -1
- package/lib/module/ServerContext.js.map +0 -1
- package/lib/module/__stubs__/window.js +0 -75
- package/lib/module/__stubs__/window.js.map +0 -1
- package/lib/module/theming/DefaultTheme.js +0 -16
- package/lib/module/theming/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/ServerContainer.d.ts +0 -14
- package/lib/typescript/src/ServerContainer.d.ts.map +0 -1
- package/lib/typescript/src/ServerContext.d.ts.map +0 -1
- package/lib/typescript/src/__stubs__/window.d.ts +0 -18
- package/lib/typescript/src/__stubs__/window.d.ts.map +0 -1
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +0 -1
- package/src/ServerContainer.tsx +0 -57
- package/src/__stubs__/window.tsx +0 -77
- /package/lib/module/{ServerContext.js → server/ServerContext.js} +0 -0
package/lib/module/Link.js
CHANGED
|
@@ -2,61 +2,117 @@
|
|
|
2
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { Platform, Text } from 'react-native';
|
|
6
5
|
import { useLinkProps } from "./useLinkProps.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
/**
|
|
8
8
|
* Component to render link to another screen using a path.
|
|
9
9
|
* Uses an anchor tag on the web.
|
|
10
10
|
*
|
|
11
|
+
* @param props.in Name of the current or parent screen whose navigator contains the target screen.
|
|
11
12
|
* @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
|
|
12
13
|
* @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
|
|
13
14
|
* @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
|
|
14
|
-
* @param props.action Optional action to
|
|
15
|
+
* @param props.action Optional action to override the in-page navigation. The `href` is still derived from `screen`, so this can be used to render a link while dispatching a different action (e.g. a `replace`).
|
|
15
16
|
* @param props.children Child elements to render the content.
|
|
16
17
|
*/
|
|
17
18
|
export function Link({
|
|
19
|
+
in: parent,
|
|
18
20
|
screen,
|
|
19
21
|
params,
|
|
20
22
|
action,
|
|
21
23
|
href,
|
|
24
|
+
target,
|
|
25
|
+
disabled,
|
|
26
|
+
id,
|
|
27
|
+
testID,
|
|
28
|
+
onPress,
|
|
29
|
+
className,
|
|
22
30
|
style,
|
|
23
|
-
|
|
31
|
+
children,
|
|
32
|
+
'aria-label': ariaLabel,
|
|
33
|
+
'aria-busy': ariaBusy,
|
|
34
|
+
'aria-expanded': ariaExpanded,
|
|
35
|
+
'aria-hidden': ariaHidden,
|
|
36
|
+
'aria-labelledby': ariaLabelledBy,
|
|
37
|
+
'aria-live': ariaLive
|
|
24
38
|
}) {
|
|
25
|
-
|
|
26
|
-
colors,
|
|
27
|
-
fonts
|
|
28
|
-
} = useTheme();
|
|
29
|
-
// @ts-expect-error: This is already type-checked by the prop types
|
|
39
|
+
// @ts-expect-error: destructuring loses the relationship between target props
|
|
30
40
|
const props = useLinkProps({
|
|
41
|
+
in: parent,
|
|
31
42
|
screen,
|
|
32
43
|
params,
|
|
33
44
|
action,
|
|
34
45
|
href
|
|
35
46
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
|
|
48
|
+
// Keep usage of `useTheme` after `useLinkProps`
|
|
49
|
+
// This ensures proper error when used outside of navigation container
|
|
50
|
+
const {
|
|
51
|
+
colors,
|
|
52
|
+
fonts
|
|
53
|
+
} = useTheme();
|
|
54
|
+
if (typeof colors.primary !== 'string') {
|
|
55
|
+
throw new Error('Invalid color format.');
|
|
56
|
+
}
|
|
57
|
+
const onClick = e => {
|
|
58
|
+
if (disabled) {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
return;
|
|
39
62
|
}
|
|
63
|
+
onPress?.(e);
|
|
40
64
|
|
|
41
65
|
// Let user prevent default behavior
|
|
42
66
|
if (!e.defaultPrevented) {
|
|
43
67
|
props.onPress(e);
|
|
44
68
|
}
|
|
45
69
|
};
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
return /*#__PURE__*/_jsx("a", {
|
|
71
|
+
"aria-busy": ariaBusy,
|
|
72
|
+
"aria-disabled": disabled,
|
|
73
|
+
"aria-expanded": ariaExpanded,
|
|
74
|
+
"aria-hidden": ariaHidden,
|
|
75
|
+
"aria-label": ariaLabel,
|
|
76
|
+
"aria-labelledby": ariaLabelledBy,
|
|
77
|
+
"aria-live": ariaLive,
|
|
78
|
+
id: id,
|
|
79
|
+
"data-testid": testID,
|
|
80
|
+
tabIndex: props.href == null ? 0 : undefined,
|
|
81
|
+
target: target,
|
|
82
|
+
role: props.role,
|
|
83
|
+
href: props.href,
|
|
84
|
+
onAuxClick: disabled ? e => {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
} : undefined,
|
|
88
|
+
onClick: onClick,
|
|
89
|
+
onKeyDown: props.href == null ? e => {
|
|
90
|
+
// On browser, pressing Enter on a link triggers a click event
|
|
91
|
+
// So we simulate browser behavior when href is not provided
|
|
92
|
+
if (e.key === 'Enter') {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.currentTarget.click();
|
|
55
95
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
96
|
+
} : undefined,
|
|
97
|
+
className: className,
|
|
98
|
+
style: {
|
|
99
|
+
backgroundColor: 'transparent',
|
|
100
|
+
boxSizing: 'border-box',
|
|
101
|
+
color: colors.primary,
|
|
102
|
+
cursor: disabled ? 'default' : 'pointer',
|
|
103
|
+
display: 'inline',
|
|
104
|
+
fontSize: 14,
|
|
105
|
+
margin: 0,
|
|
106
|
+
overflowWrap: 'break-word',
|
|
107
|
+
padding: 0,
|
|
108
|
+
position: 'relative',
|
|
109
|
+
textAlign: 'start',
|
|
110
|
+
textDecoration: 'none',
|
|
111
|
+
whiteSpace: 'pre-wrap',
|
|
112
|
+
...fonts.regular,
|
|
113
|
+
...style
|
|
114
|
+
},
|
|
115
|
+
children: children
|
|
60
116
|
});
|
|
61
117
|
}
|
|
62
118
|
//# sourceMappingURL=Link.js.map
|
package/lib/module/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTheme","React","
|
|
1
|
+
{"version":3,"names":["useTheme","React","useLinkProps","jsx","_jsx","Link","in","parent","screen","params","action","href","target","disabled","id","testID","onPress","className","style","children","ariaLabel","ariaBusy","ariaExpanded","ariaHidden","ariaLabelledBy","ariaLive","props","colors","fonts","primary","Error","onClick","e","preventDefault","stopPropagation","defaultPrevented","tabIndex","undefined","role","onAuxClick","onKeyDown","key","currentTarget","click","backgroundColor","boxSizing","color","cursor","display","fontSize","margin","overflowWrap","padding","position","textAlign","textDecoration","whiteSpace","regular"],"sourceRoot":"../../src","sources":["Link.tsx"],"mappings":";;AAAA,SAA6BA,QAAQ,QAAQ,wBAAwB;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAG9B,SAAyBC,YAAY,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,IAAIA,CAMlB;EACAC,EAAE,EAAEC,MAAM;EACVC,MAAM;EACNC,MAAM;EACNC,MAAM;EACNC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,EAAE;EACFC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC,KAAK;EACLC,QAAQ;EACR,YAAY,EAAEC,SAAS;EACvB,WAAW,EAAEC,QAAQ;EACrB,eAAe,EAAEC,YAAY;EAC7B,aAAa,EAAEC,UAAU;EACzB,iBAAiB,EAAEC,cAAc;EACjC,WAAW,E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EACPd,KAAK,CAACf,IAAI,IAAI,IAAI,GACbqB,CAAC,IAAK;MACL;MACA;MACA,IAAIA,CAAC,CAACS,GAAG,KAAK,OAAO,EAAE;QACrBT,CAAC,CAACC,cAAc,CAAC,CAAC;QAClBD,CAAC,CAACU,aAAa,CAACC,KAAK,CAAC,CAAC;MACzB;IACF,CAAC,GACDN,SACL;IACDpB,SAAS,EAAEA,SAAU;IACrBC,KAAK,EAAE;MACL0B,eAAe,EAAE,aAAa;MAC9BC,SAAS,EAAE,YAAY;MACvBC,KAAK,EAAEnB,MAAM,CAACE,OAAO;MACrBkB,MAAM,EAAElC,QAAQ,GAAG,SAAS,GAAG,SAAS;MACxCmC,OAAO,EAAE,QAAQ;MACjBC,QAAQ,EAAE,EAAE;MACZC,MAAM,EAAE,CAAC;MACTC,YAAY,EAAE,YAAY;MAC1BC,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAE,UAAU;MACpBC,SAAS,EAAE,OAAO;MAClBC,cAAc,EAAE,MAAM;MACtBC,UAAU,EAAE,UAAU;MACtB,GAAG5B,KAAK,CAAC6B,OAAO;MAChB,GAAGvC;IACL,CAAE;IAAAC,QAAA,EAEDA;EAAQ,CACR,CAAC;AAER","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '@react-navigation/core';
|
|
4
|
+
import { Text } from 'react-native';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line import-x/extensions
|
|
7
|
+
|
|
8
|
+
import { useLinkProps } from "./useLinkProps.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function Link({
|
|
11
|
+
in: parent,
|
|
12
|
+
screen,
|
|
13
|
+
params,
|
|
14
|
+
action,
|
|
15
|
+
href,
|
|
16
|
+
style,
|
|
17
|
+
disabled,
|
|
18
|
+
children,
|
|
19
|
+
onPress,
|
|
20
|
+
id,
|
|
21
|
+
numberOfLines,
|
|
22
|
+
testID,
|
|
23
|
+
'aria-label': ariaLabel,
|
|
24
|
+
'aria-busy': ariaBusy,
|
|
25
|
+
'aria-expanded': ariaExpanded,
|
|
26
|
+
'aria-hidden': ariaHidden,
|
|
27
|
+
'aria-labelledby': ariaLabelledBy,
|
|
28
|
+
'aria-live': ariaLive
|
|
29
|
+
}) {
|
|
30
|
+
// @ts-expect-error: destructuring loses the relationship between target props
|
|
31
|
+
const props = useLinkProps({
|
|
32
|
+
in: parent,
|
|
33
|
+
screen,
|
|
34
|
+
params,
|
|
35
|
+
action,
|
|
36
|
+
href
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Keep usage of `useTheme` after `useLinkProps`
|
|
40
|
+
// This ensures proper error when used outside of navigation container
|
|
41
|
+
const {
|
|
42
|
+
colors,
|
|
43
|
+
fonts
|
|
44
|
+
} = useTheme();
|
|
45
|
+
const onLinkPress = e => {
|
|
46
|
+
onPress?.(e);
|
|
47
|
+
|
|
48
|
+
// Let user prevent default behavior
|
|
49
|
+
if (!e.defaultPrevented) {
|
|
50
|
+
props.onPress(e);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
54
|
+
...props,
|
|
55
|
+
"aria-busy": ariaBusy,
|
|
56
|
+
"aria-expanded": ariaExpanded,
|
|
57
|
+
"aria-hidden": ariaHidden,
|
|
58
|
+
"aria-label": ariaLabel,
|
|
59
|
+
accessibilityLabelledBy: ariaLabelledBy,
|
|
60
|
+
accessibilityLiveRegion: ariaLive === 'off' ? 'none' : ariaLive,
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
id: id,
|
|
63
|
+
testID: testID,
|
|
64
|
+
numberOfLines: numberOfLines,
|
|
65
|
+
onPress: onLinkPress,
|
|
66
|
+
style: [{
|
|
67
|
+
color: colors.primary
|
|
68
|
+
}, fonts.regular, style],
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Link.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useTheme","Text","useLinkProps","jsx","_jsx","Link","in","parent","screen","params","action","href","style","disabled","children","onPress","id","numberOfLines","testID","ariaLabel","ariaBusy","ariaExpanded","ariaHidden","ariaLabelledBy","ariaLive","props","colors","fonts","onLinkPress","e","defaultPrevented","accessibilityLabelledBy","accessibilityLiveRegion","color","primary","regular"],"sourceRoot":"../../src","sources":["Link.native.tsx"],"mappings":";;AAAA,SAA6BA,QAAQ,QAAQ,wBAAwB;AACrE,SAAqCC,IAAI,QAAQ,cAAc;;AAE/D;;AAEA,SAASC,YAAY,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,OAAO,SAASC,IAAIA,CAMlB;EACAC,EAAE,EAAEC,MAAM;EACVC,MAAM;EACNC,MAAM;EACNC,MAAM;EACNC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,EAAE;EACFC,aAAa;EACbC,MAAM;EACN,YAAY,EAAEC,SAAS;EACvB,WAAW,EAAEC,QAAQ;EACrB,eAAe,EAAEC,YAAY;EAC7B,aAAa,EAAEC,UAAU;EACzB,iBAAiB,EAAEC,cAAc;EACjC,WAAW,EAAEC;AACc,CAAC,EAAE;EAC9B;EACA,MAAMC,KAAK,GAAGvB,YAAY,CAAC;IAAEI,EAAE,EAAEC,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAK,CAAC,CAAC;;EAExE;EACA;EACA,MAAM;IAAEe,MAAM;IAAEC;EAAM,CAAC,GAAG3B,QAAQ,CAAC,CAAC;EAEpC,MAAM4B,WAAW,GAAIC,CAAwB,IAAK;IAChDd,OAAO,GAAGc,CAAC,CAAC;;IAEZ;IACA,IAAI,CAACA,CAAC,CAACC,gBAAgB,EAAE;MACvBL,KAAK,CAACV,OAAO,CAACc,CAAC,CAAC;IAClB;EACF,CAAC;EAED,oBACEzB,IAAA,CAACH,IAAI;IAAA,GACCwB,KAAK;IACT,aAAWL,QAAS;IACpB,iBAAeC,YAAa;IAC5B,eAAaC,UAAW;IACxB,cAAYH,SAAU;IACtBY,uBAAuB,EAAER,cAAe;IACxCS,uBAAuB,EAAER,QAAQ,KAAK,KAAK,GAAG,MAAM,GAAGA,QAAS;IAChEX,QAAQ,EAAEA,QAAS;IACnBG,EAAE,EAAEA,EAAG;IACPE,MAAM,EAAEA,MAAO;IACfD,aAAa,EAAEA,aAAc;IAC7BF,OAAO,EAAEa,WAAY;IACrBhB,KAAK,EAAE,CAAC;MAAEqB,KAAK,EAAEP,MAAM,CAACQ;IAAQ,CAAC,EAAEP,KAAK,CAACQ,OAAO,EAAEvB,KAAK,CAAE;IAAAE,QAAA,EAExDA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { BaseNavigationContainer, getActionFromState, getPathFromState, getStateFromPath, ThemeProvider, validatePathConfig } from '@react-navigation/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import warnOnce from 'warn-once';
|
|
6
|
+
import { checkSerializable } from "./checkSerializable.js";
|
|
7
|
+
import { DEFAULT_DIRECTION, IS_NATIVE } from './constants';
|
|
8
|
+
import { getStateBreadcrumb } from "./getStateBreadcrumb.js";
|
|
6
9
|
import { LinkingContext } from "./LinkingContext.js";
|
|
7
10
|
import { LocaleDirContext } from "./LocaleDirContext.js";
|
|
8
|
-
import {
|
|
11
|
+
import { LightTheme } from "./theming/LightTheme.js";
|
|
9
12
|
import { useBackButton } from './useBackButton';
|
|
10
13
|
import { useDocumentTitle } from './useDocumentTitle';
|
|
11
14
|
import { useLinking } from './useLinking';
|
|
@@ -13,19 +16,26 @@ import { useThenable } from "./useThenable.js";
|
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
17
|
globalThis.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
|
|
15
18
|
const RESTORE_STATE_ERROR = 'Failed to restore navigation state. The state will be initialized based on the navigation tree.';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const PARSE_STATE_ERROR = 'Failed to parse the restored navigation state. The state will be initialized based on the navigation tree.';
|
|
20
|
+
const PERSIST_STATE_ERROR = 'Failed to persist the navigation state.';
|
|
21
|
+
const STRINGIFY_STATE_ERROR = 'Failed to stringify the navigation state. The state will not be persisted.';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Container component that manages the navigation state.
|
|
25
|
+
*
|
|
26
|
+
* This should be rendered at the root wrapping the whole app.
|
|
27
|
+
*/
|
|
28
|
+
export function NavigationContainer({
|
|
29
|
+
direction = DEFAULT_DIRECTION,
|
|
30
|
+
theme = LightTheme,
|
|
19
31
|
linking,
|
|
20
32
|
persistor,
|
|
21
33
|
fallback = null,
|
|
22
34
|
documentTitle,
|
|
23
35
|
onStateChange,
|
|
36
|
+
ref,
|
|
24
37
|
...rest
|
|
25
|
-
}
|
|
26
|
-
if (linking?.config) {
|
|
27
|
-
validatePathConfig(linking.config);
|
|
28
|
-
}
|
|
38
|
+
}) {
|
|
29
39
|
const refContainer = React.useRef(null);
|
|
30
40
|
useBackButton(refContainer);
|
|
31
41
|
useDocumentTitle(refContainer, documentTitle);
|
|
@@ -37,6 +47,9 @@ function NavigationContainerInner({
|
|
|
37
47
|
}
|
|
38
48
|
};
|
|
39
49
|
}
|
|
50
|
+
if (linking?.config) {
|
|
51
|
+
validatePathConfig(linking.config);
|
|
52
|
+
}
|
|
40
53
|
return {
|
|
41
54
|
options: {
|
|
42
55
|
...linking,
|
|
@@ -56,9 +69,14 @@ function NavigationContainerInner({
|
|
|
56
69
|
// This will be used by the devtools
|
|
57
70
|
React.useEffect(() => {
|
|
58
71
|
if (refContainer.current) {
|
|
72
|
+
const previous = REACT_NAVIGATION_DEVTOOLS.get(refContainer.current);
|
|
73
|
+
const listeners = previous?.listeners ?? new Set();
|
|
59
74
|
REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
|
|
60
75
|
get linking() {
|
|
61
76
|
return linkingConfig.options;
|
|
77
|
+
},
|
|
78
|
+
get listeners() {
|
|
79
|
+
return listeners;
|
|
62
80
|
}
|
|
63
81
|
});
|
|
64
82
|
}
|
|
@@ -69,34 +87,66 @@ function NavigationContainerInner({
|
|
|
69
87
|
}
|
|
70
88
|
return getInitialState();
|
|
71
89
|
});
|
|
72
|
-
const isPersistenceSupported =
|
|
90
|
+
const isPersistenceSupported = IS_NATIVE || !linkingConfig.options.enabled;
|
|
73
91
|
const [isPersistedStateResolved, initialStateFromPersisted] = useThenable(() => {
|
|
74
92
|
if (isPersistenceSupported === false || rest.initialState != null || persistor == null) {
|
|
75
93
|
return undefined;
|
|
76
94
|
}
|
|
77
|
-
|
|
95
|
+
const parse = serializedState => {
|
|
96
|
+
if (serializedState == null) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return persistor.parse ? persistor.parse(serializedState) : JSON.parse(serializedState);
|
|
101
|
+
} catch (e) {
|
|
102
|
+
console.error(PARSE_STATE_ERROR, e);
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
78
106
|
try {
|
|
79
|
-
|
|
107
|
+
const result = persistor.restore();
|
|
108
|
+
return result != null && typeof result === 'object' && 'then' in result ? result.then(parse, e => {
|
|
109
|
+
console.error(RESTORE_STATE_ERROR, e);
|
|
110
|
+
return undefined;
|
|
111
|
+
}) : parse(result);
|
|
80
112
|
} catch (e) {
|
|
81
113
|
console.error(RESTORE_STATE_ERROR, e);
|
|
82
114
|
return undefined;
|
|
83
115
|
}
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
});
|
|
117
|
+
const onPersistState = state => {
|
|
118
|
+
if (persistor == null) {
|
|
119
|
+
return;
|
|
86
120
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
121
|
+
let serializedState;
|
|
122
|
+
try {
|
|
123
|
+
serializedState = persistor.stringify ? persistor.stringify(state) : JSON.stringify(state);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
console.error(STRINGIFY_STATE_ERROR, e);
|
|
126
|
+
return;
|
|
92
127
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
128
|
+
try {
|
|
129
|
+
const value = persistor.persist(serializedState);
|
|
130
|
+
if (value != null && typeof value === 'object' && 'then' in value) {
|
|
131
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
132
|
+
value.then(undefined, e => {
|
|
133
|
+
console.error(PERSIST_STATE_ERROR, e);
|
|
134
|
+
});
|
|
96
135
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
136
|
+
} catch (e) {
|
|
137
|
+
console.error(PERSIST_STATE_ERROR, e);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const onSerializableCheck = state => {
|
|
141
|
+
if (process.env.NODE_ENV !== 'production' && state != null) {
|
|
142
|
+
const result = checkSerializable(state);
|
|
143
|
+
if (!result.serializable) {
|
|
144
|
+
const breadcrumb = getStateBreadcrumb(state, result.location);
|
|
145
|
+
const message = `Non-serializable values were found in the navigation state. Check:\n\n${breadcrumb} (${result.reason})\n\nThis can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.`;
|
|
146
|
+
warnOnce(true, message);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
100
150
|
|
|
101
151
|
// FIXME
|
|
102
152
|
// @ts-expect-error not sure why this is not working
|
|
@@ -121,18 +171,12 @@ function NavigationContainerInner({
|
|
|
121
171
|
initialState: rest.initialState ?? initialStateFromLink ?? initialStateFromPersisted,
|
|
122
172
|
onStateChange: state => {
|
|
123
173
|
onStateChange?.(state);
|
|
124
|
-
|
|
174
|
+
onPersistState(state);
|
|
175
|
+
onSerializableCheck(state);
|
|
125
176
|
},
|
|
126
177
|
ref: refContainer
|
|
127
178
|
})
|
|
128
179
|
})
|
|
129
180
|
});
|
|
130
181
|
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Container component that manages the navigation state.
|
|
134
|
-
*
|
|
135
|
-
* This should be rendered at the root wrapping the whole app.
|
|
136
|
-
*/
|
|
137
|
-
export const NavigationContainer = /*#__PURE__*/React.forwardRef(NavigationContainerInner);
|
|
138
182
|
//# sourceMappingURL=NavigationContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseNavigationContainer","getActionFromState","getPathFromState","getStateFromPath","ThemeProvider","validatePathConfig","React","
|
|
1
|
+
{"version":3,"names":["BaseNavigationContainer","getActionFromState","getPathFromState","getStateFromPath","ThemeProvider","validatePathConfig","React","warnOnce","checkSerializable","DEFAULT_DIRECTION","IS_NATIVE","getStateBreadcrumb","LinkingContext","LocaleDirContext","LightTheme","useBackButton","useDocumentTitle","useLinking","useThenable","jsx","_jsx","globalThis","REACT_NAVIGATION_DEVTOOLS","WeakMap","RESTORE_STATE_ERROR","PARSE_STATE_ERROR","PERSIST_STATE_ERROR","STRINGIFY_STATE_ERROR","NavigationContainer","direction","theme","linking","persistor","fallback","documentTitle","onStateChange","ref","rest","refContainer","useRef","linkingConfig","useMemo","options","enabled","config","prefixes","getInitialState","useEffect","current","previous","get","listeners","Set","set","isLinkStateResolved","initialStateFromLink","initialState","undefined","isPersistenceSupported","isPersistedStateResolved","initialStateFromPersisted","parse","serializedState","JSON","e","console","error","result","restore","then","onPersistState","state","stringify","value","persist","onSerializableCheck","process","env","NODE_ENV","serializable","breadcrumb","location","message","reason","useImperativeHandle","isStateReady","Provider","children"],"sourceRoot":"../../src","sources":["NavigationContainer.tsx"],"mappings":";;AAAA,SACEA,uBAAuB,EACvBC,kBAAkB,EAClBC,gBAAgB,EACh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M,CAACgB,MAAM,4aAA4a;QAEjiB5E,QAAQ,CAAC,IAAI,EAAE2E,OAAO,CAAC;MACzB;IACF;EACF,CAAC;;EAED;EACA;EACA5E,KAAK,CAAC8E,mBAAmB,CAAChD,GAAG,EAAE,MAAME,YAAY,CAACU,OAAO,CAAC;EAE1D,MAAMqC,YAAY,GAChBhD,IAAI,CAACmB,YAAY,IAAI,IAAI,IACxBF,mBAAmB,IAAIK,wBAAyB;EAEnD,IAAI,CAAC0B,YAAY,EAAE;IACjB,oBACEjE,IAAA,CAACP,gBAAgB,CAACyE,QAAQ;MAACb,KAAK,EAAE5C,SAAU;MAAA0D,QAAA,eAC1CnE,IAAA,CAAChB,aAAa;QAACqE,KAAK,EAAE3C,KAAM;QAAAyD,QAAA,EAAEtD;MAAQ,CAAgB;IAAC,CAC9B,CAAC;EAEhC;EAEA,oBACEb,IAAA,CAACP,gBAAgB,CAACyE,QAAQ;IAACb,KAAK,EAAE5C,SAAU;IAAA0D,QAAA,eAC1CnE,IAAA,CAACR,cAAc,CAAC0E,QAAQ;MAACb,KAAK,EAAEjC,aAAc;MAAA+C,QAAA,eAC5CnE,IAAA,CAACpB,uBAAuB;QAAA,GAClBqC,IAAI;QACRP,KAAK,EAAEA,KAAM;QACb0B,YAAY,EACVnB,IAAI,CAACmB,YAAY,IACjBD,oBAAoB,IACpBK,yBACD;QACDzB,aAAa,EAAGoC,KAAK,IAAK;UACxBpC,aAAa,GAAGoC,KAAK,CAAC;UACtBD,cAAc,CAACC,KAAK,CAAC;UACrBI,mBAAmB,CAACJ,KAAK,CAAC;QAC5B,CAAE;QACFnC,GAAG,EAAEE;MAAa,CACnB;IAAC,CACqB;EAAC,CACD,CAAC;AAEhC","ignoreList":[]}
|
|
@@ -8,11 +8,17 @@ const StackNavigator = props => {
|
|
|
8
8
|
descriptors,
|
|
9
9
|
NavigationContent
|
|
10
10
|
} = useNavigationBuilder(StackRouter, props);
|
|
11
|
+
const route = state.routes[state.index];
|
|
12
|
+
if (route == null) {
|
|
13
|
+
throw new Error(`Couldn't find a route at index ${state.index}.`);
|
|
14
|
+
}
|
|
15
|
+
const descriptor = descriptors[route.key];
|
|
16
|
+
if (descriptor == null) {
|
|
17
|
+
throw new Error(`Couldn't find a descriptor for route '${route.key}'.`);
|
|
18
|
+
}
|
|
11
19
|
return /*#__PURE__*/_jsx(NavigationContent, {
|
|
12
|
-
children:
|
|
20
|
+
children: descriptor.render()
|
|
13
21
|
});
|
|
14
22
|
};
|
|
15
|
-
export
|
|
16
|
-
return createNavigatorFactory(StackNavigator)();
|
|
17
|
-
}
|
|
23
|
+
export const createStackNavigator = createNavigatorFactory(StackNavigator);
|
|
18
24
|
//# sourceMappingURL=createStackNavigator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createNavigatorFactory","StackRouter","useNavigationBuilder","jsx","_jsx","StackNavigator","props","state","descriptors","NavigationContent","
|
|
1
|
+
{"version":3,"names":["createNavigatorFactory","StackRouter","useNavigationBuilder","jsx","_jsx","StackNavigator","props","state","descriptors","NavigationContent","route","routes","index","Error","descriptor","key","children","render","createStackNavigator"],"sourceRoot":"../../../src","sources":["__stubs__/createStackNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EAKtBC,WAAW,EACXC,oBAAoB,QACf,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhC,MAAMC,cAAc,GAClBC,KAMC,IACE;EACH,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC;EAAkB,CAAC,GAAGP,oBAAoB,CACpED,WAAW,EACXK,KACF,CAAC;EAED,MAAMI,KAAK,GAAGH,KAAK,CAACI,MAAM,CAACJ,KAAK,CAACK,KAAK,CAAC;EAEvC,IAAIF,KAAK,IAAI,IAAI,EAAE;IACjB,MAAM,IAAIG,KAAK,CAAC,kCAAkCN,KAAK,CAACK,KAAK,GAAG,CAAC;EACnE;EAEA,MAAME,UAAU,GAAGN,WAAW,CAACE,KAAK,CAACK,GAAG,CAAC;EAEzC,IAAID,UAAU,IAAI,IAAI,EAAE;IACtB,MAAM,IAAID,KAAK,CAAC,yCAAyCH,KAAK,CAACK,GAAG,IAAI,CAAC;EACzE;EAEA,oBAAOX,IAAA,CAACK,iBAAiB;IAAAO,QAAA,EAAEF,UAAU,CAACG,MAAM,CAAC;EAAC,CAAoB,CAAC;AACrE,CAAC;AAOD,OAAO,MAAMC,oBAAoB,GAC/BlB,sBAAsB,CAAmBK,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SERIALIZABLE = {
|
|
4
|
+
serializable: true
|
|
5
|
+
};
|
|
6
|
+
const isPlainObject = o => {
|
|
7
|
+
const prototype = Object.getPrototypeOf(o);
|
|
8
|
+
return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
|
|
9
|
+
};
|
|
10
|
+
const isSerializablePrimitive = o => typeof o === 'boolean' || typeof o === 'string' || typeof o === 'number' && Number.isFinite(o) && !Object.is(o, -0);
|
|
11
|
+
const checkValue = (o, ancestors) => {
|
|
12
|
+
switch (typeof o) {
|
|
13
|
+
case 'boolean':
|
|
14
|
+
case 'string':
|
|
15
|
+
return undefined;
|
|
16
|
+
case 'number':
|
|
17
|
+
if (Number.isFinite(o) && !Object.is(o, -0)) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
serializable: false,
|
|
22
|
+
location: [],
|
|
23
|
+
reason: Object.is(o, -0) ? 'Negative zero' : String(o)
|
|
24
|
+
};
|
|
25
|
+
case 'function':
|
|
26
|
+
return {
|
|
27
|
+
serializable: false,
|
|
28
|
+
location: [],
|
|
29
|
+
reason: 'Function'
|
|
30
|
+
};
|
|
31
|
+
case 'bigint':
|
|
32
|
+
return {
|
|
33
|
+
serializable: false,
|
|
34
|
+
location: [],
|
|
35
|
+
reason: 'BigInt'
|
|
36
|
+
};
|
|
37
|
+
case 'undefined':
|
|
38
|
+
return {
|
|
39
|
+
serializable: false,
|
|
40
|
+
location: [],
|
|
41
|
+
reason: 'Undefined'
|
|
42
|
+
};
|
|
43
|
+
case 'object':
|
|
44
|
+
if (o === null) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
return {
|
|
50
|
+
serializable: false,
|
|
51
|
+
location: [],
|
|
52
|
+
reason: String(o)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const isArray = Array.isArray(o);
|
|
56
|
+
const isPlainArray = isArray && (Object.getPrototypeOf(o) === Array.prototype || Array.isArray(Object.getPrototypeOf(o)));
|
|
57
|
+
if (isArray && !isPlainArray || !isArray && !isPlainObject(o)) {
|
|
58
|
+
const objectType = Object.prototype.toString.call(o).slice(8, -1);
|
|
59
|
+
let reason = objectType;
|
|
60
|
+
if (isArray) {
|
|
61
|
+
reason = 'Array subclass';
|
|
62
|
+
} else if (objectType === 'Object') {
|
|
63
|
+
reason = 'Object with a custom prototype';
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
serializable: false,
|
|
67
|
+
location: [],
|
|
68
|
+
reason
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (ancestors.includes(o)) {
|
|
72
|
+
return {
|
|
73
|
+
serializable: false,
|
|
74
|
+
reason: 'Circular reference',
|
|
75
|
+
location: []
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
ancestors.push(o);
|
|
79
|
+
if (isArray) {
|
|
80
|
+
const keys = Object.keys(o);
|
|
81
|
+
const isClean = keys.length === o.length && (o.length === 0 || keys[o.length - 1] === String(o.length - 1));
|
|
82
|
+
if (isClean) {
|
|
83
|
+
const symbols = Object.getOwnPropertySymbols(o);
|
|
84
|
+
if (symbols.length > 0) {
|
|
85
|
+
return {
|
|
86
|
+
serializable: false,
|
|
87
|
+
location: [String(symbols[0])],
|
|
88
|
+
reason: 'Extra array property'
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
const names = Object.getOwnPropertyNames(o);
|
|
93
|
+
const symbols = Object.getOwnPropertySymbols(o);
|
|
94
|
+
if (names.length + symbols.length > o.length + 1) {
|
|
95
|
+
for (const key of names) {
|
|
96
|
+
if (key === 'length') {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const index = Number(key);
|
|
100
|
+
if (!Number.isInteger(index) || index < 0 || index >= o.length || String(index) !== key) {
|
|
101
|
+
return {
|
|
102
|
+
serializable: false,
|
|
103
|
+
location: [key],
|
|
104
|
+
reason: 'Extra array property'
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (symbols.length > 0) {
|
|
109
|
+
return {
|
|
110
|
+
serializable: false,
|
|
111
|
+
location: [String(symbols[0])],
|
|
112
|
+
reason: 'Extra array property'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (let i = 0; i < o.length; i++) {
|
|
118
|
+
if (!isClean && !Object.hasOwn(o, i)) {
|
|
119
|
+
return {
|
|
120
|
+
serializable: false,
|
|
121
|
+
location: [i],
|
|
122
|
+
reason: 'Sparse array'
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const value = o[i];
|
|
126
|
+
if (value === null || isSerializablePrimitive(value)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const childResult = checkValue(value, ancestors);
|
|
130
|
+
if (childResult) {
|
|
131
|
+
childResult.location.push(i);
|
|
132
|
+
return childResult;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
const keys = Object.keys(o);
|
|
137
|
+
const names = Object.getOwnPropertyNames(o);
|
|
138
|
+
if (keys.length !== names.length) {
|
|
139
|
+
for (const key of names) {
|
|
140
|
+
if (!Object.prototype.propertyIsEnumerable.call(o, key)) {
|
|
141
|
+
return {
|
|
142
|
+
serializable: false,
|
|
143
|
+
location: [key],
|
|
144
|
+
reason: 'Non-enumerable property'
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const symbols = Object.getOwnPropertySymbols(o);
|
|
150
|
+
if (symbols.length > 0) {
|
|
151
|
+
return {
|
|
152
|
+
serializable: false,
|
|
153
|
+
location: [String(symbols[0])],
|
|
154
|
+
reason: 'Symbol key'
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
for (const key of keys) {
|
|
158
|
+
const value = o[key];
|
|
159
|
+
if (value == null || isSerializablePrimitive(value)) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const childResult = checkValue(value, ancestors);
|
|
163
|
+
if (childResult) {
|
|
164
|
+
childResult.location.push(key);
|
|
165
|
+
return childResult;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
ancestors.pop();
|
|
170
|
+
return undefined;
|
|
171
|
+
};
|
|
172
|
+
export function checkSerializable(o) {
|
|
173
|
+
const result = checkValue(o, []);
|
|
174
|
+
if (!result) {
|
|
175
|
+
return SERIALIZABLE;
|
|
176
|
+
}
|
|
177
|
+
result.location.reverse();
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=checkSerializable.js.map
|