@jsenv/navi 0.29.163 → 0.29.164

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.
@@ -34,6 +34,37 @@ of a bottom bar, side by side, neither before the other — a cut is the honest
34
34
  rendering of that fact. Resist the urge to fill every navigation with movement;
35
35
  declare the relations that exist and let the rest cut.
36
36
 
37
+ ## A page opened from anywhere
38
+
39
+ One shape of page has no pair to write. Its door is in the fixed furniture — a
40
+ gear in the top bar, a "+" in the tab bar — so it is opened from every screen of
41
+ the app and closed back onto whichever one the reader was on. The relation is
42
+ real and it is a single sentence ("the settings come down over the screen you
43
+ were on, and go back up"), but there are twenty-five `from` pages and not one of
44
+ them is the point.
45
+
46
+ Leave the `from` out:
47
+
48
+ ```js
49
+ defineRouteTransition(null, SETTINGS_PAGE, "cover-top");
50
+ ```
51
+
52
+ Arriving there plays forward from wherever, leaving plays back to wherever. The
53
+ back half is what this exists for: closing such a page is almost always a back —
54
+ the close button running `--navi-nav-back`, the browser's back button, a swipe —
55
+ and a traversal carries no link and therefore no request, so `routeTransition` on
56
+ the way in has no counterpart on the way out. Written on the destination, the way
57
+ out is found the same way the way in was, with nothing to remember per history
58
+ entry.
59
+
60
+ It is tried last, after every written pair, so a pair naming the same destination
61
+ still owns its crossing — the map, where it was drawn, is more precise than "from
62
+ wherever". And it is not `defineRouteDefaultTransition`: a default is about every
63
+ navigation nothing was said about, this is about ONE destination whose door
64
+ happens to be everywhere. Write it for a page whose door really is furniture; a
65
+ page reached from a screen has that screen to be paired with, and the pair says
66
+ more.
67
+
37
68
  ## Choosing a movement
38
69
 
39
70
  - **`slide-x`** — going INTO something: a list item opened, a card followed, a
@@ -42,10 +73,13 @@ declare the relations that exist and let the rest cut.
42
73
  taught.
43
74
  - **`slide-y`** — the same relation on a vertical arrangement, when the layout
44
75
  genuinely reads as a column.
45
- - **`cover-x` / `cover-y`** — a page that INTERRUPTS rather than continues:
46
- settings, a composer, anything modal-like that one returns from to find the
47
- page beneath unchanged. The covered page holding still is the point — it
48
- promises "you are not leaving, this is on top".
76
+ - **`cover-right` / `cover-left` / `cover-bottom` / `cover-top`** — a page that
77
+ INTERRUPTS rather than continues: settings, a composer, anything modal-like
78
+ that one returns from to find the page beneath unchanged. The covered page
79
+ holding still is the point — it promises "you are not leaving, this is on
80
+ top". The edge named is the one the page comes IN from, and the one to name is
81
+ where its door is: a composer opened from a bottom bar covers from the bottom,
82
+ settings pulled down from a top bar cover from the top.
49
83
  - **`zoom`** — a detail brought closer: a photo, a card expanded into a page.
50
84
  - **`cross-fade`** — a soft change with no spatial claim. Use it where a cut
51
85
  feels harsh but no direction would be true.
@@ -284,7 +318,7 @@ const ALERT_CREATE_ROUTE = route("/me/alerts/create");
284
318
  const ALERT_DETAIL_ROUTE = route("/me/alerts/:alertId"); // "create" is an alertId
285
319
 
286
320
  defineRouteTransition(ALERTS_ROUTE, ALERT_DETAIL_ROUTE, "slide-x");
287
- defineRouteTransition(ALERTS_ROUTE, ALERT_CREATE_ROUTE, "cover-y");
321
+ defineRouteTransition(ALERTS_ROUTE, ALERT_CREATE_ROUTE, "cover-bottom");
288
322
  ```
289
323
 
290
324
  On `/me/alerts/create` both detail and create are current; the page mentioned
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.163",
3
+ "version": "0.29.164",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {