@react-navigation/native 6.1.0 → 6.1.2

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 (136) hide show
  1. package/lib/commonjs/Link.js +2 -12
  2. package/lib/commonjs/Link.js.map +1 -1
  3. package/lib/commonjs/LinkingContext.js +0 -4
  4. package/lib/commonjs/LinkingContext.js.map +1 -1
  5. package/lib/commonjs/NavigationContainer.js +9 -31
  6. package/lib/commonjs/NavigationContainer.js.map +1 -1
  7. package/lib/commonjs/ServerContainer.js +2 -12
  8. package/lib/commonjs/ServerContainer.js.map +1 -1
  9. package/lib/commonjs/ServerContext.js +0 -4
  10. package/lib/commonjs/ServerContext.js.map +1 -1
  11. package/lib/commonjs/createMemoryHistory.js +29 -54
  12. package/lib/commonjs/createMemoryHistory.js.map +1 -1
  13. package/lib/commonjs/extractPathFromURL.js +2 -8
  14. package/lib/commonjs/extractPathFromURL.js.map +1 -1
  15. package/lib/commonjs/index.js +0 -17
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/theming/DarkTheme.js.map +1 -1
  18. package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
  19. package/lib/commonjs/theming/ThemeContext.js +0 -6
  20. package/lib/commonjs/theming/ThemeContext.js.map +1 -1
  21. package/lib/commonjs/theming/ThemeProvider.js +0 -6
  22. package/lib/commonjs/theming/ThemeProvider.js.map +1 -1
  23. package/lib/commonjs/theming/useTheme.js +0 -6
  24. package/lib/commonjs/theming/useTheme.js.map +1 -1
  25. package/lib/commonjs/types.js.map +1 -1
  26. package/lib/commonjs/useBackButton.js +0 -9
  27. package/lib/commonjs/useBackButton.js.map +1 -1
  28. package/lib/commonjs/useDocumentTitle.js +1 -12
  29. package/lib/commonjs/useDocumentTitle.js.map +1 -1
  30. package/lib/commonjs/useDocumentTitle.native.js +2 -2
  31. package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
  32. package/lib/commonjs/useLinkBuilder.js +5 -15
  33. package/lib/commonjs/useLinkBuilder.js.map +1 -1
  34. package/lib/commonjs/useLinkProps.js +8 -24
  35. package/lib/commonjs/useLinkProps.js.map +1 -1
  36. package/lib/commonjs/useLinkTo.js +0 -12
  37. package/lib/commonjs/useLinkTo.js.map +1 -1
  38. package/lib/commonjs/useLinking.js +35 -79
  39. package/lib/commonjs/useLinking.js.map +1 -1
  40. package/lib/commonjs/useLinking.native.js +9 -36
  41. package/lib/commonjs/useLinking.native.js.map +1 -1
  42. package/lib/commonjs/useScrollToTop.js +10 -17
  43. package/lib/commonjs/useScrollToTop.js.map +1 -1
  44. package/lib/commonjs/useThenable.js +2 -9
  45. package/lib/commonjs/useThenable.js.map +1 -1
  46. package/lib/module/Link.js +2 -6
  47. package/lib/module/Link.js.map +1 -1
  48. package/lib/module/LinkingContext.js.map +1 -1
  49. package/lib/module/NavigationContainer.js +9 -18
  50. package/lib/module/NavigationContainer.js.map +1 -1
  51. package/lib/module/ServerContainer.js +2 -5
  52. package/lib/module/ServerContainer.js.map +1 -1
  53. package/lib/module/ServerContext.js.map +1 -1
  54. package/lib/module/createMemoryHistory.js +29 -52
  55. package/lib/module/createMemoryHistory.js.map +1 -1
  56. package/lib/module/extractPathFromURL.js +2 -5
  57. package/lib/module/extractPathFromURL.js.map +1 -1
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/theming/DarkTheme.js.map +1 -1
  60. package/lib/module/theming/DefaultTheme.js.map +1 -1
  61. package/lib/module/theming/ThemeContext.js.map +1 -1
  62. package/lib/module/theming/ThemeProvider.js.map +1 -1
  63. package/lib/module/theming/useTheme.js.map +1 -1
  64. package/lib/module/types.js.map +1 -1
  65. package/lib/module/useBackButton.js +0 -3
  66. package/lib/module/useBackButton.js.map +1 -1
  67. package/lib/module/useDocumentTitle.js +1 -9
  68. package/lib/module/useDocumentTitle.js.map +1 -1
  69. package/lib/module/useDocumentTitle.native.js +2 -1
  70. package/lib/module/useDocumentTitle.native.js.map +1 -1
  71. package/lib/module/useLinkBuilder.js +5 -9
  72. package/lib/module/useLinkBuilder.js.map +1 -1
  73. package/lib/module/useLinkProps.js +8 -16
  74. package/lib/module/useLinkProps.js.map +1 -1
  75. package/lib/module/useLinkTo.js +0 -5
  76. package/lib/module/useLinkTo.js.map +1 -1
  77. package/lib/module/useLinking.js +35 -70
  78. package/lib/module/useLinking.js.map +1 -1
  79. package/lib/module/useLinking.native.js +9 -26
  80. package/lib/module/useLinking.native.js.map +1 -1
  81. package/lib/module/useScrollToTop.js +10 -13
  82. package/lib/module/useScrollToTop.js.map +1 -1
  83. package/lib/module/useThenable.js +2 -5
  84. package/lib/module/useThenable.js.map +1 -1
  85. package/lib/typescript/src/Link.d.ts +1 -0
  86. package/lib/typescript/src/Link.d.ts.map +1 -0
  87. package/lib/typescript/src/LinkingContext.d.ts +1 -0
  88. package/lib/typescript/src/LinkingContext.d.ts.map +1 -0
  89. package/lib/typescript/src/NavigationContainer.d.ts +1 -0
  90. package/lib/typescript/src/NavigationContainer.d.ts.map +1 -0
  91. package/lib/typescript/src/ServerContainer.d.ts +1 -0
  92. package/lib/typescript/src/ServerContainer.d.ts.map +1 -0
  93. package/lib/typescript/src/ServerContext.d.ts +1 -0
  94. package/lib/typescript/src/ServerContext.d.ts.map +1 -0
  95. package/lib/typescript/src/__mocks__/window.d.ts +1 -0
  96. package/lib/typescript/src/__mocks__/window.d.ts.map +1 -0
  97. package/lib/typescript/src/createMemoryHistory.d.ts +1 -0
  98. package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -0
  99. package/lib/typescript/src/extractPathFromURL.d.ts +1 -0
  100. package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -0
  101. package/lib/typescript/src/index.d.ts +1 -0
  102. package/lib/typescript/src/index.d.ts.map +1 -0
  103. package/lib/typescript/src/theming/DarkTheme.d.ts +1 -0
  104. package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -0
  105. package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -0
  106. package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -0
  107. package/lib/typescript/src/theming/ThemeContext.d.ts +1 -0
  108. package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -0
  109. package/lib/typescript/src/theming/ThemeProvider.d.ts +1 -0
  110. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -0
  111. package/lib/typescript/src/theming/useTheme.d.ts +1 -0
  112. package/lib/typescript/src/theming/useTheme.d.ts.map +1 -0
  113. package/lib/typescript/src/types.d.ts +1 -0
  114. package/lib/typescript/src/types.d.ts.map +1 -0
  115. package/lib/typescript/src/useBackButton.d.ts +1 -0
  116. package/lib/typescript/src/useBackButton.d.ts.map +1 -0
  117. package/lib/typescript/src/useDocumentTitle.d.ts +1 -0
  118. package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -0
  119. package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -0
  120. package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -0
  121. package/lib/typescript/src/useLinkBuilder.d.ts +1 -0
  122. package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -0
  123. package/lib/typescript/src/useLinkProps.d.ts +1 -0
  124. package/lib/typescript/src/useLinkProps.d.ts.map +1 -0
  125. package/lib/typescript/src/useLinkTo.d.ts +1 -0
  126. package/lib/typescript/src/useLinkTo.d.ts.map +1 -0
  127. package/lib/typescript/src/useLinking.d.ts +1 -0
  128. package/lib/typescript/src/useLinking.d.ts.map +1 -0
  129. package/lib/typescript/src/useLinking.native.d.ts +1 -0
  130. package/lib/typescript/src/useLinking.native.d.ts.map +1 -0
  131. package/lib/typescript/src/useScrollToTop.d.ts +1 -0
  132. package/lib/typescript/src/useScrollToTop.d.ts.map +1 -0
  133. package/lib/typescript/src/useThenable.d.ts +1 -0
  134. package/lib/typescript/src/useThenable.d.ts.map +1 -0
  135. package/package.json +4 -4
  136. package/src/useScrollToTop.tsx +6 -1
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Link;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _useLinkProps = _interopRequireDefault(require("./useLinkProps"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
13
  /**
21
14
  * Component to render link to another screen using a path.
22
15
  * Uses an anchor tag on the web.
@@ -35,18 +28,15 @@ function Link(_ref) {
35
28
  to,
36
29
  action
37
30
  });
38
-
39
31
  const onPress = e => {
40
32
  if ('onPress' in rest) {
41
33
  var _rest$onPress;
42
-
43
34
  (_rest$onPress = rest.onPress) === null || _rest$onPress === void 0 ? void 0 : _rest$onPress.call(rest, e);
44
35
  }
45
-
46
36
  props.onPress(e);
47
37
  };
48
-
49
- return /*#__PURE__*/React.createElement(_reactNative.Text, { ...props,
38
+ return /*#__PURE__*/React.createElement(_reactNative.Text, {
39
+ ...props,
50
40
  ...rest,
51
41
  ..._reactNative.Platform.select({
52
42
  web: {
@@ -1 +1 @@
1
- {"version":3,"names":["Link","to","action","rest","props","useLinkProps","onPress","e","React","createElement","Text","Platform","select","web","onClick","default"],"sources":["Link.tsx"],"sourcesContent":["import type { NavigationAction } from '@react-navigation/core';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform, Text, TextProps } from 'react-native';\n\nimport useLinkProps from './useLinkProps';\nimport type { To } from './useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n to: To<ParamList>;\n action?: NavigationAction;\n target?: string;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (TextProps & { children: React.ReactNode });\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.to Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport default function Link<ParamList extends ReactNavigation.RootParamList>({\n to,\n action,\n ...rest\n}: Props<ParamList>) {\n const props = useLinkProps<ParamList>({ to, action });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n props.onPress(e);\n };\n\n return React.createElement(Text, {\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n });\n}\n"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;;;;;;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,IAAT,OAIM;EAAA,IAJyD;IAC5EC,EAD4E;IAE5EC,MAF4E;IAG5E,GAAGC;EAHyE,CAIzD;EACnB,MAAMC,KAAK,GAAG,IAAAC,qBAAA,EAAwB;IAAEJ,EAAF;IAAMC;EAAN,CAAxB,CAAd;;EAEA,MAAMI,OAAO,GACXC,CADc,IAEX;IACH,IAAI,aAAaJ,IAAjB,EAAuB;MAAA;;MACrB,iBAAAA,IAAI,CAACG,OAAL,qEAAAH,IAAI,EAAWI,CAAX,CAAJ;IACD;;IAEDH,KAAK,CAACE,OAAN,CAAcC,CAAd;EACD,CARD;;EAUA,oBAAOC,KAAK,CAACC,aAAN,CAAoBC,iBAApB,EAA0B,EAC/B,GAAGN,KAD4B;IAE/B,GAAGD,IAF4B;IAG/B,GAAGQ,qBAAA,CAASC,MAAT,CAAgB;MACjBC,GAAG,EAAE;QAAEC,OAAO,EAAER;MAAX,CADY;MAEjBS,OAAO,EAAE;QAAET;MAAF;IAFQ,CAAhB;EAH4B,CAA1B,CAAP;AAQD"}
1
+ {"version":3,"names":["Link","to","action","rest","props","useLinkProps","onPress","e","React","createElement","Text","Platform","select","web","onClick","default"],"sourceRoot":"../../src","sources":["Link.tsx"],"mappings":";;;;;;AACA;AACA;AAEA;AAA0C;AAAA;AAAA;AAY1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,IAAI,OAIP;EAAA,IAJyD;IAC5EC,EAAE;IACFC,MAAM;IACN,GAAGC;EACa,CAAC;EACjB,MAAMC,KAAK,GAAG,IAAAC,qBAAY,EAAY;IAAEJ,EAAE;IAAEC;EAAO,CAAC,CAAC;EAErD,MAAMI,OAAO,GACXC,CAA0E,IACvE;IACH,IAAI,SAAS,IAAIJ,IAAI,EAAE;MAAA;MACrB,iBAAAA,IAAI,CAACG,OAAO,kDAAZ,mBAAAH,IAAI,EAAWI,CAAC,CAAC;IACnB;IAEAH,KAAK,CAACE,OAAO,CAACC,CAAC,CAAC;EAClB,CAAC;EAED,oBAAOC,KAAK,CAACC,aAAa,CAACC,iBAAI,EAAE;IAC/B,GAAGN,KAAK;IACR,GAAGD,IAAI;IACP,GAAGQ,qBAAQ,CAACC,MAAM,CAAC;MACjBC,GAAG,EAAE;QAAEC,OAAO,EAAER;MAAQ,CAAQ;MAChCS,OAAO,EAAE;QAAET;MAAQ;IACrB,CAAC;EACH,CAAC,CAAC;AACJ"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  const LinkingContext = /*#__PURE__*/React.createContext({
15
11
  options: undefined
16
12
  });
@@ -1 +1 @@
1
- {"version":3,"names":["LinkingContext","React","createContext","options","undefined","displayName"],"sources":["LinkingContext.tsx"],"sourcesContent":["import type { ParamListBase } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport type { LinkingOptions } from './types';\n\nconst LinkingContext = React.createContext<{\n options: LinkingOptions<ParamListBase> | undefined;\n}>({ options: undefined });\n\nLinkingContext.displayName = 'LinkingContext';\n\nexport default LinkingContext;\n"],"mappings":";;;;;;;AACA;;;;;;AAIA,MAAMA,cAAc,gBAAGC,KAAK,CAACC,aAAN,CAEpB;EAAEC,OAAO,EAAEC;AAAX,CAFoB,CAAvB;AAIAJ,cAAc,CAACK,WAAf,GAA6B,gBAA7B;eAEeL,c"}
1
+ {"version":3,"names":["LinkingContext","React","createContext","options","undefined","displayName"],"sourceRoot":"../../src","sources":["LinkingContext.tsx"],"mappings":";;;;;;AACA;AAA+B;AAAA;AAI/B,MAAMA,cAAc,gBAAGC,KAAK,CAACC,aAAa,CAEvC;EAAEC,OAAO,EAAEC;AAAU,CAAC,CAAC;AAE1BJ,cAAc,CAACK,WAAW,GAAG,gBAAgB;AAAC,eAE/BL,cAAc;AAAA"}
@@ -4,35 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _core = require("@react-navigation/core");
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _LinkingContext = _interopRequireDefault(require("./LinkingContext"));
13
-
14
10
  var _DefaultTheme = _interopRequireDefault(require("./theming/DefaultTheme"));
15
-
16
11
  var _ThemeProvider = _interopRequireDefault(require("./theming/ThemeProvider"));
17
-
18
12
  var _useBackButton = _interopRequireDefault(require("./useBackButton"));
19
-
20
13
  var _useDocumentTitle = _interopRequireDefault(require("./useDocumentTitle"));
21
-
22
14
  var _useLinking = _interopRequireDefault(require("./useLinking"));
23
-
24
15
  var _useThenable = _interopRequireDefault(require("./useThenable"));
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
19
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
33
-
34
20
  global.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
35
-
36
21
  /**
37
22
  * Container component which holds the navigation state designed for React Native apps.
38
23
  * This should be rendered at the root wrapping the whole app.
@@ -57,11 +42,9 @@ function NavigationContainerInner(_ref, ref) {
57
42
  ...rest
58
43
  } = _ref;
59
44
  const isLinkingEnabled = linking ? linking.enabled !== false : false;
60
-
61
45
  if (linking !== null && linking !== void 0 && linking.config) {
62
46
  (0, _core.validatePathConfig)(linking.config);
63
47
  }
64
-
65
48
  const refContainer = React.useRef(null);
66
49
  (0, _useBackButton.default)(refContainer);
67
50
  (0, _useDocumentTitle.default)(refContainer, documentTitle);
@@ -72,24 +55,23 @@ function NavigationContainerInner(_ref, ref) {
72
55
  enabled: isLinkingEnabled,
73
56
  prefixes: [],
74
57
  ...linking
75
- }); // Add additional linking related info to the ref
76
- // This will be used by the devtools
58
+ });
77
59
 
60
+ // Add additional linking related info to the ref
61
+ // This will be used by the devtools
78
62
  React.useEffect(() => {
79
63
  if (refContainer.current) {
80
64
  REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
81
65
  get linking() {
82
- var _linking$prefixes, _linking$getStateFrom, _linking$getPathFromS, _linking$getActionFro;
83
-
84
- return { ...linking,
66
+ return {
67
+ ...linking,
85
68
  enabled: isLinkingEnabled,
86
- prefixes: (_linking$prefixes = linking === null || linking === void 0 ? void 0 : linking.prefixes) !== null && _linking$prefixes !== void 0 ? _linking$prefixes : [],
87
- getStateFromPath: (_linking$getStateFrom = linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) !== null && _linking$getStateFrom !== void 0 ? _linking$getStateFrom : _core.getStateFromPath,
88
- getPathFromState: (_linking$getPathFromS = linking === null || linking === void 0 ? void 0 : linking.getPathFromState) !== null && _linking$getPathFromS !== void 0 ? _linking$getPathFromS : _core.getPathFromState,
89
- getActionFromState: (_linking$getActionFro = linking === null || linking === void 0 ? void 0 : linking.getActionFromState) !== null && _linking$getActionFro !== void 0 ? _linking$getActionFro : _core.getActionFromState
69
+ prefixes: (linking === null || linking === void 0 ? void 0 : linking.prefixes) ?? [],
70
+ getStateFromPath: (linking === null || linking === void 0 ? void 0 : linking.getStateFromPath) ?? _core.getStateFromPath,
71
+ getPathFromState: (linking === null || linking === void 0 ? void 0 : linking.getPathFromState) ?? _core.getPathFromState,
72
+ getActionFromState: (linking === null || linking === void 0 ? void 0 : linking.getActionFromState) ?? _core.getActionFromState
90
73
  };
91
74
  }
92
-
93
75
  });
94
76
  }
95
77
  });
@@ -106,17 +88,14 @@ function NavigationContainerInner(_ref, ref) {
106
88
  React.useEffect(() => {
107
89
  if (isReady) {
108
90
  var _onReadyRef$current;
109
-
110
91
  (_onReadyRef$current = onReadyRef.current) === null || _onReadyRef$current === void 0 ? void 0 : _onReadyRef$current.call(onReadyRef);
111
92
  }
112
93
  }, [isReady]);
113
-
114
94
  if (!isReady) {
115
95
  // This is temporary until we have Suspense for data-fetching
116
96
  // Then the fallback will be handled by a parent `Suspense` component
117
97
  return fallback;
118
98
  }
119
-
120
99
  return /*#__PURE__*/React.createElement(_LinkingContext.default.Provider, {
121
100
  value: linkingContext
122
101
  }, /*#__PURE__*/React.createElement(_ThemeProvider.default, {
@@ -126,7 +105,6 @@ function NavigationContainerInner(_ref, ref) {
126
105
  ref: refContainer
127
106
  }))));
128
107
  }
129
-
130
108
  const NavigationContainer = /*#__PURE__*/React.forwardRef(NavigationContainerInner);
131
109
  var _default = NavigationContainer;
132
110
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["global","REACT_NAVIGATION_DEVTOOLS","WeakMap","NavigationContainerInner","ref","theme","DefaultTheme","linking","fallback","documentTitle","onReady","rest","isLinkingEnabled","enabled","config","validatePathConfig","refContainer","React","useRef","useBackButton","useDocumentTitle","getInitialState","useLinking","independent","prefixes","useEffect","current","set","getStateFromPath","getPathFromState","getActionFromState","isResolved","initialState","useThenable","useImperativeHandle","linkingContext","useMemo","options","isReady","onReadyRef","NavigationContainer","forwardRef"],"sources":["NavigationContainer.tsx"],"sourcesContent":["import {\n BaseNavigationContainer,\n getActionFromState,\n getPathFromState,\n getStateFromPath,\n NavigationContainerProps,\n NavigationContainerRef,\n ParamListBase,\n validatePathConfig,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\nimport DefaultTheme from './theming/DefaultTheme';\nimport ThemeProvider from './theming/ThemeProvider';\nimport type { DocumentTitleOptions, LinkingOptions, Theme } from './types';\nimport useBackButton from './useBackButton';\nimport useDocumentTitle from './useDocumentTitle';\nimport useLinking from './useLinking';\nimport useThenable from './useThenable';\n\ndeclare global {\n var REACT_NAVIGATION_DEVTOOLS: WeakMap<\n NavigationContainerRef<any>,\n { readonly linking: LinkingOptions<any> }\n >;\n}\n\nglobal.REACT_NAVIGATION_DEVTOOLS = new WeakMap();\n\ntype Props<ParamList extends {}> = NavigationContainerProps & {\n theme?: Theme;\n linking?: LinkingOptions<ParamList>;\n fallback?: React.ReactNode;\n documentTitle?: DocumentTitleOptions;\n onReady?: () => void;\n};\n\n/**\n * Container component which holds the navigation state designed for React Native apps.\n * This should be rendered at the root wrapping the whole app.\n *\n * @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()`).\n * @param props.onReady Callback which is called after the navigation tree mounts.\n * @param props.onStateChange Callback which is called with the latest navigation state when it changes.\n * @param props.theme Theme object for the navigators.\n * @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.\n * @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.\n * @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which refers to the navigation object containing helper methods.\n */\nfunction NavigationContainerInner(\n {\n theme = DefaultTheme,\n linking,\n fallback = null,\n documentTitle,\n onReady,\n ...rest\n }: Props<ParamListBase>,\n ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>\n) {\n const isLinkingEnabled = linking ? linking.enabled !== false : false;\n\n if (linking?.config) {\n validatePathConfig(linking.config);\n }\n\n const refContainer =\n React.useRef<NavigationContainerRef<ParamListBase>>(null);\n\n useBackButton(refContainer);\n useDocumentTitle(refContainer, documentTitle);\n\n const { getInitialState } = useLinking(refContainer, {\n independent: rest.independent,\n enabled: isLinkingEnabled,\n prefixes: [],\n ...linking,\n });\n\n // Add additional linking related info to the ref\n // This will be used by the devtools\n React.useEffect(() => {\n if (refContainer.current) {\n REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {\n get linking() {\n return {\n ...linking,\n enabled: isLinkingEnabled,\n prefixes: linking?.prefixes ?? [],\n getStateFromPath: linking?.getStateFromPath ?? getStateFromPath,\n getPathFromState: linking?.getPathFromState ?? getPathFromState,\n getActionFromState:\n linking?.getActionFromState ?? getActionFromState,\n };\n },\n });\n }\n });\n\n const [isResolved, initialState] = useThenable(getInitialState);\n\n React.useImperativeHandle(ref, () => refContainer.current);\n\n const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);\n\n const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;\n\n const onReadyRef = React.useRef(onReady);\n\n React.useEffect(() => {\n onReadyRef.current = onReady;\n });\n\n React.useEffect(() => {\n if (isReady) {\n onReadyRef.current?.();\n }\n }, [isReady]);\n\n if (!isReady) {\n // This is temporary until we have Suspense for data-fetching\n // Then the fallback will be handled by a parent `Suspense` component\n return fallback as React.ReactElement;\n }\n\n return (\n <LinkingContext.Provider value={linkingContext}>\n <ThemeProvider value={theme}>\n <BaseNavigationContainer\n {...rest}\n initialState={\n rest.initialState == null ? initialState : rest.initialState\n }\n ref={refContainer}\n />\n </ThemeProvider>\n </LinkingContext.Provider>\n );\n}\n\nconst NavigationContainer = React.forwardRef(NavigationContainerInner) as <\n RootParamList extends {} = ReactNavigation.RootParamList\n>(\n props: Props<RootParamList> & {\n ref?: React.Ref<NavigationContainerRef<RootParamList>>;\n }\n) => React.ReactElement;\n\nexport default NavigationContainer;\n"],"mappings":";;;;;;;AAAA;;AAUA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AASAA,MAAM,CAACC,yBAAP,GAAmC,IAAIC,OAAJ,EAAnC;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,wBAAT,OASEC,GATF,EAUE;EAAA,IATA;IACEC,KAAK,GAAGC,qBADV;IAEEC,OAFF;IAGEC,QAAQ,GAAG,IAHb;IAIEC,aAJF;IAKEC,OALF;IAME,GAAGC;EANL,CASA;EACA,MAAMC,gBAAgB,GAAGL,OAAO,GAAGA,OAAO,CAACM,OAAR,KAAoB,KAAvB,GAA+B,KAA/D;;EAEA,IAAIN,OAAJ,aAAIA,OAAJ,eAAIA,OAAO,CAAEO,MAAb,EAAqB;IACnB,IAAAC,wBAAA,EAAmBR,OAAO,CAACO,MAA3B;EACD;;EAED,MAAME,YAAY,GAChBC,KAAK,CAACC,MAAN,CAAoD,IAApD,CADF;EAGA,IAAAC,sBAAA,EAAcH,YAAd;EACA,IAAAI,yBAAA,EAAiBJ,YAAjB,EAA+BP,aAA/B;EAEA,MAAM;IAAEY;EAAF,IAAsB,IAAAC,mBAAA,EAAWN,YAAX,EAAyB;IACn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AaR,OAAb,CAAnB;EAEAO,KAAK,CAACQ,SAAN,CAAgB,MAAM;IACpBc,UAAU,CAACb,OAAX,GAAqBhB,OAArB;EACD,CAFD;EAIAO,KAAK,CAACQ,SAAN,CAAgB,MAAM;IACpB,IAAIa,OAAJ,EAAa;MAAA;;MACX,uBAAAC,UAAU,CAACb,OAAX,iFAAAa,UAAU;IACX;EACF,CAJD,EAIG,CAACD,OAAD,CAJH;;EAMA,IAAI,CAACA,OAAL,EAAc;IACZ;IACA;IACA,OAAO9B,QAAP;EACD;;EAED,oBACE,oBAAC,uBAAD,CAAgB,QAAhB;IAAyB,KAAK,EAAE2B;EAAhC,gBACE,oBAAC,sBAAD;IAAe,KAAK,EAAE9B;EAAtB,gBACE,oBAAC,6BAAD,eACMM,IADN;IAEE,YAAY,EACVA,IAAI,CAACqB,YAAL,IAAqB,IAArB,GAA4BA,YAA5B,GAA2CrB,IAAI,CAACqB,YAHpD;IAKE,GAAG,EAAEhB;EALP,GADF,CADF,CADF;AAaD;;AAED,MAAMwB,mBAAmB,gBAAGvB,KAAK,CAACwB,UAAN,CAAiBtC,wBAAjB,CAA5B;eAQeqC,mB"}
1
+ {"version":3,"names":["global","REACT_NAVIGATION_DEVTOOLS","WeakMap","NavigationContainerInner","ref","theme","DefaultTheme","linking","fallback","documentTitle","onReady","rest","isLinkingEnabled","enabled","config","validatePathConfig","refContainer","React","useRef","useBackButton","useDocumentTitle","getInitialState","useLinking","independent","prefixes","useEffect","current","set","getStateFromPath","getPathFromState","getActionFromState","isResolved","initialState","useThenable","useImperativeHandle","linkingContext","useMemo","options","isReady","onReadyRef","NavigationContainer","forwardRef"],"sourceRoot":"../../src","sources":["NavigationContainer.tsx"],"mappings":";;;;;;AAAA;AAUA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAwC;AAAA;AAAA;AAAA;AASxCA,MAAM,CAACC,yBAAyB,GAAG,IAAIC,OAAO,EAAE;AAUhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA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ACD,GAAG,EAAEhB;EAAa,GAClB,CACY,CACQ;AAE9B;AAEA,MAAMwB,mBAAmB,gBAAGvB,KAAK,CAACwB,UAAU,CAACtC,wBAAwB,CAM9C;AAAC,eAETqC,mBAAmB;AAAA"}
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _core = require("@react-navigation/core");
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _ServerContext = _interopRequireDefault(require("./ServerContext"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
13
  /**
21
14
  * Container component for server rendering.
22
15
  *
@@ -33,18 +26,17 @@ var _default = /*#__PURE__*/React.forwardRef(function ServerContainer(_ref, ref)
33
26
  console.error("'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.");
34
27
  }, []);
35
28
  const current = {};
36
-
37
29
  if (ref) {
38
30
  const value = {
39
31
  getCurrentOptions() {
40
32
  return current.options;
41
33
  }
34
+ };
42
35
 
43
- }; // We write to the `ref` during render instead of `React.useImperativeHandle`
36
+ // We write to the `ref` during render instead of `React.useImperativeHandle`
44
37
  // This is because `useImperativeHandle` will update the ref after 'commit',
45
38
  // and there's no 'commit' phase during SSR.
46
39
  // Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.
47
-
48
40
  if (typeof ref === 'function') {
49
41
  ref(value);
50
42
  } else {
@@ -52,7 +44,6 @@ var _default = /*#__PURE__*/React.forwardRef(function ServerContainer(_ref, ref)
52
44
  ref.current = value;
53
45
  }
54
46
  }
55
-
56
47
  return /*#__PURE__*/React.createElement(_ServerContext.default.Provider, {
57
48
  value: {
58
49
  location
@@ -61,6 +52,5 @@ var _default = /*#__PURE__*/React.forwardRef(function ServerContainer(_ref, ref)
61
52
  value: current
62
53
  }, children));
63
54
  });
64
-
65
55
  exports.default = _default;
66
56
  //# sourceMappingURL=ServerContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","ServerContainer","ref","children","location","useEffect","console","error","current","value","getCurrentOptions","options"],"sources":["ServerContainer.tsx"],"sourcesContent":["import { CurrentRenderContext } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport ServerContext, { ServerContextType } from './ServerContext';\nimport type { ServerContainerRef } from './types';\n\ntype Props = ServerContextType & {\n children: React.ReactNode;\n};\n\n/**\n * Container component for server rendering.\n *\n * @param props.location Location object to base the initial URL for SSR.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which contains helper methods.\n */\nexport default React.forwardRef(function ServerContainer(\n { children, location }: Props,\n ref: React.Ref<ServerContainerRef>\n) {\n React.useEffect(() => {\n console.error(\n \"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\"\n );\n }, []);\n\n const current: { options?: object } = {};\n\n if (ref) {\n const value = {\n getCurrentOptions() {\n return current.options;\n },\n };\n\n // We write to the `ref` during render instead of `React.useImperativeHandle`\n // This is because `useImperativeHandle` will update the ref after 'commit',\n // and there's no 'commit' phase during SSR.\n // Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.\n if (typeof ref === 'function') {\n ref(value);\n } else {\n // @ts-expect-error: the TS types are incorrect and say that ref.current is readonly\n ref.current = value;\n }\n }\n\n return (\n <ServerContext.Provider value={{ location }}>\n <CurrentRenderContext.Provider value={current}>\n {children}\n </CurrentRenderContext.Provider>\n </ServerContext.Provider>\n );\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;4BACeA,KAAK,CAACC,UAAN,CAAiB,SAASC,eAAT,OAE9BC,GAF8B,EAG9B;EAAA,IAFA;IAAEC,QAAF;IAAYC;EAAZ,CAEA;EACAL,KAAK,CAACM,SAAN,CAAgB,MAAM;IACpBC,OAAO,CAACC,KAAR,CACE,sFADF;EAGD,CAJD,EAIG,EAJH;EAMA,MAAMC,OAA6B,GAAG,EAAtC;;EAEA,IAAIN,GAAJ,EAAS;IACP,MAAMO,KAAK,GAAG;MACZC,iBAAiB,GAAG;QAClB,OAAOF,OAAO,CAACG,OAAf;MACD;;IAHW,CAAd,CADO,CAOP;IACA;IACA;IACA;;IACA,IAAI,OAAOT,GAAP,KAAe,UAAnB,EAA+B;MAC7BA,GAAG,CAACO,KAAD,CAAH;IACD,CAFD,MAEO;MACL;MACAP,GAAG,CAACM,OAAJ,GAAcC,KAAd;IACD;EACF;;EAED,oBACE,oBAAC,sBAAD,CAAe,QAAf;IAAwB,KAAK,EAAE;MAAEL;IAAF;EAA/B,gBACE,oBAAC,0BAAD,CAAsB,QAAtB;IAA+B,KAAK,EAAEI;EAAtC,GACGL,QADH,CADF,CADF;AAOD,CAtCc,C"}
1
+ {"version":3,"names":["React","forwardRef","ServerContainer","ref","children","location","useEffect","console","error","current","value","getCurrentOptions","options"],"sourceRoot":"../../src","sources":["ServerContainer.tsx"],"mappings":";;;;;;AAAA;AACA;AAEA;AAAmE;AAAA;AAAA;AAOnE;AACA;AACA;AACA;AACA;AACA;AACA;AANA,4BAOeA,KAAK,CAACC,UAAU,CAAC,SAASC,eAAe,OAEtDC,GAAkC,EAClC;EAAA,IAFA;IAAEC,QAAQ;IAAEC;EAAgB,CAAC;EAG7BL,KAAK,CAACM,SAAS,CAAC,MAAM;IACpBC,OAAO,CAACC,KAAK,CACX,sFAAsF,CACvF;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,OAA6B,GAAG,CAAC,CAAC;EAExC,IAAIN,GAAG,EAAE;IACP,MAAMO,KAAK,GAAG;MACZC,iBAAiB,GAAG;QAClB,OAAOF,OAAO,CAACG,OAAO;MACxB;IACF,CAAC;;IAED;IACA;IACA;IACA;IACA,IAAI,OAAOT,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACO,KAAK,CAAC;IACZ,CAAC,MAAM;MACL;MACAP,GAAG,CAACM,OAAO,GAAGC,KAAK;IACrB;EACF;EAEA,oBACE,oBAAC,sBAAa,CAAC,QAAQ;IAAC,KAAK,EAAE;MAAEL;IAAS;EAAE,gBAC1C,oBAAC,0BAAoB,CAAC,QAAQ;IAAC,KAAK,EAAEI;EAAQ,GAC3CL,QAAQ,CACqB,CACT;AAE7B,CAAC,CAAC;AAAA"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  const ServerContext = /*#__PURE__*/React.createContext(undefined);
15
11
  var _default = ServerContext;
16
12
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["ServerContext","React","createContext","undefined"],"sources":["ServerContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type ServerContextType = {\n location?: {\n pathname: string;\n search: string;\n };\n};\n\nconst ServerContext = React.createContext<ServerContextType | undefined>(\n undefined\n);\n\nexport default ServerContext;\n"],"mappings":";;;;;;;AAAA;;;;;;AASA,MAAMA,aAAa,gBAAGC,KAAK,CAACC,aAAN,CACpBC,SADoB,CAAtB;eAIeH,a"}
1
+ {"version":3,"names":["ServerContext","React","createContext","undefined"],"sourceRoot":"../../src","sources":["ServerContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAS/B,MAAMA,aAAa,gBAAGC,KAAK,CAACC,aAAa,CACvCC,SAAS,CACV;AAAC,eAEaH,aAAa;AAAA"}
@@ -4,102 +4,89 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = createMemoryHistory;
7
-
8
7
  var _nonSecure = require("nanoid/non-secure");
9
-
10
8
  function createMemoryHistory() {
11
9
  let index = 0;
12
- let items = []; // Pending callbacks for `history.go(n)`
13
- // We might modify the callback stored if it was interrupted, so we have a ref to identify it
10
+ let items = [];
14
11
 
12
+ // Pending callbacks for `history.go(n)`
13
+ // We might modify the callback stored if it was interrupted, so we have a ref to identify it
15
14
  const pending = [];
16
-
17
15
  const interrupt = () => {
18
16
  // If another history operation was performed we need to interrupt existing ones
19
17
  // This makes sure that calls such as `history.replace` after `history.go` don't happen
20
18
  // Since otherwise it won't be correct if something else has changed
21
19
  pending.forEach(it => {
22
20
  const cb = it.cb;
23
-
24
21
  it.cb = () => cb(true);
25
22
  });
26
23
  };
27
-
28
24
  const history = {
29
25
  get index() {
30
26
  var _window$history$state;
31
-
32
27
  // We store an id in the state instead of an index
33
28
  // Index could get out of sync with in-memory values if page reloads
34
29
  const id = (_window$history$state = window.history.state) === null || _window$history$state === void 0 ? void 0 : _window$history$state.id;
35
-
36
30
  if (id) {
37
31
  const index = items.findIndex(item => item.id === id);
38
32
  return index > -1 ? index : 0;
39
33
  }
40
-
41
34
  return 0;
42
35
  },
43
-
44
36
  get(index) {
45
37
  return items[index];
46
38
  },
47
-
48
39
  backIndex(_ref) {
49
40
  let {
50
41
  path
51
42
  } = _ref;
52
-
53
43
  // We need to find the index from the element before current to get closest path to go back to
54
44
  for (let i = index - 1; i >= 0; i--) {
55
45
  const item = items[i];
56
-
57
46
  if (item.path === path) {
58
47
  return i;
59
48
  }
60
49
  }
61
-
62
50
  return -1;
63
51
  },
64
-
65
52
  push(_ref2) {
66
53
  let {
67
54
  path,
68
55
  state
69
56
  } = _ref2;
70
57
  interrupt();
71
- const id = (0, _nonSecure.nanoid)(); // When a new entry is pushed, all the existing entries after index will be inaccessible
72
- // So we remove any existing entries after the current index to clean them up
58
+ const id = (0, _nonSecure.nanoid)();
73
59
 
60
+ // When a new entry is pushed, all the existing entries after index will be inaccessible
61
+ // So we remove any existing entries after the current index to clean them up
74
62
  items = items.slice(0, index + 1);
75
63
  items.push({
76
64
  path,
77
65
  state,
78
66
  id
79
67
  });
80
- index = items.length - 1; // We pass empty string for title because it's ignored in all browsers except safari
68
+ index = items.length - 1;
69
+
70
+ // We pass empty string for title because it's ignored in all browsers except safari
81
71
  // We don't store state object in history.state because:
82
72
  // - browsers have limits on how big it can be, and we don't control the size
83
73
  // - while not recommended, there could be non-serializable data in state
84
-
85
74
  window.history.pushState({
86
75
  id
87
76
  }, '', path);
88
77
  },
89
-
90
78
  replace(_ref3) {
91
- var _window$history$state2, _window$history$state3;
92
-
79
+ var _window$history$state2;
93
80
  let {
94
81
  path,
95
82
  state
96
83
  } = _ref3;
97
84
  interrupt();
98
- const id = (_window$history$state2 = (_window$history$state3 = window.history.state) === null || _window$history$state3 === void 0 ? void 0 : _window$history$state3.id) !== null && _window$history$state2 !== void 0 ? _window$history$state2 : (0, _nonSecure.nanoid)(); // Need to keep the hash part of the path if there was no previous history entry
99
- // or the previous history entry had the same path
85
+ const id = ((_window$history$state2 = window.history.state) === null || _window$history$state2 === void 0 ? void 0 : _window$history$state2.id) ?? (0, _nonSecure.nanoid)();
100
86
 
87
+ // Need to keep the hash part of the path if there was no previous history entry
88
+ // or the previous history entry had the same path
101
89
  let pathWithHash = path;
102
-
103
90
  if (!items.length || items.findIndex(item => item.id === id) < 0) {
104
91
  // There are two scenarios for creating an array with only one history record:
105
92
  // - When loaded id not found in the items array, this function by default will replace
@@ -118,31 +105,28 @@ function createMemoryHistory() {
118
105
  if (items[index].path === path) {
119
106
  pathWithHash = pathWithHash + location.hash;
120
107
  }
121
-
122
108
  items[index] = {
123
109
  path,
124
110
  state,
125
111
  id
126
112
  };
127
113
  }
128
-
129
114
  window.history.replaceState({
130
115
  id
131
116
  }, '', pathWithHash);
132
117
  },
133
-
134
118
  // `history.go(n)` is asynchronous, there are couple of things to keep in mind:
135
119
  // - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
136
120
  // - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
137
121
  // - the `popstate` event fires before the next frame after calling `history.go(n)`.
138
122
  // This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.
139
123
  go(n) {
140
- interrupt(); // To guard against unexpected navigation out of the app we will assume that browser history is only as deep as the length of our memory
141
- // history. If we don't have an item to navigate to then update our index and navigate as far as we can without taking the user out of the app.
124
+ interrupt();
142
125
 
126
+ // To guard against unexpected navigation out of the app we will assume that browser history is only as deep as the length of our memory
127
+ // history. If we don't have an item to navigate to then update our index and navigate as far as we can without taking the user out of the app.
143
128
  const nextIndex = index + n;
144
129
  const lastItemIndex = items.length - 1;
145
-
146
130
  if (n < 0 && !items[nextIndex]) {
147
131
  // Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.
148
132
  n = -index;
@@ -154,24 +138,24 @@ function createMemoryHistory() {
154
138
  } else {
155
139
  index = nextIndex;
156
140
  }
157
-
158
141
  if (n === 0) {
159
142
  return;
160
- } // When we call `history.go`, `popstate` will fire when there's history to go back to
143
+ }
144
+
145
+ // When we call `history.go`, `popstate` will fire when there's history to go back to
161
146
  // So we need to somehow handle following cases:
162
147
  // - There's history to go back, `history.go` is called, and `popstate` fires
163
148
  // - `history.go` is called multiple times, we need to resolve on respective `popstate`
164
149
  // - No history to go back, but `history.go` was called, browser has no API to detect it
165
-
166
-
167
150
  return new Promise((resolve, reject) => {
168
151
  const done = interrupted => {
169
152
  clearTimeout(timer);
170
-
171
153
  if (interrupted) {
172
154
  reject(new Error('History was changed during navigation.'));
173
155
  return;
174
- } // There seems to be a bug in Chrome regarding updating the title
156
+ }
157
+
158
+ // There seems to be a bug in Chrome regarding updating the title
175
159
  // If we set a title just before calling `history.go`, the title gets lost
176
160
  // However the value of `document.title` is still what we set it to
177
161
  // It's just not displayed in the tab bar
@@ -179,8 +163,6 @@ function createMemoryHistory() {
179
163
  // And set the title to what it was before so it gets applied
180
164
  // It won't work without setting it to empty string coz otherwise title isn't changing
181
165
  // Which means that the browser won't do anything after setting the title
182
-
183
-
184
166
  const {
185
167
  title
186
168
  } = window.document;
@@ -188,43 +170,39 @@ function createMemoryHistory() {
188
170
  window.document.title = title;
189
171
  resolve();
190
172
  };
191
-
192
173
  pending.push({
193
174
  ref: done,
194
175
  cb: done
195
- }); // If navigation didn't happen within 100ms, assume that it won't happen
176
+ });
177
+
178
+ // If navigation didn't happen within 100ms, assume that it won't happen
196
179
  // This may not be accurate, but hopefully it won't take so much time
197
180
  // In Chrome, navigation seems to happen instantly in next microtask
198
181
  // But on Firefox, it seems to take much longer, around 50ms from our testing
199
182
  // We're using a hacky timeout since there doesn't seem to be way to know for sure
200
-
201
183
  const timer = setTimeout(() => {
202
184
  const index = pending.findIndex(it => it.ref === done);
203
-
204
185
  if (index > -1) {
205
186
  pending[index].cb();
206
187
  pending.splice(index, 1);
207
188
  }
208
189
  }, 100);
209
-
210
190
  const onPopState = () => {
211
- var _window$history$state4;
191
+ var _window$history$state3;
192
+ const id = (_window$history$state3 = window.history.state) === null || _window$history$state3 === void 0 ? void 0 : _window$history$state3.id;
193
+ const currentIndex = items.findIndex(item => item.id === id);
212
194
 
213
- const id = (_window$history$state4 = window.history.state) === null || _window$history$state4 === void 0 ? void 0 : _window$history$state4.id;
214
- const currentIndex = items.findIndex(item => item.id === id); // Fix createMemoryHistory.index variable's value
195
+ // Fix createMemoryHistory.index variable's value
215
196
  // as it may go out of sync when navigating in the browser.
216
-
217
197
  index = Math.max(currentIndex, 0);
218
198
  const last = pending.pop();
219
199
  window.removeEventListener('popstate', onPopState);
220
200
  last === null || last === void 0 ? void 0 : last.cb();
221
201
  };
222
-
223
202
  window.addEventListener('popstate', onPopState);
224
203
  window.history.go(n);
225
204
  });
226
205
  },
227
-
228
206
  // The `popstate` event is triggered when history changes, except `pushState` and `replaceState`
229
207
  // If we call `history.go(n)` ourselves, we don't want it to trigger the listener
230
208
  // Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
@@ -234,14 +212,11 @@ function createMemoryHistory() {
234
212
  // This was triggered by `history.go(n)`, we shouldn't call the listener
235
213
  return;
236
214
  }
237
-
238
215
  listener();
239
216
  };
240
-
241
217
  window.addEventListener('popstate', onPopState);
242
218
  return () => window.removeEventListener('popstate', onPopState);
243
219
  }
244
-
245
220
  };
246
221
  return history;
247
222
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","nanoid","slice","length","pushState","replace","pathWithHash","location","hash","replaceState","go","n","nextIndex","lastItemIndex","Promise","resolve","reject","done","interrupted","clearTimeout","timer","Error","title","document","ref","setTimeout","splice","onPopState","currentIndex","Math","max","last","pop","removeEventListener","addEventListener","listen","listener"],"sources":["createMemoryHistory.tsx"],"sourcesContent":["import type { NavigationState } from '@react-navigation/core';\nimport { nanoid } from 'nanoid/non-secure';\n\ntype HistoryRecord = {\n // Unique identifier for this record to match it with window.history.state\n id: string;\n // Navigation state object for the history entry\n state: NavigationState;\n // Path of the history entry\n path: string;\n};\n\nexport default function createMemoryHistory() {\n let index = 0;\n let items: HistoryRecord[] = [];\n\n // Pending callbacks for `history.go(n)`\n // We might modify the callback stored if it was interrupted, so we have a ref to identify it\n const pending: { ref: unknown; cb: (interrupted?: boolean) => void }[] = [];\n\n const interrupt = () => {\n // If another history operation was performed we need to interrupt existing ones\n // This makes sure that calls such as `history.replace` after `history.go` don't happen\n // Since otherwise it won't be correct if something else has changed\n pending.forEach((it) => {\n const cb = it.cb;\n it.cb = () => cb(true);\n });\n };\n\n const history = {\n get index(): number {\n // We store an id in the state instead of an index\n // Index could get out of sync with in-memory values if page reloads\n const id = window.history.state?.id;\n\n if (id) {\n const index = items.findIndex((item) => item.id === id);\n\n return index > -1 ? index : 0;\n }\n\n return 0;\n },\n\n get(index: number) {\n return items[index];\n },\n\n backIndex({ path }: { path: string }) {\n // We need to find the index from the element before current to get closest path to go back to\n for (let i = index - 1; i >= 0; i--) {\n const item = items[i];\n\n if (item.path === path) {\n return i;\n }\n }\n\n return -1;\n },\n\n push({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = nanoid();\n\n // When a new entry is pushed, all the existing entries after index will be inaccessible\n // So we remove any existing entries after the current index to clean them up\n items = items.slice(0, index + 1);\n\n items.push({ path, state, id });\n index = items.length - 1;\n\n // We pass empty string for title because it's ignored in all browsers except safari\n // We don't store state object in history.state because:\n // - browsers have limits on how big it can be, and we don't control the size\n // - while not recommended, there could be non-serializable data in state\n window.history.pushState({ id }, '', path);\n },\n\n replace({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = window.history.state?.id ?? nanoid();\n\n // Need to keep the hash part of the path if there was no previous history entry\n // or the previous history entry had the same path\n let pathWithHash = path;\n\n if (!items.length || items.findIndex((item) => item.id === id) < 0) {\n // There are two scenarios for creating an array with only one history record:\n // - When loaded id not found in the items array, this function by default will replace\n // the first item. We need to keep only the new updated object, otherwise it will break\n // the page when navigating forward in history.\n // - This is the first time any state modifications are done\n // So we need to push the entry as there's nothing to replace\n pathWithHash = pathWithHash + location.hash;\n items = [{ path: pathWithHash, state, id }];\n index = 0;\n } else {\n if (items[index].path === path) {\n pathWithHash = pathWithHash + location.hash;\n }\n items[index] = { path, state, id };\n }\n\n window.history.replaceState({ id }, '', pathWithHash);\n },\n\n // `history.go(n)` is asynchronous, there are couple of things to keep in mind:\n // - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.\n // - each `history.go(n)` call will trigger a separate `popstate` event with correct location.\n // - the `popstate` event fires before the next frame after calling `history.go(n)`.\n // This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.\n go(n: number) {\n interrupt();\n\n // To guard against unexpected navigation out of the app we will assume that browser history is only as deep as the length of our memory\n // history. If we don't have an item to navigate to then update our index and navigate as far as we can without taking the user out of the app.\n const nextIndex = index + n;\n const lastItemIndex = items.length - 1;\n if (n < 0 && !items[nextIndex]) {\n // Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.\n n = -index;\n index = 0;\n } else if (n > 0 && nextIndex > lastItemIndex) {\n // Attempted to navigate past the last index. Calculate how many indices away from the last index and go there.\n n = lastItemIndex - index;\n index = lastItemIndex;\n } else {\n index = nextIndex;\n }\n\n if (n === 0) {\n return;\n }\n\n // When we call `history.go`, `popstate` will fire when there's history to go back to\n // So we need to somehow handle following cases:\n // - There's history to go back, `history.go` is called, and `popstate` fires\n // - `history.go` is called multiple times, we need to resolve on respective `popstate`\n // - No history to go back, but `history.go` was called, browser has no API to detect it\n return new Promise<void>((resolve, reject) => {\n const done = (interrupted?: boolean) => {\n clearTimeout(timer);\n\n if (interrupted) {\n reject(new Error('History was changed during navigation.'));\n return;\n }\n\n // There seems to be a bug in Chrome regarding updating the title\n // If we set a title just before calling `history.go`, the title gets lost\n // However the value of `document.title` is still what we set it to\n // It's just not displayed in the tab bar\n // To update the tab bar, we need to reset the title to something else first (e.g. '')\n // And set the title to what it was before so it gets applied\n // It won't work without setting it to empty string coz otherwise title isn't changing\n // Which means that the browser won't do anything after setting the title\n const { title } = window.document;\n\n window.document.title = '';\n window.document.title = title;\n\n resolve();\n };\n\n pending.push({ ref: done, cb: done });\n\n // If navigation didn't happen within 100ms, assume that it won't happen\n // This may not be accurate, but hopefully it won't take so much time\n // In Chrome, navigation seems to happen instantly in next microtask\n // But on Firefox, it seems to take much longer, around 50ms from our testing\n // We're using a hacky timeout since there doesn't seem to be way to know for sure\n const timer = setTimeout(() => {\n const index = pending.findIndex((it) => it.ref === done);\n\n if (index > -1) {\n pending[index].cb();\n pending.splice(index, 1);\n }\n }, 100);\n\n const onPopState = () => {\n const id = window.history.state?.id;\n const currentIndex = items.findIndex((item) => item.id === id);\n\n // Fix createMemoryHistory.index variable's value\n // as it may go out of sync when navigating in the browser.\n index = Math.max(currentIndex, 0);\n\n const last = pending.pop();\n\n window.removeEventListener('popstate', onPopState);\n last?.cb();\n };\n\n window.addEventListener('popstate', onPopState);\n window.history.go(n);\n });\n },\n\n // The `popstate` event is triggered when history changes, except `pushState` and `replaceState`\n // If we call `history.go(n)` ourselves, we don't want it to trigger the listener\n // Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener\n listen(listener: () => void) {\n const onPopState = () => {\n if (pending.length) {\n // This was triggered by `history.go(n)`, we shouldn't call the listener\n return;\n }\n\n listener();\n };\n\n window.addEventListener('popstate', onPopState);\n\n return () => window.removeEventListener('popstate', onPopState);\n },\n };\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;IACAwB,MAAM,CAACC,QAAD,EAAuB;MAC3B,MAAMT,UAAU,GAAG,MAAM;QACvB,IAAI1C,OAAO,CAACkB,MAAZ,EAAoB;UAClB;UACA;QACD;;QAEDiC,QAAQ;MACT,CAPD;;MASA5C,MAAM,CAAC0C,gBAAP,CAAwB,UAAxB,EAAoCP,UAApC;MAEA,OAAO,MAAMnC,MAAM,CAACyC,mBAAP,CAA2B,UAA3B,EAAuCN,UAAvC,CAAb;IACD;;EA7La,CAAhB;EAgMA,OAAOrC,OAAP;AACD"}
1
+ {"version":3,"names":["createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","nanoid","slice","length","pushState","replace","pathWithHash","location","hash","replaceState","go","n","nextIndex","lastItemIndex","Promise","resolve","reject","done","interrupted","clearTimeout","timer","Error","title","document","ref","setTimeout","splice","onPopState","currentIndex","Math","max","last","pop","removeEventListener","addEventListener","listen","listener"],"sourceRoot":"../../src","sources":["createMemoryHistory.tsx"],"mappings":";;;;;;AACA;AAWe,SAASA,mBAAmB,GAAG;EAC5C,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,KAAsB,GAAG,EAAE;;EAE/B;EACA;EACA,MAAMC,OAAgE,GAAG,EAAE;EAE3E,MAAMC,SAAS,GAAG,MAAM;IACtB;IACA;IACA;IACAD,OAAO,CAACE,OAAO,CAAEC,EAAE,IAAK;MACtB,MAAMC,EAAE,GAAGD,EAAE,CAACC,EAAE;MAChBD,EAAE,CAACC,EAAE,GAAG,MAAMA,EAAE,CAAC,IAAI,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC;EAED,MAAMC,OAAO,GAAG;IACd,IAAIP,KAAK,GAAW;MAAA;MAClB;MACA;MACA,MAAMQ,EAAE,4BAAGC,MAAM,CAACF,OAAO,CAACG,KAAK,0DAApB,sBAAsBF,EAAE;MAEnC,IAAIA,EAAE,EAAE;QACN,MAAMR,KAAK,GAAGC,KAAK,CAACU,SAAS,CAAEC,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