@react-navigation/native 6.1.6 → 7.0.0-alpha.1

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 (189) hide show
  1. package/lib/commonjs/Link.js +19 -9
  2. package/lib/commonjs/Link.js.map +1 -1
  3. package/lib/commonjs/LinkingContext.js +2 -3
  4. package/lib/commonjs/LinkingContext.js.map +1 -1
  5. package/lib/commonjs/NavigationContainer.js +19 -32
  6. package/lib/commonjs/NavigationContainer.js.map +1 -1
  7. package/lib/commonjs/ServerContainer.js +5 -6
  8. package/lib/commonjs/ServerContainer.js.map +1 -1
  9. package/lib/commonjs/ServerContext.js +2 -3
  10. package/lib/commonjs/ServerContext.js.map +1 -1
  11. package/lib/commonjs/createMemoryHistory.js +1 -1
  12. package/lib/commonjs/createMemoryHistory.js.map +1 -1
  13. package/lib/commonjs/createStaticNavigation.js +38 -0
  14. package/lib/commonjs/createStaticNavigation.js.map +1 -0
  15. package/lib/commonjs/extractPathFromURL.js +1 -1
  16. package/lib/commonjs/extractPathFromURL.js.map +1 -1
  17. package/lib/commonjs/index.js +28 -29
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/theming/DarkTheme.js +5 -4
  20. package/lib/commonjs/theming/DarkTheme.js.map +1 -1
  21. package/lib/commonjs/theming/DefaultTheme.js +5 -4
  22. package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
  23. package/lib/commonjs/theming/ThemeContext.js +4 -6
  24. package/lib/commonjs/theming/ThemeContext.js.map +1 -1
  25. package/lib/commonjs/theming/ThemeProvider.js +3 -4
  26. package/lib/commonjs/theming/ThemeProvider.js.map +1 -1
  27. package/lib/commonjs/theming/fonts.js +66 -0
  28. package/lib/commonjs/theming/fonts.js.map +1 -0
  29. package/lib/commonjs/theming/useTheme.js +3 -4
  30. package/lib/commonjs/theming/useTheme.js.map +1 -1
  31. package/lib/commonjs/useBackButton.js +1 -1
  32. package/lib/commonjs/useBackButton.js.map +1 -1
  33. package/lib/commonjs/useDocumentTitle.js +1 -1
  34. package/lib/commonjs/useDocumentTitle.js.map +1 -1
  35. package/lib/commonjs/useDocumentTitle.native.js +1 -1
  36. package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
  37. package/lib/commonjs/useLinkProps.js +20 -19
  38. package/lib/commonjs/useLinkProps.js.map +1 -1
  39. package/lib/commonjs/{useLinkBuilder.js → useLinkTools.js} +25 -8
  40. package/lib/commonjs/useLinkTools.js.map +1 -0
  41. package/lib/commonjs/useLinking.js +7 -9
  42. package/lib/commonjs/useLinking.js.map +1 -1
  43. package/lib/commonjs/useLinking.native.js +6 -8
  44. package/lib/commonjs/useLinking.native.js.map +1 -1
  45. package/lib/commonjs/useScrollToTop.js +1 -1
  46. package/lib/commonjs/useScrollToTop.js.map +1 -1
  47. package/lib/commonjs/useThenable.js +1 -1
  48. package/lib/commonjs/useThenable.js.map +1 -1
  49. package/lib/module/Link.js +18 -7
  50. package/lib/module/Link.js.map +1 -1
  51. package/lib/module/LinkingContext.js +1 -2
  52. package/lib/module/LinkingContext.js.map +1 -1
  53. package/lib/module/NavigationContainer.js +11 -23
  54. package/lib/module/NavigationContainer.js.map +1 -1
  55. package/lib/module/ServerContainer.js +2 -2
  56. package/lib/module/ServerContainer.js.map +1 -1
  57. package/lib/module/ServerContext.js +1 -2
  58. package/lib/module/ServerContext.js.map +1 -1
  59. package/lib/module/createMemoryHistory.js +1 -1
  60. package/lib/module/createMemoryHistory.js.map +1 -1
  61. package/lib/module/createStaticNavigation.js +30 -0
  62. package/lib/module/createStaticNavigation.js.map +1 -0
  63. package/lib/module/extractPathFromURL.js +1 -1
  64. package/lib/module/extractPathFromURL.js.map +1 -1
  65. package/lib/module/index.js +12 -12
  66. package/lib/module/index.js.map +1 -1
  67. package/lib/module/theming/DarkTheme.js +4 -3
  68. package/lib/module/theming/DarkTheme.js.map +1 -1
  69. package/lib/module/theming/DefaultTheme.js +4 -3
  70. package/lib/module/theming/DefaultTheme.js.map +1 -1
  71. package/lib/module/theming/ThemeContext.js +2 -3
  72. package/lib/module/theming/ThemeContext.js.map +1 -1
  73. package/lib/module/theming/ThemeProvider.js +2 -2
  74. package/lib/module/theming/ThemeProvider.js.map +1 -1
  75. package/lib/module/theming/fonts.js +59 -0
  76. package/lib/module/theming/fonts.js.map +1 -0
  77. package/lib/module/theming/useTheme.js +2 -2
  78. package/lib/module/theming/useTheme.js.map +1 -1
  79. package/lib/module/useBackButton.js +1 -1
  80. package/lib/module/useBackButton.js.map +1 -1
  81. package/lib/module/useDocumentTitle.js +1 -1
  82. package/lib/module/useDocumentTitle.js.map +1 -1
  83. package/lib/module/useDocumentTitle.native.js +1 -1
  84. package/lib/module/useDocumentTitle.native.js.map +1 -1
  85. package/lib/module/useLinkProps.js +19 -17
  86. package/lib/module/useLinkProps.js.map +1 -1
  87. package/lib/module/{useLinkBuilder.js → useLinkTools.js} +24 -6
  88. package/lib/module/useLinkTools.js.map +1 -0
  89. package/lib/module/useLinking.js +6 -8
  90. package/lib/module/useLinking.js.map +1 -1
  91. package/lib/module/useLinking.native.js +6 -7
  92. package/lib/module/useLinking.native.js.map +1 -1
  93. package/lib/module/useScrollToTop.js +1 -1
  94. package/lib/module/useScrollToTop.js.map +1 -1
  95. package/lib/module/useThenable.js +1 -1
  96. package/lib/module/useThenable.js.map +1 -1
  97. package/lib/typescript/src/Link.d.ts +8 -9
  98. package/lib/typescript/src/Link.d.ts.map +1 -1
  99. package/lib/typescript/src/LinkingContext.d.ts +1 -2
  100. package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
  101. package/lib/typescript/src/NavigationContainer.d.ts +3 -5
  102. package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
  103. package/lib/typescript/src/ServerContainer.d.ts +1 -2
  104. package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
  105. package/lib/typescript/src/ServerContext.d.ts +2 -3
  106. package/lib/typescript/src/ServerContext.d.ts.map +1 -1
  107. package/lib/typescript/src/__mocks__/createStackNavigator.d.ts +56 -0
  108. package/lib/typescript/src/__mocks__/createStackNavigator.d.ts.map +1 -0
  109. package/lib/typescript/src/__mocks__/window.d.ts +1 -2
  110. package/lib/typescript/src/__mocks__/window.d.ts.map +1 -1
  111. package/lib/typescript/src/createMemoryHistory.d.ts +2 -2
  112. package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
  113. package/lib/typescript/src/createStaticNavigation.d.ts +20 -0
  114. package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -0
  115. package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
  116. package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
  117. package/lib/typescript/src/index.d.ts +12 -12
  118. package/lib/typescript/src/index.d.ts.map +1 -1
  119. package/lib/typescript/src/theming/DarkTheme.d.ts +1 -2
  120. package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
  121. package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -2
  122. package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -1
  123. package/lib/typescript/src/theming/ThemeContext.d.ts +1 -2
  124. package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -1
  125. package/lib/typescript/src/theming/ThemeProvider.d.ts +2 -2
  126. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -1
  127. package/lib/typescript/src/theming/fonts.d.ts +53 -0
  128. package/lib/typescript/src/theming/fonts.d.ts.map +1 -0
  129. package/lib/typescript/src/theming/useTheme.d.ts +1 -1
  130. package/lib/typescript/src/theming/useTheme.d.ts.map +1 -1
  131. package/lib/typescript/src/types.d.ts +15 -4
  132. package/lib/typescript/src/types.d.ts.map +1 -1
  133. package/lib/typescript/src/useBackButton.d.ts +1 -1
  134. package/lib/typescript/src/useBackButton.d.ts.map +1 -1
  135. package/lib/typescript/src/useDocumentTitle.d.ts +1 -1
  136. package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
  137. package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -1
  138. package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -1
  139. package/lib/typescript/src/useLinkProps.d.ts +17 -7
  140. package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
  141. package/lib/typescript/src/useLinkTools.d.ts +33 -0
  142. package/lib/typescript/src/useLinkTools.d.ts.map +1 -0
  143. package/lib/typescript/src/useLinking.d.ts +2 -4
  144. package/lib/typescript/src/useLinking.d.ts.map +1 -1
  145. package/lib/typescript/src/useLinking.native.d.ts +2 -4
  146. package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
  147. package/lib/typescript/src/useScrollToTop.d.ts +4 -4
  148. package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
  149. package/lib/typescript/src/useThenable.d.ts +1 -1
  150. package/lib/typescript/src/useThenable.d.ts.map +1 -1
  151. package/package.json +11 -11
  152. package/src/Link.tsx +26 -16
  153. package/src/LinkingContext.tsx +1 -3
  154. package/src/NavigationContainer.tsx +14 -29
  155. package/src/ServerContainer.tsx +2 -2
  156. package/src/ServerContext.tsx +1 -3
  157. package/src/__mocks__/createStackNavigator.tsx +19 -0
  158. package/src/__mocks__/window.tsx +1 -3
  159. package/src/createMemoryHistory.tsx +1 -1
  160. package/src/createStaticNavigation.tsx +47 -0
  161. package/src/extractPathFromURL.tsx +1 -1
  162. package/src/index.tsx +12 -12
  163. package/src/theming/DarkTheme.tsx +3 -3
  164. package/src/theming/DefaultTheme.tsx +3 -3
  165. package/src/theming/ThemeContext.tsx +2 -4
  166. package/src/theming/ThemeProvider.tsx +2 -2
  167. package/src/theming/fonts.tsx +63 -0
  168. package/src/theming/useTheme.tsx +2 -2
  169. package/src/types.tsx +22 -0
  170. package/src/useBackButton.tsx +1 -1
  171. package/src/useDocumentTitle.native.tsx +1 -1
  172. package/src/useDocumentTitle.tsx +1 -1
  173. package/src/useLinkProps.tsx +49 -33
  174. package/src/{useLinkBuilder.tsx → useLinkTools.tsx} +33 -4
  175. package/src/useLinking.native.tsx +8 -8
  176. package/src/useLinking.tsx +8 -9
  177. package/src/useScrollToTop.tsx +1 -3
  178. package/src/useThenable.tsx +1 -1
  179. package/lib/commonjs/useLinkBuilder.js.map +0 -1
  180. package/lib/commonjs/useLinkTo.js +0 -45
  181. package/lib/commonjs/useLinkTo.js.map +0 -1
  182. package/lib/module/useLinkBuilder.js.map +0 -1
  183. package/lib/module/useLinkTo.js +0 -36
  184. package/lib/module/useLinkTo.js.map +0 -1
  185. package/lib/typescript/src/useLinkBuilder.d.ts +0 -6
  186. package/lib/typescript/src/useLinkBuilder.d.ts.map +0 -1
  187. package/lib/typescript/src/useLinkTo.d.ts +0 -9
  188. package/lib/typescript/src/useLinkTo.d.ts.map +0 -1
  189. package/src/useLinkTo.tsx +0 -71
