@react-navigation/native 6.0.16 → 6.1.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.
- package/lib/commonjs/Link.js +2 -12
- package/lib/commonjs/Link.js.map +1 -1
- package/lib/commonjs/LinkingContext.js +0 -4
- package/lib/commonjs/LinkingContext.js.map +1 -1
- package/lib/commonjs/NavigationContainer.js +9 -31
- package/lib/commonjs/NavigationContainer.js.map +1 -1
- package/lib/commonjs/ServerContainer.js +2 -12
- package/lib/commonjs/ServerContainer.js.map +1 -1
- package/lib/commonjs/ServerContext.js +0 -4
- package/lib/commonjs/ServerContext.js.map +1 -1
- package/lib/commonjs/createMemoryHistory.js +36 -53
- package/lib/commonjs/createMemoryHistory.js.map +1 -1
- package/lib/commonjs/extractPathFromURL.js +2 -8
- package/lib/commonjs/extractPathFromURL.js.map +1 -1
- package/lib/commonjs/index.js +0 -17
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theming/DarkTheme.js.map +1 -1
- package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
- package/lib/commonjs/theming/ThemeContext.js +0 -6
- package/lib/commonjs/theming/ThemeContext.js.map +1 -1
- package/lib/commonjs/theming/ThemeProvider.js +0 -6
- package/lib/commonjs/theming/ThemeProvider.js.map +1 -1
- package/lib/commonjs/theming/useTheme.js +0 -6
- package/lib/commonjs/theming/useTheme.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useBackButton.js +0 -9
- package/lib/commonjs/useBackButton.js.map +1 -1
- package/lib/commonjs/useDocumentTitle.js +1 -12
- package/lib/commonjs/useDocumentTitle.js.map +1 -1
- package/lib/commonjs/useDocumentTitle.native.js +2 -2
- package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
- package/lib/commonjs/useLinkBuilder.js +5 -15
- package/lib/commonjs/useLinkBuilder.js.map +1 -1
- package/lib/commonjs/useLinkProps.js +8 -24
- package/lib/commonjs/useLinkProps.js.map +1 -1
- package/lib/commonjs/useLinkTo.js +0 -12
- package/lib/commonjs/useLinkTo.js.map +1 -1
- package/lib/commonjs/useLinking.js +35 -79
- package/lib/commonjs/useLinking.js.map +1 -1
- package/lib/commonjs/useLinking.native.js +9 -36
- package/lib/commonjs/useLinking.native.js.map +1 -1
- package/lib/commonjs/useScrollToTop.js +48 -47
- package/lib/commonjs/useScrollToTop.js.map +1 -1
- package/lib/commonjs/useThenable.js +2 -9
- package/lib/commonjs/useThenable.js.map +1 -1
- package/lib/module/Link.js +2 -6
- package/lib/module/Link.js.map +1 -1
- package/lib/module/LinkingContext.js.map +1 -1
- package/lib/module/NavigationContainer.js +9 -18
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/ServerContainer.js +2 -5
- package/lib/module/ServerContainer.js.map +1 -1
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/createMemoryHistory.js +36 -51
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/extractPathFromURL.js +2 -5
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/DefaultTheme.js.map +1 -1
- package/lib/module/theming/ThemeContext.js.map +1 -1
- package/lib/module/theming/ThemeProvider.js.map +1 -1
- package/lib/module/theming/useTheme.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useBackButton.js +0 -3
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useDocumentTitle.js +1 -9
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useDocumentTitle.native.js +2 -1
- package/lib/module/useDocumentTitle.native.js.map +1 -1
- package/lib/module/useLinkBuilder.js +5 -9
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +8 -16
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +0 -5
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +35 -70
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +9 -26
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useScrollToTop.js +48 -43
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +2 -5
- package/lib/module/useThenable.js.map +1 -1
- package/lib/typescript/src/Link.d.ts +1 -0
- package/lib/typescript/src/Link.d.ts.map +1 -0
- package/lib/typescript/src/LinkingContext.d.ts +1 -0
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainer.d.ts +1 -0
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -0
- package/lib/typescript/src/ServerContainer.d.ts +1 -0
- package/lib/typescript/src/ServerContainer.d.ts.map +1 -0
- package/lib/typescript/src/ServerContext.d.ts +1 -0
- package/lib/typescript/src/ServerContext.d.ts.map +1 -0
- package/lib/typescript/src/__mocks__/window.d.ts +1 -0
- package/lib/typescript/src/__mocks__/window.d.ts.map +1 -0
- package/lib/typescript/src/createMemoryHistory.d.ts +1 -0
- package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -0
- package/lib/typescript/src/extractPathFromURL.d.ts +1 -0
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theming/DarkTheme.d.ts +1 -0
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/DefaultTheme.d.ts +1 -0
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/ThemeContext.d.ts +1 -0
- package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/src/theming/ThemeProvider.d.ts +1 -0
- package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/src/theming/useTheme.d.ts +1 -0
- package/lib/typescript/src/theming/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/useBackButton.d.ts +1 -0
- package/lib/typescript/src/useBackButton.d.ts.map +1 -0
- package/lib/typescript/src/useDocumentTitle.d.ts +1 -0
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -0
- package/lib/typescript/src/useDocumentTitle.native.d.ts +1 -0
- package/lib/typescript/src/useDocumentTitle.native.d.ts.map +1 -0
- package/lib/typescript/src/useLinkBuilder.d.ts +1 -0
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -0
- package/lib/typescript/src/useLinkProps.d.ts +1 -0
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -0
- package/lib/typescript/src/useLinkTo.d.ts +1 -0
- package/lib/typescript/src/useLinkTo.d.ts.map +1 -0
- package/lib/typescript/src/useLinking.d.ts +1 -0
- package/lib/typescript/src/useLinking.d.ts.map +1 -0
- package/lib/typescript/src/useLinking.native.d.ts +1 -0
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -0
- package/lib/typescript/src/useThenable.d.ts +1 -0
- package/lib/typescript/src/useThenable.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/createMemoryHistory.tsx +10 -2
- package/src/useScrollToTop.tsx +52 -38
package/lib/commonjs/Link.js
CHANGED
|
@@ -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
|
-
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
39
|
+
...props,
|
|
50
40
|
...rest,
|
|
51
41
|
..._reactNative.Platform.select({
|
|
52
42
|
web: {
|
package/lib/commonjs/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Link","to","action","rest","props","useLinkProps","onPress","e","React","createElement","Text","Platform","select","web","onClick","default"],"
|
|
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"],"
|
|
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
|
-
});
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
return { ...linking,
|
|
66
|
+
return {
|
|
67
|
+
...linking,
|
|
85
68
|
enabled: isLinkingEnabled,
|
|
86
|
-
prefixes: (
|
|
87
|
-
getStateFromPath: (
|
|
88
|
-
getPathFromState: (
|
|
89
|
-
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"],"
|
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,wBAAwB,OAS/BC,GAA6D,EAC7D;EAAA,IATA;IACEC,KAAK,GAAGC,qBAAY;IACpBC,OAAO;IACPC,QAAQ,GAAG,IAAI;IACfC,aAAa;IACbC,OAAO;IACP,GAAGC;EACiB,CAAC;EAGvB,MAAMC,gBAAgB,GAAGL,OAAO,GAAGA,OAAO,CAACM,OAAO,KAAK,KAAK,GAAG,KAAK;EAEpE,IAAIN,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEO,MAAM,EAAE;IACnB,IAAAC,wBAAkB,EAACR,OAAO,CAACO,MAAM,CAAC;EACpC;EAEA,MAAME,YAAY,GAChBC,KAAK,CAACC,MAAM,CAAwC,IAAI,CAAC;EAE3D,IAAAC,sBAAa,EAACH,YAAY,CAAC;EAC3B,IAAAI,yBAAgB,EAACJ,YAAY,EAAEP,aAAa,CAAC;EAE7C,MAAM;IAAEY;EAAgB,CAAC,GAAG,IAAAC,mBAAU,EA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ACC,MAAM,CAACR,OAAO,CAAC;EAExCO,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpBc,UAAU,CAACb,OAAO,GAAGhB,OAAO;EAC9B,CAAC,CAAC;EAEFO,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,IAAIa,OAAO,EAAE;MAAA;MACX,uBAAAC,UAAU,CAACb,OAAO,wDAAlB,yBAAAa,UAAU,CAAY;IACxB;EACF,CAAC,EAAE,CAACD,OAAO,CAAC,CAAC;EAEb,IAAI,CAACA,OAAO,EAAE;IACZ;IACA;IACA,OAAO9B,QAAQ;EACjB;EAEA,oBACE,oBAAC,uBAAc,CAAC,QAAQ;IAAC,KAAK,EAAE2B;EAAe,gBAC7C,oBAAC,sBAAa;IAAC,KAAK,EAAE9B;EAAM,gBAC1B,oBAAC,6BAAuB,eAClBM,IAAI;IACR,YAAY,EACVA,IAAI,CAACqB,YAAY,IAAI,IAAI,GAAGA,YAAY,GAAGrB,IAAI,CAACqB,YACjD;IACD,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
|
-
|
|
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"],"
|
|
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"],"
|
|
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,99 +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 = [];
|
|
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)();
|
|
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;
|
|
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
|
|
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 =
|
|
85
|
+
const id = ((_window$history$state2 = window.history.state) === null || _window$history$state2 === void 0 ? void 0 : _window$history$state2.id) ?? (0, _nonSecure.nanoid)();
|
|
99
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
|
|
89
|
+
let pathWithHash = path;
|
|
100
90
|
if (!items.length || items.findIndex(item => item.id === id) < 0) {
|
|
101
91
|
// There are two scenarios for creating an array with only one history record:
|
|
102
92
|
// - When loaded id not found in the items array, this function by default will replace
|
|
@@ -104,37 +94,39 @@ function createMemoryHistory() {
|
|
|
104
94
|
// the page when navigating forward in history.
|
|
105
95
|
// - This is the first time any state modifications are done
|
|
106
96
|
// So we need to push the entry as there's nothing to replace
|
|
97
|
+
pathWithHash = pathWithHash + location.hash;
|
|
107
98
|
items = [{
|
|
108
|
-
path,
|
|
99
|
+
path: pathWithHash,
|
|
109
100
|
state,
|
|
110
101
|
id
|
|
111
102
|
}];
|
|
112
103
|
index = 0;
|
|
113
104
|
} else {
|
|
105
|
+
if (items[index].path === path) {
|
|
106
|
+
pathWithHash = pathWithHash + location.hash;
|
|
107
|
+
}
|
|
114
108
|
items[index] = {
|
|
115
109
|
path,
|
|
116
110
|
state,
|
|
117
111
|
id
|
|
118
112
|
};
|
|
119
113
|
}
|
|
120
|
-
|
|
121
114
|
window.history.replaceState({
|
|
122
115
|
id
|
|
123
|
-
}, '',
|
|
116
|
+
}, '', pathWithHash);
|
|
124
117
|
},
|
|
125
|
-
|
|
126
118
|
// `history.go(n)` is asynchronous, there are couple of things to keep in mind:
|
|
127
119
|
// - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
|
|
128
120
|
// - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
|
|
129
121
|
// - the `popstate` event fires before the next frame after calling `history.go(n)`.
|
|
130
122
|
// This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.
|
|
131
123
|
go(n) {
|
|
132
|
-
interrupt();
|
|
133
|
-
// 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();
|
|
134
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.
|
|
135
128
|
const nextIndex = index + n;
|
|
136
129
|
const lastItemIndex = items.length - 1;
|
|
137
|
-
|
|
138
130
|
if (n < 0 && !items[nextIndex]) {
|
|
139
131
|
// Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.
|
|
140
132
|
n = -index;
|
|
@@ -146,24 +138,24 @@ function createMemoryHistory() {
|
|
|
146
138
|
} else {
|
|
147
139
|
index = nextIndex;
|
|
148
140
|
}
|
|
149
|
-
|
|
150
141
|
if (n === 0) {
|
|
151
142
|
return;
|
|
152
|
-
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// When we call `history.go`, `popstate` will fire when there's history to go back to
|
|
153
146
|
// So we need to somehow handle following cases:
|
|
154
147
|
// - There's history to go back, `history.go` is called, and `popstate` fires
|
|
155
148
|
// - `history.go` is called multiple times, we need to resolve on respective `popstate`
|
|
156
149
|
// - No history to go back, but `history.go` was called, browser has no API to detect it
|
|
157
|
-
|
|
158
|
-
|
|
159
150
|
return new Promise((resolve, reject) => {
|
|
160
151
|
const done = interrupted => {
|
|
161
152
|
clearTimeout(timer);
|
|
162
|
-
|
|
163
153
|
if (interrupted) {
|
|
164
154
|
reject(new Error('History was changed during navigation.'));
|
|
165
155
|
return;
|
|
166
|
-
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// There seems to be a bug in Chrome regarding updating the title
|
|
167
159
|
// If we set a title just before calling `history.go`, the title gets lost
|
|
168
160
|
// However the value of `document.title` is still what we set it to
|
|
169
161
|
// It's just not displayed in the tab bar
|
|
@@ -171,8 +163,6 @@ function createMemoryHistory() {
|
|
|
171
163
|
// And set the title to what it was before so it gets applied
|
|
172
164
|
// It won't work without setting it to empty string coz otherwise title isn't changing
|
|
173
165
|
// Which means that the browser won't do anything after setting the title
|
|
174
|
-
|
|
175
|
-
|
|
176
166
|
const {
|
|
177
167
|
title
|
|
178
168
|
} = window.document;
|
|
@@ -180,43 +170,39 @@ function createMemoryHistory() {
|
|
|
180
170
|
window.document.title = title;
|
|
181
171
|
resolve();
|
|
182
172
|
};
|
|
183
|
-
|
|
184
173
|
pending.push({
|
|
185
174
|
ref: done,
|
|
186
175
|
cb: done
|
|
187
|
-
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// If navigation didn't happen within 100ms, assume that it won't happen
|
|
188
179
|
// This may not be accurate, but hopefully it won't take so much time
|
|
189
180
|
// In Chrome, navigation seems to happen instantly in next microtask
|
|
190
181
|
// But on Firefox, it seems to take much longer, around 50ms from our testing
|
|
191
182
|
// We're using a hacky timeout since there doesn't seem to be way to know for sure
|
|
192
|
-
|
|
193
183
|
const timer = setTimeout(() => {
|
|
194
184
|
const index = pending.findIndex(it => it.ref === done);
|
|
195
|
-
|
|
196
185
|
if (index > -1) {
|
|
197
186
|
pending[index].cb();
|
|
198
187
|
pending.splice(index, 1);
|
|
199
188
|
}
|
|
200
189
|
}, 100);
|
|
201
|
-
|
|
202
190
|
const onPopState = () => {
|
|
203
|
-
var _window$history$
|
|
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);
|
|
204
194
|
|
|
205
|
-
|
|
206
|
-
const currentIndex = items.findIndex(item => item.id === id); // Fix createMemoryHistory.index variable's value
|
|
195
|
+
// Fix createMemoryHistory.index variable's value
|
|
207
196
|
// as it may go out of sync when navigating in the browser.
|
|
208
|
-
|
|
209
197
|
index = Math.max(currentIndex, 0);
|
|
210
198
|
const last = pending.pop();
|
|
211
199
|
window.removeEventListener('popstate', onPopState);
|
|
212
200
|
last === null || last === void 0 ? void 0 : last.cb();
|
|
213
201
|
};
|
|
214
|
-
|
|
215
202
|
window.addEventListener('popstate', onPopState);
|
|
216
203
|
window.history.go(n);
|
|
217
204
|
});
|
|
218
205
|
},
|
|
219
|
-
|
|
220
206
|
// The `popstate` event is triggered when history changes, except `pushState` and `replaceState`
|
|
221
207
|
// If we call `history.go(n)` ourselves, we don't want it to trigger the listener
|
|
222
208
|
// Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
|
|
@@ -226,14 +212,11 @@ function createMemoryHistory() {
|
|
|
226
212
|
// This was triggered by `history.go(n)`, we shouldn't call the listener
|
|
227
213
|
return;
|
|
228
214
|
}
|
|
229
|
-
|
|
230
215
|
listener();
|
|
231
216
|
};
|
|
232
|
-
|
|
233
217
|
window.addEventListener('popstate', onPopState);
|
|
234
218
|
return () => window.removeEventListener('popstate', onPopState);
|
|
235
219
|
}
|
|
236
|
-
|
|
237
220
|
};
|
|
238
221
|
return history;
|
|
239
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","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 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 items = [{ path, state, id }];\n index = 0;\n } else {\n items[index] = { path, state, id };\n }\n\n window.history.replaceState({ id }, '', path);\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 };\n\n return history;\n}\n"],"mappings":";;;;;;;AACA;;AAWe,SAASA,mBAAT,GAA+B;EAC5C,IAAIC,KAAK,GAAG,CAAZ;EACA,IAAIC,KAAsB,GAAG,EAA7B,CAF4C,CAI5C;EACA;;EACA,MAAMC,OAAgE,GAAG,EAAzE;;EAEA,MAAMC,SAAS,GAAG,MAAM;IACtB;IACA;IACA;IACAD,OAAO,CAACE,OAAR,CAAiBC,EAAD,IAAQ;MACtB,MAAMC,EAAE,GAAGD,EAAE,CAACC,EAAd;;MACAD,EAAE,CAACC,EAAH,GAAQ,MAAMA,EAAE,CAAC,IAAD,CAAhB;IACD,CAHD;EAID,CARD;;EAUA,MAAMC,OAAO,GAAG;IACd,IAAIP,KAAJ,GAAoB;MAAA;;MAClB;MACA;MACA,MAAMQ,EAAE,4BAAGC,MAAM,CAACF,OAAP,CAAeG,KAAlB,0DAAG,sBAAsBF,EAAjC;;MAEA,IAAIA,EAAJ,EAAQ;QACN,MAAMR,KAAK,GAAGC,KAAK,CAACU,SAAN,CAAiBC,IAAD,IAAUA,IAAI,CAACJ,EAAL,KAAYA,EAAtC,CAAd;QAEA,OA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AuCN,UAAvC;UACAI,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEvC,EAAN;QACD,CAZD;;QAcAG,MAAM,CAACuC,gBAAP,CAAwB,UAAxB,EAAoCP,UAApC;QACAhC,MAAM,CAACF,OAAP,CAAeiB,EAAf,CAAkBC,CAAlB;MACD,CAzDM,CAAP;IA0DD,CAnKa;;IAqKd;IACA;IACA;IACAwB,MAAM,CAACC,QAAD,EAAuB;MAC3B,MAAMT,UAAU,GAAG,MAAM;QACvB,IAAIvC,OAAO,CAACkB,MAAZ,EAAoB;UAClB;UACA;QACD;;QAED8B,QAAQ;MACT,CAPD;;MASAzC,MAAM,CAACuC,gBAAP,CAAwB,UAAxB,EAAoCP,UAApC;MAEA,OAAO,MAAMhC,MAAM,CAACsC,mBAAP,CAA2B,UAA3B,EAAuCN,UAAvC,CAAb;IACD;;EArLa,CAAhB;EAwLA,OAAOlC,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,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