@react-navigation/native 8.0.0-alpha.3 → 8.0.0-alpha.30
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 +80 -6
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +33 -12
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +81 -8
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +39 -6
- 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_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_300.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 +4102 -0
- 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 +4102 -0
- 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 +34 -0
- package/ios/ReactNavigationSFSymbolView.swift +543 -7
- package/lib/module/NavigationContainer.js +16 -11
- 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/__stubs__/window.js +3 -0
- package/lib/module/__stubs__/window.js.map +1 -1
- package/lib/module/createMemoryHistory.js +15 -6
- 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 +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +66 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +17 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/MaterialSymbol.android.js +9 -20
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbolData.js +0 -7
- package/lib/module/native/MaterialSymbolData.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +4 -4
- package/lib/module/native/NativeMaterialSymbolModule.js.map +1 -1
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/lib/module/native/SFSymbol.ios.js +45 -1
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +28 -1
- package/lib/module/native/constants.js +14 -0
- package/lib/module/native/constants.js.map +1 -0
- 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 +4 -4
- package/lib/module/theming/{DefaultTheme.js → LightTheme.js} +5 -5
- 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/useBackButton.js.map +1 -1
- 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 +5 -26
- 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 +81 -11
- 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 +1 -1
- package/lib/typescript/src/Link.d.ts.map +1 -1
- 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/__stubs__/window.d.ts.map +1 -1
- 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 +31 -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 +17 -15
- 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 +3 -3
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +0 -3
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +3 -3
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +1 -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 +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 +28 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/constants.d.ts +12 -0
- package/lib/typescript/src/native/constants.d.ts.map +1 -0
- package/lib/typescript/src/native/types.d.ts +345 -5
- 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 -4
- package/lib/typescript/src/theming/{DefaultTheme.d.ts → LightTheme.d.ts} +5 -5
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts +127 -0
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +251 -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/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/useDocumentTitle.d.ts +2 -2
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +54 -66
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +17 -19
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +31 -33
- 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 +41 -22
- package/src/NavigationContainer.tsx +41 -32
- package/src/__stubs__/createStackNavigator.tsx +19 -17
- package/src/__stubs__/window.tsx +5 -0
- package/src/createMemoryHistory.tsx +19 -6
- package/src/createStandardNavigationFactories.tsx +218 -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 +85 -0
- package/src/native/CornerInset.tsx +40 -0
- package/src/native/MaterialSymbol.android.tsx +9 -28
- package/src/native/MaterialSymbolData.tsx +0 -4
- package/src/native/MaterialSymbolViewNativeComponent.ts +4 -4
- package/src/native/NativeMaterialSymbolModule.ts +3 -4
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/src/native/SFSymbol.ios.tsx +84 -2
- package/src/native/SFSymbolViewNativeComponent.ts +28 -1
- package/src/native/constants.tsx +11 -0
- package/src/native/types.tsx +433 -4
- 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/types.tsx +38 -40
- package/src/useBackButton.tsx +2 -2
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +15 -7
- package/src/useLinkProps.tsx +8 -41
- package/src/useLinkTo.tsx +1 -1
- package/src/useLinking.native.tsx +58 -30
- package/src/useLinking.tsx +132 -22
- 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/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 -38
- 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 -113
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +0 -32
- 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/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/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/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/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/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/theming/DefaultTheme.d.ts.map +0 -1
- package/src/ServerContainer.tsx +0 -57
- /package/lib/module/{ServerContext.js → server/ServerContext.js} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Theme } from '@react-navigation/core';
|
|
2
|
+
|
|
3
|
+
import { fonts } from './fonts';
|
|
4
|
+
|
|
5
|
+
export const MaterialLightFallbackTheme = {
|
|
6
|
+
dark: false,
|
|
7
|
+
colors: {
|
|
8
|
+
primary: '#6750a4',
|
|
9
|
+
background: '#f3edf7',
|
|
10
|
+
card: '#fef7ff',
|
|
11
|
+
text: '#1d1b20',
|
|
12
|
+
border: '#cac4d0',
|
|
13
|
+
notification: '#ba1a1a',
|
|
14
|
+
},
|
|
15
|
+
fonts,
|
|
16
|
+
} as const satisfies Theme;
|
|
17
|
+
|
|
18
|
+
export const MaterialDarkFallbackTheme = {
|
|
19
|
+
dark: true,
|
|
20
|
+
colors: {
|
|
21
|
+
primary: '#d0bcff',
|
|
22
|
+
background: '#211f26',
|
|
23
|
+
card: '#141218',
|
|
24
|
+
text: '#e6e0e9',
|
|
25
|
+
border: '#49454f',
|
|
26
|
+
notification: '#ffb4ab',
|
|
27
|
+
},
|
|
28
|
+
fonts,
|
|
29
|
+
} as const satisfies Theme;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Theme } from '@react-navigation/core';
|
|
2
|
+
import { Platform, PlatformColor } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { fonts } from './fonts';
|
|
5
|
+
import {
|
|
6
|
+
MaterialDarkFallbackTheme,
|
|
7
|
+
MaterialLightFallbackTheme,
|
|
8
|
+
} from './MaterialFallbackTheme';
|
|
9
|
+
|
|
10
|
+
const isDynamicThemeSupported =
|
|
11
|
+
Platform.OS === 'android' && Platform.Version >= 34;
|
|
12
|
+
|
|
13
|
+
const MaterialLightDynamicTheme = {
|
|
14
|
+
dark: false,
|
|
15
|
+
colors: {
|
|
16
|
+
primary: PlatformColor('@android:color/system_primary_light'),
|
|
17
|
+
background: PlatformColor('@android:color/system_surface_container_light'),
|
|
18
|
+
card: PlatformColor('@android:color/system_background_light'),
|
|
19
|
+
text: PlatformColor('@android:color/system_on_surface_light'),
|
|
20
|
+
border: PlatformColor('@android:color/system_outline_variant_light'),
|
|
21
|
+
notification: PlatformColor('@android:color/system_error_light'),
|
|
22
|
+
},
|
|
23
|
+
fonts,
|
|
24
|
+
} as const satisfies Theme;
|
|
25
|
+
|
|
26
|
+
const MaterialDarkDynamicTheme = {
|
|
27
|
+
dark: true,
|
|
28
|
+
colors: {
|
|
29
|
+
primary: PlatformColor('@android:color/system_primary_dark'),
|
|
30
|
+
background: PlatformColor('@android:color/system_surface_container_dark'),
|
|
31
|
+
card: PlatformColor('@android:color/system_background_dark'),
|
|
32
|
+
text: PlatformColor('@android:color/system_on_surface_dark'),
|
|
33
|
+
border: PlatformColor('@android:color/system_outline_variant_dark'),
|
|
34
|
+
notification: PlatformColor('@android:color/system_error_dark'),
|
|
35
|
+
},
|
|
36
|
+
fonts,
|
|
37
|
+
} as const satisfies Theme;
|
|
38
|
+
|
|
39
|
+
export const MaterialLightTheme = isDynamicThemeSupported
|
|
40
|
+
? MaterialLightDynamicTheme
|
|
41
|
+
: MaterialLightFallbackTheme;
|
|
42
|
+
|
|
43
|
+
export const MaterialDarkTheme = isDynamicThemeSupported
|
|
44
|
+
? MaterialDarkDynamicTheme
|
|
45
|
+
: MaterialDarkFallbackTheme;
|
package/src/types.tsx
CHANGED
|
@@ -68,7 +68,7 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
68
68
|
*
|
|
69
69
|
* Defaults to `true` when a linking config is specified.
|
|
70
70
|
*/
|
|
71
|
-
enabled?: boolean;
|
|
71
|
+
enabled?: boolean | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* The prefixes to match to determine whether to handle a URL.
|
|
74
74
|
*
|
|
@@ -96,7 +96,7 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
96
96
|
* }
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
|
-
prefixes?: LinkingPrefix[];
|
|
99
|
+
prefixes?: LinkingPrefix[] | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* Optional function which takes an incoming URL returns a boolean
|
|
102
102
|
* indicating whether React Navigation should handle it.
|
|
@@ -114,7 +114,7 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
114
114
|
* }
|
|
115
115
|
* ```
|
|
116
116
|
*/
|
|
117
|
-
filter?: (url: string) => boolean;
|
|
117
|
+
filter?: ((url: string) => boolean) | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* Config to fine-tune how to parse the path.
|
|
120
120
|
*
|
|
@@ -128,23 +128,25 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
128
128
|
* }
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
config?:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
config?:
|
|
132
|
+
| {
|
|
133
|
+
/**
|
|
134
|
+
* Path string to match against for the whole navigation tree.
|
|
135
|
+
* It's not possible to specify params here since this doesn't belong to a screen.
|
|
136
|
+
* This is useful when the whole app is under a specific path.
|
|
137
|
+
* e.g. all of the screens are under `/admin` in `https://example.com/admin`
|
|
138
|
+
*/
|
|
139
|
+
path?: string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Path configuration for child screens.
|
|
142
|
+
*/
|
|
143
|
+
screens: PathConfigMap<ParamList>;
|
|
144
|
+
/**
|
|
145
|
+
* Name of the initial route to use for the root navigator.
|
|
146
|
+
*/
|
|
147
|
+
initialRouteName?: Extract<keyof ParamList, string> | undefined;
|
|
148
|
+
}
|
|
149
|
+
| undefined;
|
|
148
150
|
/**
|
|
149
151
|
* Custom function to get the initial URL used for linking.
|
|
150
152
|
* Uses `Linking.getInitialURL()` by default.
|
|
@@ -158,11 +160,9 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
158
160
|
* }
|
|
159
161
|
* ```
|
|
160
162
|
*/
|
|
161
|
-
getInitialURL?:
|
|
162
|
-
| string
|
|
163
|
-
|
|
|
164
|
-
| undefined
|
|
165
|
-
| Promise<string | null | undefined>;
|
|
163
|
+
getInitialURL?:
|
|
164
|
+
| (() => string | null | undefined | Promise<string | null | undefined>)
|
|
165
|
+
| undefined;
|
|
166
166
|
/**
|
|
167
167
|
* Custom function to get subscribe to URL updates.
|
|
168
168
|
* Uses `Linking.addEventListener('url', callback)` by default.
|
|
@@ -184,30 +184,32 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
184
184
|
* }
|
|
185
185
|
* ```
|
|
186
186
|
*/
|
|
187
|
-
subscribe?:
|
|
188
|
-
listener: (url: string) => void
|
|
189
|
-
|
|
187
|
+
subscribe?:
|
|
188
|
+
| ((listener: (url: string) => void) => undefined | void | (() => void))
|
|
189
|
+
| undefined;
|
|
190
190
|
/**
|
|
191
191
|
* Custom function to parse the URL to a valid navigation state (advanced).
|
|
192
192
|
*/
|
|
193
|
-
getStateFromPath?: typeof getStateFromPathDefault;
|
|
193
|
+
getStateFromPath?: typeof getStateFromPathDefault | undefined;
|
|
194
194
|
/**
|
|
195
195
|
* Custom function to convert the state object to a valid URL (advanced).
|
|
196
196
|
* Only applicable on Web.
|
|
197
197
|
*/
|
|
198
|
-
getPathFromState?: typeof getPathFromStateDefault;
|
|
198
|
+
getPathFromState?: typeof getPathFromStateDefault | undefined;
|
|
199
199
|
/**
|
|
200
200
|
* Custom function to convert the state object to a valid action (advanced).
|
|
201
201
|
*/
|
|
202
|
-
getActionFromState?: typeof getActionFromStateDefault;
|
|
202
|
+
getActionFromState?: typeof getActionFromStateDefault | undefined;
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
export type DocumentTitleOptions = {
|
|
206
|
-
enabled?: boolean;
|
|
207
|
-
formatter?:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
enabled?: boolean | undefined;
|
|
207
|
+
formatter?:
|
|
208
|
+
| ((
|
|
209
|
+
options: Record<string, any> | undefined,
|
|
210
|
+
route: Route<string> | undefined
|
|
211
|
+
) => string)
|
|
212
|
+
| undefined;
|
|
211
213
|
};
|
|
212
214
|
|
|
213
215
|
export type Persistor = {
|
|
@@ -223,7 +225,3 @@ export type Persistor = {
|
|
|
223
225
|
*/
|
|
224
226
|
restore(): PromiseLike<InitialState | undefined> | InitialState | undefined;
|
|
225
227
|
};
|
|
226
|
-
|
|
227
|
-
export type ServerContainerRef = {
|
|
228
|
-
getCurrentOptions(): Record<string, any> | undefined;
|
|
229
|
-
};
|
package/src/useBackButton.tsx
CHANGED
|
@@ -3,8 +3,8 @@ import type {
|
|
|
3
3
|
ParamListBase,
|
|
4
4
|
} from '@react-navigation/core';
|
|
5
5
|
|
|
6
|
-
export function useBackButton(
|
|
7
|
-
_: React.RefObject<NavigationContainerRef<
|
|
6
|
+
export function useBackButton<ParamList extends ParamListBase>(
|
|
7
|
+
_: React.RefObject<NavigationContainerRef<ParamList> | null>
|
|
8
8
|
) {
|
|
9
9
|
// No-op
|
|
10
10
|
// BackHandler is not available on web
|
package/src/useDocumentTitle.tsx
CHANGED
|
@@ -9,8 +9,8 @@ import type { DocumentTitleOptions } from './types';
|
|
|
9
9
|
/**
|
|
10
10
|
* Set the document title for the active screen
|
|
11
11
|
*/
|
|
12
|
-
export function useDocumentTitle(
|
|
13
|
-
ref: React.RefObject<NavigationContainerRef<
|
|
12
|
+
export function useDocumentTitle<ParamList extends ParamListBase>(
|
|
13
|
+
ref: React.RefObject<NavigationContainerRef<ParamList> | null>,
|
|
14
14
|
{
|
|
15
15
|
enabled = true,
|
|
16
16
|
formatter = (options, route) => options?.title ?? route?.name,
|
package/src/useLinkBuilder.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
findFocusedRoute,
|
|
4
4
|
getActionFromState,
|
|
5
5
|
getPathFromState,
|
|
6
|
+
NavigationContainerRefContext,
|
|
6
7
|
NavigationHelpersContext,
|
|
7
8
|
NavigationRouteContext,
|
|
8
9
|
useStateForPath,
|
|
@@ -13,17 +14,23 @@ import { getStateFromHref } from './getStateFromHref';
|
|
|
13
14
|
import { LinkingContext } from './LinkingContext';
|
|
14
15
|
|
|
15
16
|
type MinimalState = {
|
|
16
|
-
routes: [
|
|
17
|
+
routes: [
|
|
18
|
+
{
|
|
19
|
+
name: string;
|
|
20
|
+
params?: object | undefined;
|
|
21
|
+
state?: MinimalState | undefined;
|
|
22
|
+
},
|
|
23
|
+
];
|
|
17
24
|
};
|
|
18
25
|
|
|
19
26
|
/**
|
|
20
27
|
* Helper to build a href for a screen based on the linking options.
|
|
21
28
|
*/
|
|
22
29
|
export function useBuildHref() {
|
|
23
|
-
const navigation = React.
|
|
24
|
-
const route = React.
|
|
30
|
+
const navigation = React.use(NavigationHelpersContext);
|
|
31
|
+
const route = React.use(NavigationRouteContext);
|
|
25
32
|
|
|
26
|
-
const { options } = React.
|
|
33
|
+
const { options } = React.use(LinkingContext);
|
|
27
34
|
|
|
28
35
|
const focusedRouteState = useStateForPath();
|
|
29
36
|
|
|
@@ -103,14 +110,15 @@ export function useBuildHref() {
|
|
|
103
110
|
* Helper to build a navigation action from a href based on the linking options.
|
|
104
111
|
*/
|
|
105
112
|
export function useBuildAction() {
|
|
106
|
-
const
|
|
113
|
+
const navigation = React.use(NavigationContainerRefContext);
|
|
114
|
+
const { options } = React.use(LinkingContext);
|
|
107
115
|
|
|
108
116
|
const getActionFromStateHelper =
|
|
109
117
|
options?.getActionFromState ?? getActionFromState;
|
|
110
118
|
|
|
111
119
|
const buildAction = React.useCallback(
|
|
112
120
|
(href: string) => {
|
|
113
|
-
const state = getStateFromHref(href, options);
|
|
121
|
+
const state = getStateFromHref(href, options, navigation?.getRootState());
|
|
114
122
|
|
|
115
123
|
if (state) {
|
|
116
124
|
const action = getActionFromStateHelper(state, options?.config);
|
|
@@ -122,7 +130,7 @@ export function useBuildAction() {
|
|
|
122
130
|
);
|
|
123
131
|
}
|
|
124
132
|
},
|
|
125
|
-
[options, getActionFromStateHelper]
|
|
133
|
+
[navigation, options, getActionFromStateHelper]
|
|
126
134
|
);
|
|
127
135
|
|
|
128
136
|
return buildAction;
|
package/src/useLinkProps.tsx
CHANGED
|
@@ -3,11 +3,8 @@ import {
|
|
|
3
3
|
type NavigationAction,
|
|
4
4
|
NavigationContainerRefContext,
|
|
5
5
|
NavigationHelpersContext,
|
|
6
|
-
type NavigatorScreenParams,
|
|
7
|
-
type ParamListBase,
|
|
8
6
|
type RootParamList,
|
|
9
7
|
} from '@react-navigation/core';
|
|
10
|
-
import type { NavigationState, PartialState } from '@react-navigation/routers';
|
|
11
8
|
import * as React from 'react';
|
|
12
9
|
import { type GestureResponderEvent, Platform } from 'react-native';
|
|
13
10
|
|
|
@@ -32,35 +29,6 @@ export type LinkProps<
|
|
|
32
29
|
params?: undefined;
|
|
33
30
|
};
|
|
34
31
|
|
|
35
|
-
const getStateFromParams = (
|
|
36
|
-
params: NavigatorScreenParams<ParamListBase> | undefined
|
|
37
|
-
): PartialState<NavigationState> | NavigationState | undefined => {
|
|
38
|
-
if (params?.state) {
|
|
39
|
-
return params.state;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (params?.screen) {
|
|
43
|
-
return {
|
|
44
|
-
routes: [
|
|
45
|
-
{
|
|
46
|
-
name: params.screen,
|
|
47
|
-
params: params.params,
|
|
48
|
-
// @ts-expect-error this is fine 🔥
|
|
49
|
-
state: params.screen
|
|
50
|
-
? getStateFromParams(
|
|
51
|
-
params.params as
|
|
52
|
-
| NavigatorScreenParams<ParamListBase>
|
|
53
|
-
| undefined
|
|
54
|
-
)
|
|
55
|
-
: undefined,
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return undefined;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
32
|
/**
|
|
65
33
|
* Hook to get props for an anchor tag so it can work with in page navigation.
|
|
66
34
|
*
|
|
@@ -73,9 +41,9 @@ export function useLinkProps<
|
|
|
73
41
|
const ParamList extends {} = RootParamList,
|
|
74
42
|
const RouteName extends keyof ParamList = keyof ParamList,
|
|
75
43
|
>({ screen, params, href, action }: LinkProps<ParamList, RouteName>) {
|
|
76
|
-
const root = React.
|
|
77
|
-
const navigation = React.
|
|
78
|
-
const { options } = React.
|
|
44
|
+
const root = React.use(NavigationContainerRefContext);
|
|
45
|
+
const navigation = React.use(NavigationHelpersContext);
|
|
46
|
+
const { options } = React.use(LinkingContext);
|
|
79
47
|
|
|
80
48
|
const onPress = (
|
|
81
49
|
e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
|
|
@@ -162,17 +130,16 @@ export function useLinkProps<
|
|
|
162
130
|
return {
|
|
163
131
|
href:
|
|
164
132
|
href ??
|
|
165
|
-
(Platform.OS === 'web' && screen
|
|
133
|
+
(Platform.OS === 'web' && typeof screen === 'string'
|
|
166
134
|
? getPathFromStateHelper(
|
|
167
135
|
{
|
|
168
136
|
routes: [
|
|
169
137
|
{
|
|
170
|
-
// @ts-expect-error this is fine 🔥
|
|
171
138
|
name: screen,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
139
|
+
params:
|
|
140
|
+
typeof params === 'object' && params != null
|
|
141
|
+
? params
|
|
142
|
+
: undefined,
|
|
176
143
|
},
|
|
177
144
|
],
|
|
178
145
|
},
|
package/src/useLinkTo.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { useBuildAction } from './useLinkBuilder';
|
|
|
9
9
|
* @returns function that receives the href to navigate to.
|
|
10
10
|
*/
|
|
11
11
|
export function useLinkTo() {
|
|
12
|
-
const navigation = React.
|
|
12
|
+
const navigation = React.use(NavigationContainerRefContext);
|
|
13
13
|
const buildAction = useBuildAction();
|
|
14
14
|
|
|
15
15
|
const linkTo = React.useCallback(
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
getActionFromState as getActionFromStateDefault,
|
|
3
3
|
getStateFromPath as getStateFromPathDefault,
|
|
4
4
|
type NavigationContainerRef,
|
|
5
|
+
type NavigationState,
|
|
5
6
|
type ParamListBase,
|
|
6
7
|
useNavigationIndependentTree,
|
|
7
8
|
} from '@react-navigation/core';
|
|
@@ -14,12 +15,10 @@ import type { Thenable } from './useThenable';
|
|
|
14
15
|
|
|
15
16
|
type ResultState = ReturnType<typeof getStateFromPathDefault>;
|
|
16
17
|
|
|
17
|
-
type Options = LinkingOptions<ParamListBase>;
|
|
18
|
-
|
|
19
18
|
const linkingHandlers = new Set<symbol>();
|
|
20
19
|
|
|
21
|
-
export function useLinking(
|
|
22
|
-
ref: React.RefObject<NavigationContainerRef<
|
|
20
|
+
export function useLinking<ParamList extends ParamListBase>(
|
|
21
|
+
ref: React.RefObject<NavigationContainerRef<ParamList> | null>,
|
|
23
22
|
{
|
|
24
23
|
enabled = true,
|
|
25
24
|
prefixes = ['*'],
|
|
@@ -45,7 +44,7 @@ export function useLinking(
|
|
|
45
44
|
},
|
|
46
45
|
getStateFromPath = getStateFromPathDefault,
|
|
47
46
|
getActionFromState = getActionFromStateDefault,
|
|
48
|
-
}:
|
|
47
|
+
}: LinkingOptions<ParamListBase>
|
|
49
48
|
) {
|
|
50
49
|
const independent = useNavigationIndependentTree();
|
|
51
50
|
|
|
@@ -58,28 +57,39 @@ export function useLinking(
|
|
|
58
57
|
return undefined;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
if (enabled !== false && linkingHandlers.size) {
|
|
62
|
-
console.error(
|
|
63
|
-
[
|
|
64
|
-
'Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:',
|
|
65
|
-
"- You don't have multiple NavigationContainers in the app each with 'linking' enabled",
|
|
66
|
-
'- Only a single instance of the root component is rendered',
|
|
67
|
-
Platform.OS === 'android'
|
|
68
|
-
? "- You have set 'android:launchMode=singleTask' in the '<activity />' section of the 'AndroidManifest.xml' file to avoid launching multiple instances"
|
|
69
|
-
: '',
|
|
70
|
-
]
|
|
71
|
-
.join('\n')
|
|
72
|
-
.trim()
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
60
|
const handler = Symbol();
|
|
77
61
|
|
|
78
62
|
if (enabled !== false) {
|
|
79
63
|
linkingHandlers.add(handler);
|
|
80
64
|
}
|
|
81
65
|
|
|
66
|
+
// In some cases, the effect cleanup may get called out of order
|
|
67
|
+
// This may result in multiple linking handlers being registered
|
|
68
|
+
// For example, when changing the wallpaper on Android
|
|
69
|
+
// Showing the error in a delay avoids false positives
|
|
70
|
+
const timer = setTimeout(() => {
|
|
71
|
+
if (
|
|
72
|
+
enabled !== false &&
|
|
73
|
+
linkingHandlers.size &&
|
|
74
|
+
!(linkingHandlers.size === 1 && linkingHandlers.has(handler))
|
|
75
|
+
) {
|
|
76
|
+
console.error(
|
|
77
|
+
[
|
|
78
|
+
'Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:',
|
|
79
|
+
"- You don't have multiple NavigationContainers in the app each with 'linking' enabled",
|
|
80
|
+
'- Only a single instance of the root component is rendered',
|
|
81
|
+
Platform.OS === 'android'
|
|
82
|
+
? "- You have set 'android:launchMode=singleTask' in the '<activity />' section of the 'AndroidManifest.xml' file to avoid launching multiple instances"
|
|
83
|
+
: '',
|
|
84
|
+
]
|
|
85
|
+
.join('\n')
|
|
86
|
+
.trim()
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}, 1000);
|
|
90
|
+
|
|
82
91
|
return () => {
|
|
92
|
+
clearTimeout(timer);
|
|
83
93
|
linkingHandlers.delete(handler);
|
|
84
94
|
};
|
|
85
95
|
}, [enabled, independent]);
|
|
@@ -106,18 +116,22 @@ export function useLinking(
|
|
|
106
116
|
});
|
|
107
117
|
|
|
108
118
|
const getStateFromURL = React.useCallback(
|
|
109
|
-
(url: string | null | undefined) => {
|
|
119
|
+
(url: string | null | undefined, previous: NavigationState | undefined) => {
|
|
110
120
|
if (!url) {
|
|
111
121
|
return undefined;
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
try {
|
|
115
|
-
return getStateFromHref(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
return getStateFromHref(
|
|
126
|
+
url,
|
|
127
|
+
{
|
|
128
|
+
prefixes: prefixesRef.current,
|
|
129
|
+
filter: filterRef.current,
|
|
130
|
+
config: configRef.current,
|
|
131
|
+
getStateFromPath: getStateFromPathRef.current,
|
|
132
|
+
},
|
|
133
|
+
previous
|
|
134
|
+
);
|
|
121
135
|
} catch (e) {
|
|
122
136
|
return undefined;
|
|
123
137
|
}
|
|
@@ -134,14 +148,14 @@ export function useLinking(
|
|
|
134
148
|
if (url != null) {
|
|
135
149
|
if (typeof url !== 'string') {
|
|
136
150
|
return url.then((url) => {
|
|
137
|
-
const state = getStateFromURL(url);
|
|
151
|
+
const state = getStateFromURL(url, undefined);
|
|
138
152
|
|
|
139
153
|
return state;
|
|
140
154
|
});
|
|
141
155
|
}
|
|
142
156
|
}
|
|
143
157
|
|
|
144
|
-
state = getStateFromURL(url);
|
|
158
|
+
state = getStateFromURL(url, undefined);
|
|
145
159
|
}
|
|
146
160
|
|
|
147
161
|
const thenable: Thenable<ResultState | undefined> = {
|
|
@@ -160,7 +174,21 @@ export function useLinking(
|
|
|
160
174
|
}
|
|
161
175
|
|
|
162
176
|
const navigation = ref.current;
|
|
163
|
-
const state = navigation
|
|
177
|
+
const state = navigation
|
|
178
|
+
? getStateFromURL(url, navigation.getRootState())
|
|
179
|
+
: undefined;
|
|
180
|
+
|
|
181
|
+
if (navigation) {
|
|
182
|
+
REACT_NAVIGATION_DEVTOOLS.get(navigation)?.listeners.forEach(
|
|
183
|
+
(listener) => {
|
|
184
|
+
listener({
|
|
185
|
+
type: 'link',
|
|
186
|
+
url,
|
|
187
|
+
state,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
164
192
|
|
|
165
193
|
if (navigation && state) {
|
|
166
194
|
const action = getActionFromStateRef.current(state, configRef.current);
|