@jsenv/navi 0.29.419 → 0.29.420
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 +392 -153
- package/dist/dev/jsenv_navi.js.map +30 -30
- package/dist/jsenv_navi.js +373 -146
- package/dist/jsenv_navi.js.map +30 -30
- package/docs/create_and_edit.md +10 -0
- package/docs/data_states.md +6 -7
- package/docs/form_changed.md +5 -3
- package/package.json +2 -2
package/docs/create_and_edit.md
CHANGED
|
@@ -215,6 +215,16 @@ By hand this is a `useEffect` keyed on `game?.id` — `[game]` is the natural,
|
|
|
215
215
|
wrong, thing to write — and a passive effect is too late: the screen opens
|
|
216
216
|
**already changed**, and Save sends the resource back untouched.
|
|
217
217
|
|
|
218
|
+
`defaultValue={game?.name}` on the fields needs no copy — a field follows a new
|
|
219
|
+
default while it holds no edit
|
|
220
|
+
([control_value.md](./control_value.md#a-defaultvalue-follows-what-it-was-read-from))
|
|
221
|
+
— and fails the same way: a default is a suggestion the form does not hold, and
|
|
222
|
+
confirming one is an answer
|
|
223
|
+
([form_changed.md](./form_changed.md#what-counts-as-already-held)), so the
|
|
224
|
+
untouched game goes out on the first Save. What the copy gives up is that
|
|
225
|
+
follow: a game moved while the screen is open stays as `onLoad` found it — which
|
|
226
|
+
a screen left on saving, and copied afresh when it opens again, can afford.
|
|
227
|
+
|
|
218
228
|
**Or the screen waits, showing nothing of the form**: a skeleton until the
|
|
219
229
|
resource is there, then the form holding its values from its first render —
|
|
220
230
|
for a screen that can be blanked without the person losing their place.
|
package/docs/data_states.md
CHANGED
|
@@ -73,14 +73,13 @@ means something different:
|
|
|
73
73
|
whose params name a row the store already holds — read earlier by a `GET_MANY`,
|
|
74
74
|
a relation, a list — starts on the second line, not the first: the row is
|
|
75
75
|
drawn, the request goes out behind it, and a failure lands beside it like any
|
|
76
|
-
refresh failure. A
|
|
77
|
-
|
|
76
|
+
refresh failure. A `GET` of a row the store lacks starts on the first line, so
|
|
77
|
+
what is drawn is never a different row — a `GET` bound through a signal (a route
|
|
78
|
+
action, a `bindParams` holding one) included, when the signal moves to other
|
|
79
|
+
params. A row known from the previous page load counts too, when the resource
|
|
80
|
+
asks for it:
|
|
78
81
|
[`persist`](./resource.md#persist-the-last-answer-drawn-again-after-a-reload)
|
|
79
|
-
puts a reload on the second line as well.
|
|
80
|
-
route action, a `bindParams` holding one — is on the second line when the signal
|
|
81
|
-
moves to params it has not answered yet, with the previous params' row: its
|
|
82
|
-
`data` stays that row until the new answer lands, whether or not the store holds
|
|
83
|
-
the new one.
|
|
82
|
+
puts a reload on the second line as well.
|
|
84
83
|
|
|
85
84
|
**The emptiness test is `data === undefined`, never `loading`.** Reading
|
|
86
85
|
`loading` as "there is nothing to display" blanks the screen on every refresh —
|
package/docs/form_changed.md
CHANGED
|
@@ -16,9 +16,11 @@ later.
|
|
|
16
16
|
|
|
17
17
|
## Sending nothing is the default
|
|
18
18
|
|
|
19
|
-
Submitting a form nobody touched — one just rendered, one
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
Submitting a form nobody touched — one just rendered, one reopened and left
|
|
20
|
+
alone — runs **no action**. No request, nothing in the network tab. The
|
|
21
|
+
exception is a field still showing its `defaultValue`: confirming a suggestion
|
|
22
|
+
is an answer, sent once (see
|
|
23
|
+
[What counts as already held](#what-counts-as-already-held)).
|
|
22
24
|
|
|
23
25
|
Everything around the action still happens: the constraints are checked, and
|
|
24
26
|
what follows the send still follows it — the popup closes, the slide moves on,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/navi",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.420",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Library of components including navigation to create frontend applications",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"preact": "^11.0.0-rc.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@jsenv/dom": "0.17.
|
|
37
|
+
"@jsenv/dom": "0.17.86",
|
|
38
38
|
"@jsenv/humanize": "1.8.6",
|
|
39
39
|
"@jsenv/validity": "0.4.5"
|
|
40
40
|
},
|