@react-navigation/native 7.0.0-alpha.0 → 7.0.0-alpha.10

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 (238) hide show
  1. package/lib/commonjs/Link.js +16 -9
  2. package/lib/commonjs/Link.js.map +1 -1
  3. package/lib/commonjs/LinkingContext.js +8 -7
  4. package/lib/commonjs/LinkingContext.js.map +1 -1
  5. package/lib/commonjs/LocaleDirContext.js +12 -0
  6. package/lib/commonjs/LocaleDirContext.js.map +1 -0
  7. package/lib/commonjs/NavigationContainer.js +68 -32
  8. package/lib/commonjs/NavigationContainer.js.map +1 -1
  9. package/lib/commonjs/ServerContainer.js +6 -8
  10. package/lib/commonjs/ServerContainer.js.map +1 -1
  11. package/lib/commonjs/ServerContext.js +4 -6
  12. package/lib/commonjs/ServerContext.js.map +1 -1
  13. package/lib/commonjs/UnhandledLinkingContext.js +20 -0
  14. package/lib/commonjs/UnhandledLinkingContext.js.map +1 -0
  15. package/lib/commonjs/__stubs__/createStackNavigator.js +19 -0
  16. package/lib/commonjs/__stubs__/createStackNavigator.js.map +1 -0
  17. package/lib/commonjs/__stubs__/window.js +79 -0
  18. package/lib/commonjs/__stubs__/window.js.map +1 -0
  19. package/lib/commonjs/createMemoryHistory.js +5 -8
  20. package/lib/commonjs/createMemoryHistory.js.map +1 -1
  21. package/lib/commonjs/createStaticNavigation.js +8 -8
  22. package/lib/commonjs/createStaticNavigation.js.map +1 -1
  23. package/lib/commonjs/extractPathFromURL.js +4 -4
  24. package/lib/commonjs/extractPathFromURL.js.map +1 -1
  25. package/lib/commonjs/index.js +33 -34
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/theming/DarkTheme.js +5 -5
  28. package/lib/commonjs/theming/DarkTheme.js.map +1 -1
  29. package/lib/commonjs/theming/DefaultTheme.js +5 -5
  30. package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
  31. package/lib/commonjs/theming/fonts.js +65 -0
  32. package/lib/commonjs/theming/fonts.js.map +1 -0
  33. package/lib/commonjs/types.js.map +1 -1
  34. package/lib/commonjs/useBackButton.js +4 -20
  35. package/lib/commonjs/useBackButton.js.map +1 -1
  36. package/lib/commonjs/useBackButton.native.js +27 -0
  37. package/lib/commonjs/useBackButton.native.js.map +1 -0
  38. package/lib/commonjs/useDocumentTitle.js +6 -6
  39. package/lib/commonjs/useDocumentTitle.js.map +1 -1
  40. package/lib/commonjs/useDocumentTitle.native.js +1 -1
  41. package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
  42. package/lib/commonjs/useLinkBuilder.js +80 -0
  43. package/lib/commonjs/useLinkBuilder.js.map +1 -0
  44. package/lib/commonjs/useLinkProps.js +23 -27
  45. package/lib/commonjs/useLinkProps.js.map +1 -1
  46. package/lib/commonjs/useLinkTo.js +30 -0
  47. package/lib/commonjs/useLinkTo.js.map +1 -0
  48. package/lib/commonjs/useLinking.js +39 -40
  49. package/lib/commonjs/useLinking.js.map +1 -1
  50. package/lib/commonjs/useLinking.native.js +33 -27
  51. package/lib/commonjs/useLinking.native.js.map +1 -1
  52. package/lib/commonjs/useLocale.js +23 -0
  53. package/lib/commonjs/useLocale.js.map +1 -0
  54. package/lib/commonjs/useScrollToTop.js +9 -7
  55. package/lib/commonjs/useScrollToTop.js.map +1 -1
  56. package/lib/commonjs/useThenable.js +4 -3
  57. package/lib/commonjs/useThenable.js.map +1 -1
  58. package/lib/commonjs/useUnhandledLinking.js +75 -0
  59. package/lib/commonjs/useUnhandledLinking.js.map +1 -0
  60. package/lib/module/Link.js +13 -5
  61. package/lib/module/Link.js.map +1 -1
  62. package/lib/module/LinkingContext.js +5 -3
  63. package/lib/module/LinkingContext.js.map +1 -1
  64. package/lib/module/LocaleDirContext.js +4 -0
  65. package/lib/module/LocaleDirContext.js.map +1 -0
  66. package/lib/module/NavigationContainer.js +60 -23
  67. package/lib/module/NavigationContainer.js.map +1 -1
  68. package/lib/module/ServerContainer.js +2 -2
  69. package/lib/module/ServerContainer.js.map +1 -1
  70. package/lib/module/ServerContext.js +1 -2
  71. package/lib/module/ServerContext.js.map +1 -1
  72. package/lib/module/UnhandledLinkingContext.js +12 -0
  73. package/lib/module/UnhandledLinkingContext.js.map +1 -0
  74. package/lib/module/__stubs__/createStackNavigator.js +11 -0
  75. package/lib/module/__stubs__/createStackNavigator.js.map +1 -0
  76. package/lib/module/__stubs__/window.js +73 -0
  77. package/lib/module/__stubs__/window.js.map +1 -0
  78. package/lib/module/createMemoryHistory.js +5 -8
  79. package/lib/module/createMemoryHistory.js.map +1 -1
  80. package/lib/module/createStaticNavigation.js +5 -4
  81. package/lib/module/createStaticNavigation.js.map +1 -1
  82. package/lib/module/extractPathFromURL.js +4 -4
  83. package/lib/module/extractPathFromURL.js.map +1 -1
  84. package/lib/module/index.js +12 -12
  85. package/lib/module/index.js.map +1 -1
  86. package/lib/module/theming/DarkTheme.js +4 -3
  87. package/lib/module/theming/DarkTheme.js.map +1 -1
  88. package/lib/module/theming/DefaultTheme.js +4 -3
  89. package/lib/module/theming/DefaultTheme.js.map +1 -1
  90. package/lib/module/theming/fonts.js +59 -0
  91. package/lib/module/theming/fonts.js.map +1 -0
  92. package/lib/module/types.js.map +1 -1
  93. package/lib/module/useBackButton.js +3 -17
  94. package/lib/module/useBackButton.js.map +1 -1
  95. package/lib/module/useBackButton.native.js +19 -0
  96. package/lib/module/useBackButton.native.js.map +1 -0
  97. package/lib/module/useDocumentTitle.js +4 -4
  98. package/lib/module/useDocumentTitle.js.map +1 -1
  99. package/lib/module/useDocumentTitle.native.js +1 -1
  100. package/lib/module/useDocumentTitle.native.js.map +1 -1
  101. package/lib/module/{useLinkTools.js → useLinkBuilder.js} +11 -11
  102. package/lib/module/useLinkBuilder.js.map +1 -0
  103. package/lib/module/useLinkProps.js +20 -23
  104. package/lib/module/useLinkProps.js.map +1 -1
  105. package/lib/module/useLinkTo.js +23 -0
  106. package/lib/module/useLinkTo.js.map +1 -0
  107. package/lib/module/useLinking.js +33 -36
  108. package/lib/module/useLinking.js.map +1 -1
  109. package/lib/module/useLinking.native.js +29 -22
  110. package/lib/module/useLinking.native.js.map +1 -1
  111. package/lib/module/useLocale.js +16 -0
  112. package/lib/module/useLocale.js.map +1 -0
  113. package/lib/module/useScrollToTop.js +8 -6
  114. package/lib/module/useScrollToTop.js.map +1 -1
  115. package/lib/module/useThenable.js +2 -1
  116. package/lib/module/useThenable.js.map +1 -1
  117. package/lib/module/useUnhandledLinking.js +69 -0
  118. package/lib/module/useUnhandledLinking.js.map +1 -0
  119. package/lib/typescript/src/Link.d.ts +3 -3
  120. package/lib/typescript/src/Link.d.ts.map +1 -1
  121. package/lib/typescript/src/LinkingContext.d.ts +2 -3
  122. package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
  123. package/lib/typescript/src/LocaleDirContext.d.ts +4 -0
  124. package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -0
  125. package/lib/typescript/src/NavigationContainer.d.ts +6 -6
  126. package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
  127. package/lib/typescript/src/ServerContainer.d.ts +2 -3
  128. package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
  129. package/lib/typescript/src/ServerContext.d.ts +1 -2
  130. package/lib/typescript/src/ServerContext.d.ts.map +1 -1
  131. package/lib/typescript/src/UnhandledLinkingContext.d.ts +6 -0
  132. package/lib/typescript/src/UnhandledLinkingContext.d.ts.map +1 -0
  133. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +32 -0
  134. package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -0
  135. package/lib/typescript/src/{__mocks__ → __stubs__}/window.d.ts +2 -3
  136. package/lib/typescript/src/__stubs__/window.d.ts.map +1 -0
  137. package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
  138. package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
  139. package/lib/typescript/src/createStaticNavigation.d.ts +3 -3
  140. package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
  141. package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
  142. package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
  143. package/lib/typescript/src/index.d.ts +12 -12
  144. package/lib/typescript/src/index.d.ts.map +1 -1
  145. package/lib/typescript/src/theming/DarkTheme.d.ts +1 -2
  146. package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
  147. package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -2
  148. package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -1
  149. package/lib/typescript/src/theming/fonts.d.ts +53 -0
  150. package/lib/typescript/src/theming/fonts.d.ts.map +1 -0
  151. package/lib/typescript/src/types.d.ts +41 -11
  152. package/lib/typescript/src/types.d.ts.map +1 -1
  153. package/lib/typescript/src/useBackButton.d.ts +2 -2
  154. package/lib/typescript/src/useBackButton.d.ts.map +1 -1
  155. package/lib/typescript/src/useBackButton.native.d.ts +4 -0
  156. package/lib/typescript/src/useBackButton.native.d.ts.map +1 -0
  157. package/lib/typescript/src/useDocumentTitle.d.ts +1 -1
  158. package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
  159. package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -1
  160. package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -1
  161. package/lib/typescript/src/useLinkBuilder.d.ts +25 -0
  162. package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -0
  163. package/lib/typescript/src/useLinkProps.d.ts +3 -3
  164. package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
  165. package/lib/typescript/src/useLinkTo.d.ts +6 -0
  166. package/lib/typescript/src/useLinkTo.d.ts.map +1 -0
  167. package/lib/typescript/src/useLinking.d.ts +8 -20
  168. package/lib/typescript/src/useLinking.d.ts.map +1 -1
  169. package/lib/typescript/src/useLinking.native.d.ts +4 -20
  170. package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
  171. package/lib/typescript/src/useLocale.d.ts +7 -0
  172. package/lib/typescript/src/useLocale.d.ts.map +1 -0
  173. package/lib/typescript/src/useScrollToTop.d.ts +1 -1
  174. package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
  175. package/lib/typescript/src/useThenable.d.ts +1 -1
  176. package/lib/typescript/src/useThenable.d.ts.map +1 -1
  177. package/lib/typescript/src/useUnhandledLinking.d.ts +7 -0
  178. package/lib/typescript/src/useUnhandledLinking.d.ts.map +1 -0
  179. package/package.json +15 -15
  180. package/src/Link.tsx +12 -3
  181. package/src/LinkingContext.tsx +9 -5
  182. package/src/LocaleDirContext.tsx +7 -0
  183. package/src/NavigationContainer.tsx +90 -36
  184. package/src/ServerContainer.tsx +2 -2
  185. package/src/ServerContext.tsx +1 -3
  186. package/src/UnhandledLinkingContext.tsx +18 -0
  187. package/src/{__mocks__ → __stubs__}/createStackNavigator.tsx +1 -3
  188. package/src/{__mocks__ → __stubs__}/window.tsx +8 -8
  189. package/src/createMemoryHistory.tsx +1 -1
  190. package/src/createStaticNavigation.tsx +8 -8
  191. package/src/extractPathFromURL.tsx +5 -2
  192. package/src/index.tsx +12 -12
  193. package/src/theming/DarkTheme.tsx +3 -3
  194. package/src/theming/DefaultTheme.tsx +3 -3
  195. package/src/theming/fonts.tsx +63 -0
  196. package/src/types.tsx +55 -11
  197. package/src/useBackButton.native.tsx +33 -0
  198. package/src/useBackButton.tsx +4 -26
  199. package/src/useDocumentTitle.native.tsx +1 -1
  200. package/src/useDocumentTitle.tsx +1 -1
  201. package/src/{useLinkTools.tsx → useLinkBuilder.tsx} +9 -9
  202. package/src/useLinkProps.tsx +27 -23
  203. package/src/useLinkTo.tsx +30 -0
  204. package/src/useLinking.native.tsx +28 -22
  205. package/src/useLinking.tsx +46 -44
  206. package/src/useLocale.tsx +18 -0
  207. package/src/useScrollToTop.tsx +14 -10
  208. package/src/useThenable.tsx +2 -1
  209. package/src/useUnhandledLinking.tsx +91 -0
  210. package/lib/commonjs/theming/ThemeContext.js +0 -16
  211. package/lib/commonjs/theming/ThemeContext.js.map +0 -1
  212. package/lib/commonjs/theming/ThemeProvider.js +0 -21
  213. package/lib/commonjs/theming/ThemeProvider.js.map +0 -1
  214. package/lib/commonjs/theming/useTheme.js +0 -16
  215. package/lib/commonjs/theming/useTheme.js.map +0 -1
  216. package/lib/commonjs/useLinkTools.js +0 -81
  217. package/lib/commonjs/useLinkTools.js.map +0 -1
  218. package/lib/module/theming/ThemeContext.js +0 -6
  219. package/lib/module/theming/ThemeContext.js.map +0 -1
  220. package/lib/module/theming/ThemeProvider.js +0 -12
  221. package/lib/module/theming/ThemeProvider.js.map +0 -1
  222. package/lib/module/theming/useTheme.js +0 -7
  223. package/lib/module/theming/useTheme.js.map +0 -1
  224. package/lib/module/useLinkTools.js.map +0 -1
  225. package/lib/typescript/src/__mocks__/createStackNavigator.d.ts +0 -57
  226. package/lib/typescript/src/__mocks__/createStackNavigator.d.ts.map +0 -1
  227. package/lib/typescript/src/__mocks__/window.d.ts.map +0 -1
  228. package/lib/typescript/src/theming/ThemeContext.d.ts +0 -5
  229. package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
  230. package/lib/typescript/src/theming/ThemeProvider.d.ts +0 -9
  231. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
  232. package/lib/typescript/src/theming/useTheme.d.ts +0 -2
  233. package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
  234. package/lib/typescript/src/useLinkTools.d.ts +0 -33
  235. package/lib/typescript/src/useLinkTools.d.ts.map +0 -1
  236. package/src/theming/ThemeContext.tsx +0 -10
  237. package/src/theming/ThemeProvider.tsx +0 -15
  238. package/src/theming/useTheme.tsx +0 -9
@@ -1,33 +0,0 @@
1
- import { CommonActions } from '@react-navigation/core';
2
- /**
3
- * Build destination link for a navigate action.
4
- * Useful for showing anchor tags on the web for buttons that perform navigation.
5
- */
6
- export default function useLinkTools(): {
7
- buildHref: (name: string, params?: object) => string | undefined;
8
- buildAction: (href: string) => {
9
- type: "NAVIGATE";
10
- payload: {
11
- name: string;
12
- params?: import("@react-navigation/core").NavigatorScreenParams<Readonly<{
13
- key: string;
14
- index: number;
15
- routeNames: string[];
16
- history?: unknown[] | undefined;
17
- routes: (Readonly<{
18
- key: string;
19
- name: string;
20
- path?: string | undefined;
21
- }> & Readonly<{
22
- params?: Readonly<object | undefined>;
23
- }> & {
24
- state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
25
- })[];
26
- type: string;
27
- stale: false;
28
- }>>;
29
- path?: string | undefined;
30
- };
31
- } | CommonActions.Action;
32
- };
33
- //# sourceMappingURL=useLinkTools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLinkTools.d.ts","sourceRoot":"","sources":["../../../src/useLinkTools.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAQd,MAAM,wBAAwB,CAAC;AAqChC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY;sBAKzB,MAAM,WAAW,MAAM;wBA6BvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EA0BhB"}
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import type { Theme } from '../types';
4
- import DefaultTheme from './DefaultTheme';
5
-
6
- const ThemeContext = React.createContext<Theme>(DefaultTheme);
7
-
8
- ThemeContext.displayName = 'ThemeContext';
9
-
10
- export default ThemeContext;
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import type { Theme } from '../types';
4
- import ThemeContext from './ThemeContext';
5
-
6
- type Props = {
7
- value: Theme;
8
- children: React.ReactNode;
9
- };
10
-
11
- export default function ThemeProvider({ value, children }: Props) {
12
- return (
13
- <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
14
- );
15
- }
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import ThemeContext from './ThemeContext';
4
-
5
- export default function useTheme() {
6
- const theme = React.useContext(ThemeContext);
7
-
8
- return theme;
9
- }