@jsenv/navi 0.29.82 → 0.29.83
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/dist/jsenv_navi.js +37 -1
- package/dist/jsenv_navi.js.map +8 -4
- package/docs/navigation.md +25 -3
- package/package.json +1 -1
package/docs/navigation.md
CHANGED
|
@@ -243,6 +243,27 @@ gives it a `view-transition-name` of its own: the browser then moves it on the
|
|
|
243
243
|
same clock as any transition playing — including a `RouteTravel` swipe, with no
|
|
244
244
|
wiring between the two.
|
|
245
245
|
|
|
246
|
+
A row of tabs is a lateral move: the neighbour is one finger away, and going
|
|
247
|
+
there is not going one step deeper. `replace` says exactly that — the
|
|
248
|
+
destination takes the place of the current history entry instead of stacking
|
|
249
|
+
onto it, so the whole row weighs one entry and the back button (the arrow at the
|
|
250
|
+
top, the phone's own) leaves by where the reader came in:
|
|
251
|
+
|
|
252
|
+
```jsx
|
|
253
|
+
<Link route={CANDIDATE_GAMES_ROUTE} variant="tab" replace>
|
|
254
|
+
Candidatures
|
|
255
|
+
</Link>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
The link stays a link — an address, a middle click, the keyboard, `aria-current`
|
|
259
|
+
— only the way there changes. It is the same word as `navTo(url, { replace:
|
|
260
|
+
true })` and `route.redirectTo()`.
|
|
261
|
+
|
|
262
|
+
A replaced entry inherits the state of the one it takes the place of (so does
|
|
263
|
+
`route.redirectTo()`): **an entry's state does not say how it arrived**. An app
|
|
264
|
+
keeping its own count of how deep it stands cannot read it back from
|
|
265
|
+
`history.state` — it has to write it down as it navigates.
|
|
266
|
+
|
|
246
267
|
## Tabs that travel: `RouteTravel`
|
|
247
268
|
|
|
248
269
|
`<RouteTravel>` wraps the `<Route>` tree of a row of tabs and makes every change
|
|
@@ -276,9 +297,10 @@ place, not a step along the row, and it plays no movement. `axis="y"` lays the
|
|
|
276
297
|
pages out as a column instead: forward is then the page rising and the next one
|
|
277
298
|
coming up from below.
|
|
278
299
|
|
|
279
|
-
A swipe **replaces** the current history entry
|
|
280
|
-
|
|
281
|
-
|
|
300
|
+
A swipe **replaces** the current history entry, and a tab pressed says the same
|
|
301
|
+
thing when its link asks for it (`<Link replace>`, see above) — the two gestures
|
|
302
|
+
towards the same neighbour must not write two different histories. `onTravel`
|
|
303
|
+
decides otherwise.
|
|
282
304
|
|
|
283
305
|
Several `RouteTravel` boxes may live on one page — a section of the path and a
|
|
284
306
|
search param of the root route are two rows of tabs, both live — and only the one
|