@@ -0,0 +1,20 @@
1
+ import { ParamListBase, StaticNavigation } from '@react-navigation/core';
2
+ import * as React from 'react';
3
+ import { NavigationContainer } from './NavigationContainer';
4
+ import type { LinkingOptions } from './types';
5
+ type Props = Omit<React.ComponentProps<typeof NavigationContainer>, 'linking' | 'children'> & {
6
+ /**
7
+ * Options for deep linking.
8
+ */
9
+ linking?: Omit<LinkingOptions<ParamListBase>, 'config'>;
10
+ };
11
+ /**
12
+ * Create a navigation component from a static navigation config.
13
+ * The returned component is a wrapper around `NavigationContainer`.
14
+ *
15
+ * @param tree Static navigation config.
16
+ * @returns Navigation component to use in your app.
17
+ */
18
+ export declare function createStaticNavigation(tree: StaticNavigation<any, any, any>): ({ linking, ...rest }: Props) => JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=createStaticNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStaticNavigation.d.ts","sourceRoot":"","sources":["../../../src/createStaticNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EACb,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,KAAK,GAAG,IAAI,CACf,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,EAChD,SAAS,GAAG,UAAU,CACvB,GAAG;IACF;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,0BAQzB,KAAK,iBAUvD"}
@@ -1,2 +1,2 @@
1
- export default function extractPathFromURL(prefixes: string[], url: string): string | undefined;
1
+ export declare function extractPathFromURL(prefixes: string[], url: string): string | undefined;
2
2
  //# sourceMappingURL=extractPathFromURL.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../../src/extractPathFromURL.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,sBAuBzE"}
1
+ {"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../../src/extractPathFromURL.tsx"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,sBAuBjE"}
@@ -1,15 +1,15 @@
1
- export { default as Link } from './Link';
2
- export { default as LinkingContext } from './LinkingContext';
3
- export { default as NavigationContainer } from './NavigationContainer';
4
- export { default as ServerContainer } from './ServerContainer';
5
- export { default as DarkTheme } from './theming/DarkTheme';
6
- export { default as DefaultTheme } from './theming/DefaultTheme';
7
- export { default as ThemeProvider } from './theming/ThemeProvider';
8
- export { default as useTheme } from './theming/useTheme';
1
+ export { createStaticNavigation } from './createStaticNavigation';
2
+ export { Link } from './Link';
3
+ export { LinkingContext } from './LinkingContext';
4
+ export { NavigationContainer } from './NavigationContainer';
5
+ export { ServerContainer } from './ServerContainer';
6
+ export { DarkTheme } from './theming/DarkTheme';
7
+ export { DefaultTheme } from './theming/DefaultTheme';
8
+ export { ThemeProvider } from './theming/ThemeProvider';
9
+ export { useTheme } from './theming/useTheme';
9
10
  export * from './types';
10
- export { default as useLinkBuilder } from './useLinkBuilder';
11
- export { default as useLinkProps } from './useLinkProps';
12
- export { default as useLinkTo } from './useLinkTo';
13
- export { default as useScrollToTop } from './useScrollToTop';
11
+ export { useLinkProps } from './useLinkProps';
12
+ export { useLinkTools } from './useLinkTools';
13
+ export { useScrollToTop } from './useScrollToTop';
14
14
  export * from '@react-navigation/core';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,wBAAwB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import type { Theme } from '../types';
2
- declare const DarkTheme: Theme;
3
- export default DarkTheme;
2
+ export declare const DarkTheme: Theme;
4
3
  //# sourceMappingURL=DarkTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DarkTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/DarkTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,QAAA,MAAM,SAAS,EAAE,KAUhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"DarkTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/DarkTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import type { Theme } from '../types';
2
- declare const DefaultTheme: Theme;
3
- export default DefaultTheme;
2
+ export declare const DefaultTheme: Theme;
4
3
  //# sourceMappingURL=DefaultTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/DefaultTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,QAAA,MAAM,YAAY,EAAE,KAUnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"DefaultTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/DefaultTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import type { Theme } from '../types';
3
- declare const ThemeContext: React.Context<Theme>;
4
- export default ThemeContext;
3
+ export declare const ThemeContext: React.Context<Theme>;
5
4
  //# sourceMappingURL=ThemeContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/theming/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,QAAA,MAAM,YAAY,sBAA2C,CAAC;AAI9D,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/theming/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,YAAY,sBAA2C,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import type { Theme } from '../types';
3
- declare type Props = {
3
+ type Props = {
4
4
  value: Theme;
5
5
  children: React.ReactNode;
6
6
  };
7
- export default function ThemeProvider({ value, children }: Props): JSX.Element;
7
+ export declare function ThemeProvider({ value, children }: Props): JSX.Element;
8
8
  export {};
9
9
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theming/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,eAI/D"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theming/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,eAIvD"}
@@ -0,0 +1,53 @@
1
+ export declare const fonts: {
2
+ readonly regular: {
3
+ readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
4
+ readonly fontWeight: "400";
5
+ };
6
+ readonly medium: {
7
+ readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
8
+ readonly fontWeight: "500";
9
+ };
10
+ readonly bold: {
11
+ readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
12
+ readonly fontWeight: "600";
13
+ };
14
+ readonly heavy: {
15
+ readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
16
+ readonly fontWeight: "700";
17
+ };
18
+ } | {
19
+ readonly regular: {
20
+ readonly fontFamily: "System";
21
+ readonly fontWeight: "400";
22
+ };
23
+ readonly medium: {
24
+ readonly fontFamily: "System";
25
+ readonly fontWeight: "500";
26
+ };
27
+ readonly bold: {
28
+ readonly fontFamily: "System";
29
+ readonly fontWeight: "600";
30
+ };
31
+ readonly heavy: {
32
+ readonly fontFamily: "System";
33
+ readonly fontWeight: "700";
34
+ };
35
+ } | {
36
+ readonly regular: {
37
+ readonly fontFamily: "sans-serif";
38
+ readonly fontWeight: "normal";
39
+ };
40
+ readonly medium: {
41
+ readonly fontFamily: "sans-serif-medium";
42
+ readonly fontWeight: "normal";
43
+ };
44
+ readonly bold: {
45
+ readonly fontFamily: "sans-serif";
46
+ readonly fontWeight: "600";
47
+ };
48
+ readonly heavy: {
49
+ readonly fontFamily: "sans-serif";
50
+ readonly fontWeight: "700";
51
+ };
52
+ };
53
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../../src/theming/fonts.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDkC,CAAC"}
@@ -1,2 +1,2 @@
1
- export default function useTheme(): import("..").Theme;
1
+ export declare function useTheme(): import("..").Theme;
2
2
  //# sourceMappingURL=useTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/useTheme.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,QAAQ,uBAI/B"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/theming/useTheme.tsx"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,uBAIvB"}
@@ -1,5 +1,9 @@
1
1
  import type { getActionFromState as getActionFromStateDefault, getPathFromState as getPathFromStateDefault, getStateFromPath as getStateFromPathDefault, PathConfigMap, Route } from '@react-navigation/core';
2
- export declare type Theme = {
2
+ type FontStyle = {
3
+ fontFamily: string;
4
+ fontWeight: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
5
+ };
6
+ export type Theme = {
3
7
  dark: boolean;
4
8
  colors: {
5
9
  primary: string;
@@ -9,8 +13,14 @@ export declare type Theme = {
9
13
  border: string;
10
14
  notification: string;
11
15
  };
16
+ fonts: {
17
+ regular: FontStyle;
18
+ medium: FontStyle;
19
+ bold: FontStyle;
20
+ heavy: FontStyle;
21
+ };
12
22
  };
13
- export declare type LinkingOptions<ParamList extends {}> = {
23
+ export type LinkingOptions<ParamList extends {}> = {
14
24
  /**
15
25
  * Whether deep link handling should be enabled.
16
26
  * Defaults to true.
@@ -117,11 +127,12 @@ export declare type LinkingOptions<ParamList extends {}> = {
117
127
  */
118
128
  getActionFromState?: typeof getActionFromStateDefault;
119
129
  };
120
- export declare type DocumentTitleOptions = {
130
+ export type DocumentTitleOptions = {
121
131
  enabled?: boolean;
122
132
  formatter?: (options: Record<string, any> | undefined, route: Route<string> | undefined) => string;
123
133
  };
124
- export declare type ServerContainerRef = {
134
+ export type ServerContainerRef = {
125
135
  getCurrentOptions(): Record<string, any> | undefined;
126
136
  };
137
+ export {};
127
138
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,IAAI,yBAAyB,EAC/C,gBAAgB,IAAI,uBAAuB,EAC3C,gBAAgB,IAAI,uBAAuB,EAC3C,aAAa,EACb,KAAK,EACN,MAAM,wBAAwB,CAAC;AAEhC,oBAAY,KAAK,GAAG;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,oBAAY,cAAc,CAAC,SAAS,SAAS,EAAE,IAAI;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE;QACP,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;QACnC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACnC,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,MACZ,MAAM,GACN,IAAI,GACJ,SA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O,uBAAuB,CAAC;IAClD;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,yBAAyB,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,CACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,KAC7B,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CACtD,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
2
2
  import * as React from 'react';
3
- export default function useBackButton(ref: React.RefObject<NavigationContainerRef<ParamListBase>>): void;
3
+ export declare function useBackButton(ref: React.RefObject<NavigationContainerRef<ParamListBase>>): void;
4
4
  //# sourceMappingURL=useBackButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBackButton.d.ts","sourceRoot":"","sources":["../../../src/useBackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,QAwB5D"}
1
+ {"version":3,"file":"useBackButton.d.ts","sourceRoot":"","sources":["../../../src/useBackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wBAAgB,aAAa,CAC3B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,QAwB5D"}
@@ -4,5 +4,5 @@ import type { DocumentTitleOptions } from './types';
4
4
  /**
5
5
  * Set the document title for the active screen
6
6
  */
7
- export default function useDocumentTitle(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, formatter, }?: DocumentTitleOptions): void;
7
+ export declare function useDocumentTitle(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, formatter, }?: DocumentTitleOptions): void;
8
8
  //# sourceMappingURL=useDocumentTitle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentTitle.d.ts","sourceRoot":"","sources":["../../../src/useDocumentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,SAA6D,GAC9D,GAAE,oBAAyB,QAwB7B"}
1
+ {"version":3,"file":"useDocumentTitle.d.ts","sourceRoot":"","sources":["../../../src/useDocumentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,SAA6D,GAC9D,GAAE,oBAAyB,QAwB7B"}
@@ -1,2 +1,2 @@
1
- export default function useDocumentTitle(): void;
1
+ export declare function useDocumentTitle(): void;
2
2
  //# sourceMappingURL=useDocumentTitle.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentTitle.native.d.ts","sourceRoot":"","sources":["../../../src/useDocumentTitle.native.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,gBAAgB,SAEvC"}
1
+ {"version":3,"file":"useDocumentTitle.native.d.ts","sourceRoot":"","sources":["../../../src/useDocumentTitle.native.tsx"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,SAE/B"}
@@ -1,21 +1,31 @@
1
1
  import { NavigationAction } from '@react-navigation/core';
2
2
  import * as React from 'react';
3
3
  import { GestureResponderEvent } from 'react-native';
4
- import { To } from './useLinkTo';
5
- declare type Props<ParamList extends ReactNavigation.RootParamList> = {
6
- to: To<ParamList>;
4
+ export type Props<ParamList extends ReactNavigation.RootParamList, RouteName extends keyof ParamList = keyof ParamList> = ({
5
+ screen: Extract<RouteName, string>;
6
+ href?: string;
7
7
  action?: NavigationAction;
8
+ } & (undefined extends ParamList[RouteName] ? {
9
+ params?: ParamList[RouteName];
10
+ } : {
11
+ params: ParamList[RouteName];
12
+ })) | {
13
+ href?: string;
14
+ action: NavigationAction;
15
+ screen?: undefined;
16
+ params?: undefined;
8
17
  };
9
18
  /**
10
19
  * Hook to get props for an anchor tag so it can work with in page navigation.
11
20
  *
12
- * @param props.to Absolute path to screen (e.g. `/feeds/hot`).
21
+ * @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
22
+ * @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
23
+ * @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
13
24
  * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
14
25
  */
15
- export default function useLinkProps<ParamList extends ReactNavigation.RootParamList>({ to, action }: Props<ParamList>): {
16
- href: string;
26
+ export declare function useLinkProps<ParamList extends ReactNavigation.RootParamList>({ screen, params, href, action, }: Props<ParamList>): {
27
+ href: string | undefined;
17
28
  accessibilityRole: "link";
18
29
  onPress: (e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
19
30
  };
20
- export {};
21
31
  //# sourceMappingURL=useLinkProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAKjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAG/D,OAAkB,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAE5C,aAAK,KAAK,CAAC,SAAS,SAAS,eAAe,CAAC,aAAa,IAAI;IAC5D,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;IAClB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AA+BF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,SAAS,SAAS,eAAe,CAAC,aAAa,EAC/C,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC;;;kBAO1B,gBAAgB,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,qBAAqB;EA6D9E"}
1
+ {"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAKjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAI/D,MAAM,MAAM,KAAK,CACf,SAAS,SAAS,eAAe,CAAC,aAAa,EAC/C,SAAS,SAAS,MAAM,SAAS,GAAG,MAAM,SAAS,IAEjD,CAAC;IACC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,GAAG,CAAC,SAAS,SAAS,SAAS,CAAC,SAAS,CAAC,GACvC;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GACjC;IAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC,CAAC,GACtC;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AA+BN;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,SAAS,SAAS,eAAe,CAAC,aAAa,EAAE,EAC5E,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,GACP,EAAE,KAAK,CAAC,SAAS,CAAC;;;kBAMX,gBAAgB,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,qBAAqB;EA6D9E"}
@@ -0,0 +1,33 @@
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 declare 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
@@ -0,0 +1 @@
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,wBAAgB,YAAY;sBAKjB,MAAM,WAAW,MAAM;wBA6BvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EA0BhB"}
@@ -1,10 +1,8 @@
1
1
  import { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
2
2
  import * as React from 'react';
3
3
  import type { LinkingOptions } from './types';
4
- declare type Options = LinkingOptions<ParamListBase> & {
5
- independent?: boolean;
6
- };
7
- export default function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { independent, enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: Options): {
4
+ type Options = LinkingOptions<ParamListBase>;
5
+ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: Options): {
8
6
  getInitialState: () => PromiseLike<(Partial<Omit<Readonly<{
9
7
  key: string;
10
8
  index: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,sBAAsB,EAEtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiF9C,aAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,GAAG;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,WAAW,EACX,OAAc,EACd,MAAM,EACN,gBAA0C,EAC1C,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuTX"}
1
+ {"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,sBAAsB,EAEtB,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiF9C,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAE7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,MAAM,EACN,gBAA0C,EAC1C,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwTX"}
@@ -1,10 +1,8 @@
1
1
  import { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
2
2
  import * as React from 'react';
3
3
  import type { LinkingOptions } from './types';
4
- declare type Options = LinkingOptions<ParamListBase> & {
5
- independent?: boolean;
6
- };
7
- export default function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { independent, enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState, }: Options): {
4
+ type Options = LinkingOptions<ParamListBase>;
5
+ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState, }: Options): {
8
6
  getInitialState: () => PromiseLike<(Partial<Omit<Readonly<{
9
7
  key: string;
10
8
  index: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,aAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,GAAG;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,WAAW,EACX,OAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAkBC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4JX"}
1
+ {"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,EACtB,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAI7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAmBC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6JX"}
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import type { ScrollView } from 'react-native';
3
- declare type ScrollOptions = {
3
+ type ScrollOptions = {
4
4
  x?: number;
5
5
  y?: number;
6
6
  animated?: boolean;
7
7
  };
8
- declare type ScrollableView = {
8
+ type ScrollableView = {
9
9
  scrollToTop(): void;
10
10
  } | {
11
11
  scrollTo(options: ScrollOptions): void;
@@ -17,11 +17,11 @@ declare type ScrollableView = {
17
17
  } | {
18
18
  scrollResponderScrollTo(options: ScrollOptions): void;
19
19
  };
20
- declare type ScrollableWrapper = {
20
+ type ScrollableWrapper = {
21
21
  getScrollResponder(): React.ReactNode | ScrollView;
22
22
  } | {
23
23
  getNode(): ScrollableView;
24
24
  } | ScrollableView;
25
- export default function useScrollToTop(ref: React.RefObject<ScrollableWrapper>): void;
25
+ export declare function useScrollToTop(ref: React.RefObject<ScrollableWrapper>): void;
26
26
  export {};
27
27
  //# sourceMappingURL=useScrollToTop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollToTop.d.ts","sourceRoot":"","sources":["../../../src/useScrollToTop.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,aAAK,aAAa,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,aAAK,cAAc,GACf;IAAE,WAAW,IAAI,IAAI,CAAA;CAAE,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,GAC1C;IAAE,cAAc,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CA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AK,CAAC,SAAS,CAAC,iBAAiB,CAAC,QA+DrE"}
@@ -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,4BAsC1D"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/native",
3
3
  "description": "React Native integration for React Navigation",
4
- "version": "6.1.6",
4
+ "version": "7.0.0-alpha.1",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "react-navigation",
@@ -37,22 +37,22 @@
37
37
  "clean": "del lib"
38
38
  },
39
39
  "dependencies": {
40
- "@react-navigation/core": "^6.4.8",
40
+ "@react-navigation/core": "^7.0.0-alpha.1",
41
41
  "escape-string-regexp": "^4.0.0",
42
42
  "fast-deep-equal": "^3.1.3",
43
43
  "nanoid": "^3.1.23"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@testing-library/react-native": "^11.5.0",
47
- "@types/react": "~18.0.0",
48
- "@types/react-dom": "~18.0.0",
49
- "@types/react-native": "~0.69.1",
50
- "del-cli": "^3.0.1",
51
- "react": "18.0.0",
52
- "react-dom": "18.0.0",
53
- "react-native": "0.69.5",
47
+ "@types/react": "~18.0.26",
48
+ "@types/react-dom": "~18.0.9",
49
+ "@types/react-native": "~0.70.8",
50
+ "del-cli": "^5.0.0",
51
+ "react": "18.1.0",
52
+ "react-dom": "18.2.0",
53
+ "react-native": "0.70.5",
54
54
  "react-native-builder-bob": "^0.20.4",
55
- "typescript": "^4.7.4"
55
+ "typescript": "^4.9.4"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "react": "*",
@@ -72,5 +72,5 @@
72
72
  ]
73
73
  ]
74
74
  },
75
- "gitHead": "ba6380c93f945e4c586f5e17e618208ab603bf30"
75
+ "gitHead": "230c09deeeb886929a15cb4cdcb496372a9496e1"
76
76
  }
package/src/Link.tsx CHANGED
@@ -1,33 +1,40 @@
1
- import type { NavigationAction } from '@react-navigation/core';
2
1
  import * as React from 'react';
3
2
  import { GestureResponderEvent, Platform, Text, TextProps } from 'react-native';
4
3
 
5
- import useLinkProps from './useLinkProps';
6
- import type { To } from './useLinkTo';
4
+ import { Props as LinkProps, useLinkProps } from './useLinkProps';
7
5
 
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
- } & (TextProps & { children: React.ReactNode });
6
+ type Props<ParamList extends ReactNavigation.RootParamList> =
7
+ LinkProps<ParamList> &
8
+ Omit<TextProps, 'disabled'> & {
9
+ target?: string;
10
+ onPress?: (
11
+ e:
12
+ | React.MouseEvent<HTMLAnchorElement, MouseEvent>
13
+ | GestureResponderEvent
14
+ ) => void;
15
+ disabled?: boolean | null;
16
+ children: React.ReactNode;
17
+ };
16
18
 
17
19
  /**
18
20
  * Component to render link to another screen using a path.
19
21
  * Uses an anchor tag on the web.
20
22
  *
21
- * @param props.to Absolute path to screen (e.g. `/feeds/hot`).
23
+ * @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
24
+ * @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
25
+ * @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
22
26
  * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
23
27
  * @param props.children Child elements to render the content.
24
28
  */
25
- export default function Link<ParamList extends ReactNavigation.RootParamList>({
26
- to,
29
+ export function Link<ParamList extends ReactNavigation.RootParamList>({
30
+ screen,
31
+ params,
27
32
  action,
33
+ href,
28
34
  ...rest
29
35
  }: Props<ParamList>) {
30
- const props = useLinkProps<ParamList>({ to, action });
36
+ // @ts-expect-error: This is already type-checked by the prop types
37
+ const props = useLinkProps<ParamList>({ screen, params, action, href });
31
38
 
32
39
  const onPress = (
33
40
  e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
@@ -36,7 +43,10 @@ export default function Link<ParamList extends ReactNavigation.RootParamList>({
36
43
  rest.onPress?.(e);
37
44
  }
38
45
 
39
- props.onPress(e);
46
+ // Let user prevent default behavior
47
+ if (!e.defaultPrevented) {
48
+ props.onPress(e);
49
+ }
40
50
  };
41
51
 
42
52
  return React.createElement(Text, {
@@ -3,10 +3,8 @@ import * as React from 'react';
3
3
 
4
4
  import type { LinkingOptions } from './types';
5
5
 
6
- const LinkingContext = React.createContext<{
6
+ export const LinkingContext = React.createContext<{
7
7
  options: LinkingOptions<ParamListBase> | undefined;
8
8
  }>({ options: undefined });
9
9
 
10
10
  LinkingContext.displayName = 'LinkingContext';
11
-
12
- export default LinkingContext;