@jsenv/navi 0.29.457 → 0.29.459

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.
@@ -145,6 +145,24 @@ that asks for nothing (`() => true`).
145
145
  `routeAction(route, action, undefined, { prefetch: false })` keeps a param-less
146
146
  read that is not worth a hover out of it.
147
147
 
148
+ A page only some readers may download keeps its condition out of the params and
149
+ says it with `when`: a condition on app state, not on the address, so the link
150
+ still prefetches the action, as long as the condition holds when the pointer
151
+ arrives. A reader for whom it does not hold downloads nothing, not even by
152
+ typing the address.
153
+
154
+ ```js
155
+ const VIDEO_PAGE_CODE = routeAction(
156
+ VIDEO_ROUTE,
157
+ () => import("./video_page.jsx").then((m) => m.VideoPage),
158
+ undefined,
159
+ { when: () => meIsAdminSignal.value },
160
+ );
161
+ ```
162
+
163
+ The link reads `when` as it is at that moment, not as the address it leads to
164
+ will make it: a condition that reads the address belongs in the params.
165
+
148
166
  A prefetch that fails is not reported: nothing on screen asked for it. The failure
149
167
  stays on the action, and a failed action is run again by whatever asks next — the
150
168
  arrival, which shows its own failure, and every later hover alike.
@@ -784,8 +784,10 @@ Every piece of it answers something:
784
784
  off screen;
785
785
  - **no `defineRouteTransition` for it.** The page beneath does not change, so
786
786
  there is no pair of pages to move between — route transitions are for pages
787
- replacing pages ([route_transitions.md](./route_transitions.md)). When a link
788
- inside the layer does change it, see
787
+ replacing pages ([route_transitions.md](./route_transitions.md)). Nor does
788
+ what is open on it: a popup or a section kept with `navState` stays open under
789
+ the layer ([popup_open.md](./popup_open.md#navstate--the-history-entry-holds-it)).
790
+ When a link inside the layer does change the page, see
789
791
  [below](#a-link-inside-the-layer-leads-to-a-page).
790
792
 
791
793
  ### Places inside the layer
@@ -680,6 +680,23 @@ picker open and come back to is a new mount, and the state stays in the entry
680
680
  with nothing to read it (navi warns). A picker whose popup leads somewhere, a
681
681
  link inside it, has an `id`.
682
682
 
683
+ What a new entry inherits is decided by the page, not by the address. A push to
684
+ another path starts its entry empty: a popup open on the page being left
685
+ describes that page alone, and carried onto the next one it would open whatever
686
+ mounts there under the same key. A push that keeps the path — a
687
+ [layer](./navigation.md#a-layer-over-the-screen-what-its-address-may-say)
688
+ opening over the page, a
689
+ [state whose values are places](./navigation.md#a-state-whose-values-are-places-history-push)
690
+ — stacks an entry over a page that is still mounted, and that entry starts with
691
+ what the one below it held: an `Expandable` section open under the layer stays
692
+ open, and closing the layer finds it as it was, with nothing played again. The
693
+ scroll reads the same rule
694
+ ([navigation.md](./navigation.md#where-a-navigation-lands-the-scroll)).
695
+
696
+ A link inside the popup follows the same rule: one to the same path with other
697
+ search params leaves the popup open on the entry it pushes. A link whose press
698
+ is a choice that ends the popup says so itself, with `command="--navi-close"`.
699
+
683
700
  The two meet when the signal IS a route's: a search-param `stateSignal` given to
684
701
  `signal` puts the open state in the address itself, where a link can point at
685
702
  it — the shape of a popup that is a LAYER over the screen, whose address is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.457",
3
+ "version": "0.29.459",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {