@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/src/useLinkProps.tsx
CHANGED
|
@@ -1,184 +1,437 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CommonActions,
|
|
3
|
+
type FocusedRouteState,
|
|
2
4
|
getPathFromState,
|
|
3
5
|
type NavigationAction,
|
|
6
|
+
type NavigationContainerRef,
|
|
4
7
|
NavigationContainerRefContext,
|
|
8
|
+
NavigationContext,
|
|
9
|
+
NavigationFocusedRouteStateContext,
|
|
10
|
+
type NavigationHelpers,
|
|
5
11
|
NavigationHelpersContext,
|
|
12
|
+
type NavigationProp,
|
|
6
13
|
type NavigatorScreenParams,
|
|
7
14
|
type ParamListBase,
|
|
15
|
+
type ParamListForNavigator,
|
|
8
16
|
type RootParamList,
|
|
9
17
|
} from '@react-navigation/core';
|
|
10
|
-
import type { NavigationState, PartialState } from '@react-navigation/routers';
|
|
11
18
|
import * as React from 'react';
|
|
12
|
-
import {
|
|
19
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
20
|
+
import useLatestCallback from 'use-latest-callback';
|
|
13
21
|
|
|
22
|
+
import { IS_NATIVE } from './constants';
|
|
14
23
|
import { LinkingContext } from './LinkingContext';
|
|
24
|
+
import { useDeepStableValue } from './useDeepStableValue';
|
|
25
|
+
|
|
26
|
+
type LinkScreenTargetProps<
|
|
27
|
+
ParamList extends {},
|
|
28
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
29
|
+
keyof ParamList,
|
|
30
|
+
string
|
|
31
|
+
>,
|
|
32
|
+
> = RouteName extends unknown
|
|
33
|
+
? undefined extends ParamList[RouteName]
|
|
34
|
+
? {
|
|
35
|
+
href?: string | undefined;
|
|
36
|
+
action?: NavigationAction | undefined;
|
|
37
|
+
in?: Extract<keyof ParamList, string> | undefined;
|
|
38
|
+
screen: RouteName;
|
|
39
|
+
params?: ParamList[RouteName] | undefined;
|
|
40
|
+
}
|
|
41
|
+
: {
|
|
42
|
+
href?: string | undefined;
|
|
43
|
+
action?: NavigationAction | undefined;
|
|
44
|
+
in?: Extract<keyof ParamList, string> | undefined;
|
|
45
|
+
screen: RouteName;
|
|
46
|
+
params: ParamList[RouteName];
|
|
47
|
+
}
|
|
48
|
+
: never;
|
|
49
|
+
|
|
50
|
+
type LinkScreenTargetPropsWithIn<
|
|
51
|
+
ParamList extends {},
|
|
52
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
53
|
+
keyof ParamList,
|
|
54
|
+
string
|
|
55
|
+
>,
|
|
56
|
+
> = RouteName extends unknown
|
|
57
|
+
? undefined extends ParamList[RouteName]
|
|
58
|
+
? {
|
|
59
|
+
href?: string | undefined;
|
|
60
|
+
action?: NavigationAction | undefined;
|
|
61
|
+
in: Extract<keyof ParamList, string>;
|
|
62
|
+
screen: RouteName;
|
|
63
|
+
params?: ParamList[RouteName] | undefined;
|
|
64
|
+
}
|
|
65
|
+
: {
|
|
66
|
+
href?: string | undefined;
|
|
67
|
+
action?: NavigationAction | undefined;
|
|
68
|
+
in: Extract<keyof ParamList, string>;
|
|
69
|
+
screen: RouteName;
|
|
70
|
+
params: ParamList[RouteName];
|
|
71
|
+
}
|
|
72
|
+
: never;
|
|
73
|
+
|
|
74
|
+
type LinkPropsWithInForParams<Params> = [Params] extends [never]
|
|
75
|
+
? never
|
|
76
|
+
: [Params] extends [NavigatorScreenParams<infer Navigator>]
|
|
77
|
+
? ParamListForNavigator<Navigator> extends infer NestedParamList extends {}
|
|
78
|
+
?
|
|
79
|
+
| LinkScreenTargetPropsWithIn<NestedParamList>
|
|
80
|
+
| LinkPropsWithIn<NestedParamList>
|
|
81
|
+
: never
|
|
82
|
+
: never;
|
|
83
|
+
|
|
84
|
+
type LinkPropsWithIn<ParamList extends {}> = string extends keyof ParamList
|
|
85
|
+
? never
|
|
86
|
+
: {
|
|
87
|
+
[RouteName in keyof ParamList]: LinkPropsWithInForParams<
|
|
88
|
+
Exclude<ParamList[RouteName], undefined>
|
|
89
|
+
>;
|
|
90
|
+
}[keyof ParamList];
|
|
15
91
|
|
|
16
92
|
export type LinkProps<
|
|
17
93
|
ParamList extends {} = RootParamList,
|
|
18
|
-
RouteName extends keyof ParamList =
|
|
94
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
95
|
+
keyof ParamList,
|
|
96
|
+
string
|
|
97
|
+
>,
|
|
19
98
|
> =
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
action?: NavigationAction;
|
|
23
|
-
} & (RouteName extends unknown
|
|
24
|
-
? undefined extends ParamList[RouteName]
|
|
25
|
-
? { screen: RouteName; params?: ParamList[RouteName] }
|
|
26
|
-
: { screen: RouteName; params: ParamList[RouteName] }
|
|
27
|
-
: never))
|
|
99
|
+
| LinkScreenTargetProps<ParamList, RouteName>
|
|
100
|
+
| LinkPropsWithIn<ParamList>
|
|
28
101
|
| {
|
|
29
|
-
href?: string;
|
|
102
|
+
href?: string | undefined;
|
|
30
103
|
action: NavigationAction;
|
|
104
|
+
in?: undefined;
|
|
31
105
|
screen?: undefined;
|
|
32
106
|
params?: undefined;
|
|
33
107
|
};
|
|
34
108
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
109
|
+
const NESTED_KEYS = ['payload', 'params', 'state', 'routes'] as const;
|
|
110
|
+
const NESTED_PARAMS_KEYS = ['params', 'state'] as const;
|
|
111
|
+
const NAVIGATE_ACTION_TYPES = [
|
|
112
|
+
'NAVIGATE',
|
|
113
|
+
'PUSH',
|
|
114
|
+
'REPLACE',
|
|
115
|
+
'POP_TO',
|
|
116
|
+
'JUMP_TO',
|
|
117
|
+
];
|
|
118
|
+
/**
|
|
119
|
+
* Nested params are tracked as consumed after handling
|
|
120
|
+
* So navigating with same params again won't work
|
|
121
|
+
* This can happen if the action or params are memoized
|
|
122
|
+
* Or component hasn't re-renderd to re-create inline objects
|
|
123
|
+
* So we clone the action and params when necessary before dispatch
|
|
124
|
+
*/
|
|
125
|
+
function clone<T>(value: T): T;
|
|
126
|
+
function clone(
|
|
127
|
+
value: unknown,
|
|
128
|
+
keys: typeof NESTED_KEYS | typeof NESTED_PARAMS_KEYS,
|
|
129
|
+
clones: WeakMap<object, object>
|
|
130
|
+
): unknown;
|
|
131
|
+
function clone(
|
|
132
|
+
value: unknown,
|
|
133
|
+
keys: typeof NESTED_KEYS | typeof NESTED_PARAMS_KEYS = NESTED_KEYS,
|
|
134
|
+
clones?: WeakMap<object, object>
|
|
135
|
+
): unknown {
|
|
136
|
+
if (typeof value !== 'object' || value == null) {
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const existing = clones?.get(value);
|
|
141
|
+
|
|
142
|
+
if (existing) {
|
|
143
|
+
return existing;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const isArray = Array.isArray(value);
|
|
147
|
+
|
|
148
|
+
if (
|
|
149
|
+
keys === NESTED_PARAMS_KEYS &&
|
|
150
|
+
'screen' in value &&
|
|
151
|
+
typeof value.screen !== 'string' &&
|
|
152
|
+
!(
|
|
153
|
+
'state' in value &&
|
|
154
|
+
typeof value.state === 'object' &&
|
|
155
|
+
value.state != null &&
|
|
156
|
+
'routes' in value.state &&
|
|
157
|
+
Array.isArray(value.state.routes)
|
|
158
|
+
)
|
|
159
|
+
) {
|
|
160
|
+
return value;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let copy: object | undefined =
|
|
164
|
+
keys === NESTED_PARAMS_KEYS ? { ...value } : undefined;
|
|
165
|
+
|
|
166
|
+
clones ??= new WeakMap();
|
|
167
|
+
clones.set(value, copy ?? value);
|
|
168
|
+
|
|
169
|
+
for (const key of isArray ? value.keys() : keys) {
|
|
170
|
+
const nested: unknown = Reflect.get(value, key);
|
|
171
|
+
|
|
172
|
+
const cloned = clone(
|
|
173
|
+
nested,
|
|
174
|
+
key === 'params' ? NESTED_PARAMS_KEYS : NESTED_KEYS,
|
|
175
|
+
clones
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
if (cloned !== nested) {
|
|
179
|
+
copy ??= isArray ? [...value] : { ...value };
|
|
180
|
+
clones.set(value, copy);
|
|
181
|
+
|
|
182
|
+
Reflect.set(copy, key, cloned);
|
|
183
|
+
}
|
|
40
184
|
}
|
|
41
185
|
|
|
42
|
-
|
|
186
|
+
return copy ?? value;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const getTargetFromAction = (
|
|
190
|
+
action: NavigationAction | undefined,
|
|
191
|
+
screens: Record<string, unknown> | undefined
|
|
192
|
+
) => {
|
|
193
|
+
if (action === undefined || screens === undefined) {
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const { payload } = action;
|
|
198
|
+
|
|
199
|
+
if (
|
|
200
|
+
!NAVIGATE_ACTION_TYPES.includes(action.type) ||
|
|
201
|
+
payload === undefined ||
|
|
202
|
+
!('name' in payload) ||
|
|
203
|
+
typeof payload.name !== 'string' ||
|
|
204
|
+
!(payload.name in screens)
|
|
205
|
+
) {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
screen: payload.name,
|
|
211
|
+
params:
|
|
212
|
+
'params' in payload &&
|
|
213
|
+
typeof payload.params === 'object' &&
|
|
214
|
+
payload.params != null
|
|
215
|
+
? payload.params
|
|
216
|
+
: undefined,
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const getStateForParent = (
|
|
221
|
+
parent: string | undefined,
|
|
222
|
+
targetState: FocusedRouteState,
|
|
223
|
+
focusedRouteState: FocusedRouteState | undefined
|
|
224
|
+
): FocusedRouteState | undefined => {
|
|
225
|
+
if (parent === undefined) {
|
|
226
|
+
return targetState;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (focusedRouteState === undefined) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const route = focusedRouteState.routes[0];
|
|
234
|
+
|
|
235
|
+
const childState = getStateForParent(parent, targetState, route.state);
|
|
236
|
+
|
|
237
|
+
if (childState !== undefined) {
|
|
43
238
|
return {
|
|
44
239
|
routes: [
|
|
45
240
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// @ts-expect-error this is fine 🔥
|
|
49
|
-
state: params.screen
|
|
50
|
-
? getStateFromParams(
|
|
51
|
-
params.params as
|
|
52
|
-
| NavigatorScreenParams<ParamListBase>
|
|
53
|
-
| undefined
|
|
54
|
-
)
|
|
55
|
-
: undefined,
|
|
241
|
+
...route,
|
|
242
|
+
state: childState,
|
|
56
243
|
},
|
|
57
244
|
],
|
|
58
245
|
};
|
|
59
246
|
}
|
|
60
247
|
|
|
248
|
+
if (route.name === parent) {
|
|
249
|
+
return targetState;
|
|
250
|
+
}
|
|
251
|
+
|
|
61
252
|
return undefined;
|
|
62
253
|
};
|
|
63
254
|
|
|
64
255
|
/**
|
|
65
256
|
* Hook to get props for an anchor tag so it can work with in page navigation.
|
|
66
257
|
*
|
|
258
|
+
* @param props.in Name of the current or parent screen whose navigator contains the target screen.
|
|
67
259
|
* @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
|
|
68
260
|
* @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
|
|
69
261
|
* @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
|
|
70
|
-
* @param props.action Optional action to
|
|
262
|
+
* @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`).
|
|
71
263
|
*/
|
|
72
264
|
export function useLinkProps<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
265
|
+
ParamList extends {} = RootParamList,
|
|
266
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
267
|
+
keyof ParamList,
|
|
268
|
+
string
|
|
269
|
+
>,
|
|
270
|
+
>({
|
|
271
|
+
in: parent,
|
|
272
|
+
screen,
|
|
273
|
+
params,
|
|
274
|
+
action,
|
|
275
|
+
...rest
|
|
276
|
+
}: LinkProps<NoInfer<ParamList>, RouteName>) {
|
|
277
|
+
const root = React.use(NavigationContainerRefContext);
|
|
278
|
+
|
|
279
|
+
let navigation:
|
|
280
|
+
| NavigationHelpers<ParamListBase>
|
|
281
|
+
| NavigationProp<ParamListBase>
|
|
282
|
+
| NavigationContainerRef<ParamListBase>
|
|
283
|
+
| undefined = React.use(NavigationContext);
|
|
284
|
+
|
|
285
|
+
if (parent != null) {
|
|
286
|
+
navigation = navigation?.getParent(parent);
|
|
287
|
+
} else if (action != null) {
|
|
288
|
+
const helpers = React.use(NavigationHelpersContext);
|
|
289
|
+
|
|
290
|
+
// Handle custom actions in the immediate parent
|
|
291
|
+
navigation = helpers ?? navigation ?? root;
|
|
292
|
+
} else {
|
|
293
|
+
// The ref dispatches in currently focused screen
|
|
294
|
+
// So prefer the top-most navigator if available
|
|
295
|
+
let parent = navigation?.getParent();
|
|
296
|
+
|
|
297
|
+
while (parent !== undefined) {
|
|
298
|
+
navigation = parent;
|
|
299
|
+
parent = navigation.getParent();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
navigation = navigation ?? root;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (navigation == null) {
|
|
306
|
+
if (parent != null) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
`Couldn't find a navigation object for '${parent}' in current or any parent screens. Is your component inside the correct screen?`
|
|
309
|
+
);
|
|
110
310
|
}
|
|
111
311
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
312
|
+
throw new Error(
|
|
313
|
+
"Couldn't find a navigation object. Is your component inside NavigationContainer?"
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const { options } = React.use(LinkingContext);
|
|
318
|
+
|
|
319
|
+
const onPress = useLatestCallback(
|
|
320
|
+
(
|
|
321
|
+
e?:
|
|
322
|
+
| React.MouseEvent<HTMLAnchorElement, MouseEvent>
|
|
323
|
+
| GestureResponderEvent
|
|
324
|
+
) => {
|
|
325
|
+
if (!IS_NATIVE && e) {
|
|
326
|
+
// ignore clicks with modifier keys
|
|
327
|
+
const hasModifierKey =
|
|
328
|
+
('metaKey' in e && e.metaKey) ||
|
|
329
|
+
('altKey' in e && e.altKey) ||
|
|
330
|
+
('ctrlKey' in e && e.ctrlKey) ||
|
|
331
|
+
('shiftKey' in e && e.shiftKey);
|
|
332
|
+
|
|
333
|
+
// only handle left clicks
|
|
334
|
+
const isLeftClick =
|
|
335
|
+
'button' in e ? e.button == null || e.button === 0 : true;
|
|
336
|
+
|
|
337
|
+
// let browser handle "target=_blank" etc.
|
|
338
|
+
const isSelfTarget =
|
|
339
|
+
e.currentTarget && 'target' in e.currentTarget
|
|
340
|
+
? [undefined, null, '', '_self'].includes(e.currentTarget.target)
|
|
341
|
+
: true;
|
|
342
|
+
|
|
343
|
+
// let the browser handle the interaction
|
|
344
|
+
if (hasModifierKey || !isLeftClick || !isSelfTarget) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
e?.preventDefault();
|
|
350
|
+
|
|
351
|
+
let cloned: NavigationAction;
|
|
352
|
+
|
|
353
|
+
if (action != null) {
|
|
354
|
+
cloned = clone(action);
|
|
355
|
+
} else {
|
|
356
|
+
if (screen == null) {
|
|
119
357
|
throw new Error(
|
|
120
|
-
"Couldn't find a
|
|
358
|
+
"Couldn't find a screen to navigate to. Make sure to provide a screen name."
|
|
121
359
|
);
|
|
122
360
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
361
|
+
|
|
362
|
+
cloned = clone(
|
|
363
|
+
CommonActions.navigate(
|
|
364
|
+
screen,
|
|
365
|
+
// @ts-expect-error This is already type-checked by the prop types
|
|
366
|
+
params
|
|
367
|
+
)
|
|
368
|
+
);
|
|
369
|
+
|
|
370
|
+
if (parent != null) {
|
|
371
|
+
cloned = {
|
|
372
|
+
...cloned,
|
|
373
|
+
target: navigation.getState()?.key,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
126
376
|
}
|
|
377
|
+
|
|
378
|
+
navigation.dispatch(cloned);
|
|
127
379
|
}
|
|
128
|
-
|
|
380
|
+
);
|
|
129
381
|
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
case 'REPLACE':
|
|
138
|
-
case 'POP_TO':
|
|
139
|
-
case 'JUMP_TO': {
|
|
140
|
-
if (
|
|
141
|
-
action.payload != null &&
|
|
142
|
-
'name' in action.payload &&
|
|
143
|
-
typeof action.payload.name === 'string' &&
|
|
144
|
-
action.payload.name in options.config.screens
|
|
145
|
-
) {
|
|
146
|
-
screen = action.payload.name;
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
'params' in action.payload &&
|
|
150
|
-
typeof action.payload.params === 'object' &&
|
|
151
|
-
action.payload.params != null
|
|
152
|
-
) {
|
|
153
|
-
// @ts-expect-error this is fine 🔥
|
|
154
|
-
params = action.payload.params;
|
|
155
|
-
}
|
|
382
|
+
const target = useDeepStableValue(
|
|
383
|
+
!IS_NATIVE
|
|
384
|
+
? typeof screen === 'string'
|
|
385
|
+
? {
|
|
386
|
+
screen,
|
|
387
|
+
params:
|
|
388
|
+
typeof params === 'object' && params != null ? params : undefined,
|
|
156
389
|
}
|
|
157
|
-
|
|
158
|
-
|
|
390
|
+
: getTargetFromAction(action, options?.config?.screens)
|
|
391
|
+
: undefined
|
|
392
|
+
);
|
|
393
|
+
|
|
394
|
+
const state =
|
|
395
|
+
!IS_NATIVE && rest.href == null && target != null
|
|
396
|
+
? React.use(NavigationFocusedRouteStateContext)
|
|
397
|
+
: undefined;
|
|
398
|
+
|
|
399
|
+
const href = React.useMemo(() => {
|
|
400
|
+
if (IS_NATIVE || rest.href != null || target == null) {
|
|
401
|
+
return rest.href;
|
|
159
402
|
}
|
|
160
|
-
|
|
403
|
+
|
|
404
|
+
const stateForParent = getStateForParent(
|
|
405
|
+
parent,
|
|
406
|
+
{
|
|
407
|
+
routes: [
|
|
408
|
+
{
|
|
409
|
+
name: target.screen,
|
|
410
|
+
params: target.params,
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
state
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
if (stateForParent) {
|
|
418
|
+
const getPath = options?.getPathFromState ?? getPathFromState;
|
|
419
|
+
|
|
420
|
+
return getPath(stateForParent, options?.config);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return undefined;
|
|
424
|
+
}, [
|
|
425
|
+
rest.href,
|
|
426
|
+
target,
|
|
427
|
+
parent,
|
|
428
|
+
state,
|
|
429
|
+
options?.getPathFromState,
|
|
430
|
+
options?.config,
|
|
431
|
+
]);
|
|
161
432
|
|
|
162
433
|
return {
|
|
163
|
-
href
|
|
164
|
-
href ??
|
|
165
|
-
(Platform.OS === 'web' && screen != null
|
|
166
|
-
? getPathFromStateHelper(
|
|
167
|
-
{
|
|
168
|
-
routes: [
|
|
169
|
-
{
|
|
170
|
-
// @ts-expect-error this is fine 🔥
|
|
171
|
-
name: screen,
|
|
172
|
-
// @ts-expect-error this is fine 🔥
|
|
173
|
-
params: params,
|
|
174
|
-
// @ts-expect-error this is fine 🔥
|
|
175
|
-
state: getStateFromParams(params),
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
options?.config
|
|
180
|
-
)
|
|
181
|
-
: undefined),
|
|
434
|
+
href,
|
|
182
435
|
role: 'link' as const,
|
|
183
436
|
onPress,
|
|
184
437
|
};
|
package/src/useLinkTo.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { useBuildAction } from './useLinkBuilder';
|
|
|
9
9
|
* @returns function that receives the href to navigate to.
|
|
10
10
|
*/
|
|
11
11
|
export function useLinkTo() {
|
|
12
|
-
const navigation = React.
|
|
12
|
+
const navigation = React.use(NavigationContainerRefContext);
|
|
13
13
|
const buildAction = useBuildAction();
|
|
14
14
|
|
|
15
15
|
const linkTo = React.useCallback(
|