@react-navigation/native 8.0.0-alpha.4 → 8.0.0-alpha.40
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 +179 -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 +179 -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 +179 -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 +22 -17
- 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/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/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 +3 -12
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +6 -3
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +33 -0
- package/lib/module/native/SFSymbol.ios.js +35 -14
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +30 -14
- 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 -7
- 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 -2
- package/lib/module/useScrollToTop.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 +13 -6
- 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/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/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 +28 -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 +1 -1
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +2 -2
- 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 +2 -2
- 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 +1 -1
- package/lib/typescript/src/native/SFSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbol.ios.d.ts +2 -2
- package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +26 -13
- 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 +13 -16
- 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.map +1 -1
- package/package.json +47 -23
- package/src/Link.native.tsx +69 -0
- package/src/Link.tsx +126 -37
- package/src/NavigationContainer.tsx +47 -39
- package/src/__stubs__/createStackNavigator.tsx +19 -17
- 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/getStateFromHref.tsx +8 -3
- package/src/index.tsx +11 -2
- package/src/native/CornerInset.ios.tsx +87 -0
- package/src/native/CornerInset.tsx +40 -0
- package/src/native/MaterialSymbol.android.tsx +2 -18
- package/src/native/MaterialSymbol.tsx +1 -1
- package/src/native/MaterialSymbolData.tsx +155 -0
- package/src/native/MaterialSymbolViewNativeComponent.ts +6 -3
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +33 -0
- package/src/native/SFSymbol.ios.tsx +73 -14
- package/src/native/SFSymbolViewNativeComponent.ts +30 -14
- 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 +38 -40
- 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 +15 -7
- 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 -2
- 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,EAAEC;AACc,CAAC,EAAE;EAC9B;EACA,MAAMC,KAAK,GAAGxB,YAAY,CAAC;IAAEI,EAAE,EAAEC,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAK,CAAC,CAAC;;EAExE;EACA;EACA,MAAM;IAAEgB,MAAM;IAAEC;EAAM,CAAC,GAAG5B,QAAQ,CAAC,CAAC;EAEpC,IAAI,OAAO2B,MAAM,CAACE,OAAO,KAAK,QAAQ,EAAE;IACtC,MAAM,IAAIC,KAAK,CAAC,uBAAuB,CAAC;EAC1C;EAEA,MAAMC,OAAO,GAAIC,CAAkD,IAAK;IACtE,IAAInB,QAAQ,EAAE;MACZmB,CAAC,CAACC,cAAc,CAAC,CAAC;MAClBD,CAAC,CAACE,eAAe,CAAC,CAAC;MACnB;IACF;IAEAlB,OAAO,GAAGgB,CAAC,CAAC;;IAEZ;IACA,IAAI,CAACA,CAAC,CAACG,gBAAgB,EAAE;MACvB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ClBC,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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getStateFromPath, ThemeProvider, validatePathConfig } from '@react-navigation/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { DEFAULT_DIRECTION, IS_NATIVE } from './constants';
|
|
6
6
|
import { LinkingContext } from "./LinkingContext.js";
|
|
7
7
|
import { LocaleDirContext } from "./LocaleDirContext.js";
|
|
8
|
-
import {
|
|
8
|
+
import { LightTheme } from "./theming/LightTheme.js";
|
|
9
9
|
import { useBackButton } from './useBackButton';
|
|
10
10
|
import { useDocumentTitle } from './useDocumentTitle';
|
|
11
11
|
import { useLinking } from './useLinking';
|
|
@@ -13,19 +13,23 @@ import { useThenable } from "./useThenable.js";
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
globalThis.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
|
|
15
15
|
const RESTORE_STATE_ERROR = 'Failed to restore navigation state. The state will be initialized based on the navigation tree.';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Container component that manages the navigation state.
|
|
19
|
+
*
|
|
20
|
+
* This should be rendered at the root wrapping the whole app.
|
|
21
|
+
*/
|
|
22
|
+
export function NavigationContainer({
|
|
23
|
+
direction = DEFAULT_DIRECTION,
|
|
24
|
+
theme = LightTheme,
|
|
19
25
|
linking,
|
|
20
26
|
persistor,
|
|
21
27
|
fallback = null,
|
|
22
28
|
documentTitle,
|
|
23
29
|
onStateChange,
|
|
30
|
+
ref,
|
|
24
31
|
...rest
|
|
25
|
-
}
|
|
26
|
-
if (linking?.config) {
|
|
27
|
-
validatePathConfig(linking.config);
|
|
28
|
-
}
|
|
32
|
+
}) {
|
|
29
33
|
const refContainer = React.useRef(null);
|
|
30
34
|
useBackButton(refContainer);
|
|
31
35
|
useDocumentTitle(refContainer, documentTitle);
|
|
@@ -37,6 +41,9 @@ function NavigationContainerInner({
|
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
43
|
}
|
|
44
|
+
if (linking?.config) {
|
|
45
|
+
validatePathConfig(linking.config);
|
|
46
|
+
}
|
|
40
47
|
return {
|
|
41
48
|
options: {
|
|
42
49
|
...linking,
|
|
@@ -56,9 +63,14 @@ function NavigationContainerInner({
|
|
|
56
63
|
// This will be used by the devtools
|
|
57
64
|
React.useEffect(() => {
|
|
58
65
|
if (refContainer.current) {
|
|
66
|
+
const previous = REACT_NAVIGATION_DEVTOOLS.get(refContainer.current);
|
|
67
|
+
const listeners = previous?.listeners ?? new Set();
|
|
59
68
|
REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
|
|
60
69
|
get linking() {
|
|
61
70
|
return linkingConfig.options;
|
|
71
|
+
},
|
|
72
|
+
get listeners() {
|
|
73
|
+
return listeners;
|
|
62
74
|
}
|
|
63
75
|
});
|
|
64
76
|
}
|
|
@@ -69,7 +81,7 @@ function NavigationContainerInner({
|
|
|
69
81
|
}
|
|
70
82
|
return getInitialState();
|
|
71
83
|
});
|
|
72
|
-
const isPersistenceSupported =
|
|
84
|
+
const isPersistenceSupported = IS_NATIVE || !linkingConfig.options.enabled;
|
|
73
85
|
const [isPersistedStateResolved, initialStateFromPersisted] = useThenable(() => {
|
|
74
86
|
if (isPersistenceSupported === false || rest.initialState != null || persistor == null) {
|
|
75
87
|
return undefined;
|
|
@@ -128,11 +140,4 @@ function NavigationContainerInner({
|
|
|
128
140
|
})
|
|
129
141
|
});
|
|
130
142
|
}
|
|
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
143
|
//# 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","DEFAULT_DIRECTION","IS_NATIVE","LinkingContext","LocaleDirContext","LightTheme","useBackButton","useDocumentTitle","useLinking","useThenable","jsx","_jsx","globalThis","REACT_NAVIGATION_DEVTOOLS","WeakMap","RESTORE_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","restoredState","restore","e","console","error","then","state","thenable","onfulfilled","Promise","resolve","useImperativeHandle","isStateReady","Provider","value","children","persist"],"sourceRoot":"../../src","sources":["NavigationContainer.tsx"],"mappings":";;AAAA,SACEA,uBAAuB,EACvBC,kBAAkB,EAClBC,gBAAgB,EAChBC,gBAAgB,EAOhBC,aAAa,EACbC,kBAAkB,QACb,wBAAwB;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,iBAAiB,EAAEC,SAAS,QAAQ,aAAa;AAC1D,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,UAAU,QAAQ,yBAAsB;AAOjD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAAwBC,WAAW,QAAQ,kBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkB3DC,UAAU,CAACC,yBAAyB,GAAG,IAAIC,OAAO,CAAC,CAAC;AAkEpD,MAAMC,mBAAmB,GACvB,iGAAiG;;AAEnG;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAuC;EACxEC,SAAS,GAAGhB,iBAAiB;EAC7BiB,KAAK,GAAGb,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|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_DIRECTION","IS_NATIVE"],"sourceRoot":"../../src","sources":["constants.tsx"],"mappings":";;AAEA,OAAO,MAAMA,iBAAkC,GAAG,KAAK;AAEvD,OAAO,MAAMC,SAAS,GAAG,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["I18nManager","DEFAULT_DIRECTION","getConstants","isRTL","IS_NATIVE"],"sourceRoot":"../../src","sources":["constants.native.tsx"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,cAAc;AAI1C,OAAO,MAAMC,iBAAkC,GAAGD,WAAW,CAACE,YAAY,CAAC,CAAC,CACzEC,KAAK,GACJ,KAAK,GACL,KAAK;AAET,OAAO,MAAMC,SAAS,GAAG,IAAI","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { nanoid } from 'nanoid/non-secure';
|
|
4
|
+
const getPathWithoutHash = path => path.split('#')[0] ?? '';
|
|
4
5
|
export function createMemoryHistory() {
|
|
5
6
|
let index = 0;
|
|
6
7
|
let items = [];
|
|
@@ -34,10 +35,15 @@ export function createMemoryHistory() {
|
|
|
34
35
|
backIndex({
|
|
35
36
|
path
|
|
36
37
|
}) {
|
|
38
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
39
|
+
|
|
37
40
|
// We need to find the index from the element before current to get closest path to go back to
|
|
38
41
|
for (let i = index - 1; i >= 0; i--) {
|
|
39
42
|
const item = items[i];
|
|
40
|
-
if (item
|
|
43
|
+
if (item == null) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (item.path === pathWithoutHash) {
|
|
41
47
|
return i;
|
|
42
48
|
}
|
|
43
49
|
}
|
|
@@ -49,12 +55,13 @@ export function createMemoryHistory() {
|
|
|
49
55
|
}) {
|
|
50
56
|
interrupt();
|
|
51
57
|
const id = nanoid();
|
|
58
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
52
59
|
|
|
53
60
|
// When a new entry is pushed, all the existing entries after index will be inaccessible
|
|
54
61
|
// So we remove any existing entries after the current index to clean them up
|
|
55
62
|
items = items.slice(0, index + 1);
|
|
56
63
|
items.push({
|
|
57
|
-
path,
|
|
64
|
+
path: pathWithoutHash,
|
|
58
65
|
state,
|
|
59
66
|
id
|
|
60
67
|
});
|
|
@@ -74,6 +81,7 @@ export function createMemoryHistory() {
|
|
|
74
81
|
}) {
|
|
75
82
|
interrupt();
|
|
76
83
|
const id = window.history.state?.id ?? nanoid();
|
|
84
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
77
85
|
|
|
78
86
|
// Need to keep the hash part of the path if there was no previous history entry
|
|
79
87
|
// or the previous history entry had the same path
|
|
@@ -89,17 +97,18 @@ export function createMemoryHistory() {
|
|
|
89
97
|
|
|
90
98
|
pathWithHash = pathWithHash + hash;
|
|
91
99
|
items = [{
|
|
92
|
-
path:
|
|
100
|
+
path: pathWithoutHash,
|
|
93
101
|
state,
|
|
94
102
|
id
|
|
95
103
|
}];
|
|
96
104
|
index = 0;
|
|
97
105
|
} else {
|
|
98
|
-
|
|
106
|
+
const item = items[index];
|
|
107
|
+
if (item?.path === pathWithoutHash) {
|
|
99
108
|
pathWithHash = pathWithHash + hash;
|
|
100
109
|
}
|
|
101
110
|
items[index] = {
|
|
102
|
-
path,
|
|
111
|
+
path: pathWithoutHash,
|
|
103
112
|
state,
|
|
104
113
|
id
|
|
105
114
|
};
|
|
@@ -134,6 +143,7 @@ export function createMemoryHistory() {
|
|
|
134
143
|
if (n === 0) {
|
|
135
144
|
return;
|
|
136
145
|
}
|
|
146
|
+
const targetId = items[index]?.id;
|
|
137
147
|
|
|
138
148
|
// When we call `history.go`, `popstate` will fire when there's history to go back to
|
|
139
149
|
// So we need to somehow handle following cases:
|
|
@@ -143,7 +153,12 @@ export function createMemoryHistory() {
|
|
|
143
153
|
return new Promise((resolve, reject) => {
|
|
144
154
|
const done = interrupted => {
|
|
145
155
|
clearTimeout(timer);
|
|
146
|
-
|
|
156
|
+
|
|
157
|
+
// The current entry may not be the one we intended to land on:
|
|
158
|
+
// - The traversal didn't happen yet, e.g. it took longer than the timeout
|
|
159
|
+
// - The user navigated in the browser while our traversal was in-flight
|
|
160
|
+
// So we treat it the same as the operation being interrupted
|
|
161
|
+
if (interrupted || window.history.state?.id !== targetId) {
|
|
147
162
|
reject(new Error('History was changed during navigation.'));
|
|
148
163
|
return;
|
|
149
164
|
}
|
|
@@ -174,9 +189,10 @@ export function createMemoryHistory() {
|
|
|
174
189
|
// But on Firefox, it seems to take much longer, around 50ms from our testing
|
|
175
190
|
// We're using a hacky timeout since there doesn't seem to be way to know for sure
|
|
176
191
|
const timer = setTimeout(() => {
|
|
192
|
+
window.removeEventListener('popstate', onPopState);
|
|
177
193
|
const foundIndex = pending.findIndex(it => it.ref === done);
|
|
178
194
|
if (foundIndex > -1) {
|
|
179
|
-
pending[foundIndex]
|
|
195
|
+
pending[foundIndex]?.cb();
|
|
180
196
|
pending.splice(foundIndex, 1);
|
|
181
197
|
}
|
|
182
198
|
index = this.index;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["nanoid","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","
|
|
1
|
+
{"version":3,"names":["nanoid","getPathWithoutHash","path","split","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","pathWithoutHash","i","push","slice","length","pushState","replace","pathWithHash","hash","includes","location","replaceState","go","n","nextIndex","lastItemIndex","targetId","Promise","resolve","reject","done","interrupted","clearTimeout","timer","Error","title","document","ref","setTimeout","removeEventListener","onPopState","foundIndex","splice","last","pop","addEventListener","listen","listener"],"sourceRoot":"../../src","sources":["createMemoryHistory.tsx"],"mappings":";;AACA,SAASA,MAAM,QAAQ,mBAAmB;AAW1C,MAAMC,kBAAkB,GAAIC,IAAY,IAAKA,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;AAErE,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EACpC,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,KAAsB,GAAG,EAAE;;EAE/B;EACA;EACA,MAAMC,OAAgE,GAAG,EAAE;EAE3E,MAAMC,SAAS,GAAGA,CAAA,KAAM;IACtB;IACA;IACA;IACAD,OAAO,CAACE,OAAO,CAAEC,EAAE,IAAK;MACtB,MAAMC,EAAE,GAAGD,EAAE,CAACC,EAAE;MAChBD,EAAE,CAACC,EAAE,GAAG,MAAMA,EAAE,CAAC,IAAI,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC;EAED,MAAMC,OAAO,GAAG;IACd,IAAIP,KAAKA,CAAA,EAAW;MAClB;MACA;MACA,MAAMQ,EAAE,GAAGC,MAAM,CAACF,OAAO,CAACG,KAAK,EAAEF,EAAE;MAEnC,IAAIA,EAAE,EAAE;QACN,MAAMR,KAAK,GAAGC,KAAK,CAACU,SAAS,CAAEC,IAAI,IAAKA,IAAI,CAACJ,EAAE,KAAKA,EAAE,CAAC;QAEvD,OAAOR,KAAK,GAAG,CAAC,CAAC,GAAGA,KAA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";
|
|
2
|
+
|
|
3
|
+
import { CommonActions, createNavigatorFactory, createScreenFactory, useNavigationBuilder } from '@react-navigation/core';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useBuildHref } from "./useLinkBuilder.js";
|
|
6
|
+
import { useMemoArray } from "./useMemoArray.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export function createStandardNavigationFactories(navigator, router, mapper) {
|
|
9
|
+
const {
|
|
10
|
+
type,
|
|
11
|
+
version,
|
|
12
|
+
NavigatorContent
|
|
13
|
+
} = navigator;
|
|
14
|
+
if (type !== 'standard') {
|
|
15
|
+
throw new Error(`createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type "${type}".` : 'unknown type.'}`);
|
|
16
|
+
}
|
|
17
|
+
if (version !== 1) {
|
|
18
|
+
throw new Error(`createStandardNavigationFactories only works with version 1 of standard navigator objects, but got version ${version}.`);
|
|
19
|
+
}
|
|
20
|
+
function StandardNavigationNavigator(props) {
|
|
21
|
+
const builder = useNavigationBuilder(router, props);
|
|
22
|
+
const buildHref = useBuildHref();
|
|
23
|
+
const routes = useMemoArray(builder.state.routes.map(route => {
|
|
24
|
+
const href = buildHref(route.name, route.params);
|
|
25
|
+
return [{
|
|
26
|
+
key: route.key,
|
|
27
|
+
name: route.name,
|
|
28
|
+
params: route.params,
|
|
29
|
+
href
|
|
30
|
+
}, [route.key, route.name, route.params, href]];
|
|
31
|
+
}));
|
|
32
|
+
const state = React.useMemo(() => ({
|
|
33
|
+
index: builder.state.index,
|
|
34
|
+
routes
|
|
35
|
+
}), [builder.state.index, routes]);
|
|
36
|
+
const descriptors = {};
|
|
37
|
+
for (const route of state.routes) {
|
|
38
|
+
const descriptor = builder.descriptors[route.key];
|
|
39
|
+
if (descriptor == null) {
|
|
40
|
+
throw new Error(`No descriptor found for route "${route.name}" (${route.key}).`);
|
|
41
|
+
}
|
|
42
|
+
descriptors[route.key] = {
|
|
43
|
+
options: descriptor.options,
|
|
44
|
+
render: descriptor.render
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const actions = React.useMemo(() => ({
|
|
48
|
+
navigate(name, params) {
|
|
49
|
+
builder.navigation.dispatch({
|
|
50
|
+
...CommonActions.navigate(name, params),
|
|
51
|
+
target: builder.state.key
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
back() {
|
|
55
|
+
builder.navigation.goBack();
|
|
56
|
+
}
|
|
57
|
+
}), [builder.navigation, builder.state.key]);
|
|
58
|
+
const emitter = React.useMemo(() => ({
|
|
59
|
+
// @ts-expect-error - they are compatible
|
|
60
|
+
emit: builder.navigation.emit
|
|
61
|
+
}), [builder.navigation]);
|
|
62
|
+
const mapped = mapper?.({
|
|
63
|
+
state: builder.state,
|
|
64
|
+
navigation: builder.navigation
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Omit props used by useNavigationBuilder and routers internally
|
|
68
|
+
const {
|
|
69
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
70
|
+
children,
|
|
71
|
+
initialRouteName,
|
|
72
|
+
layout,
|
|
73
|
+
routeNamesChangeBehavior,
|
|
74
|
+
router: routerOverride,
|
|
75
|
+
screenLayout,
|
|
76
|
+
screenListeners,
|
|
77
|
+
screenOptions,
|
|
78
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
79
|
+
...rest
|
|
80
|
+
} = props;
|
|
81
|
+
return /*#__PURE__*/_jsx(builder.NavigationContent, {
|
|
82
|
+
children: /*#__PURE__*/_jsx(NavigatorContent, {
|
|
83
|
+
...rest,
|
|
84
|
+
...mapped,
|
|
85
|
+
state: state,
|
|
86
|
+
descriptors: descriptors,
|
|
87
|
+
actions: actions,
|
|
88
|
+
emitter: emitter
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const createNavigator = createNavigatorFactory(StandardNavigationNavigator);
|
|
93
|
+
const createScreen = createScreenFactory();
|
|
94
|
+
return {
|
|
95
|
+
createNavigator,
|
|
96
|
+
createScreen
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=createStandardNavigationFactories.js.map
|