@yuneta/gobj-ui 7.25.6 → 7.25.8
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/README.md +53 -1
- package/dist/gobj-ui.cjs.js +330 -63
- package/dist/gobj-ui.es.js +330 -63
- package/package.json +1 -1
- package/src/c_yui_schema_editor.js +339 -66
- package/src/schema_editor_reload.wiring.test.js +473 -0
- package/src/schema_editor_transport.wiring.test.js +174 -1
- package/src/shell_modals.js +61 -12
- package/src/shell_toast_once.test.js +125 -0
package/README.md
CHANGED
|
@@ -2161,7 +2161,43 @@ else.
|
|
|
2161
2161
|
`the connection dropped during the write` (an i18n key the consumer's
|
|
2162
2162
|
locales carry). Each request carries its round in `__md_command__`
|
|
2163
2163
|
(`round` / `write`), so an answer of what the drop cut is ignored with a
|
|
2164
|
-
warning.
|
|
2164
|
+
warning. The drop itself is logged ONCE; the failures a routing adapter
|
|
2165
|
+
settles for the same drop are that one event and are not logged again.
|
|
2166
|
+
- **Nothing moves the editor out of `ST_LOADING` or `ST_SAVING` but the end of
|
|
2167
|
+
what is in flight** (7.25.7). An `EV_SHOW` that arrives meanwhile waits, the
|
|
2168
|
+
last one wins, and it is applied when the load lands, fails or is cut, or
|
|
2169
|
+
when the write ends. 7.25.6 let it move a RELOAD out of `ST_LOADING`: every
|
|
2170
|
+
answer of that load was then "for a load that is over", and the next write
|
|
2171
|
+
patched the records the reload had emptied into a model with no treedb.
|
|
2172
|
+
With no model and no load, `EV_SHOW` keeps the position and stays in
|
|
2173
|
+
`ST_IDLE`; the next load goes there.
|
|
2174
|
+
|
|
2175
|
+
```js
|
|
2176
|
+
gobj_send_event(editor, "EV_REFRESH", {}, host); // ST_LOADING
|
|
2177
|
+
gobj_send_event(editor, "EV_SHOW", {subpath: "db"}, host); // waits
|
|
2178
|
+
// ... the three `nodes` answers land -> ST_TOPICS of `db`
|
|
2179
|
+
```
|
|
2180
|
+
- **The loading screen is drawn** (7.25.8): the body is cleared, the drawing
|
|
2181
|
+
destroyed and every toolbar button disabled, as in `ST_SAVING`, because
|
|
2182
|
+
`ST_LOADING` declares none of a screen's actions. A **dialog** left open is
|
|
2183
|
+
the one thing still reachable: its Save (`EV_SAVE_COLUMN`, `EV_SAVE_TOPIC`),
|
|
2184
|
+
a confirmation (`EV_CONFIRMED`), an orphan delete or an import is refused
|
|
2185
|
+
with `the schemas are loading: try again when they are in` (an i18n key the
|
|
2186
|
+
consumer's locales carry) and the dialog stays open with what was typed, so
|
|
2187
|
+
the same Save works once the load is in. A write that ends with an error --
|
|
2188
|
+
a drop included -- still applies a position that waited, as a load does.
|
|
2189
|
+
Out of session a load is not asked at all (no *"not in session"* errors);
|
|
2190
|
+
the reconnect loads.
|
|
2191
|
+
- A write this view gave up on (a drop, a deadline) whose answer still says it
|
|
2192
|
+
was DONE makes the editor read the model again (at once, after the write in
|
|
2193
|
+
flight, or on the reconnect), and it is a write for the host too: it
|
|
2194
|
+
publishes `EV_RECORD_WRITTEN` and marks the topic of the record answered.
|
|
2195
|
+
Only the host's `EV_REFRESH` (a Save sends it) forgets what this session
|
|
2196
|
+
wrote; the reloads the editor asks itself (the reconnect's, a late write's)
|
|
2197
|
+
keep the draft chips. Through a routing adapter that settled the
|
|
2198
|
+
write on its OWN deadline the late answer does not reach the view -- the
|
|
2199
|
+
adapter echoes a node event instead, which this view does not hear -- and
|
|
2200
|
+
Refresh is what reads the store.
|
|
2165
2201
|
|
|
2166
2202
|
```js
|
|
2167
2203
|
// the host forwards its session edges; nothing else is needed
|
|
@@ -2593,6 +2629,22 @@ live region it is both read and announced when it changes.
|
|
|
2593
2629
|
> long time and nothing ever rendered it; the claim is gone. Implement it there
|
|
2594
2630
|
> the day a menu entry needs one.
|
|
2595
2631
|
|
|
2632
|
+
### Toasts — `yui_shell_show_info` / `_warning` / `_error`
|
|
2633
|
+
|
|
2634
|
+
`yui_shell_show_error(shell, "key", {t, timeout})` shows a non-blocking toast
|
|
2635
|
+
(5000 ms by default, `timeout: 0` = until closed) and returns `{close()}`. A
|
|
2636
|
+
string message of the same kind as a toast still on screen is not stacked
|
|
2637
|
+
under it -- there is ONE toast per message -- but each call is a caller of its
|
|
2638
|
+
own: it gets its own handle and its own time, and the toast goes when every
|
|
2639
|
+
caller has closed its handle or timed out (7.25.8). The ✕ closes it for all.
|
|
2640
|
+
|
|
2641
|
+
```js
|
|
2642
|
+
const a = yui_shell_show_error(shell, "the connection dropped", {t}); // 5 s
|
|
2643
|
+
const b = yui_shell_show_error(shell, "the connection dropped", {t, timeout: 0}); // same toast
|
|
2644
|
+
a.close(); // still shown: b holds it
|
|
2645
|
+
b.close(); // gone
|
|
2646
|
+
```
|
|
2647
|
+
|
|
2596
2648
|
### Modals — `yui_shell_show_modal` and the `before_close` veto
|
|
2597
2649
|
|
|
2598
2650
|
`yui_shell_show_modal(shell, $box, opts)` is the standard popup: pass
|