@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
|
@@ -1,94 +1,86 @@
|
|
|
1
1
|
import { nanoid } from 'nanoid/non-secure';
|
|
2
2
|
export default function createMemoryHistory() {
|
|
3
3
|
let index = 0;
|
|
4
|
-
let items = [];
|
|
5
|
-
// We might modify the callback stored if it was interrupted, so we have a ref to identify it
|
|
4
|
+
let items = [];
|
|
6
5
|
|
|
6
|
+
// Pending callbacks for `history.go(n)`
|
|
7
|
+
// We might modify the callback stored if it was interrupted, so we have a ref to identify it
|
|
7
8
|
const pending = [];
|
|
8
|
-
|
|
9
9
|
const interrupt = () => {
|
|
10
10
|
// If another history operation was performed we need to interrupt existing ones
|
|
11
11
|
// This makes sure that calls such as `history.replace` after `history.go` don't happen
|
|
12
12
|
// Since otherwise it won't be correct if something else has changed
|
|
13
13
|
pending.forEach(it => {
|
|
14
14
|
const cb = it.cb;
|
|
15
|
-
|
|
16
15
|
it.cb = () => cb(true);
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
const history = {
|
|
21
19
|
get index() {
|
|
22
20
|
var _window$history$state;
|
|
23
|
-
|
|
24
21
|
// We store an id in the state instead of an index
|
|
25
22
|
// Index could get out of sync with in-memory values if page reloads
|
|
26
23
|
const id = (_window$history$state = window.history.state) === null || _window$history$state === void 0 ? void 0 : _window$history$state.id;
|
|
27
|
-
|
|
28
24
|
if (id) {
|
|
29
25
|
const index = items.findIndex(item => item.id === id);
|
|
30
26
|
return index > -1 ? index : 0;
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
return 0;
|
|
34
29
|
},
|
|
35
|
-
|
|
36
30
|
get(index) {
|
|
37
31
|
return items[index];
|
|
38
32
|
},
|
|
39
|
-
|
|
40
33
|
backIndex(_ref) {
|
|
41
34
|
let {
|
|
42
35
|
path
|
|
43
36
|
} = _ref;
|
|
44
|
-
|
|
45
37
|
// We need to find the index from the element before current to get closest path to go back to
|
|
46
38
|
for (let i = index - 1; i >= 0; i--) {
|
|
47
39
|
const item = items[i];
|
|
48
|
-
|
|
49
40
|
if (item.path === path) {
|
|
50
41
|
return i;
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
return -1;
|
|
55
45
|
},
|
|
56
|
-
|
|
57
46
|
push(_ref2) {
|
|
58
47
|
let {
|
|
59
48
|
path,
|
|
60
49
|
state
|
|
61
50
|
} = _ref2;
|
|
62
51
|
interrupt();
|
|
63
|
-
const id = nanoid();
|
|
64
|
-
// So we remove any existing entries after the current index to clean them up
|
|
52
|
+
const id = nanoid();
|
|
65
53
|
|
|
54
|
+
// When a new entry is pushed, all the existing entries after index will be inaccessible
|
|
55
|
+
// So we remove any existing entries after the current index to clean them up
|
|
66
56
|
items = items.slice(0, index + 1);
|
|
67
57
|
items.push({
|
|
68
58
|
path,
|
|
69
59
|
state,
|
|
70
60
|
id
|
|
71
61
|
});
|
|
72
|
-
index = items.length - 1;
|
|
62
|
+
index = items.length - 1;
|
|
63
|
+
|
|
64
|
+
// We pass empty string for title because it's ignored in all browsers except safari
|
|
73
65
|
// We don't store state object in history.state because:
|
|
74
66
|
// - browsers have limits on how big it can be, and we don't control the size
|
|
75
67
|
// - while not recommended, there could be non-serializable data in state
|
|
76
|
-
|
|
77
68
|
window.history.pushState({
|
|
78
69
|
id
|
|
79
70
|
}, '', path);
|
|
80
71
|
},
|
|
81
|
-
|
|
82
72
|
replace(_ref3) {
|
|
83
|
-
var _window$history$state2
|
|
84
|
-
|
|
73
|
+
var _window$history$state2;
|
|
85
74
|
let {
|
|
86
75
|
path,
|
|
87
76
|
state
|
|
88
77
|
} = _ref3;
|
|
89
78
|
interrupt();
|
|
90
|
-
const id = (_window$history$state2 =
|
|
79
|
+
const id = ((_window$history$state2 = window.history.state) === null || _window$history$state2 === void 0 ? void 0 : _window$history$state2.id) ?? nanoid();
|
|
91
80
|
|
|
81
|
+
// Need to keep the hash part of the path if there was no previous history entry
|
|
82
|
+
// or the previous history entry had the same path
|
|
83
|
+
let pathWithHash = path;
|
|
92
84
|
if (!items.length || items.findIndex(item => item.id === id) < 0) {
|
|
93
85
|
// There are two scenarios for creating an array with only one history record:
|
|
94
86
|
// - When loaded id not found in the items array, this function by default will replace
|
|
@@ -96,37 +88,39 @@ export default function createMemoryHistory() {
|
|
|
96
88
|
// the page when navigating forward in history.
|
|
97
89
|
// - This is the first time any state modifications are done
|
|
98
90
|
// So we need to push the entry as there's nothing to replace
|
|
91
|
+
pathWithHash = pathWithHash + location.hash;
|
|
99
92
|
items = [{
|
|
100
|
-
path,
|
|
93
|
+
path: pathWithHash,
|
|
101
94
|
state,
|
|
102
95
|
id
|
|
103
96
|
}];
|
|
104
97
|
index = 0;
|
|
105
98
|
} else {
|
|
99
|
+
if (items[index].path === path) {
|
|
100
|
+
pathWithHash = pathWithHash + location.hash;
|
|
101
|
+
}
|
|
106
102
|
items[index] = {
|
|
107
103
|
path,
|
|
108
104
|
state,
|
|
109
105
|
id
|
|
110
106
|
};
|
|
111
107
|
}
|
|
112
|
-
|
|
113
108
|
window.history.replaceState({
|
|
114
109
|
id
|
|
115
|
-
}, '',
|
|
110
|
+
}, '', pathWithHash);
|
|
116
111
|
},
|
|
117
|
-
|
|
118
112
|
// `history.go(n)` is asynchronous, there are couple of things to keep in mind:
|
|
119
113
|
// - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
|
|
120
114
|
// - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
|
|
121
115
|
// - the `popstate` event fires before the next frame after calling `history.go(n)`.
|
|
122
116
|
// This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.
|
|
123
117
|
go(n) {
|
|
124
|
-
interrupt();
|
|
125
|
-
// 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.
|
|
118
|
+
interrupt();
|
|
126
119
|
|
|
120
|
+
// 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
|
|
121
|
+
// 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.
|
|
127
122
|
const nextIndex = index + n;
|
|
128
123
|
const lastItemIndex = items.length - 1;
|
|
129
|
-
|
|
130
124
|
if (n < 0 && !items[nextIndex]) {
|
|
131
125
|
// Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.
|
|
132
126
|
n = -index;
|
|
@@ -138,24 +132,24 @@ export default function createMemoryHistory() {
|
|
|
138
132
|
} else {
|
|
139
133
|
index = nextIndex;
|
|
140
134
|
}
|
|
141
|
-
|
|
142
135
|
if (n === 0) {
|
|
143
136
|
return;
|
|
144
|
-
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// When we call `history.go`, `popstate` will fire when there's history to go back to
|
|
145
140
|
// So we need to somehow handle following cases:
|
|
146
141
|
// - There's history to go back, `history.go` is called, and `popstate` fires
|
|
147
142
|
// - `history.go` is called multiple times, we need to resolve on respective `popstate`
|
|
148
143
|
// - No history to go back, but `history.go` was called, browser has no API to detect it
|
|
149
|
-
|
|
150
|
-
|
|
151
144
|
return new Promise((resolve, reject) => {
|
|
152
145
|
const done = interrupted => {
|
|
153
146
|
clearTimeout(timer);
|
|
154
|
-
|
|
155
147
|
if (interrupted) {
|
|
156
148
|
reject(new Error('History was changed during navigation.'));
|
|
157
149
|
return;
|
|
158
|
-
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// There seems to be a bug in Chrome regarding updating the title
|
|
159
153
|
// If we set a title just before calling `history.go`, the title gets lost
|
|
160
154
|
// However the value of `document.title` is still what we set it to
|
|
161
155
|
// It's just not displayed in the tab bar
|
|
@@ -163,8 +157,6 @@ export default function createMemoryHistory() {
|
|
|
163
157
|
// And set the title to what it was before so it gets applied
|
|
164
158
|
// It won't work without setting it to empty string coz otherwise title isn't changing
|
|
165
159
|
// Which means that the browser won't do anything after setting the title
|
|
166
|
-
|
|
167
|
-
|
|
168
160
|
const {
|
|
169
161
|
title
|
|
170
162
|
} = window.document;
|
|
@@ -172,43 +164,39 @@ export default function createMemoryHistory() {
|
|
|
172
164
|
window.document.title = title;
|
|
173
165
|
resolve();
|
|
174
166
|
};
|
|
175
|
-
|
|
176
167
|
pending.push({
|
|
177
168
|
ref: done,
|
|
178
169
|
cb: done
|
|
179
|
-
});
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// If navigation didn't happen within 100ms, assume that it won't happen
|
|
180
173
|
// This may not be accurate, but hopefully it won't take so much time
|
|
181
174
|
// In Chrome, navigation seems to happen instantly in next microtask
|
|
182
175
|
// But on Firefox, it seems to take much longer, around 50ms from our testing
|
|
183
176
|
// We're using a hacky timeout since there doesn't seem to be way to know for sure
|
|
184
|
-
|
|
185
177
|
const timer = setTimeout(() => {
|
|
186
178
|
const index = pending.findIndex(it => it.ref === done);
|
|
187
|
-
|
|
188
179
|
if (index > -1) {
|
|
189
180
|
pending[index].cb();
|
|
190
181
|
pending.splice(index, 1);
|
|
191
182
|
}
|
|
192
183
|
}, 100);
|
|
193
|
-
|
|
194
184
|
const onPopState = () => {
|
|
195
|
-
var _window$history$
|
|
185
|
+
var _window$history$state3;
|
|
186
|
+
const id = (_window$history$state3 = window.history.state) === null || _window$history$state3 === void 0 ? void 0 : _window$history$state3.id;
|
|
187
|
+
const currentIndex = items.findIndex(item => item.id === id);
|
|
196
188
|
|
|
197
|
-
|
|
198
|
-
const currentIndex = items.findIndex(item => item.id === id); // Fix createMemoryHistory.index variable's value
|
|
189
|
+
// Fix createMemoryHistory.index variable's value
|
|
199
190
|
// as it may go out of sync when navigating in the browser.
|
|
200
|
-
|
|
201
191
|
index = Math.max(currentIndex, 0);
|
|
202
192
|
const last = pending.pop();
|
|
203
193
|
window.removeEventListener('popstate', onPopState);
|
|
204
194
|
last === null || last === void 0 ? void 0 : last.cb();
|
|
205
195
|
};
|
|
206
|
-
|
|
207
196
|
window.addEventListener('popstate', onPopState);
|
|
208
197
|
window.history.go(n);
|
|
209
198
|
});
|
|
210
199
|
},
|
|
211
|
-
|
|
212
200
|
// The `popstate` event is triggered when history changes, except `pushState` and `replaceState`
|
|
213
201
|
// If we call `history.go(n)` ourselves, we don't want it to trigger the listener
|
|
214
202
|
// Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
|
|
@@ -218,14 +206,11 @@ export default function createMemoryHistory() {
|
|
|
218
206
|
// This was triggered by `history.go(n)`, we shouldn't call the listener
|
|
219
207
|
return;
|
|
220
208
|
}
|
|
221
|
-
|
|
222
209
|
listener();
|
|
223
210
|
};
|
|
224
|
-
|
|
225
211
|
window.addEventListener('popstate', onPopState);
|
|
226
212
|
return () => window.removeEventListener('popstate', onPopState);
|
|
227
213
|
}
|
|
228
|
-
|
|
229
214
|
};
|
|
230
215
|
return history;
|
|
231
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["nanoid","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","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,SAASA,MAAT,QAAuB,mBAAvB;AAWA,eAAe,SAASC,mBAAT,G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version":3,"names":["nanoid","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","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,SAASA,MAAM,QAAQ,mBAAmB;AAW1C,eAAe,SAASC,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,IAAI,IAAKA,IAAI,CAACJ,EAAE,KAAKA,EAAE,CAAC;QAEvD,OAAOR,KAAK,GAAG,CAAC,CAAC,GAAGA,KAAK,GAAG,CAAC;MAC/B;MAEA,OAAO,CAAC;IACV,CAAC;IAEDa,GAAG,CAACb,KAAa,EAAE;MACjB,OAAOC,KAAK,CAACD,KAAK,CAAC;IACrB,CAAC;IAEDc,SAAS,OAA6B;MAAA,IAA5B;QAAEC;MAAuB,CAAC;MAClC;MACA,KAAK,IAAIC,CAA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E,EAAE;QACZ,CAAC;QAEDG,MAAM,CAACyC,gBAAgB,CAAC,UAAU,EAAEP,UAAU,CAAC;QAC/ClC,MAAM,CAACF,OAAO,CAACmB,EAAE,CAACC,CAAC,CAAC;MACtB,CAAC,CAAC;IACJ,CAAC;IAED;IACA;IACA;IACAwB,MAAM,CAACC,QAAoB,EAAE;MAC3B,MAAMT,UAAU,GAAG,MAAM;QACvB,IAAIzC,OAAO,CAACiB,MAAM,EAAE;UAClB;UACA;QACF;QAEAiC,QAAQ,EAAE;MACZ,CAAC;MAED3C,MAAM,CAACyC,gBAAgB,CAAC,UAAU,EAAEP,UAAU,CAAC;MAE/C,OAAO,MAAMlC,MAAM,CAACwC,mBAAmB,CAAC,UAAU,EAAEN,UAAU,CAAC;IACjE;EACF,CAAC;EAED,OAAOpC,OAAO;AAChB"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
2
2
|
export default function extractPathFromURL(prefixes, url) {
|
|
3
3
|
for (const prefix of prefixes) {
|
|
4
|
-
var _prefix$match
|
|
5
|
-
|
|
6
|
-
const protocol = (_prefix$match$ = (_prefix$match = prefix.match(/^[^:]+:/)) === null || _prefix$match === void 0 ? void 0 : _prefix$match[0]) !== null && _prefix$match$ !== void 0 ? _prefix$match$ : '';
|
|
4
|
+
var _prefix$match;
|
|
5
|
+
const protocol = ((_prefix$match = prefix.match(/^[^:]+:/)) === null || _prefix$match === void 0 ? void 0 : _prefix$match[0]) ?? '';
|
|
7
6
|
const host = prefix.replace(new RegExp(`^${escapeStringRegexp(protocol)}`), '').replace(/\/+/g, '/') // Replace multiple slash (//) with single ones
|
|
8
7
|
.replace(/^\//, ''); // Remove extra leading slash
|
|
9
8
|
|
|
10
9
|
const prefixRegex = new RegExp(`^${escapeStringRegexp(protocol)}(/)*${host.split('.').map(it => it === '*' ? '[^/]+' : escapeStringRegexp(it)).join('\\.')}`);
|
|
11
10
|
const normalizedURL = url.replace(/\/+/g, '/');
|
|
12
|
-
|
|
13
11
|
if (prefixRegex.test(normalizedURL)) {
|
|
14
12
|
return normalizedURL.replace(prefixRegex, '');
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
return undefined;
|
|
19
16
|
}
|
|
20
17
|
//# sourceMappingURL=extractPathFromURL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["escapeStringRegexp","extractPathFromURL","prefixes","url","prefix","protocol","match","host","replace","RegExp","prefixRegex","split","map","it","join","normalizedURL","test","undefined"],"
|
|
1
|
+
{"version":3,"names":["escapeStringRegexp","extractPathFromURL","prefixes","url","prefix","protocol","match","host","replace","RegExp","prefixRegex","split","map","it","join","normalizedURL","test","undefined"],"sourceRoot":"../../src","sources":["extractPathFromURL.tsx"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AAErD,eAAe,SAASC,kBAAkB,CAACC,QAAkB,EAAEC,GAAW,EAAE;EAC1E,KAAK,MAAMC,MAAM,IAAIF,QAAQ,EAAE;IAAA;IAC7B,MAAMG,QAAQ,GAAG,kBAAAD,MAAM,CAACE,KAAK,CAAC,SAAS,CAAC,kDAAvB,cAA0B,CAAC,CAAC,KAAI,EAAE;IACnD,MAAMC,IAAI,GAAGH,MAAM,CAChBI,OAAO,CAAC,IAAIC,MAAM,CAAE,IAAGT,kBAAkB,CAACK,QAAQ,CAAE,EAAC,CAAC,EAAE,EAAE,CAAC,CAC3DG,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAA,CACrBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;;IAEvB,MAAME,WAAW,GAAG,IAAID,MAAM,CAC3B,IAAGT,kBAAkB,CAACK,QAAQ,CAAE,OAAME,IAAI,CACxCI,KAAK,CAAC,GAAG,CAAC,CACVC,GAAG,CAAEC,EAAE,IAAMA,EAAE,KAAK,GAAG,GAAG,OAAO,GAAGb,kBAAkB,CAACa,EAAE,CAAE,CAAC,CAC5DC,IAAI,CAAC,KAAK,CAAE,EAAC,CACjB;IAED,MAAMC,aAAa,GAAGZ,GAAG,CAACK,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAE9C,IAAIE,WAAW,CAACM,IAAI,CAACD,aAAa,CAAC,EAAE;MACnC,OAAOA,aAAa,CAACP,OAAO,CAACE,WAAW,EAAE,EAAE,CAAC;IAC/C;EACF;EAEA,OAAOO,SAAS;AAClB"}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Link","LinkingContext","NavigationContainer","ServerContainer","DarkTheme","DefaultTheme","ThemeProvider","useTheme","useLinkBuilder","useLinkProps","useLinkTo","useScrollToTop"],"
|
|
1
|
+
{"version":3,"names":["default","Link","LinkingContext","NavigationContainer","ServerContainer","DarkTheme","DefaultTheme","ThemeProvider","useTheme","useLinkBuilder","useLinkProps","useLinkTo","useScrollToTop"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASD,OAAO,IAAIE,cAAc,QAAQ,kBAAkB;AAC5D,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,uBAAuB;AACtE,SAASH,OAAO,IAAII,eAAe,QAAQ,mBAAmB;AAC9D,SAASJ,OAAO,IAAIK,SAAS,QAAQ,qBAAqB;AAC1D,SAASL,OAAO,IAAIM,YAAY,QAAQ,wBAAwB;AAChE,SAASN,OAAO,IAAIO,aAAa,QAAQ,yBAAyB;AAClE,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,oBAAoB;AACxD,cAAc,SAAS;AACvB,SAASR,OAAO,IAAIS,cAAc,QAAQ,kBAAkB;AAC5D,SAAST,OAAO,IAAIU,YAAY,QAAQ,gBAAgB;AACxD,SAASV,OAAO,IAAIW,SAAS,QAAQ,aAAa;AAClD,SAASX,OAAO,IAAIY,cAAc,QAAQ,kBAAkB;AAC5D,cAAc,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DarkTheme","dark","colors","primary","background","card","text","border","notification"],"
|
|
1
|
+
{"version":3,"names":["DarkTheme","dark","colors","primary","background","card","text","border","notification"],"sourceRoot":"../../src","sources":["DarkTheme.tsx"],"mappings":"AAEA,MAAMA,SAAgB,GAAG;EACvBC,IAAI,EAAE,IAAI;EACVC,MAAM,EAAE;IACNC,OAAO,EAAE,mBAAmB;IAC5BC,UAAU,EAAE,cAAc;IAC1BC,IAAI,EAAE,iBAAiB;IACvBC,IAAI,EAAE,oBAAoB;IAC1BC,MAAM,EAAE,iBAAiB;IACzBC,YAAY,EAAE;EAChB;AACF,CAAC;AAED,eAAeR,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DefaultTheme","dark","colors","primary","background","card","text","border","notification"],"
|
|
1
|
+
{"version":3,"names":["DefaultTheme","dark","colors","primary","background","card","text","border","notification"],"sourceRoot":"../../src","sources":["DefaultTheme.tsx"],"mappings":"AAEA,MAAMA,YAAmB,GAAG;EAC1BC,IAAI,EAAE,KAAK;EACXC,MAAM,EAAE;IACNC,OAAO,EAAE,kBAAkB;IAC3BC,UAAU,EAAE,oBAAoB;IAChCC,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE,oBAAoB;IAC5BC,YAAY,EAAE;EAChB;AACF,CAAC;AAED,eAAeR,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DefaultTheme","ThemeContext","createContext","displayName"],"
|
|
1
|
+
{"version":3,"names":["React","DefaultTheme","ThemeContext","createContext","displayName"],"sourceRoot":"../../src","sources":["ThemeContext.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,MAAMC,YAAY,gBAAGF,KAAK,CAACG,aAAa,CAAQF,YAAY,CAAC;AAE7DC,YAAY,CAACE,WAAW,GAAG,cAAc;AAEzC,eAAeF,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ThemeContext","ThemeProvider","value","children"],"
|
|
1
|
+
{"version":3,"names":["React","ThemeContext","ThemeProvider","value","children"],"sourceRoot":"../../src","sources":["ThemeProvider.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAOC,YAAY,MAAM,gBAAgB;AAOzC,eAAe,SAASC,aAAa,OAA6B;EAAA,IAA5B;IAAEC,KAAK;IAAEC;EAAgB,CAAC;EAC9D,oBACE,oBAAC,YAAY,CAAC,QAAQ;IAAC,KAAK,EAAED;EAAM,GAAEC,QAAQ,CAAyB;AAE3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ThemeContext","useTheme","theme","useContext"],"
|
|
1
|
+
{"version":3,"names":["React","ThemeContext","useTheme","theme","useContext"],"sourceRoot":"../../src","sources":["useTheme.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,eAAe,SAASC,QAAQ,GAAG;EACjC,MAAMC,KAAK,GAAGH,KAAK,CAACI,UAAU,CAACH,YAAY,CAAC;EAE5C,OAAOE,KAAK;AACd"}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
|
|
@@ -4,16 +4,13 @@ export default function useBackButton(ref) {
|
|
|
4
4
|
React.useEffect(() => {
|
|
5
5
|
const subscription = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
6
6
|
const navigation = ref.current;
|
|
7
|
-
|
|
8
7
|
if (navigation == null) {
|
|
9
8
|
return false;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
if (navigation.canGoBack()) {
|
|
13
11
|
navigation.goBack();
|
|
14
12
|
return true;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
return false;
|
|
18
15
|
});
|
|
19
16
|
return () => subscription.remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","BackHandler","useBackButton","ref","useEffect","subscription","addEventListener","navigation","current","canGoBack","goBack","remove"],"
|
|
1
|
+
{"version":3,"names":["React","BackHandler","useBackButton","ref","useEffect","subscription","addEventListener","navigation","current","canGoBack","goBack","remove"],"sourceRoot":"../../src","sources":["useBackButton.tsx"],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,cAAc;AAE1C,eAAe,SAASC,aAAa,CACnCC,GAA2D,EAC3D;EACAH,KAAK,CAACI,SAAS,CAAC,MAAM;IACpB,MAAMC,YAAY,GAAGJ,WAAW,CAACK,gBAAgB,CAC/C,mBAAmB,EACnB,MAAM;MACJ,MAAMC,UAAU,GAAGJ,GAAG,CAACK,OAAO;MAE9B,IAAID,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,KAAK;MACd;MAEA,IAAIA,UAAU,CAACE,SAAS,EAAE,EAAE;QAC1BF,UAAU,CAACG,MAAM,EAAE;QAEnB,OAAO,IAAI;MACb;MAEA,OAAO,KAAK;IACd,CAAC,CACF;IAED,OAAO,MAAML,YAAY,CAACM,MAAM,EAAE;EACpC,CAAC,EAAE,CAACR,GAAG,CAAC,CAAC;AACX"}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Set the document title for the active screen
|
|
5
4
|
*/
|
|
6
5
|
export default function useDocumentTitle(ref) {
|
|
7
6
|
let {
|
|
8
7
|
enabled = true,
|
|
9
|
-
formatter = (options, route) =>
|
|
10
|
-
var _options$title;
|
|
11
|
-
|
|
12
|
-
return (_options$title = options === null || options === void 0 ? void 0 : options.title) !== null && _options$title !== void 0 ? _options$title : route === null || route === void 0 ? void 0 : route.name;
|
|
13
|
-
}
|
|
8
|
+
formatter = (options, route) => (options === null || options === void 0 ? void 0 : options.title) ?? (route === null || route === void 0 ? void 0 : route.name)
|
|
14
9
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15
10
|
React.useEffect(() => {
|
|
16
11
|
if (!enabled) {
|
|
17
12
|
return;
|
|
18
13
|
}
|
|
19
|
-
|
|
20
14
|
const navigation = ref.current;
|
|
21
|
-
|
|
22
15
|
if (navigation) {
|
|
23
16
|
const title = formatter(navigation.getCurrentOptions(), navigation.getCurrentRoute());
|
|
24
17
|
document.title = title;
|
|
25
18
|
}
|
|
26
|
-
|
|
27
19
|
return navigation === null || navigation === void 0 ? void 0 : navigation.addListener('options', e => {
|
|
28
20
|
const title = formatter(e.data.options, navigation === null || navigation === void 0 ? void 0 : navigation.getCurrentRoute());
|
|
29
21
|
document.title = title;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useDocumentTitle","ref","enabled","formatter","options","route","title","name","useEffect","navigation","current","getCurrentOptions","getCurrentRoute","document","addListener","e","data"],"
|
|
1
|
+
{"version":3,"names":["React","useDocumentTitle","ref","enabled","formatter","options","route","title","name","useEffect","navigation","current","getCurrentOptions","getCurrentRoute","document","addListener","e","data"],"sourceRoot":"../../src","sources":["useDocumentTitle.tsx"],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B;AACA;AACA;AACA,eAAe,SAASC,gBAAgB,CACtCC,GAA2D,EAK3D;EAAA,IAJA;IACEC,OAAO,GAAG,IAAI;IACdC,SAAS,GAAG,CAACC,OAAO,EAAEC,KAAK,KAAK,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,KAAK,MAAID,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,IAAI;EACzC,CAAC,uEAAG,CAAC,CAAC;EAE5BR,KAAK,CAACS,SAAS,CAAC,MAAM;IACpB,IAAI,CAACN,OAAO,EAAE;MACZ;IACF;IAEA,MAAMO,UAAU,GAAGR,GAAG,CAACS,OAAO;IAE9B,IAAID,UAAU,EAAE;MACd,MAAMH,KAAK,GAAGH,SAAS,CACrBM,UAAU,CAACE,iBAAiB,EAAE,EAC9BF,UAAU,CAACG,eAAe,EAAE,CAC7B;MAEDC,QAAQ,CAACP,KAAK,GAAGA,KAAK;IACxB;IAEA,OAAOG,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEK,WAAW,CAAC,SAAS,EAAGC,CAAC,IAAK;MAC/C,MAAMT,KAAK,GAAGH,SAAS,CAACY,CAAC,CAACC,IAAI,CAACZ,OAAO,EAAEK,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEG,eAAe,EAAE,CAAC;MAEtEC,QAAQ,CAACP,KAAK,GAAGA,KAAK;IACxB,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDocumentTitle"],"
|
|
1
|
+
{"version":3,"names":["useDocumentTitle"],"sourceRoot":"../../src","sources":["useDocumentTitle.native.tsx"],"mappings":"AAAA,eAAe,SAASA,gBAAgB,GAAG;EACzC;AAAA"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import { getPathFromState, NavigationHelpersContext } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import LinkingContext from './LinkingContext';
|
|
4
|
-
|
|
5
4
|
const getRootStateForNavigate = (navigation, state) => {
|
|
6
5
|
const parent = navigation.getParent();
|
|
7
|
-
|
|
8
6
|
if (parent) {
|
|
9
7
|
const parentState = parent.getState();
|
|
10
8
|
return getRootStateForNavigate(parent, {
|
|
11
9
|
index: 0,
|
|
12
|
-
routes: [{
|
|
10
|
+
routes: [{
|
|
11
|
+
...parentState.routes[parentState.index],
|
|
13
12
|
state: state
|
|
14
13
|
}]
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return state;
|
|
19
17
|
};
|
|
18
|
+
|
|
20
19
|
/**
|
|
21
20
|
* Build destination link for a navigate action.
|
|
22
21
|
* Useful for showing anchor tags on the web for buttons that perform navigation.
|
|
23
22
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
23
|
export default function useLinkBuilder() {
|
|
27
24
|
const navigation = React.useContext(NavigationHelpersContext);
|
|
28
25
|
const linking = React.useContext(LinkingContext);
|
|
@@ -30,18 +27,17 @@ export default function useLinkBuilder() {
|
|
|
30
27
|
const {
|
|
31
28
|
options
|
|
32
29
|
} = linking;
|
|
33
|
-
|
|
34
30
|
if ((options === null || options === void 0 ? void 0 : options.enabled) === false) {
|
|
35
31
|
return undefined;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
const state = navigation ? getRootStateForNavigate(navigation, {
|
|
39
34
|
index: 0,
|
|
40
35
|
routes: [{
|
|
41
36
|
name,
|
|
42
37
|
params
|
|
43
38
|
}]
|
|
44
|
-
}) :
|
|
39
|
+
}) :
|
|
40
|
+
// If we couldn't find a navigation object in context, we're at root
|
|
45
41
|
// So we'll construct a basic state object to use
|
|
46
42
|
{
|
|
47
43
|
index: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPathFromState","NavigationHelpersContext","React","LinkingContext","getRootStateForNavigate","navigation","state","parent","getParent","parentState","getState","index","routes","useLinkBuilder","useContext","linking","buildLink","useCallback","name","params","options","enabled","undefined","path","config"],"
|
|
1
|
+
{"version":3,"names":["getPathFromState","NavigationHelpersContext","React","LinkingContext","getRootStateForNavigate","navigation","state","parent","getParent","parentState","getState","index","routes","useLinkBuilder","useContext","linking","buildLink","useCallback","name","params","options","enabled","undefined","path","config"],"sourceRoot":"../../src","sources":["useLinkBuilder.tsx"],"mappings":"AAAA,SACEA,gBAAgB,EAEhBC,wBAAwB,QAGnB,wBAAwB;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,OAAOC,cAAc,MAAM,kBAAkB;AAW7C,MAAMC,uBAAuB,GAA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