@jsenv/navi 0.29.141 → 0.29.142

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.
@@ -97,11 +97,24 @@ This is the same entry point the attributes go through: same target resolution,
97
97
  same command proxies, same events. The popup stays uncontrolled, and keeps its
98
98
  say over closing.
99
99
 
100
- `event` is the DOM event the decision came from. Pass it whenever there is one:
101
- it is chained into the request event, and that chain is what lets the popup
102
- handle focus correctly (which element to give focus back to, whether a
103
- mousedown's click must be swallowed). Omit it only when nothing user-initiated
104
- triggered the command.
100
+ `event` is what caused the decision, and it is mandatory — triggering a command
101
+ without one throws. It is chained into the request event, and that chain is what
102
+ lets the popup handle focus correctly (which element to give focus back to,
103
+ whether a mousedown's click must be swallowed) and what the debug panel groups
104
+ the whole sequence under.
105
+
106
+ Almost always there is a DOM event to hand over, because almost always something
107
+ was done to the page. When there genuinely was not — a timer firing, an action
108
+ settling, a signal changing — say so with a `CustomEvent` named after what
109
+ happened rather than leaving the origin unsaid:
110
+
111
+ ```js
112
+ import { chainEvent, triggerNaviCommand } from "@jsenv/navi";
113
+
114
+ const expiredEvent = new CustomEvent("session_expired");
115
+ chainEvent(expiredEvent, causeEvent); // when something did precede it
116
+ triggerNaviCommand(dialogRef.current, "--navi-open", expiredEvent);
117
+ ```
105
118
 
106
119
  ## Which element receives the command
107
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.141",
3
+ "version": "0.29.142",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {