@react-navigation/native 8.0.0-alpha.5 → 8.0.0-alpha.51
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 +101 -28
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +42 -13
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +126 -24
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +42 -23
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +25 -7
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- 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 +30 -10
- package/ios/ReactNavigationSFSymbolView.swift +361 -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 +11 -8
- 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 +27 -10
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStandardNavigationFactories.js +97 -0
- package/lib/module/createStandardNavigationFactories.js.map +1 -0
- package/lib/module/createStaticNavigation.js +7 -5
- 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 +19 -20
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbol.js +3 -0
- package/lib/module/native/MaterialSymbol.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +8 -4
- package/lib/module/native/NativeMaterialSymbolModule.js.map +1 -1
- 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 +17 -17
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +143 -68
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +5 -5
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +268 -58
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +31 -12
- 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 +6 -9
- 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 +2 -2
- 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 +26 -14
- 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 +9 -9
- 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 +11 -5
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +10 -4
- 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 +4 -3
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +2 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.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 +289 -52
- 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 +41 -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 +62 -70
- 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/useLinkTo.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +7 -49
- 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 +1 -4
- 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/LinkingContext.tsx +1 -1
- package/src/NavigationContainer.tsx +141 -70
- package/src/__stubs__/createStackNavigator.tsx +20 -18
- package/src/checkSerializable.tsx +246 -0
- package/src/constants.native.tsx +10 -0
- package/src/constants.tsx +5 -0
- package/src/createMemoryHistory.tsx +32 -10
- package/src/createStandardNavigationFactories.tsx +217 -0
- package/src/createStaticNavigation.tsx +32 -31
- 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 +31 -26
- package/src/native/MaterialSymbol.tsx +16 -4
- package/src/native/MaterialSymbolData.tsx +200 -373
- package/src/native/MaterialSymbolViewNativeComponent.ts +8 -4
- package/src/native/NativeMaterialSymbolModule.ts +4 -1
- 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 +348 -54
- 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 +67 -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 +29 -25
- package/src/useLinkProps.tsx +371 -127
- package/src/useLinkTo.tsx +9 -8
- package/src/useLinking.native.tsx +70 -39
- package/src/useLinking.tsx +426 -87
- package/src/useLocale.tsx +1 -1
- package/src/useMemoArray.tsx +41 -0
- package/src/useRoutePath.tsx +1 -1
- package/src/useScrollToTop.tsx +21 -13
- 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 -81
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -34
- 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 -176
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -132
- 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/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerDelegate.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerInterface.class.uniqueId1 +0 -0
- 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/assets/fonts/MaterialSymbolsOutlined.codepoints +0 -4102
- 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 +0 -4102
- 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 +0 -4102
- 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/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
|
@@ -10,6 +10,8 @@ type HistoryRecord = {
|
|
|
10
10
|
path: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const getPathWithoutHash = (path: string) => path.split('#')[0] ?? '';
|
|
14
|
+
|
|
13
15
|
export function createMemoryHistory() {
|
|
14
16
|
let index = 0;
|
|
15
17
|
let items: HistoryRecord[] = [];
|
|
@@ -48,11 +50,17 @@ export function createMemoryHistory() {
|
|
|
48
50
|
},
|
|
49
51
|
|
|
50
52
|
backIndex({ path }: { path: string }) {
|
|
53
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
54
|
+
|
|
51
55
|
// We need to find the index from the element before current to get closest path to go back to
|
|
52
56
|
for (let i = index - 1; i >= 0; i--) {
|
|
53
57
|
const item = items[i];
|
|
54
58
|
|
|
55
|
-
if (item
|
|
59
|
+
if (item == null) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (item.path === pathWithoutHash) {
|
|
56
64
|
return i;
|
|
57
65
|
}
|
|
58
66
|
}
|
|
@@ -64,12 +72,13 @@ export function createMemoryHistory() {
|
|
|
64
72
|
interrupt();
|
|
65
73
|
|
|
66
74
|
const id = nanoid();
|
|
75
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
67
76
|
|
|
68
77
|
// When a new entry is pushed, all the existing entries after index will be inaccessible
|
|
69
78
|
// So we remove any existing entries after the current index to clean them up
|
|
70
79
|
items = items.slice(0, index + 1);
|
|
71
80
|
|
|
72
|
-
items.push({ path, state, id });
|
|
81
|
+
items.push({ path: pathWithoutHash, state, id });
|
|
73
82
|
index = items.length - 1;
|
|
74
83
|
|
|
75
84
|
// We pass empty string for title because it's ignored in all browsers except safari
|
|
@@ -83,6 +92,7 @@ export function createMemoryHistory() {
|
|
|
83
92
|
interrupt();
|
|
84
93
|
|
|
85
94
|
const id = window.history.state?.id ?? nanoid();
|
|
95
|
+
const pathWithoutHash = getPathWithoutHash(path);
|
|
86
96
|
|
|
87
97
|
// Need to keep the hash part of the path if there was no previous history entry
|
|
88
98
|
// or the previous history entry had the same path
|
|
@@ -98,13 +108,16 @@ export function createMemoryHistory() {
|
|
|
98
108
|
// So we need to push the entry as there's nothing to replace
|
|
99
109
|
|
|
100
110
|
pathWithHash = pathWithHash + hash;
|
|
101
|
-
items = [{ path:
|
|
111
|
+
items = [{ path: pathWithoutHash, state, id }];
|
|
102
112
|
index = 0;
|
|
103
113
|
} else {
|
|
104
|
-
|
|
114
|
+
const item = items[index];
|
|
115
|
+
|
|
116
|
+
if (item?.path === pathWithoutHash) {
|
|
105
117
|
pathWithHash = pathWithHash + hash;
|
|
106
118
|
}
|
|
107
|
-
|
|
119
|
+
|
|
120
|
+
items[index] = { path: pathWithoutHash, state, id };
|
|
108
121
|
}
|
|
109
122
|
|
|
110
123
|
window.history.replaceState({ id }, '', pathWithHash);
|
|
@@ -138,6 +151,8 @@ export function createMemoryHistory() {
|
|
|
138
151
|
return;
|
|
139
152
|
}
|
|
140
153
|
|
|
154
|
+
const targetId = items[index]?.id;
|
|
155
|
+
|
|
141
156
|
// When we call `history.go`, `popstate` will fire when there's history to go back to
|
|
142
157
|
// So we need to somehow handle following cases:
|
|
143
158
|
// - There's history to go back, `history.go` is called, and `popstate` fires
|
|
@@ -147,7 +162,11 @@ export function createMemoryHistory() {
|
|
|
147
162
|
const done = (interrupted?: boolean) => {
|
|
148
163
|
clearTimeout(timer);
|
|
149
164
|
|
|
150
|
-
|
|
165
|
+
// The current entry may not be the one we intended to land on:
|
|
166
|
+
// - The traversal didn't happen yet, e.g. it took longer than the timeout
|
|
167
|
+
// - The user navigated in the browser while our traversal was in-flight
|
|
168
|
+
// So we treat it the same as the operation being interrupted
|
|
169
|
+
if (interrupted || window.history.state?.id !== targetId) {
|
|
151
170
|
reject(new Error('History was changed during navigation.'));
|
|
152
171
|
return;
|
|
153
172
|
}
|
|
@@ -170,21 +189,24 @@ export function createMemoryHistory() {
|
|
|
170
189
|
|
|
171
190
|
pending.push({ ref: done, cb: done });
|
|
172
191
|
|
|
173
|
-
// If navigation didn't happen within
|
|
192
|
+
// If navigation didn't happen within 1000ms, assume that it won't happen
|
|
174
193
|
// This may not be accurate, but hopefully it won't take so much time
|
|
175
194
|
// In Chrome, navigation seems to happen instantly in next microtask
|
|
176
|
-
// But on Firefox,
|
|
195
|
+
// But on Firefox, the traversal can take much longer when the main thread
|
|
196
|
+
// is busy, e.g. it was measured to take up to ~900ms while rendering a new screen
|
|
177
197
|
// We're using a hacky timeout since there doesn't seem to be way to know for sure
|
|
178
198
|
const timer = setTimeout(() => {
|
|
199
|
+
window.removeEventListener('popstate', onPopState);
|
|
200
|
+
|
|
179
201
|
const foundIndex = pending.findIndex((it) => it.ref === done);
|
|
180
202
|
|
|
181
203
|
if (foundIndex > -1) {
|
|
182
|
-
pending[foundIndex]
|
|
204
|
+
pending[foundIndex]?.cb();
|
|
183
205
|
pending.splice(foundIndex, 1);
|
|
184
206
|
}
|
|
185
207
|
|
|
186
208
|
index = this.index;
|
|
187
|
-
},
|
|
209
|
+
}, 1000);
|
|
188
210
|
|
|
189
211
|
const onPopState = () => {
|
|
190
212
|
// Fix createMemoryHistory.index variable's value
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommonActions,
|
|
3
|
+
createNavigatorFactory,
|
|
4
|
+
createScreenFactory,
|
|
5
|
+
type DefaultRouterOptions,
|
|
6
|
+
type EventMapBase,
|
|
7
|
+
type NavigationAction,
|
|
8
|
+
type NavigatorTypeBagBase,
|
|
9
|
+
type ParamListBase,
|
|
10
|
+
type RouterFactory,
|
|
11
|
+
useNavigationBuilder,
|
|
12
|
+
} from '@react-navigation/core';
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import type {
|
|
15
|
+
createStandardNavigator,
|
|
16
|
+
NavigatorArgs as StandardNavigationArgs,
|
|
17
|
+
} from 'standard-navigation';
|
|
18
|
+
|
|
19
|
+
import { useBuildHref } from './useLinkBuilder';
|
|
20
|
+
import { useMemoArray } from './useMemoArray';
|
|
21
|
+
|
|
22
|
+
type StandardEventMap<EventMap extends EventMapBase> = {
|
|
23
|
+
[EventName in keyof EventMap]: {
|
|
24
|
+
data: EventMap[EventName] extends { data?: infer Data }
|
|
25
|
+
? Data extends object | undefined
|
|
26
|
+
? Data
|
|
27
|
+
: object | undefined
|
|
28
|
+
: undefined;
|
|
29
|
+
canPreventDefault: EventMap[EventName] extends { canPreventDefault: true }
|
|
30
|
+
? true
|
|
31
|
+
: false;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface StandardNavigationTypeBagBase extends NavigatorTypeBagBase {
|
|
36
|
+
RouterOptions: DefaultRouterOptions;
|
|
37
|
+
Navigator: React.ComponentType<{}>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type StandardNavigationTypeBagFor<
|
|
41
|
+
TypeBag extends StandardNavigationTypeBagBase,
|
|
42
|
+
ParamList extends ParamListBase,
|
|
43
|
+
> = TypeBag & { ParamList: ParamList };
|
|
44
|
+
|
|
45
|
+
type StandardNavigationListFor<
|
|
46
|
+
TypeBag extends StandardNavigationTypeBagBase,
|
|
47
|
+
ParamList extends ParamListBase,
|
|
48
|
+
> = StandardNavigationTypeBagFor<TypeBag, ParamList>['NavigationList'];
|
|
49
|
+
|
|
50
|
+
type StandardNavigationMapperProps<
|
|
51
|
+
TypeBag extends StandardNavigationTypeBagBase,
|
|
52
|
+
> = {
|
|
53
|
+
state: StandardNavigationTypeBagFor<TypeBag, ParamListBase>['State'];
|
|
54
|
+
navigation: StandardNavigationListFor<
|
|
55
|
+
TypeBag,
|
|
56
|
+
ParamListBase
|
|
57
|
+
>[keyof StandardNavigationListFor<TypeBag, ParamListBase>];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export function createStandardNavigationFactories<
|
|
61
|
+
TypeBag extends StandardNavigationTypeBagBase,
|
|
62
|
+
NavigatorProps extends object = {},
|
|
63
|
+
MapperProps extends object = {},
|
|
64
|
+
>(
|
|
65
|
+
navigator: ReturnType<
|
|
66
|
+
typeof createStandardNavigator<
|
|
67
|
+
TypeBag['ScreenOptions'],
|
|
68
|
+
StandardEventMap<TypeBag['EventMap']>,
|
|
69
|
+
NavigatorProps & MapperProps
|
|
70
|
+
>
|
|
71
|
+
>,
|
|
72
|
+
router: RouterFactory<
|
|
73
|
+
StandardNavigationTypeBagFor<TypeBag, ParamListBase>['State'],
|
|
74
|
+
NavigationAction,
|
|
75
|
+
TypeBag['RouterOptions']
|
|
76
|
+
>,
|
|
77
|
+
mapper?: (props: StandardNavigationMapperProps<TypeBag>) => MapperProps
|
|
78
|
+
) {
|
|
79
|
+
const { type, version, NavigatorContent } = navigator;
|
|
80
|
+
|
|
81
|
+
if (type !== 'standard') {
|
|
82
|
+
throw new Error(
|
|
83
|
+
`createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type "${type}".` : 'unknown type.'}`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (version !== 1) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
`createStandardNavigationFactories only works with version 1 of standard navigator objects, but got version ${version}.`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type StandardArgs = StandardNavigationArgs<
|
|
94
|
+
TypeBag['ScreenOptions'],
|
|
95
|
+
StandardEventMap<TypeBag['EventMap']>
|
|
96
|
+
>;
|
|
97
|
+
|
|
98
|
+
function StandardNavigationNavigator(props: any) {
|
|
99
|
+
const builder = useNavigationBuilder<
|
|
100
|
+
TypeBag['State'],
|
|
101
|
+
TypeBag['RouterOptions'],
|
|
102
|
+
TypeBag['ActionHelpers'],
|
|
103
|
+
TypeBag['ScreenOptions'],
|
|
104
|
+
TypeBag['EventMap']
|
|
105
|
+
>(router, props);
|
|
106
|
+
|
|
107
|
+
const buildHref = useBuildHref();
|
|
108
|
+
|
|
109
|
+
const routes = useMemoArray(
|
|
110
|
+
builder.state.routes.map((route) => {
|
|
111
|
+
const href = buildHref(route.name, route.params);
|
|
112
|
+
|
|
113
|
+
return [
|
|
114
|
+
{
|
|
115
|
+
key: route.key,
|
|
116
|
+
name: route.name,
|
|
117
|
+
params: route.params,
|
|
118
|
+
href,
|
|
119
|
+
},
|
|
120
|
+
[route.key, route.name, route.params, href],
|
|
121
|
+
];
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const state = React.useMemo(
|
|
126
|
+
(): StandardArgs['state'] => ({
|
|
127
|
+
index: builder.state.index,
|
|
128
|
+
routes,
|
|
129
|
+
}),
|
|
130
|
+
[builder.state.index, routes]
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const descriptors: StandardArgs['descriptors'] = {};
|
|
134
|
+
|
|
135
|
+
for (const route of state.routes) {
|
|
136
|
+
const descriptor = builder.descriptors[route.key];
|
|
137
|
+
|
|
138
|
+
if (descriptor == null) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`No descriptor found for route "${route.name}" (${route.key}).`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
descriptors[route.key] = {
|
|
145
|
+
options: descriptor.options,
|
|
146
|
+
render: descriptor.render,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const actions = React.useMemo<StandardArgs['actions']>(
|
|
151
|
+
() => ({
|
|
152
|
+
navigate(name, params) {
|
|
153
|
+
builder.navigation.dispatch({
|
|
154
|
+
...CommonActions.navigate(name, params),
|
|
155
|
+
target: builder.state.key,
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
back() {
|
|
159
|
+
builder.navigation.goBack();
|
|
160
|
+
},
|
|
161
|
+
}),
|
|
162
|
+
[builder.navigation, builder.state.key]
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const emitter = React.useMemo<StandardArgs['emitter']>(
|
|
166
|
+
() => ({
|
|
167
|
+
// @ts-expect-error - they are compatible
|
|
168
|
+
emit: builder.navigation.emit,
|
|
169
|
+
}),
|
|
170
|
+
[builder.navigation]
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
const mapped = mapper?.({
|
|
174
|
+
state: builder.state as TypeBag['State'],
|
|
175
|
+
navigation: builder.navigation as never,
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Omit props used by useNavigationBuilder and routers internally
|
|
179
|
+
const {
|
|
180
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
181
|
+
children,
|
|
182
|
+
initialRouteName,
|
|
183
|
+
layout,
|
|
184
|
+
routeNamesChangeBehavior,
|
|
185
|
+
router: routerOverride,
|
|
186
|
+
screenLayout,
|
|
187
|
+
screenListeners,
|
|
188
|
+
screenOptions,
|
|
189
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
190
|
+
...rest
|
|
191
|
+
} = props;
|
|
192
|
+
|
|
193
|
+
return builder.render(
|
|
194
|
+
<NavigatorContent
|
|
195
|
+
{...(rest as NavigatorProps & MapperProps)}
|
|
196
|
+
{...mapped}
|
|
197
|
+
state={state}
|
|
198
|
+
descriptors={descriptors}
|
|
199
|
+
actions={actions}
|
|
200
|
+
emitter={emitter}
|
|
201
|
+
/>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const createNavigator = createNavigatorFactory<
|
|
206
|
+
TypeBag & {
|
|
207
|
+
Navigator: React.ComponentType<NavigatorProps>;
|
|
208
|
+
}
|
|
209
|
+
>(StandardNavigationNavigator);
|
|
210
|
+
|
|
211
|
+
const createScreen = createScreenFactory<TypeBag>();
|
|
212
|
+
|
|
213
|
+
return {
|
|
214
|
+
createNavigator,
|
|
215
|
+
createScreen,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createComponentForStaticNavigation,
|
|
3
2
|
createPathConfigForStaticNavigation,
|
|
4
|
-
type
|
|
5
|
-
type ParamListBase,
|
|
3
|
+
type RootParamList,
|
|
6
4
|
type StaticNavigation,
|
|
7
5
|
} from '@react-navigation/core';
|
|
8
6
|
import * as React from 'react';
|
|
@@ -10,31 +8,32 @@ import * as React from 'react';
|
|
|
10
8
|
import { NavigationContainer } from './NavigationContainer';
|
|
11
9
|
import type { LinkingOptions } from './types';
|
|
12
10
|
|
|
13
|
-
type Props = Omit<
|
|
14
|
-
React.ComponentProps<typeof NavigationContainer
|
|
11
|
+
type Props<ParamList extends {}> = Omit<
|
|
12
|
+
React.ComponentProps<typeof NavigationContainer<ParamList>>,
|
|
15
13
|
'linking' | 'children'
|
|
16
14
|
> & {
|
|
17
15
|
/**
|
|
18
16
|
* Options for deep linking.
|
|
19
17
|
*/
|
|
20
|
-
linking?:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
linking?:
|
|
19
|
+
| (Omit<LinkingOptions<ParamList>, 'config' | 'enabled'> & {
|
|
20
|
+
/**
|
|
21
|
+
* Whether deep link handling should be enabled.
|
|
22
|
+
* Defaults to `auto`.
|
|
23
|
+
*
|
|
24
|
+
* When set to 'auto', all leaf screens will get autogenerated paths.
|
|
25
|
+
* The generated paths will be kebab-case versions of the screen names.
|
|
26
|
+
* This can be overridden for specific screens by specifying `linking` for the screen.
|
|
27
|
+
*/
|
|
28
|
+
enabled?: 'auto' | true | false | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Additional configuration
|
|
31
|
+
*/
|
|
32
|
+
config?:
|
|
33
|
+
| Omit<NonNullable<LinkingOptions<ParamList>['config']>, 'screens'>
|
|
34
|
+
| undefined;
|
|
35
|
+
})
|
|
36
|
+
| undefined;
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
/**
|
|
@@ -44,13 +43,15 @@ type Props = Omit<
|
|
|
44
43
|
* @param tree Static navigation config.
|
|
45
44
|
* @returns Navigation component to use in your app.
|
|
46
45
|
*/
|
|
47
|
-
export function createStaticNavigation(tree: StaticNavigation<any
|
|
48
|
-
const Component =
|
|
46
|
+
export function createStaticNavigation(tree: StaticNavigation<any>) {
|
|
47
|
+
const Component = tree.getComponent();
|
|
48
|
+
const element = <Component />;
|
|
49
49
|
|
|
50
|
-
function Navigation(
|
|
51
|
-
|
|
52
|
-
ref
|
|
53
|
-
|
|
50
|
+
function Navigation<ParamList extends {} = RootParamList>({
|
|
51
|
+
linking,
|
|
52
|
+
ref,
|
|
53
|
+
...rest
|
|
54
|
+
}: Props<ParamList>) {
|
|
54
55
|
const linkingConfig = React.useMemo(() => {
|
|
55
56
|
const screens = createPathConfigForStaticNavigation(
|
|
56
57
|
tree,
|
|
@@ -96,10 +97,10 @@ export function createStaticNavigation(tree: StaticNavigation<any, any, any>) {
|
|
|
96
97
|
|
|
97
98
|
return (
|
|
98
99
|
<NavigationContainer {...rest} ref={ref} linking={memoizedLinking}>
|
|
99
|
-
|
|
100
|
+
{element}
|
|
100
101
|
</NavigationContainer>
|
|
101
102
|
);
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
return
|
|
105
|
+
return Navigation;
|
|
105
106
|
}
|
|
@@ -18,12 +18,14 @@ export function extractPathFromURL(prefixes: LinkingPrefix[], url: string) {
|
|
|
18
18
|
prefixRegex = new RegExp(
|
|
19
19
|
`^${escapeStringRegexp(protocol)}(/)*${host
|
|
20
20
|
.split('.')
|
|
21
|
-
.map((it) => (it === '*' ? '[
|
|
22
|
-
.join('\\.')}
|
|
21
|
+
.map((it) => (it === '*' ? '[^/?#]+' : escapeStringRegexp(it)))
|
|
22
|
+
.join('\\.')}${
|
|
23
|
+
host === '' || host.endsWith('/') ? '' : '(?=$|[/?#])'
|
|
24
|
+
}`
|
|
23
25
|
);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
const [originAndPath, ...searchParams] = url.split('?');
|
|
28
|
+
const [originAndPath = '', ...searchParams] = url.split('?');
|
|
27
29
|
|
|
28
30
|
if (prefixRegex.test(originAndPath)) {
|
|
29
31
|
const result = originAndPath
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { NavigationState } from '@react-navigation/core';
|
|
2
|
+
|
|
3
|
+
export function getStateBreadcrumb(
|
|
4
|
+
state: NavigationState,
|
|
5
|
+
location: (string | number)[]
|
|
6
|
+
) {
|
|
7
|
+
let breadcrumb = '';
|
|
8
|
+
let pointer: Record<any, any> = state;
|
|
9
|
+
let params = false;
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < location.length; i++) {
|
|
12
|
+
const curr = location[i];
|
|
13
|
+
const prev = location[i - 1];
|
|
14
|
+
|
|
15
|
+
if (curr == null) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pointer = pointer[curr];
|
|
20
|
+
|
|
21
|
+
if (!params && curr === 'state') {
|
|
22
|
+
continue;
|
|
23
|
+
} else if (!params && curr === 'routes') {
|
|
24
|
+
if (breadcrumb) {
|
|
25
|
+
breadcrumb += ' > ';
|
|
26
|
+
}
|
|
27
|
+
} else if (!params && typeof curr === 'number' && prev === 'routes') {
|
|
28
|
+
breadcrumb += pointer?.name;
|
|
29
|
+
} else if (!params) {
|
|
30
|
+
breadcrumb += ` > ${curr}`;
|
|
31
|
+
params = true;
|
|
32
|
+
} else {
|
|
33
|
+
if (typeof curr === 'number' || /^[0-9]+$/.test(curr)) {
|
|
34
|
+
breadcrumb += `[${curr}]`;
|
|
35
|
+
} else if (/^[a-z$_]+$/i.test(curr)) {
|
|
36
|
+
breadcrumb += `.${curr}`;
|
|
37
|
+
} else {
|
|
38
|
+
breadcrumb += `[${JSON.stringify(curr)}]`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return breadcrumb;
|
|
44
|
+
}
|
package/src/getStateFromHref.tsx
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getStateFromPath,
|
|
3
|
+
type NavigationState,
|
|
4
|
+
type ParamListBase,
|
|
5
|
+
} from '@react-navigation/core';
|
|
2
6
|
|
|
3
7
|
import { extractPathFromURL } from './extractPathFromURL';
|
|
4
8
|
import type { LinkingOptions } from './types';
|
|
5
9
|
|
|
6
10
|
export function getStateFromHref(
|
|
7
11
|
href: string,
|
|
8
|
-
options: LinkingOptions<ParamListBase> | undefined
|
|
12
|
+
options: LinkingOptions<ParamListBase> | undefined,
|
|
13
|
+
previous: NavigationState | undefined
|
|
9
14
|
): ReturnType<typeof getStateFromPath> {
|
|
10
15
|
const {
|
|
11
16
|
prefixes,
|
|
@@ -40,7 +45,7 @@ export function getStateFromHref(
|
|
|
40
45
|
);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
const state = getStateFromPathHelper(path, config);
|
|
48
|
+
const state = getStateFromPathHelper(path, config, previous);
|
|
44
49
|
|
|
45
50
|
return state;
|
|
46
51
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createStandardNavigationFactories,
|
|
3
|
+
type StandardNavigationTypeBagBase,
|
|
4
|
+
} from './createStandardNavigationFactories';
|
|
1
5
|
export { createStaticNavigation } from './createStaticNavigation';
|
|
2
6
|
export { Link } from './Link';
|
|
3
7
|
export { LinkingContext } from './LinkingContext';
|
|
4
8
|
export { LocaleDirContext } from './LocaleDirContext';
|
|
9
|
+
export {
|
|
10
|
+
type CornerInsetProps,
|
|
11
|
+
type CornerInsetRef,
|
|
12
|
+
CornerInset as UNSTABLE_CornerInset,
|
|
13
|
+
} from './native/CornerInset';
|
|
5
14
|
export {
|
|
6
15
|
MaterialSymbol,
|
|
7
16
|
type MaterialSymbolProps,
|
|
8
17
|
} from './native/MaterialSymbol';
|
|
9
18
|
export { SFSymbol, type SFSymbolProps } from './native/SFSymbol';
|
|
10
19
|
export { NavigationContainer } from './NavigationContainer';
|
|
11
|
-
export { ServerContainer } from './ServerContainer';
|
|
12
20
|
export { DarkTheme } from './theming/DarkTheme';
|
|
13
|
-
export { DefaultTheme } from './theming/
|
|
21
|
+
export { LightTheme as DefaultTheme } from './theming/LightTheme';
|
|
22
|
+
export { MaterialDarkTheme, MaterialLightTheme } from './theming/MaterialTheme';
|
|
14
23
|
export * from './types';
|
|
15
24
|
export { useLinkBuilder } from './useLinkBuilder';
|
|
16
25
|
export { type LinkProps, useLinkProps } from './useLinkProps';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { NavigationContainerRefContext } from '@react-navigation/core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dimensions } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line import-x/extensions
|
|
6
|
+
import type { CornerInsetProps, CornerInsetRef } from './CornerInset.tsx';
|
|
7
|
+
import ReactNavigationCornerInsetViewNativeComponent, {
|
|
8
|
+
Commands,
|
|
9
|
+
} from './ReactNavigationCornerInsetViewNativeComponent';
|
|
10
|
+
|
|
11
|
+
type Props = CornerInsetProps & {
|
|
12
|
+
ref?: React.Ref<CornerInsetRef> | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function CornerInset({ ref, ...rest }: Props) {
|
|
16
|
+
const root = React.use(NavigationContainerRefContext);
|
|
17
|
+
|
|
18
|
+
const nativeRef =
|
|
19
|
+
React.useRef<
|
|
20
|
+
React.ComponentRef<typeof ReactNavigationCornerInsetViewNativeComponent>
|
|
21
|
+
>(null);
|
|
22
|
+
|
|
23
|
+
const relayout = React.useCallback(() => {
|
|
24
|
+
if (nativeRef.current) {
|
|
25
|
+
Commands.relayout(nativeRef.current);
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
if (root == null) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let animationFrameHandle: number | null = null;
|
|
35
|
+
|
|
36
|
+
// We freeze the corner insets after initial measurements
|
|
37
|
+
// This is to avoid the insets getting out of sync during transitions
|
|
38
|
+
// We trigger a relayout explicitly on window resize and transition end
|
|
39
|
+
// eslint-disable-next-line @eslint-react/web-api/no-leaked-event-listener
|
|
40
|
+
const unsubscribeWindowResize = Dimensions.addEventListener(
|
|
41
|
+
'change',
|
|
42
|
+
// eslint-disable-next-line @eslint-react/web-api/no-leaked-event-listener
|
|
43
|
+
() => {
|
|
44
|
+
relayout();
|
|
45
|
+
|
|
46
|
+
if (animationFrameHandle) {
|
|
47
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// When window is unmaximized, calling relayout immediately doesn't work
|
|
51
|
+
// So we delay it to the next frame as a workaround
|
|
52
|
+
animationFrameHandle = requestAnimationFrame(() => {
|
|
53
|
+
animationFrameHandle = requestAnimationFrame(() => {
|
|
54
|
+
relayout();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const unsubscribeTransition = root.addListener('__unsafe_event__', (e) => {
|
|
61
|
+
if (e.data.type === 'transitionEnd') {
|
|
62
|
+
relayout();
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return () => {
|
|
67
|
+
if (animationFrameHandle) {
|
|
68
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
unsubscribeWindowResize.remove();
|
|
72
|
+
unsubscribeTransition();
|
|
73
|
+
};
|
|
74
|
+
}, [root, relayout]);
|
|
75
|
+
|
|
76
|
+
React.useImperativeHandle(
|
|
77
|
+
ref,
|
|
78
|
+
() => ({
|
|
79
|
+
relayout,
|
|
80
|
+
}),
|
|
81
|
+
[relayout]
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<ReactNavigationCornerInsetViewNativeComponent {...rest} ref={nativeRef} />
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type CornerInsetProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The direction of the content that should be inset.
|
|
7
|
+
*/
|
|
8
|
+
direction: 'vertical' | 'horizontal';
|
|
9
|
+
/**
|
|
10
|
+
* The edge where the inset should be applied.
|
|
11
|
+
*/
|
|
12
|
+
edge: 'top' | 'right' | 'bottom' | 'left';
|
|
13
|
+
/**
|
|
14
|
+
* Whether to collapse to 0 when corner inset matches the baseline inset.
|
|
15
|
+
* e.g. it will be 0 for corners without traffic lights on iPadOS.
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
adaptive?: boolean | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Style object for the inset view.
|
|
22
|
+
*/
|
|
23
|
+
style?: ViewStyle | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type CornerInsetRef = {
|
|
27
|
+
relayout(): void;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type Props = CornerInsetProps & {
|
|
31
|
+
ref?: React.Ref<CornerInsetRef> | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function CornerInset({ ref }: Props) {
|
|
35
|
+
React.useImperativeHandle(
|
|
36
|
+
ref,
|
|
37
|
+
() => ({
|
|
38
|
+
relayout() {},
|
|
39
|
+
}),
|
|
40
|
+
[]
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|