@jsenv/navi 0.29.311 → 0.29.314

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/docs/actions.md CHANGED
@@ -325,10 +325,17 @@ Which instance that is depends on whether the control carries a value:
325
325
  what it runs **is** the instance it was handed. `useActionStatus` on that
326
326
  instance sees the click, the run, the data.
327
327
  - a control that **carries a value** — an input, a form — runs the child
328
- instance bound to that value. Those params are not the caller's, so neither
329
- is the status: the instance the caller holds stays idle while the control's
330
- run moves. Read the effect where it lands (the store, for a resource verb),
331
- or listen to the run itself, below.
328
+ instance bound to that value: the value merged over the params the caller
329
+ bound, and a value that is not an object **replaces them outright**. A
330
+ checkbox handed `ACTION.bindParams({ id })` runs `ACTION(true)`, and `id`
331
+ is gone — the call fails wherever it needed it, far from the binding that
332
+ lost it. Bind params to a control that holds a value only when the value
333
+ completes them (a form's object over a bound `{ id }`); when it would
334
+ replace them, pass a function and keep the params in its closure:
335
+ `action={() => ACTION({ id, sure: true })}`. Those params are not the
336
+ caller's, so neither is the status: the instance the caller holds stays idle
337
+ while the control's run moves. Read the effect where it lands (the store,
338
+ for a resource verb), or listen to the run itself, below.
332
339
 
333
340
  Every control with an `action` reports the run it performs, whichever instance
334
341
  that is:
@@ -54,14 +54,21 @@ So the choice is not about the value, it is about whether this cluster is a
54
54
  - something the user sends → `Form`.
55
55
 
56
56
  A `<Form>` inside a `<Form>` is legal — the inner one becomes a group without
57
- the `<form>` element — but it carries all of the above with it: its own
58
- reference, its own "nothing changed", its own submit story. Grouping three
59
- fields into a sub-object should cost none of that.
57
+ the `<form>` element — and it is a **second question**, not a sub-object of the
58
+ first: what it holds is its own, and the form around it never sees it. Not in
59
+ the value it sends, not in its "nothing changed", and not in the constraints it
60
+ checks before sending — a required field in a popup nobody opened cannot refuse
61
+ the outer submit and point at something the screen is not showing.
62
+
63
+ So the inner form carries all of the above with it: its own reference, its own
64
+ "nothing changed", its own submit story. Grouping three fields into a sub-object
65
+ should cost none of that — that is a `ControlGroup`.
60
66
 
61
67
  ## Naming, and what a nameless group does
62
68
 
63
- A group's `name` is the key its value lands under, in the group above it. This
64
- is true of a `ControlGroup` and of a nested `Form` alike.
69
+ A group's `name` is the key its value lands under, in the group above it — a
70
+ `ControlGroup`, or a `Form` inside something that is not a form (a picker, say).
71
+ A form inside a form lands nowhere: it answers for itself, named or not.
65
72
 
66
73
  Left nameless, a group is a **grouping**: it exists to hold its children
67
74
  together (shared navigation, a visual cluster) without claiming a key, and what
@@ -109,7 +116,9 @@ Two things to get right:
109
116
  only one read back. Two controls side by side in a popup is the shape to
110
117
  avoid — the second is neither filled nor collected, and navi says so in dev.
111
118
  Wrap them in one `ControlGroup` (or one `Form`, when the popup has a send of
112
- its own).
119
+ its own — but only while the picker itself is not inside a form, since a form
120
+ inside a form answers for itself and the picker would be left with nothing to
121
+ fill).
113
122
  - **The value travels by name.** What the picker was given goes down into the
114
123
  group, which hands each named child its own key; a nameless grouping inside
115
124
  receives the whole object and picks out what it names. Give a picker of this
@@ -57,7 +57,11 @@ consequence: the component stays, so it is still there to offer the way out.
57
57
 
58
58
  A component that delegates nothing needs no `<Loading>` above it. One that
59
59
  delegates its wait does, since that is where the suspension lands, and navi says
60
- so rather than leaving the subtree blank.
60
+ so rather than leaving the subtree blank. Inside a popup that boundary is the
61
+ popup's own — `{ loading: true }`, or a `<Loading>` inside the popup — never
62
+ the one above the page: a suspension landing there takes the popup away with
63
+ the page it copies, and the popup does not open at all (see
64
+ [popup_open.md](./popup_open.md#a-popup-that-loads-data)).
61
65
 
62
66
  ## `data` and `loading` are independent
63
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.311",
3
+ "version": "0.29.314",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {