@jsenv/navi 0.29.300 → 0.29.301
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 +183 -33
- package/dist/dev/jsenv_navi.js.map +9 -9
- package/dist/jsenv_navi.js +140 -17
- package/dist/jsenv_navi.js.map +9 -9
- package/docs/interactions.md +6 -0
- package/docs/popup_open.md +26 -7
- package/package.json +1 -1
package/docs/interactions.md
CHANGED
|
@@ -98,6 +98,12 @@ which the carrying interactions answer with).
|
|
|
98
98
|
| `pan` `zoom` | a surface under the hand, or under a wheel |
|
|
99
99
|
| `"keyboard:<shortcut>"` | keys, e.g. `"keyboard:ctrl+backspace"` |
|
|
100
100
|
|
|
101
|
+
Two holds on one press — a `longpress` declared on something inside an
|
|
102
|
+
element that declares one too — are answered by the nearer one, the way a
|
|
103
|
+
click is the innermost target's: the inner hold fires, the outer wait is given
|
|
104
|
+
up. Delays being equal; an outer hold made shorter than the inner one fires
|
|
105
|
+
first.
|
|
106
|
+
|
|
101
107
|
A name nothing knows how to detect produces a dev warning naming the detectors
|
|
102
108
|
that exist. The carrying family and the two surface streams each have a file of
|
|
103
109
|
their own — [drag_interactions.md](./drag_interactions.md) and
|
package/docs/popup_open.md
CHANGED
|
@@ -409,8 +409,9 @@ The picker's `action` runs on the trigger, not in the popup: it is dispatched
|
|
|
409
409
|
on the close that keeps, and the popup goes while it runs. So what is still on
|
|
410
410
|
screen answers for the write — `aria-busy` and the loading outline on the
|
|
411
411
|
trigger while the request is out, the error callout on it if the server
|
|
412
|
-
refuses, and the value rolled back to the last accepted one
|
|
413
|
-
|
|
412
|
+
refuses, and the value rolled back to the last accepted one — on by default
|
|
413
|
+
for a picker, and what one wants: nobody is left mid-edit behind a closed
|
|
414
|
+
popup, and the card goes on saying what the server knows. A
|
|
414
415
|
card that IS the trigger (`variant="bare"`, the card as `ui`) therefore waits
|
|
415
416
|
as a card and is refused as a card, wherever in the tree the sheet was written.
|
|
416
417
|
|
|
@@ -422,9 +423,6 @@ as a card and is refused as a card, wherever in the tree the sheet was written.
|
|
|
422
423
|
ui={<MatchCard match={match} />}
|
|
423
424
|
value={match}
|
|
424
425
|
action={(next) => MATCH.PATCH({ id: match.id, ...next })}
|
|
425
|
-
// the draft is what the person typed, and the sheet is the only place it
|
|
426
|
-
// can be found again: keep it when the server says no
|
|
427
|
-
resetOnError={false}
|
|
428
426
|
>
|
|
429
427
|
<ControlGroup>
|
|
430
428
|
<MatchCard match={match} editable />
|
|
@@ -434,6 +432,16 @@ as a card and is refused as a card, wherever in the tree the sheet was written.
|
|
|
434
432
|
</Picker>
|
|
435
433
|
```
|
|
436
434
|
|
|
435
|
+
The card shows the answer the moment the sheet leaves when its `ui` is drawn
|
|
436
|
+
from what the picker holds rather than from what the caller knows — the same
|
|
437
|
+
state navi's own default `ui` reads, rolled back by `resetOnError`, so nothing
|
|
438
|
+
about the pending value is the caller's to keep or to put back. Two ways to
|
|
439
|
+
read it: `ui={MatchCard}` hands the component `value`, `loading` and
|
|
440
|
+
`interactive` as props; `ui={<MatchCard match={match} />}` keeps the caller's
|
|
441
|
+
own props and reads the same three with `usePickerState()` inside. The
|
|
442
|
+
`loading` is the wait: navi's loading outline is a two-pixel run around the
|
|
443
|
+
box, which a card-sized trigger draws its own waiting state for.
|
|
444
|
+
|
|
437
445
|
What the picker measures as "changed since open" is what its mirrored group
|
|
438
446
|
holds. A piece of the answer living outside the controls — a seating
|
|
439
447
|
rearranged by drag, kept in component state — has to be held by a control in
|
|
@@ -442,8 +450,19 @@ as nothing changed and nothing runs.
|
|
|
442
450
|
|
|
443
451
|
Two props finish the construct. `openOn="longpress"` (or
|
|
444
452
|
`["longpress", "contextmenu"]`) makes the hold what opens it, so a tap on the
|
|
445
|
-
card stays a tap — what a card in a list needs
|
|
446
|
-
|
|
453
|
+
card stays a tap — what a card in a list needs: the drawing gets its pointer
|
|
454
|
+
back, a link in it navigates, a button in it presses, a picker in it opens on
|
|
455
|
+
its own click, with nothing to declare. Two pickers on one card is the score
|
|
456
|
+
sheet inside the edit card (`12_picker_card_demo.html`): the inner one names
|
|
457
|
+
the card as its `anchor` so it lifts the whole card, and says `standalone` so
|
|
458
|
+
its value stays its own. One card, one wait: each picker wears the other's
|
|
459
|
+
run through `loading` (from its `onActionStart`/`onActionEnd`), so while
|
|
460
|
+
either write is out the hold and the click are both refused, with the busy
|
|
461
|
+
reason where the finger is — the click only once the score picker says
|
|
462
|
+
`openWhileReadOnly={false}`: a busy picker otherwise still opens, to be read,
|
|
463
|
+
and a sheet of fields to fill in is not that. A hold declared inside the card answers before the
|
|
464
|
+
card's own: the nearer hold takes the press. `animation="growing"` with
|
|
465
|
+
`dialogSizeFromAnchor` (as wide as the card, floor and ceiling),
|
|
447
466
|
`popupBackgroundColor="transparent"` and `popupBoxShadow="none"` lifts the
|
|
448
467
|
card out of its place and puts it back (`data-grow` on the card inside the
|
|
449
468
|
sheet; see Dialog's own `animation`). `12_picker_card_demo.html` shows all of
|