@jsenv/navi 0.29.482 → 0.29.483
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/dev/jsenv_navi.js +591 -96
- package/dist/dev/jsenv_navi.js.map +32 -28
- package/dist/jsenv_navi.js +388 -100
- package/dist/jsenv_navi.js.map +30 -28
- package/docs/data_states.md +6 -0
- package/docs/dynamic_import.md +4 -2
- package/docs/navigation.md +9 -1
- package/docs/popup_open.md +9 -1
- package/docs/testid.md +3 -1
- package/package.json +1 -1
package/docs/data_states.md
CHANGED
|
@@ -38,6 +38,12 @@ the component reads:
|
|
|
38
38
|
| `error: true` | suspends | `error`, plus `dismissError` |
|
|
39
39
|
| both | `loading` | `error` |
|
|
40
40
|
|
|
41
|
+
A delegated failure is thrown whatever the action still holds: a refresh that
|
|
42
|
+
fails — the rerun when the app comes back to the foreground, a dependency's —
|
|
43
|
+
takes rows that were on screen to the boundary, whose fallback replaces them. A
|
|
44
|
+
reader with something to keep showing asks for `error: true`, and each reader of
|
|
45
|
+
a shared action decides this on its own.
|
|
46
|
+
|
|
41
47
|
The invariant that makes this worth relying on: **`loading: true` never
|
|
42
48
|
suspends.** Not while the action runs, not while a debounced binding is
|
|
43
49
|
settling, not while it holds params nobody has started yet, not after a failure
|
package/docs/dynamic_import.md
CHANGED
|
@@ -214,8 +214,10 @@ failed as failed: a second `import()` of the same address is refused without a
|
|
|
214
214
|
request, for the life of the document. So a retry has nothing to do —
|
|
215
215
|
`error.action.rerun()` fails again at once, on the same failure — and the one way
|
|
216
216
|
out is a fresh document: **`window.location.reload()`**, which the screen offers
|
|
217
|
-
in words the reader understands. navi
|
|
218
|
-
|
|
217
|
+
in words the reader understands. Not navi's own `reload()`: it asks the route
|
|
218
|
+
actions again inside this same document, and the import fails again at once.
|
|
219
|
+
navi does not reload on its own: a document reloading itself is a loop waiting
|
|
220
|
+
to happen.
|
|
219
221
|
|
|
220
222
|
The page or the component reading its code says it where it stands, as above. A
|
|
221
223
|
failure left to a boundary reaches it like a failed read does; a boundary that
|
package/docs/navigation.md
CHANGED
|
@@ -388,7 +388,12 @@ section of pages shares one:
|
|
|
388
388
|
<Route>
|
|
389
389
|
<ErrorBoundary
|
|
390
390
|
fallback={({ error, resetError }) => (
|
|
391
|
-
<ErrorScreen
|
|
391
|
+
<ErrorScreen
|
|
392
|
+
error={error}
|
|
393
|
+
// the rerun lifts the boundary; resetError only dismisses, and a
|
|
394
|
+
// page that never loaded has nothing to show once dismissed
|
|
395
|
+
onRetry={error.action ? () => error.action.rerun() : resetError}
|
|
396
|
+
/>
|
|
392
397
|
)}
|
|
393
398
|
>
|
|
394
399
|
<Loading fallback={<GameSkeleton />}>
|
|
@@ -452,6 +457,9 @@ with `currentAlso={[PLACE_ROUTE]}`, and `currentExcept` names a place under the
|
|
|
452
457
|
section it does NOT stand for. Both amend what a link claims about itself and
|
|
453
458
|
nothing else — neither is an answer to a route that lies about where the reader
|
|
454
459
|
is (see [what its address may say](#a-layer-over-the-screen-what-its-address-may-say)).
|
|
460
|
+
A bar entry drawn as a button for its press feedback says the same with
|
|
461
|
+
`<Button route currentAlso currentExcept>`: it is drawn as a link and wears
|
|
462
|
+
`aria-current="page"` from the same reading.
|
|
455
463
|
|
|
456
464
|
The routing takes a plain click that moves this tab, and nothing else. A link
|
|
457
465
|
with `target="_blank"` (or any `target` other than `_self`) opens the app in that
|
package/docs/popup_open.md
CHANGED
|
@@ -455,7 +455,10 @@ None of them is "one popup per row of a list", which is what a picker is for.
|
|
|
455
455
|
|
|
456
456
|
`onOpen` is called on every open (for when, see
|
|
457
457
|
[above](#onopen-runs-before-the-popup-has-built-anything)), and `onClose` on
|
|
458
|
-
every real close, with `detail.isCancel` when the close meant "revert"
|
|
458
|
+
every real close, with `detail.isCancel` when the close meant "revert" and
|
|
459
|
+
`detail.isConfirm` when it was a `--navi-confirm` saying yes — so a shared Dialog
|
|
460
|
+
asking a yes/no question after a gesture already over answers it there
|
|
461
|
+
(`onClose={(e) => e.detail.isConfirm && release()}`). Neither
|
|
459
462
|
can veto: `onClose` is the close happening, not a request to close. The refusals
|
|
460
463
|
are navi's: a close over a control mid-action, and a `Picker`'s close over a
|
|
461
464
|
value that does not validate.
|
|
@@ -923,6 +926,11 @@ option is the component drawing its own wait
|
|
|
923
926
|
(`useAsyncData(action, { loading: true })`); what is not an option is neither.
|
|
924
927
|
Both are on `src/layout/demos/13_popup_loading_demo.html`.
|
|
925
928
|
|
|
929
|
+
The failure has no boundary of its own either: delegated, it lands on the
|
|
930
|
+
nearest `<ErrorBoundary>` above the popup — the one holding the page, whose
|
|
931
|
+
fallback replaces the page under it. A read inside a popup takes `error: true`
|
|
932
|
+
and says the failure where it stands.
|
|
933
|
+
|
|
926
934
|
What the popup gains is everything a page has: the request leaves **with the
|
|
927
935
|
screen**, in parallel with the rest of what the address needs, instead of behind
|
|
928
936
|
the gesture that opens the popup; `useAsyncData` reads it (see
|
package/docs/testid.md
CHANGED
|
@@ -149,7 +149,9 @@ or waits for it to show, targets what the row draws: a testid on its content.
|
|
|
149
149
|
What navi builds itself is named through props. A `data-testid` on a `<Picker>`
|
|
150
150
|
names the trigger; `popupTestId` names the popup it builds (the callout, under
|
|
151
151
|
`mode="callout"`), and `confirmTestId` / `cancelTestId` the yes and no buttons
|
|
152
|
-
of a `type="confirm"` picker's default body
|
|
152
|
+
of a `type="confirm"` picker's default body. Likewise `menuTestId` names a
|
|
153
|
+
`SplitButton`'s chevron half, and `previousTestId` / `nextTestId` a `Spin`'s
|
|
154
|
+
two ways out (a `DaySpin`'s, a `NumberSpin`'s):
|
|
153
155
|
|
|
154
156
|
```jsx
|
|
155
157
|
<Picker data-testid="tie-break" popupTestId="tie-break-sheet">
|