@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.
Files changed (232) hide show
  1. package/SystemBundles/c0d77be093c9724f49566be215c67240e6443c16760f772a745108ddaef15503.bundle +9117 -0
  2. package/SystemBundles/c0d77be093c9724f49566be215c67240e6443c16760f772a745108ddaef15503.map +3543 -0
  3. package/SystemModules/amzn__react-navigation__native-8.modules.txt +24 -0
  4. package/SystemModules/amzn__react-navigation__native-8.private.modules.txt +77 -0
  5. package/SystemModules/keplerscript-system-bundle-config.json +4 -4
  6. package/kepler-compatibility.json +2 -2
  7. package/lib/module/Link.js +31 -10
  8. package/lib/module/Link.js.map +1 -1
  9. package/lib/module/LinkingContext.js +7 -3
  10. package/lib/module/LinkingContext.js.map +1 -1
  11. package/lib/module/LocaleDirContext.js +6 -0
  12. package/lib/module/LocaleDirContext.js.map +1 -0
  13. package/lib/module/NavigationContainer.js +87 -59
  14. package/lib/module/NavigationContainer.js.map +1 -1
  15. package/lib/module/ServerContainer.js +20 -10
  16. package/lib/module/ServerContainer.js.map +1 -1
  17. package/lib/module/ServerContext.js +3 -2
  18. package/lib/module/ServerContext.js.map +1 -1
  19. package/lib/module/UnhandledLinkingContext.js +14 -0
  20. package/lib/module/UnhandledLinkingContext.js.map +1 -0
  21. package/lib/module/__stubs__/createStackNavigator.js +18 -0
  22. package/lib/module/__stubs__/createStackNavigator.js.map +1 -0
  23. package/lib/module/__stubs__/window.js +75 -0
  24. package/lib/module/__stubs__/window.js.map +1 -0
  25. package/lib/module/createMemoryHistory.js +19 -17
  26. package/lib/module/createMemoryHistory.js.map +1 -1
  27. package/lib/module/createStaticNavigation.js +54 -0
  28. package/lib/module/createStaticNavigation.js.map +1 -0
  29. package/lib/module/extractPathFromURL.js +6 -5
  30. package/lib/module/extractPathFromURL.js.map +1 -1
  31. package/lib/module/index.js +18 -13
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/package.json +1 -0
  34. package/lib/module/theming/DarkTheme.js +6 -3
  35. package/lib/module/theming/DarkTheme.js.map +1 -1
  36. package/lib/module/theming/DefaultTheme.js +6 -3
  37. package/lib/module/theming/DefaultTheme.js.map +1 -1
  38. package/lib/module/theming/fonts.js +61 -0
  39. package/lib/module/theming/fonts.js.map +1 -0
  40. package/lib/module/types.js +2 -0
  41. package/lib/module/types.js.map +1 -1
  42. package/lib/module/useBackButton.js +3 -1
  43. package/lib/module/useBackButton.js.map +1 -1
  44. package/lib/module/useBackButton.native.js +3 -1
  45. package/lib/module/useBackButton.native.js.map +1 -1
  46. package/lib/module/useDocumentTitle.js +6 -4
  47. package/lib/module/useDocumentTitle.js.map +1 -1
  48. package/lib/module/useDocumentTitle.native.js +4 -2
  49. package/lib/module/useDocumentTitle.native.js.map +1 -1
  50. package/lib/module/useLinkBuilder.js +71 -40
  51. package/lib/module/useLinkBuilder.js.map +1 -1
  52. package/lib/module/useLinkProps.js +41 -36
  53. package/lib/module/useLinkProps.js.map +1 -1
  54. package/lib/module/useLinkTo.js +18 -28
  55. package/lib/module/useLinkTo.js.map +1 -1
  56. package/lib/module/useLinking.js +47 -19
  57. package/lib/module/useLinking.js.map +1 -1
  58. package/lib/module/useLinking.native.js +33 -28
  59. package/lib/module/useLinking.native.js.map +1 -1
  60. package/lib/module/useLocale.js +18 -0
  61. package/lib/module/useLocale.js.map +1 -0
  62. package/lib/module/useRoutePath.js +30 -0
  63. package/lib/module/useRoutePath.js.map +1 -0
  64. package/lib/module/useScrollToTop.js +11 -7
  65. package/lib/module/useScrollToTop.js.map +1 -1
  66. package/lib/module/useThenable.js +4 -1
  67. package/lib/module/useThenable.js.map +1 -1
  68. package/lib/typescript/package.json +1 -0
  69. package/lib/typescript/src/Link.d.ts +8 -10
  70. package/lib/typescript/src/Link.d.ts.map +1 -1
  71. package/lib/typescript/src/LinkingContext.d.ts +2 -3
  72. package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
  73. package/lib/typescript/src/LocaleDirContext.d.ts +4 -0
  74. package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -0
  75. package/lib/typescript/src/NavigationContainer.d.ts +36 -13
  76. package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
  77. package/lib/typescript/src/ServerContainer.d.ts +2 -3
  78. package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
  79. package/lib/typescript/src/ServerContext.d.ts +1 -2
  80. package/lib/typescript/src/ServerContext.d.ts.map +1 -1
  81. package/lib/typescript/src/UnhandledLinkingContext.d.ts +6 -0
  82. package/lib/typescript/src/UnhandledLinkingContext.d.ts.map +1 -0
  83. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +13 -0
  84. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -0
  85. package/lib/typescript/src/{__mocks__ → __stubs__}/window.d.ts +5 -6
  86. package/lib/typescript/src/__stubs__/window.d.ts.map +1 -0
  87. package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
  88. package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
  89. package/lib/typescript/src/createStaticNavigation.d.ts +34 -0
  90. package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -0
  91. package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
  92. package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
  93. package/lib/typescript/src/index.d.ts +15 -12
  94. package/lib/typescript/src/index.d.ts.map +1 -1
  95. package/lib/typescript/src/theming/DarkTheme.d.ts +1 -2
  96. package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
  97. package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -2
  98. package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -1
  99. package/lib/typescript/src/theming/fonts.d.ts +53 -0
  100. package/lib/typescript/src/theming/fonts.d.ts.map +1 -0
  101. package/lib/typescript/src/types.d.ts +35 -3
  102. package/lib/typescript/src/types.d.ts.map +1 -1
  103. package/lib/typescript/src/useBackButton.d.ts +1 -2
  104. package/lib/typescript/src/useBackButton.d.ts.map +1 -1
  105. package/lib/typescript/src/useBackButton.native.d.ts +1 -1
  106. package/lib/typescript/src/useBackButton.native.d.ts.map +1 -1
  107. package/lib/typescript/src/useDocumentTitle.d.ts +1 -1
  108. package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
  109. package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -1
  110. package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -1
  111. package/lib/typescript/src/useLinkBuilder.d.ts +97 -3
  112. package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
  113. package/lib/typescript/src/useLinkProps.d.ts +23 -10
  114. package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
  115. package/lib/typescript/src/useLinkTo.d.ts +6 -8
  116. package/lib/typescript/src/useLinkTo.d.ts.map +1 -1
  117. package/lib/typescript/src/useLinking.d.ts +5 -46
  118. package/lib/typescript/src/useLinking.d.ts.map +1 -1
  119. package/lib/typescript/src/useLinking.native.d.ts +11 -29
  120. package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
  121. package/lib/typescript/src/useLocale.d.ts +7 -0
  122. package/lib/typescript/src/useLocale.d.ts.map +1 -0
  123. package/lib/typescript/src/useRoutePath.d.ts +7 -0
  124. package/lib/typescript/src/useRoutePath.d.ts.map +1 -0
  125. package/lib/typescript/src/useScrollToTop.d.ts +2 -2
  126. package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
  127. package/lib/typescript/src/useThenable.d.ts +1 -1
  128. package/lib/typescript/src/useThenable.d.ts.map +1 -1
  129. package/oss-attribution/attribution.txt +50 -0
  130. package/oss-attribution/licenseInfos.json +18 -0
  131. package/package.json +97 -1
  132. package/src/Link.tsx +36 -20
  133. package/src/LinkingContext.tsx +9 -5
  134. package/src/LocaleDirContext.tsx +7 -0
  135. package/src/NavigationContainer.tsx +128 -69
  136. package/src/ServerContainer.tsx +4 -3
  137. package/src/ServerContext.tsx +1 -3
  138. package/src/UnhandledLinkingContext.tsx +18 -0
  139. package/src/__stubs__/createStackNavigator.tsx +46 -0
  140. package/src/{__mocks__ → __stubs__}/window.tsx +8 -8
  141. package/src/createMemoryHistory.tsx +16 -11
  142. package/src/createStaticNavigation.tsx +109 -0
  143. package/src/extractPathFromURL.tsx +3 -3
  144. package/src/index.tsx +15 -12
  145. package/src/theming/DarkTheme.tsx +3 -3
  146. package/src/theming/DefaultTheme.tsx +3 -3
  147. package/src/theming/fonts.tsx +63 -0
  148. package/src/types.tsx +49 -3
  149. package/src/useBackButton.native.tsx +2 -2
  150. package/src/useBackButton.tsx +2 -2
  151. package/src/useDocumentTitle.native.tsx +2 -2
  152. package/src/useDocumentTitle.tsx +2 -2
  153. package/src/useLinkBuilder.tsx +100 -55
  154. package/src/useLinkProps.tsx +80 -50
  155. package/src/useLinkTo.tsx +13 -53
  156. package/src/useLinking.native.tsx +33 -31
  157. package/src/useLinking.tsx +70 -23
  158. package/src/useLocale.tsx +18 -0
  159. package/src/useRoutePath.tsx +34 -0
  160. package/src/useScrollToTop.tsx +16 -12
  161. package/src/useThenable.tsx +2 -1
  162. package/SystemBundles/41869b563992545ca95a9a2f729e958cbdcada7391919e8e02112d791754072a.bundle +0 -14508
  163. package/SystemBundles/41869b563992545ca95a9a2f729e958cbdcada7391919e8e02112d791754072a.map +0 -5157
  164. package/SystemModules/amzn__react-navigation__native-7.modules.txt +0 -76
  165. package/SystemModules/amzn__react-navigation__native-7.private.modules.txt +0 -100
  166. package/THIRD_PARTY_NOTICES.txt +0 -24
  167. package/lib/commonjs/Link.js +0 -50
  168. package/lib/commonjs/Link.js.map +0 -1
  169. package/lib/commonjs/LinkingContext.js +0 -15
  170. package/lib/commonjs/LinkingContext.js.map +0 -1
  171. package/lib/commonjs/NavigationContainer.js +0 -109
  172. package/lib/commonjs/NavigationContainer.js.map +0 -1
  173. package/lib/commonjs/ServerContainer.js +0 -54
  174. package/lib/commonjs/ServerContainer.js.map +0 -1
  175. package/lib/commonjs/ServerContext.js +0 -12
  176. package/lib/commonjs/ServerContext.js.map +0 -1
  177. package/lib/commonjs/createMemoryHistory.js +0 -220
  178. package/lib/commonjs/createMemoryHistory.js.map +0 -1
  179. package/lib/commonjs/extractPathFromURL.js +0 -25
  180. package/lib/commonjs/extractPathFromURL.js.map +0 -1
  181. package/lib/commonjs/index.js +0 -129
  182. package/lib/commonjs/index.js.map +0 -1
  183. package/lib/commonjs/theming/DarkTheme.js +0 -19
  184. package/lib/commonjs/theming/DarkTheme.js.map +0 -1
  185. package/lib/commonjs/theming/DefaultTheme.js +0 -19
  186. package/lib/commonjs/theming/DefaultTheme.js.map +0 -1
  187. package/lib/commonjs/theming/ThemeContext.js +0 -15
  188. package/lib/commonjs/theming/ThemeContext.js.map +0 -1
  189. package/lib/commonjs/theming/ThemeProvider.js +0 -20
  190. package/lib/commonjs/theming/ThemeProvider.js.map +0 -1
  191. package/lib/commonjs/theming/useTheme.js +0 -16
  192. package/lib/commonjs/theming/useTheme.js.map +0 -1
  193. package/lib/commonjs/types.js +0 -6
  194. package/lib/commonjs/types.js.map +0 -1
  195. package/lib/commonjs/useBackButton.js +0 -11
  196. package/lib/commonjs/useBackButton.js.map +0 -1
  197. package/lib/commonjs/useBackButton.native.js +0 -27
  198. package/lib/commonjs/useBackButton.native.js.map +0 -1
  199. package/lib/commonjs/useDocumentTitle.js +0 -32
  200. package/lib/commonjs/useDocumentTitle.js.map +0 -1
  201. package/lib/commonjs/useDocumentTitle.native.js +0 -10
  202. package/lib/commonjs/useDocumentTitle.native.js.map +0 -1
  203. package/lib/commonjs/useLinkBuilder.js +0 -63
  204. package/lib/commonjs/useLinkBuilder.js.map +0 -1
  205. package/lib/commonjs/useLinkProps.js +0 -97
  206. package/lib/commonjs/useLinkProps.js.map +0 -1
  207. package/lib/commonjs/useLinkTo.js +0 -45
  208. package/lib/commonjs/useLinkTo.js.map +0 -1
  209. package/lib/commonjs/useLinking.js +0 -303
  210. package/lib/commonjs/useLinking.js.map +0 -1
  211. package/lib/commonjs/useLinking.native.js +0 -152
  212. package/lib/commonjs/useLinking.native.js.map +0 -1
  213. package/lib/commonjs/useScrollToTop.js +0 -95
  214. package/lib/commonjs/useScrollToTop.js.map +0 -1
  215. package/lib/commonjs/useThenable.js +0 -41
  216. package/lib/commonjs/useThenable.js.map +0 -1
  217. package/lib/module/theming/ThemeContext.js +0 -6
  218. package/lib/module/theming/ThemeContext.js.map +0 -1
  219. package/lib/module/theming/ThemeProvider.js +0 -11
  220. package/lib/module/theming/ThemeProvider.js.map +0 -1
  221. package/lib/module/theming/useTheme.js +0 -7
  222. package/lib/module/theming/useTheme.js.map +0 -1
  223. package/lib/typescript/src/__mocks__/window.d.ts.map +0 -1
  224. package/lib/typescript/src/theming/ThemeContext.d.ts +0 -5
  225. package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
  226. package/lib/typescript/src/theming/ThemeProvider.d.ts +0 -9
  227. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
  228. package/lib/typescript/src/theming/useTheme.d.ts +0 -2
  229. package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
  230. package/src/theming/ThemeContext.tsx +0 -10
  231. package/src/theming/ThemeProvider.tsx +0 -15
  232. package/src/theming/useTheme.tsx +0 -9
@@ -1,2 +1,2 @@
1
- export default function useThenable<T>(create: () => PromiseLike<T>): [boolean, T | undefined];
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,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,4BAsClE"}
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
- {"name": "@amazon-devices/react-navigation__native", "description": "React Native integration for React Navigation", "version": "7.0.9000000000", "keywords": ["react-native", "react-navigation", "ios", "android"], "license": "See license in LICENSE", "repository": {"type": "git", "url": "https://github.com/react-navigation/react-navigation.git", "directory": "packages/native"}, "bugs": {"url": "https://github.com/react-navigation/react-navigation/issues"}, "homepage": "https://reactnavigation.org", "main": "lib/commonjs/index.js", "react-native": "src/index.tsx", "source": "src/index.tsx", "module": "lib/module/index.js", "types": "lib/typescript/src/index.d.ts", "files": ["src", "lib", "!**/__tests__", "kepler-compatibility.json", "SystemModules", "SystemBundles", "THIRD_PARTY_NOTICES.txt", "kepler-transformed-package-info.json"], "sideEffects": false, "kepler": {"temporary-alias-for-package": {"name": "@react-navigation/native", "version": "6.1.9"}}, "publishConfig": {"access": "public"}, "scripts": {"clean": "del lib"}, "dependencies": {"@amazon-devices/react-navigation__core": "^7.0.0", "@amazon-devices/react-navigation__routers": "^7.0.0", "escape-string-regexp": "4.0.0", "fast-deep-equal": "3.1.3", "nanoid": "3.1.23"}, "devDependencies": {"@testing-library/react-native": "11.5.4", "@types/react": "17.0.2", "@types/react-dom": "18.0.10", "@types/jest": "26.0.15", "del-cli": "5.0.0", "react": "17.0.2", "react-dom": "18.2.0", "react-native": "0.72.0", "react-native-builder-bob": "0.20.4", "typescript": "4.9.4"}, "peerDependencies": {"react": "*", "react-native": "*"}, "react-native-builder-bob": {"source": "src", "output": "lib", "targets": ["commonjs", "module", ["typescript", {"project": "tsconfig.build.json"}]]}}
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 type { NavigationAction } from '@amazon-devices/react-navigation__core';
1
+ import { useTheme } from '@amazon-devices/react-navigation__core';
2
2
  import * as React from 'react';
3
- import { GestureResponderEvent, Platform, Text, TextProps } from 'react-native';
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
- to: To<ParamList>;
10
- action?: NavigationAction;
11
- target?: string;
12
- onPress?: (
13
- e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
14
- ) => void;
15
- } & (Omit<TextProps, 'disabled'> & {
16
- disabled?: boolean | null;
17
- children: React.ReactNode;
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.to Absolute path to screen (e.g. `/feeds/hot`).
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 default function Link<ParamList extends ReactNavigation.RootParamList>({
29
- to,
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 props = useLinkProps<ParamList>({ to, action });
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
- props.onPress(e);
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
  }
@@ -3,10 +3,14 @@ import * as React from 'react';
3
3
 
4
4
  import type { LinkingOptions } from './types';
5
5
 
6
- const LinkingContext = React.createContext<{
7
- options: LinkingOptions<ParamListBase> | undefined;
8
- }>({ options: undefined });
6
+ const MISSING_CONTEXT_ERROR = "Couldn't find a LinkingContext context.";
9
7
 
10
- LinkingContext.displayName = '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
- export default LinkingContext;
16
+ LinkingContext.displayName = 'LinkingContext';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ import type { LocaleDirection } from './types';
4
+
5
+ export const LocaleDirContext = React.createContext<LocaleDirection>('ltr');
6
+
7
+ LocaleDirContext.displayName = 'LocaleDirContext';
@@ -3,21 +3,30 @@ import {
3
3
  getActionFromState,
4
4
  getPathFromState,
5
5
  getStateFromPath,
6
- NavigationContainerProps,
7
- NavigationContainerRef,
8
- ParamListBase,
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 LinkingContext from './LinkingContext';
14
- import DefaultTheme from './theming/DefaultTheme';
15
- import ThemeProvider from './theming/ThemeProvider';
16
- import type { DocumentTitleOptions, LinkingOptions, Theme } from './types';
17
- import useBackButton from './useBackButton';
18
- import useDocumentTitle from './useDocumentTitle';
19
- import useLinking from './useLinking';
20
- import useThenable from './useThenable';
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
- global.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
38
+ globalThis.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
30
39
 
31
40
  type Props<ParamList extends {}> = NavigationContainerProps & {
32
- theme?: Theme;
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 { getInitialState } = useLinking(refContainer, {
77
- independent: rest.independent,
78
- enabled: isLinkingEnabled,
79
- prefixes: [],
80
- ...linking,
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 linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
108
-
109
- const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;
170
+ const isLinkingReady =
171
+ rest.initialState != null || !isLinkingEnabled || isResolved;
110
172
 
111
- const onReadyRef = React.useRef(onReady);
112
-
113
- React.useEffect(() => {
114
- onReadyRef.current = onReady;
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
- <LinkingContext.Provider value={linkingContext}>
131
- <ThemeProvider value={theme}>
132
- <BaseNavigationContainer
133
- {...rest}
134
- initialState={
135
- rest.initialState == null ? initialState : rest.initialState
136
- }
137
- ref={refContainer}
138
- />
139
- </ThemeProvider>
140
- </LinkingContext.Provider>
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
- const NavigationContainer = React.forwardRef(NavigationContainerInner) as <
145
- RootParamList extends {} = ReactNavigation.RootParamList
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;
@@ -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, { ServerContextType } from './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 default React.forwardRef(function ServerContainer(
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}
@@ -7,8 +7,6 @@ export type ServerContextType = {
7
7
  };
8
8
  };
9
9
 
10
- const ServerContext = React.createContext<ServerContextType | undefined>(
10
+ export const ServerContext = React.createContext<ServerContextType | undefined>(
11
11
  undefined
12
12
  );
13
-
14
- export default ServerContext;
@@ -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
+ }