@jsenv/navi 0.29.107 → 0.29.108

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.
@@ -36,7 +36,8 @@ duplicates are fine.
36
36
 
37
37
  The form has answered its question; `command` says what the screen does about
38
38
  it — dismiss the popup (`--navi-close`), move on the slide map
39
- (`--navi-left`…), go to a page (`--navi-nav-to:/games/42`), stay put
39
+ (`--navi-left`…), go to a page (`--navi-nav-to:/games/42`), go back to the one
40
+ the reader came from (`--navi-nav-back:/games`), stay put
40
41
  (`--navi-void`). Left out, the surface the form sits in decides: a popup closes,
41
42
  a slide goes on, a form on a page does nothing.
42
43
 
@@ -384,7 +384,8 @@ top, the phone's own) leaves by where the reader came in:
384
384
 
385
385
  The link stays a link — an address, a middle click, the keyboard, `aria-current`
386
386
  — only the way there changes. It is the same word as `navTo(url, { replace:
387
- true })` and `route.redirectTo()`.
387
+ true })` and `route.redirectTo()` — and as `<Button replace>`, on an `href` or
388
+ on a `--navi-nav-to` command.
388
389
 
389
390
  A replaced entry inherits the state of the one it takes the place of (so does
390
391
  `route.redirectTo()`): **an entry's state does not say how it arrived**. Only
@@ -427,6 +428,13 @@ back button would walk straight back into it — a loop with no way out of the
427
428
  app. Without a `fallback`, a `navBack()` with nothing of ours behind does
428
429
  nothing.
429
430
 
431
+ Said by a button, it is a command, the fallback being its argument the way
432
+ `--navi-nav-to` carries its destination:
433
+
434
+ ```jsx
435
+ <Button command={`--navi-nav-back:${USER_ME_ROUTE.buildUrl()}`}>←</Button>
436
+ ```
437
+
430
438
  ## Tabs that travel: `RouteTravel`
431
439
 
432
440
  `<RouteTravel>` wraps the `<Route>` tree of a row of tabs and makes every change
package/docs/testid.md CHANGED
@@ -83,12 +83,30 @@ error message, a section, a row — put the testid on the surrounding component
83
83
  (`<Field data-testid="email-field">`, `<Box data-testid="cart-row">`); anything
84
84
  built on `Box` forwards it to its own element.
85
85
 
86
+ A picker's popup is the one element the application does not render itself:
87
+ `<Picker>` builds it, so a `data-testid` on the picker names the trigger and
88
+ nothing names the popup. `popupTestId` does:
89
+
90
+ ```jsx
91
+ <Picker data-testid="tie-break" popupTestId="tie-break-sheet">
92
+
93
+ </Picker>
94
+ ```
95
+
96
+ Most tests do not need it — a testid on what the popup holds (`<Box
97
+ data-testid="place-pick">` among the children) names the screen, not the frame,
98
+ and is the better name for a test that reads or clicks the content. Reach for
99
+ `popupTestId` when the frame IS what the test looks at: a screenshot of the
100
+ popup's surface, its position, its size, its backdrop.
101
+
86
102
  ## What not to target
87
103
 
88
104
  Navi's own attributes are implementation, not a contract: `data-header`,
89
105
  `data-body`, `data-scrollable`, `data-variant`, `data-callout-*`,
90
- `navi-control*`, `.navi_*` class names, and the ids navi generates when none is
91
- given (`useId`). They change without notice and without a migration note.
106
+ `navi-control*`, `.navi_*` class names, the ids navi generates when none is
107
+ given (`useId`), and the ids it derives from yours (a picker's popup id is built
108
+ from the picker's, so the suffix is navi's even when the base is not). They
109
+ change without notice and without a migration note.
92
110
  Likewise a `view-transition-name` or a CSS variable: those exist to draw, not
93
111
  to be found.
94
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.107",
3
+ "version": "0.29.108",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {