@jsenv/navi 0.29.419 → 0.29.421
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 +2144 -1260
- package/dist/dev/jsenv_navi.js.map +34 -34
- package/dist/jsenv_navi.js +2115 -1239
- package/dist/jsenv_navi.js.map +34 -34
- package/docs/create_and_edit.md +10 -0
- package/docs/data_states.md +6 -7
- package/docs/form_changed.md +5 -3
- package/docs/popup_open.md +18 -8
- package/docs/scroll.md +28 -14
- 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/docs/popup_open.md
CHANGED
|
@@ -894,14 +894,24 @@ off it (the default of a picker told no value), fields a surrounding form
|
|
|
894
894
|
submits, a size measured from outside. `"idle"` is `"always"` minus the cost on
|
|
895
895
|
the render that draws the page.
|
|
896
896
|
|
|
897
|
-
Whatever the value but `"while-opened"`, intent on
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
897
|
+
Whatever the value but `"while-opened"`, intent on what opens the popup builds
|
|
898
|
+
the content ahead of the click, `onOpen` or not: a pointer over its anchor, or
|
|
899
|
+
focus landing in it. The anchor only says where the popup is placed, so what
|
|
900
|
+
counts is the control that intent is aimed at: the anchor itself when it is a
|
|
901
|
+
control, or the one the popup is written in (a picker's trigger). Any other
|
|
902
|
+
control inside the anchor keeps the intent for itself. A player's own picker,
|
|
903
|
+
inside a card that another picker opens from, warms the player's callout and
|
|
904
|
+
never the card's sheet; tiles anchored on the whole bar they sit in warm only
|
|
905
|
+
the menu of the tile under the pointer. A pointer on a trigger that a press does
|
|
906
|
+
not open — a picker with `openOn={[]}`, or one opened by a hold — warms nothing:
|
|
907
|
+
the card it draws is pressed all day for what it holds. Focus on it still warms,
|
|
908
|
+
since the keyboard opens it.
|
|
909
|
+
|
|
910
|
+
A `"while-opened"` popup is warmed only by a press on what opens it (a
|
|
911
|
+
`--navi-open` button, a picker's trigger when a press opens it, an expandable's
|
|
912
|
+
UI part), throws that content away when the press ends without opening it — one
|
|
913
|
+
content at a time — and is never warmed on a `Dialog`/`Popover` with an
|
|
914
|
+
`onOpen`: the one value where the content is always built after `onOpen`.
|
|
905
915
|
|
|
906
916
|
`"while-opened"` is for content whose fresh state is its initial state. An
|
|
907
917
|
untouched field does not need it to show a new `defaultValue`: it follows one
|
package/docs/scroll.md
CHANGED
|
@@ -136,7 +136,7 @@ makes that possible is `searchText` on the `List` — without it the list sees n
|
|
|
136
136
|
children and nothing else.
|
|
137
137
|
|
|
138
138
|
- **While the search is on**, the list scrolls back to its first row every time
|
|
139
|
-
the best matches change (
|
|
139
|
+
the best matches change (as many top rows as the window draws, by id and
|
|
140
140
|
`matchInfo.matchScore`), so a letter that promotes nobody new leaves the list
|
|
141
141
|
where the user put it.
|
|
142
142
|
- **When the search is emptied**, the list returns to the offset it was at when
|
|
@@ -286,13 +286,24 @@ sheet, a handful of tabs. A collection whose size the caller does not decide
|
|
|
286
286
|
</List>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
The run draws only the
|
|
290
|
-
|
|
291
|
-
scrollbar says how long the collection is and the DOM says how many
|
|
292
|
-
screen and some. The window slides as the user scrolls,
|
|
293
|
-
the
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
The run draws only the items inside the **render window** — `renderBudget`,
|
|
290
|
+
`"100item"` by default — and holds the room of the others with fillers, so the
|
|
291
|
+
scrollbar says how long the collection is and the DOM says how many items fit a
|
|
292
|
+
screen and some. The window slides as the user scrolls, three quarters of what
|
|
293
|
+
the screen leaves of it ahead of the direction the user goes, so the budget has
|
|
294
|
+
to exceed what the scroller shows at once, with room for that lookahead: the
|
|
295
|
+
list warns when it leaves less than two items beyond the screen.
|
|
296
|
+
|
|
297
|
+
The budget is a count of items or a size: `"300px"`, or `"150%"` of the
|
|
298
|
+
viewport of the box that scrolls the list. A size is for items that do not
|
|
299
|
+
weigh the same: a list mixing one-line items and full cards (a thread of past
|
|
300
|
+
games and games to come) holds ten times more of the first on a screen than of
|
|
301
|
+
the second. `"100item"` covers four screens of the one-line items and thirty of
|
|
302
|
+
the cards, and nobody scrolls to the thirtieth; a count right for the cards
|
|
303
|
+
leaves blank screens when a fling crosses the one-line items. With a size, the
|
|
304
|
+
window weighs the items it draws where they stand, and an item it has not drawn
|
|
305
|
+
yet like the drawn items next to it — items of one kind come together — then
|
|
306
|
+
weighs it again once it is drawn.
|
|
296
307
|
|
|
297
308
|
A run whose rows all fit the window is just rows: nothing is virtualized, and
|
|
298
309
|
it costs what the same rows would as children. There is no reason to hold back
|
|
@@ -304,12 +315,15 @@ A popup's content is built in the click that opens it (see
|
|
|
304
315
|
[popup_open.md](./popup_open.md)), and a page coming back in a route transition
|
|
305
316
|
is built in the transition's update callback: rows below the fold cost the same
|
|
306
317
|
there as rows on screen, and delay the movement. `renderBudget` takes
|
|
307
|
-
`{ initial, after }` for exactly this: `initial`
|
|
308
|
-
paints first
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
318
|
+
`{ initial, after }` for exactly this: `initial` for the picture the browser
|
|
319
|
+
paints first, counted from the item the list opens on, and `after` from the
|
|
320
|
+
paint on. `initial: "100%"` is the screen and nothing more, whatever the items
|
|
321
|
+
weigh: a few are drawn to be measured, and the window is sized on them before
|
|
322
|
+
the browser paints — a count (`initial: 6`) is a guess that holds for one kind
|
|
323
|
+
of item only. A position handed back with its `visibleCount` sizes that first
|
|
324
|
+
window itself, whatever `initial` says. The runs ask their source for a page of
|
|
325
|
+
items (`<List.Items pageSize>`, 100 by default) whatever either says, so the
|
|
326
|
+
smaller first window costs no second request.
|
|
313
327
|
|
|
314
328
|
The switch waits for the paint itself. Do not rebuild it with a `useEffect`
|
|
315
329
|
that widens a slice: preact runs a component's pending effects early when that
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/navi",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.421",
|
|
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
|
},
|