@amazon-devices/react-navigation__native 7.0.9000000000 → 8.0.9000000000-rn-83
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/SystemBundles/c0d77be093c9724f49566be215c67240e6443c16760f772a745108ddaef15503.bundle +9117 -0
- package/SystemBundles/c0d77be093c9724f49566be215c67240e6443c16760f772a745108ddaef15503.map +3543 -0
- package/SystemModules/amzn__react-navigation__native-8.modules.txt +24 -0
- package/SystemModules/amzn__react-navigation__native-8.private.modules.txt +77 -0
- package/SystemModules/keplerscript-system-bundle-config.json +4 -4
- package/kepler-compatibility.json +2 -2
- package/lib/module/Link.js +31 -10
- package/lib/module/Link.js.map +1 -1
- package/lib/module/LinkingContext.js +7 -3
- package/lib/module/LinkingContext.js.map +1 -1
- package/lib/module/LocaleDirContext.js +6 -0
- package/lib/module/LocaleDirContext.js.map +1 -0
- package/lib/module/NavigationContainer.js +87 -59
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/ServerContainer.js +20 -10
- package/lib/module/ServerContainer.js.map +1 -1
- package/lib/module/ServerContext.js +3 -2
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/UnhandledLinkingContext.js +14 -0
- package/lib/module/UnhandledLinkingContext.js.map +1 -0
- package/lib/module/__stubs__/createStackNavigator.js +18 -0
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -0
- package/lib/module/__stubs__/window.js +75 -0
- package/lib/module/__stubs__/window.js.map +1 -0
- package/lib/module/createMemoryHistory.js +19 -17
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStaticNavigation.js +54 -0
- package/lib/module/createStaticNavigation.js.map +1 -0
- package/lib/module/extractPathFromURL.js +6 -5
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/index.js +18 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/theming/DarkTheme.js +6 -3
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/DefaultTheme.js +6 -3
- package/lib/module/theming/DefaultTheme.js.map +1 -1
- package/lib/module/theming/fonts.js +61 -0
- package/lib/module/theming/fonts.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/useBackButton.js +3 -1
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useBackButton.native.js +3 -1
- package/lib/module/useBackButton.native.js.map +1 -1
- package/lib/module/useDocumentTitle.js +6 -4
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useDocumentTitle.native.js +4 -2
- package/lib/module/useDocumentTitle.native.js.map +1 -1
- package/lib/module/useLinkBuilder.js +71 -40
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +41 -36
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +18 -28
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +47 -19
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +33 -28
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useLocale.js +18 -0
- package/lib/module/useLocale.js.map +1 -0
- package/lib/module/useRoutePath.js +30 -0
- package/lib/module/useRoutePath.js.map +1 -0
- package/lib/module/useScrollToTop.js +11 -7
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +4 -1
- package/lib/module/useThenable.js.map +1 -1
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/Link.d.ts +8 -10
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/LinkingContext.d.ts +2 -3
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts +4 -0
- package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainer.d.ts +36 -13
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/ServerContainer.d.ts +2 -3
- package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
- package/lib/typescript/src/ServerContext.d.ts +1 -2
- package/lib/typescript/src/ServerContext.d.ts.map +1 -1
- package/lib/typescript/src/UnhandledLinkingContext.d.ts +6 -0
- package/lib/typescript/src/UnhandledLinkingContext.d.ts.map +1 -0
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +13 -0
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -0
- package/lib/typescript/src/{__mocks__ → __stubs__}/window.d.ts +5 -6
- package/lib/typescript/src/__stubs__/window.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/createStaticNavigation.d.ts +34 -0
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -0
- package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -12
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/theming/DarkTheme.d.ts +1 -2
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -2
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.d.ts +53 -0
- package/lib/typescript/src/theming/fonts.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +35 -3
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.d.ts +1 -2
- package/lib/typescript/src/useBackButton.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.native.d.ts +1 -1
- package/lib/typescript/src/useBackButton.native.d.ts.map +1 -1
- package/lib/typescript/src/useDocumentTitle.d.ts +1 -1
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -1
- package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +97 -3
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts +23 -10
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinkTo.d.ts +6 -8
- package/lib/typescript/src/useLinkTo.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +5 -46
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +11 -29
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useLocale.d.ts +7 -0
- package/lib/typescript/src/useLocale.d.ts.map +1 -0
- package/lib/typescript/src/useRoutePath.d.ts +7 -0
- package/lib/typescript/src/useRoutePath.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts +2 -2
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
- package/lib/typescript/src/useThenable.d.ts +1 -1
- package/lib/typescript/src/useThenable.d.ts.map +1 -1
- package/oss-attribution/attribution.txt +50 -0
- package/oss-attribution/licenseInfos.json +18 -0
- package/package.json +97 -1
- package/src/Link.tsx +36 -20
- package/src/LinkingContext.tsx +9 -5
- package/src/LocaleDirContext.tsx +7 -0
- package/src/NavigationContainer.tsx +128 -69
- package/src/ServerContainer.tsx +4 -3
- package/src/ServerContext.tsx +1 -3
- package/src/UnhandledLinkingContext.tsx +18 -0
- package/src/__stubs__/createStackNavigator.tsx +46 -0
- package/src/{__mocks__ → __stubs__}/window.tsx +8 -8
- package/src/createMemoryHistory.tsx +16 -11
- package/src/createStaticNavigation.tsx +109 -0
- package/src/extractPathFromURL.tsx +3 -3
- package/src/index.tsx +15 -12
- package/src/theming/DarkTheme.tsx +3 -3
- package/src/theming/DefaultTheme.tsx +3 -3
- package/src/theming/fonts.tsx +63 -0
- package/src/types.tsx +49 -3
- package/src/useBackButton.native.tsx +2 -2
- package/src/useBackButton.tsx +2 -2
- package/src/useDocumentTitle.native.tsx +2 -2
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +100 -55
- package/src/useLinkProps.tsx +80 -50
- package/src/useLinkTo.tsx +13 -53
- package/src/useLinking.native.tsx +33 -31
- package/src/useLinking.tsx +70 -23
- package/src/useLocale.tsx +18 -0
- package/src/useRoutePath.tsx +34 -0
- package/src/useScrollToTop.tsx +16 -12
- package/src/useThenable.tsx +2 -1
- package/SystemBundles/41869b563992545ca95a9a2f729e958cbdcada7391919e8e02112d791754072a.bundle +0 -14508
- package/SystemBundles/41869b563992545ca95a9a2f729e958cbdcada7391919e8e02112d791754072a.map +0 -5157
- package/SystemModules/amzn__react-navigation__native-7.modules.txt +0 -76
- package/SystemModules/amzn__react-navigation__native-7.private.modules.txt +0 -100
- package/THIRD_PARTY_NOTICES.txt +0 -24
- package/lib/commonjs/Link.js +0 -50
- package/lib/commonjs/Link.js.map +0 -1
- package/lib/commonjs/LinkingContext.js +0 -15
- package/lib/commonjs/LinkingContext.js.map +0 -1
- package/lib/commonjs/NavigationContainer.js +0 -109
- package/lib/commonjs/NavigationContainer.js.map +0 -1
- package/lib/commonjs/ServerContainer.js +0 -54
- package/lib/commonjs/ServerContainer.js.map +0 -1
- package/lib/commonjs/ServerContext.js +0 -12
- package/lib/commonjs/ServerContext.js.map +0 -1
- package/lib/commonjs/createMemoryHistory.js +0 -220
- package/lib/commonjs/createMemoryHistory.js.map +0 -1
- package/lib/commonjs/extractPathFromURL.js +0 -25
- package/lib/commonjs/extractPathFromURL.js.map +0 -1
- package/lib/commonjs/index.js +0 -129
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/theming/DarkTheme.js +0 -19
- package/lib/commonjs/theming/DarkTheme.js.map +0 -1
- package/lib/commonjs/theming/DefaultTheme.js +0 -19
- package/lib/commonjs/theming/DefaultTheme.js.map +0 -1
- package/lib/commonjs/theming/ThemeContext.js +0 -15
- package/lib/commonjs/theming/ThemeContext.js.map +0 -1
- package/lib/commonjs/theming/ThemeProvider.js +0 -20
- package/lib/commonjs/theming/ThemeProvider.js.map +0 -1
- package/lib/commonjs/theming/useTheme.js +0 -16
- package/lib/commonjs/theming/useTheme.js.map +0 -1
- package/lib/commonjs/types.js +0 -6
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/useBackButton.js +0 -11
- package/lib/commonjs/useBackButton.js.map +0 -1
- package/lib/commonjs/useBackButton.native.js +0 -27
- package/lib/commonjs/useBackButton.native.js.map +0 -1
- package/lib/commonjs/useDocumentTitle.js +0 -32
- package/lib/commonjs/useDocumentTitle.js.map +0 -1
- package/lib/commonjs/useDocumentTitle.native.js +0 -10
- package/lib/commonjs/useDocumentTitle.native.js.map +0 -1
- package/lib/commonjs/useLinkBuilder.js +0 -63
- package/lib/commonjs/useLinkBuilder.js.map +0 -1
- package/lib/commonjs/useLinkProps.js +0 -97
- package/lib/commonjs/useLinkProps.js.map +0 -1
- package/lib/commonjs/useLinkTo.js +0 -45
- package/lib/commonjs/useLinkTo.js.map +0 -1
- package/lib/commonjs/useLinking.js +0 -303
- package/lib/commonjs/useLinking.js.map +0 -1
- package/lib/commonjs/useLinking.native.js +0 -152
- package/lib/commonjs/useLinking.native.js.map +0 -1
- package/lib/commonjs/useScrollToTop.js +0 -95
- package/lib/commonjs/useScrollToTop.js.map +0 -1
- package/lib/commonjs/useThenable.js +0 -41
- package/lib/commonjs/useThenable.js.map +0 -1
- package/lib/module/theming/ThemeContext.js +0 -6
- package/lib/module/theming/ThemeContext.js.map +0 -1
- package/lib/module/theming/ThemeProvider.js +0 -11
- package/lib/module/theming/ThemeProvider.js.map +0 -1
- package/lib/module/theming/useTheme.js +0 -7
- package/lib/module/theming/useTheme.js.map +0 -1
- package/lib/typescript/src/__mocks__/window.d.ts.map +0 -1
- package/lib/typescript/src/theming/ThemeContext.d.ts +0 -5
- package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
- package/lib/typescript/src/theming/ThemeProvider.d.ts +0 -9
- package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
- package/lib/typescript/src/theming/useTheme.d.ts +0 -2
- package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
- package/src/theming/ThemeContext.tsx +0 -10
- package/src/theming/ThemeProvider.tsx +0 -15
- package/src/theming/useTheme.tsx +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function useThenable<T>(create: () => PromiseLike<T>): [boolean, T | undefined];
|
|
2
2
|
//# sourceMappingURL=useThenable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThenable.d.ts","sourceRoot":"","sources":["../../../src/useThenable.tsx"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"useThenable.d.ts","sourceRoot":"","sources":["../../../src/useThenable.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,4BAuC1D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@amazon-devices/react-navigation__core
|
|
2
|
+
8.0.9000000000 <https://github.com/react-navigation/react-navigation>
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2017 React Navigation Contributors
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
******************************
|
|
27
|
+
|
|
28
|
+
@amazon-devices/react-navigation__routers
|
|
29
|
+
8.0.9000000000 <https://github.com/react-navigation/react-navigation>
|
|
30
|
+
MIT License
|
|
31
|
+
|
|
32
|
+
Copyright (c) 2017 React Navigation Contributors
|
|
33
|
+
|
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
35
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
36
|
+
in the Software without restriction, including without limitation the rights
|
|
37
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
38
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
39
|
+
furnished to do so, subject to the following conditions:
|
|
40
|
+
|
|
41
|
+
The above copyright notice and this permission notice shall be included in all
|
|
42
|
+
copies or substantial portions of the Software.
|
|
43
|
+
|
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
45
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
46
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
47
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
48
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
49
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
50
|
+
SOFTWARE.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@amazon-devices/react-navigation__core": {
|
|
3
|
+
"ignore": false,
|
|
4
|
+
"name": "@amazon-devices/react-navigation__core",
|
|
5
|
+
"version": "8.0.9000000000",
|
|
6
|
+
"url": "https://github.com/react-navigation/react-navigation",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"licenseText": "MIT License\n\nCopyright (c) 2017 React Navigation Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
|
|
9
|
+
},
|
|
10
|
+
"@amazon-devices/react-navigation__routers": {
|
|
11
|
+
"ignore": false,
|
|
12
|
+
"name": "@amazon-devices/react-navigation__routers",
|
|
13
|
+
"version": "8.0.9000000000",
|
|
14
|
+
"url": "https://github.com/react-navigation/react-navigation",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"licenseText": "MIT License\n\nCopyright (c) 2017 React Navigation Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@amazon-devices/react-navigation__native",
|
|
3
|
+
"description": "React Native integration for React Navigation",
|
|
4
|
+
"version": "8.0.9000000000-rn-83",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"react-navigation",
|
|
8
|
+
"ios",
|
|
9
|
+
"android"
|
|
10
|
+
],
|
|
11
|
+
"license": "See license in LICENSE",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/react-navigation/react-navigation.git",
|
|
15
|
+
"directory": "packages/native"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/react-navigation/react-navigation/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://reactnavigation.org",
|
|
21
|
+
"main": "./lib/module/index.js",
|
|
22
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"source": "./src/index.tsx",
|
|
26
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
27
|
+
"default": "./lib/module/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"src",
|
|
33
|
+
"lib",
|
|
34
|
+
"!**/__tests__",
|
|
35
|
+
"kepler-compatibility.json",
|
|
36
|
+
"SystemModules",
|
|
37
|
+
"SystemBundles",
|
|
38
|
+
"oss-attribution",
|
|
39
|
+
"kepler-transformed-package-info.json"
|
|
40
|
+
],
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"kepler": {
|
|
43
|
+
"temporary-alias-for-package": {
|
|
44
|
+
"name": "@react-navigation/native",
|
|
45
|
+
"version": "7.0.14"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"clean": "del lib"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@amazon-devices/react-navigation__routers": "^8.0.1",
|
|
56
|
+
"@amazon-devices/react-navigation__core": "^8.0.1",
|
|
57
|
+
"escape-string-regexp": "^4.0.0",
|
|
58
|
+
"fast-deep-equal": "^3.1.3",
|
|
59
|
+
"nanoid": "^3.3.11",
|
|
60
|
+
"use-latest-callback": "^0.2.4"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@jest/globals": "^30.0.0",
|
|
64
|
+
"@testing-library/react-native": "^13.2.0",
|
|
65
|
+
"@types/react": "~19.0.10",
|
|
66
|
+
"@types/react-dom": "~19.1.3",
|
|
67
|
+
"del-cli": "^6.0.0",
|
|
68
|
+
"react": "19.0.0",
|
|
69
|
+
"react-dom": "19.0.0",
|
|
70
|
+
"react-native": "0.79.3",
|
|
71
|
+
"react-native-builder-bob": "^0.40.12",
|
|
72
|
+
"react-test-renderer": "19.0.0",
|
|
73
|
+
"typescript": "^5.8.3"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"react": ">= 18.2.0",
|
|
77
|
+
"react-native": "*"
|
|
78
|
+
},
|
|
79
|
+
"react-native-builder-bob": {
|
|
80
|
+
"source": "src",
|
|
81
|
+
"output": "lib",
|
|
82
|
+
"targets": [
|
|
83
|
+
[
|
|
84
|
+
"module",
|
|
85
|
+
{
|
|
86
|
+
"esm": true
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"typescript",
|
|
91
|
+
{
|
|
92
|
+
"project": "tsconfig.build.json"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
package/src/Link.tsx
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useTheme } from '@amazon-devices/react-navigation__core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type GestureResponderEvent,
|
|
5
|
+
Platform,
|
|
6
|
+
Text,
|
|
7
|
+
type TextProps,
|
|
8
|
+
} from 'react-native';
|
|
4
9
|
|
|
5
|
-
import useLinkProps from './useLinkProps';
|
|
6
|
-
import type { To } from './useLinkTo';
|
|
10
|
+
import { type LinkProps, useLinkProps } from './useLinkProps';
|
|
7
11
|
|
|
8
|
-
type Props<ParamList extends ReactNavigation.RootParamList> =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
type Props<ParamList extends ReactNavigation.RootParamList> =
|
|
13
|
+
LinkProps<ParamList> &
|
|
14
|
+
Omit<TextProps, 'disabled'> & {
|
|
15
|
+
target?: string;
|
|
16
|
+
onPress?: (
|
|
17
|
+
e:
|
|
18
|
+
| React.MouseEvent<HTMLAnchorElement, MouseEvent>
|
|
19
|
+
| GestureResponderEvent
|
|
20
|
+
) => void;
|
|
21
|
+
disabled?: boolean | null;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
};
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Component to render link to another screen using a path.
|
|
22
27
|
* Uses an anchor tag on the web.
|
|
23
28
|
*
|
|
24
|
-
* @param props.
|
|
29
|
+
* @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
|
|
30
|
+
* @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
|
|
31
|
+
* @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
|
|
25
32
|
* @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
|
|
26
33
|
* @param props.children Child elements to render the content.
|
|
27
34
|
*/
|
|
28
|
-
export
|
|
29
|
-
|
|
35
|
+
export function Link<ParamList extends ReactNavigation.RootParamList>({
|
|
36
|
+
screen,
|
|
37
|
+
params,
|
|
30
38
|
action,
|
|
39
|
+
href,
|
|
40
|
+
style,
|
|
31
41
|
...rest
|
|
32
42
|
}: Props<ParamList>) {
|
|
33
|
-
const
|
|
43
|
+
const { colors, fonts } = useTheme();
|
|
44
|
+
// @ts-expect-error: This is already type-checked by the prop types
|
|
45
|
+
const props = useLinkProps<ParamList>({ screen, params, action, href });
|
|
34
46
|
|
|
35
47
|
const onPress = (
|
|
36
48
|
e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
|
|
@@ -39,7 +51,10 @@ export default function Link<ParamList extends ReactNavigation.RootParamList>({
|
|
|
39
51
|
rest.onPress?.(e);
|
|
40
52
|
}
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
// Let user prevent default behavior
|
|
55
|
+
if (!e.defaultPrevented) {
|
|
56
|
+
props.onPress(e);
|
|
57
|
+
}
|
|
43
58
|
};
|
|
44
59
|
|
|
45
60
|
return React.createElement(Text, {
|
|
@@ -49,5 +64,6 @@ export default function Link<ParamList extends ReactNavigation.RootParamList>({
|
|
|
49
64
|
web: { onClick: onPress } as any,
|
|
50
65
|
default: { onPress },
|
|
51
66
|
}),
|
|
67
|
+
style: [{ color: colors.primary }, fonts.regular, style],
|
|
52
68
|
});
|
|
53
69
|
}
|
package/src/LinkingContext.tsx
CHANGED
|
@@ -3,10 +3,14 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import type { LinkingOptions } from './types';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
options: LinkingOptions<ParamListBase> | undefined;
|
|
8
|
-
}>({ options: undefined });
|
|
6
|
+
const MISSING_CONTEXT_ERROR = "Couldn't find a LinkingContext context.";
|
|
9
7
|
|
|
10
|
-
LinkingContext
|
|
8
|
+
export const LinkingContext = React.createContext<{
|
|
9
|
+
options?: LinkingOptions<ParamListBase>;
|
|
10
|
+
}>({
|
|
11
|
+
get options(): any {
|
|
12
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
LinkingContext.displayName = 'LinkingContext';
|
|
@@ -3,21 +3,30 @@ import {
|
|
|
3
3
|
getActionFromState,
|
|
4
4
|
getPathFromState,
|
|
5
5
|
getStateFromPath,
|
|
6
|
-
NavigationContainerProps,
|
|
7
|
-
NavigationContainerRef,
|
|
8
|
-
|
|
6
|
+
type NavigationContainerProps,
|
|
7
|
+
type NavigationContainerRef,
|
|
8
|
+
type NavigationState,
|
|
9
|
+
type ParamListBase,
|
|
10
|
+
ThemeProvider,
|
|
9
11
|
validatePathConfig,
|
|
10
12
|
} from '@amazon-devices/react-navigation__core';
|
|
11
13
|
import * as React from 'react';
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
import { I18nManager } from 'react-native';
|
|
15
|
+
import useLatestCallback from 'use-latest-callback';
|
|
16
|
+
|
|
17
|
+
import { LinkingContext } from './LinkingContext';
|
|
18
|
+
import { LocaleDirContext } from './LocaleDirContext';
|
|
19
|
+
import { DefaultTheme } from './theming/DefaultTheme';
|
|
20
|
+
import type {
|
|
21
|
+
DocumentTitleOptions,
|
|
22
|
+
LinkingOptions,
|
|
23
|
+
LocaleDirection,
|
|
24
|
+
} from './types';
|
|
25
|
+
import { UnhandledLinkingContext } from './UnhandledLinkingContext';
|
|
26
|
+
import { useBackButton } from './useBackButton';
|
|
27
|
+
import { useDocumentTitle } from './useDocumentTitle';
|
|
28
|
+
import { useLinking } from './useLinking';
|
|
29
|
+
import { useThenable } from './useThenable';
|
|
21
30
|
|
|
22
31
|
declare global {
|
|
23
32
|
var REACT_NAVIGATION_DEVTOOLS: WeakMap<
|
|
@@ -26,37 +35,50 @@ declare global {
|
|
|
26
35
|
>;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
globalThis.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
|
|
30
39
|
|
|
31
40
|
type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
32
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Initial state object for the navigation tree.
|
|
43
|
+
*
|
|
44
|
+
* If this is provided, deep link or URLs won't be handled on the initial render.
|
|
45
|
+
*/
|
|
46
|
+
initialState?: NavigationContainerProps['initialState'];
|
|
47
|
+
/**
|
|
48
|
+
* Text direction of the components. Defaults to `'ltr'`.
|
|
49
|
+
*/
|
|
50
|
+
direction?: LocaleDirection;
|
|
51
|
+
/**
|
|
52
|
+
* Options for deep linking.
|
|
53
|
+
*
|
|
54
|
+
* Deep link handling is enabled when this prop is provided,
|
|
55
|
+
* unless `linking.enabled` is `false`.
|
|
56
|
+
*/
|
|
33
57
|
linking?: LinkingOptions<ParamList>;
|
|
58
|
+
/**
|
|
59
|
+
* Fallback element to render until initial state is resolved from deep linking.
|
|
60
|
+
*
|
|
61
|
+
* Defaults to `null`.
|
|
62
|
+
*/
|
|
34
63
|
fallback?: React.ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Options to configure the document title on Web.
|
|
66
|
+
*
|
|
67
|
+
* Updating document title is handled by default,
|
|
68
|
+
* unless `documentTitle.enabled` is `false`.
|
|
69
|
+
*/
|
|
35
70
|
documentTitle?: DocumentTitleOptions;
|
|
36
|
-
onReady?: () => void;
|
|
37
71
|
};
|
|
38
72
|
|
|
39
|
-
/**
|
|
40
|
-
* Container component which holds the navigation state designed for React Native apps.
|
|
41
|
-
* This should be rendered at the root wrapping the whole app.
|
|
42
|
-
*
|
|
43
|
-
* @param props.initialState Initial state object for the navigation tree. When deep link handling is enabled, this will override deep links when specified. Make sure that you don't specify an `initialState` when there's a deep link (`Linking.getInitialURL()`).
|
|
44
|
-
* @param props.onReady Callback which is called after the navigation tree mounts.
|
|
45
|
-
* @param props.onStateChange Callback which is called with the latest navigation state when it changes.
|
|
46
|
-
* @param props.theme Theme object for the navigators.
|
|
47
|
-
* @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.
|
|
48
|
-
* @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.
|
|
49
|
-
* @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.
|
|
50
|
-
* @param props.children Child elements to render the content.
|
|
51
|
-
* @param props.ref Ref object which refers to the navigation object containing helper methods.
|
|
52
|
-
*/
|
|
53
73
|
function NavigationContainerInner(
|
|
54
74
|
{
|
|
75
|
+
direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
|
|
55
76
|
theme = DefaultTheme,
|
|
56
77
|
linking,
|
|
57
78
|
fallback = null,
|
|
58
79
|
documentTitle,
|
|
59
80
|
onReady,
|
|
81
|
+
onStateChange,
|
|
60
82
|
...rest
|
|
61
83
|
}: Props<ParamListBase>,
|
|
62
84
|
ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>
|
|
@@ -73,13 +95,52 @@ function NavigationContainerInner(
|
|
|
73
95
|
useBackButton(refContainer);
|
|
74
96
|
useDocumentTitle(refContainer, documentTitle);
|
|
75
97
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
const [lastUnhandledLink, setLastUnhandledLink] = React.useState<
|
|
99
|
+
string | undefined
|
|
100
|
+
>();
|
|
101
|
+
|
|
102
|
+
const { getInitialState } = useLinking(
|
|
103
|
+
refContainer,
|
|
104
|
+
{
|
|
105
|
+
enabled: isLinkingEnabled,
|
|
106
|
+
prefixes: [],
|
|
107
|
+
...linking,
|
|
108
|
+
},
|
|
109
|
+
setLastUnhandledLink
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
|
|
113
|
+
|
|
114
|
+
const unhandledLinkingContext = React.useMemo(
|
|
115
|
+
() => ({ lastUnhandledLink, setLastUnhandledLink }),
|
|
116
|
+
[lastUnhandledLink, setLastUnhandledLink]
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const onReadyForLinkingHandling = useLatestCallback(() => {
|
|
120
|
+
// If the screen path matches lastUnhandledLink, we do not track it
|
|
121
|
+
const path = refContainer.current?.getCurrentRoute()?.path;
|
|
122
|
+
setLastUnhandledLink((previousLastUnhandledLink) => {
|
|
123
|
+
if (previousLastUnhandledLink === path) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
return previousLastUnhandledLink;
|
|
127
|
+
});
|
|
128
|
+
onReady?.();
|
|
81
129
|
});
|
|
82
130
|
|
|
131
|
+
const onStateChangeForLinkingHandling = useLatestCallback(
|
|
132
|
+
(state: Readonly<NavigationState> | undefined) => {
|
|
133
|
+
// If the screen path matches lastUnhandledLink, we do not track it
|
|
134
|
+
const path = refContainer.current?.getCurrentRoute()?.path;
|
|
135
|
+
setLastUnhandledLink((previousLastUnhandledLink) => {
|
|
136
|
+
if (previousLastUnhandledLink === path) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
return previousLastUnhandledLink;
|
|
140
|
+
});
|
|
141
|
+
onStateChange?.(state);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
83
144
|
// Add additional linking related info to the ref
|
|
84
145
|
// This will be used by the devtools
|
|
85
146
|
React.useEffect(() => {
|
|
@@ -102,51 +163,49 @@ function NavigationContainerInner(
|
|
|
102
163
|
|
|
103
164
|
const [isResolved, initialState] = useThenable(getInitialState);
|
|
104
165
|
|
|
166
|
+
// FIXME
|
|
167
|
+
// @ts-expect-error not sure why this is not working
|
|
105
168
|
React.useImperativeHandle(ref, () => refContainer.current);
|
|
106
169
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;
|
|
170
|
+
const isLinkingReady =
|
|
171
|
+
rest.initialState != null || !isLinkingEnabled || isResolved;
|
|
110
172
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
React.useEffect(() => {
|
|
118
|
-
if (isReady) {
|
|
119
|
-
onReadyRef.current?.();
|
|
120
|
-
}
|
|
121
|
-
}, [isReady]);
|
|
122
|
-
|
|
123
|
-
if (!isReady) {
|
|
124
|
-
// This is temporary until we have Suspense for data-fetching
|
|
125
|
-
// Then the fallback will be handled by a parent `Suspense` component
|
|
126
|
-
return fallback as React.ReactElement;
|
|
173
|
+
if (!isLinkingReady) {
|
|
174
|
+
return (
|
|
175
|
+
<LocaleDirContext.Provider value={direction}>
|
|
176
|
+
<ThemeProvider value={theme}>{fallback}</ThemeProvider>
|
|
177
|
+
</LocaleDirContext.Provider>
|
|
178
|
+
);
|
|
127
179
|
}
|
|
128
180
|
|
|
129
181
|
return (
|
|
130
|
-
<
|
|
131
|
-
<
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
182
|
+
<LocaleDirContext.Provider value={direction}>
|
|
183
|
+
<UnhandledLinkingContext.Provider value={unhandledLinkingContext}>
|
|
184
|
+
<LinkingContext.Provider value={linkingContext}>
|
|
185
|
+
<BaseNavigationContainer
|
|
186
|
+
{...rest}
|
|
187
|
+
theme={theme}
|
|
188
|
+
onReady={onReadyForLinkingHandling}
|
|
189
|
+
onStateChange={onStateChangeForLinkingHandling}
|
|
190
|
+
initialState={
|
|
191
|
+
rest.initialState == null ? initialState : rest.initialState
|
|
192
|
+
}
|
|
193
|
+
ref={refContainer}
|
|
194
|
+
/>
|
|
195
|
+
</LinkingContext.Provider>
|
|
196
|
+
</UnhandledLinkingContext.Provider>
|
|
197
|
+
</LocaleDirContext.Provider>
|
|
141
198
|
);
|
|
142
199
|
}
|
|
143
200
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Container component that manages the navigation state.
|
|
203
|
+
* This should be rendered at the root wrapping the whole app.
|
|
204
|
+
*/
|
|
205
|
+
export const NavigationContainer = React.forwardRef(
|
|
206
|
+
NavigationContainerInner
|
|
207
|
+
) as <RootParamList extends {} = ReactNavigation.RootParamList>(
|
|
147
208
|
props: Props<RootParamList> & {
|
|
148
209
|
ref?: React.Ref<NavigationContainerRef<RootParamList>>;
|
|
149
210
|
}
|
|
150
211
|
) => React.ReactElement;
|
|
151
|
-
|
|
152
|
-
export default NavigationContainer;
|
package/src/ServerContainer.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CurrentRenderContext } from '@amazon-devices/react-navigation__core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import ServerContext,
|
|
4
|
+
import { ServerContext, type ServerContextType } from './ServerContext';
|
|
5
5
|
import type { ServerContainerRef } from './types';
|
|
6
6
|
|
|
7
7
|
type Props = ServerContextType & {
|
|
@@ -15,7 +15,7 @@ type Props = ServerContextType & {
|
|
|
15
15
|
* @param props.children Child elements to render the content.
|
|
16
16
|
* @param props.ref Ref object which contains helper methods.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export const ServerContainer = React.forwardRef(function ServerContainer(
|
|
19
19
|
{ children, location }: Props,
|
|
20
20
|
ref: React.Ref<ServerContainerRef>
|
|
21
21
|
) {
|
|
@@ -25,6 +25,7 @@ export default React.forwardRef(function ServerContainer(
|
|
|
25
25
|
);
|
|
26
26
|
}, []);
|
|
27
27
|
|
|
28
|
+
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
28
29
|
const current: { options?: object } = {};
|
|
29
30
|
|
|
30
31
|
if (ref) {
|
|
@@ -41,12 +42,12 @@ export default React.forwardRef(function ServerContainer(
|
|
|
41
42
|
if (typeof ref === 'function') {
|
|
42
43
|
ref(value);
|
|
43
44
|
} else {
|
|
44
|
-
// @ts-expect-error: the TS types are incorrect and say that ref.current is readonly
|
|
45
45
|
ref.current = value;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
|
+
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
50
51
|
<ServerContext.Provider value={{ location }}>
|
|
51
52
|
<CurrentRenderContext.Provider value={current}>
|
|
52
53
|
{children}
|
package/src/ServerContext.tsx
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const MISSING_CONTEXT_ERROR =
|
|
4
|
+
"Couldn't find an UnhandledLinkingContext context.";
|
|
5
|
+
|
|
6
|
+
export const UnhandledLinkingContext = React.createContext<{
|
|
7
|
+
lastUnhandledLink: string | undefined;
|
|
8
|
+
setLastUnhandledLink: (lastUnhandledUrl: string | undefined) => void;
|
|
9
|
+
}>({
|
|
10
|
+
get lastUnhandledLink(): any {
|
|
11
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
12
|
+
},
|
|
13
|
+
get setLastUnhandledLink(): any {
|
|
14
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
UnhandledLinkingContext.displayName = 'UnhandledLinkingContext';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createNavigatorFactory,
|
|
3
|
+
type DefaultNavigatorOptions,
|
|
4
|
+
type NavigationListBase,
|
|
5
|
+
type ParamListBase,
|
|
6
|
+
type StackNavigationState,
|
|
7
|
+
StackRouter,
|
|
8
|
+
type TypedNavigator,
|
|
9
|
+
useNavigationBuilder,
|
|
10
|
+
} from '@amazon-devices/react-navigation__core';
|
|
11
|
+
|
|
12
|
+
const StackNavigator = (
|
|
13
|
+
props: DefaultNavigatorOptions<
|
|
14
|
+
ParamListBase,
|
|
15
|
+
string | undefined,
|
|
16
|
+
StackNavigationState<ParamListBase>,
|
|
17
|
+
{},
|
|
18
|
+
{},
|
|
19
|
+
unknown
|
|
20
|
+
>
|
|
21
|
+
) => {
|
|
22
|
+
const { state, descriptors, NavigationContent } = useNavigationBuilder(
|
|
23
|
+
StackRouter,
|
|
24
|
+
props
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<NavigationContent>
|
|
29
|
+
{descriptors[state.routes[state.index].key].render()}
|
|
30
|
+
</NavigationContent>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function createStackNavigator<
|
|
35
|
+
ParamList extends ParamListBase,
|
|
36
|
+
>(): TypedNavigator<{
|
|
37
|
+
ParamList: ParamList;
|
|
38
|
+
NavigatorID: string | undefined;
|
|
39
|
+
State: StackNavigationState<ParamList>;
|
|
40
|
+
ScreenOptions: {};
|
|
41
|
+
EventMap: {};
|
|
42
|
+
NavigationList: NavigationListBase<ParamList>;
|
|
43
|
+
Navigator: typeof StackNavigator;
|
|
44
|
+
}> {
|
|
45
|
+
return createNavigatorFactory(StackNavigator)();
|
|
46
|
+
}
|