@yuneta/gobj-ui 7.25.14 → 7.25.16
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 +100 -4
- package/dist/gobj-ui.cjs.js +406 -94
- package/dist/gobj-ui.es.js +406 -94
- package/package.json +2 -2
- package/src/c_g6_nodes_tree.js +79 -15
- package/src/c_yui_schema_editor.js +343 -66
- package/src/c_yui_treedb_graph.js +53 -6
- package/src/c_yui_treedb_topic_with_form.js +10 -10
- package/src/c_yui_treedb_topics.js +7 -7
- package/src/form_busy.js +2 -3
- package/src/form_busy.test.js +1 -1
- package/src/form_time_value.js +1 -1
- package/src/form_time_value.test.js +1 -1
- package/src/form_writes_in_flight.js +1 -2
- package/src/form_writes_in_flight.test.js +1 -1
- package/src/g6_graphs_write_owed.wiring.test.js +200 -0
- package/src/g6_nodes_tree_fsm.test.js +33 -0
- package/src/graph_save_plan.js +28 -0
- package/src/graph_save_plan.test.js +36 -2
- package/src/host_drafts.js +2 -3
- package/src/host_drafts.test.js +2 -2
- package/src/schema_editor_drafts.wiring.test.js +2 -2
- package/src/schema_editor_reload.wiring.test.js +329 -49
- package/src/schema_editor_transport.wiring.test.js +2 -2
- package/src/schema_version_bump.test.js +1 -1
- package/src/shell_modals.js +31 -11
- package/src/shell_toast_once.test.js +73 -10
- package/src/table_cell_text.js +1 -1
- package/src/table_cell_text.test.js +1 -1
- package/src/treedb_graph_writes.wiring.test.js +208 -0
- package/src/treedb_topics_transport.wiring.test.js +2 -2
- package/src/yui_install.js +14 -3
- package/src/yui_install.test.js +23 -0
- package/src/yui_row_search.test.js +1 -1
- package/src/yui_table_select.test.js +1 -1
package/README.md
CHANGED
|
@@ -1790,6 +1790,40 @@ size. A card on its tier's default now saves its position and nothing else;
|
|
|
1790
1790
|
a closed node saves no size at all (a square is not the card's size), its
|
|
1791
1791
|
entry keeps what it had.
|
|
1792
1792
|
|
|
1793
|
+
**A Save that does not land is written again** (since `7.25.15`). `Save`
|
|
1794
|
+
writes one `__graphs__` record per topic that changed, and nothing answers such
|
|
1795
|
+
a write when it lands, so the engine takes it for granted when it leaves. A
|
|
1796
|
+
refused one was recorded as saved all the same: the next Save found nothing to
|
|
1797
|
+
write, and the arrangement was never stored. Now the host (`C_YUI_TREEDB_GRAPH`)
|
|
1798
|
+
tells the engine every way the write can fail -- the backend answers an error
|
|
1799
|
+
(shown as before), the transport refuses the command, or there is no session
|
|
1800
|
+
(the write is not sent) -- with `EV_GRAPHS_WRITE_REFUSED {topic}`. The engine
|
|
1801
|
+
forgets what it believed the backend holds for that topic
|
|
1802
|
+
(`forget_refused_graphs_write()` in `graph_save_plan.js`), logs a warning and
|
|
1803
|
+
lights Save again, so the next Save writes the topic. A host of its own that
|
|
1804
|
+
hosts `C_G6_NODES_TREE` sends the same event when its write of `__graphs__`
|
|
1805
|
+
fails:
|
|
1806
|
+
|
|
1807
|
+
```js
|
|
1808
|
+
// in the host, when the answer to its update-node of __graphs__ is an error
|
|
1809
|
+
gobj_send_event(engine, "EV_GRAPHS_WRITE_REFUSED", {topic: record.topic}, gobj);
|
|
1810
|
+
```
|
|
1811
|
+
|
|
1812
|
+
**A refused write stays OWED until a Save writes it** (since `7.25.16`). In
|
|
1813
|
+
`7.25.15` the Save lit by the refusal went dark again at the next repaint of
|
|
1814
|
+
the history buttons -- they decide the Save from `history.canUndo()`, and they
|
|
1815
|
+
run on every history change, every change of mode and every redraw of the
|
|
1816
|
+
theme -- and a refusal heard in reading was never shown. The engine now keeps
|
|
1817
|
+
the topic as owed: the Save stays lit while one is, in edition and on entering
|
|
1818
|
+
it; the Save that writes the topic again pays it, and a reload of the data
|
|
1819
|
+
forgets it (the view holds what the backend holds).
|
|
1820
|
+
|
|
1821
|
+
```js
|
|
1822
|
+
gobj_send_event(engine, "EV_GRAPHS_WRITE_REFUSED", {topic: "users"}, host); // Save lit
|
|
1823
|
+
// ... a node moved and moved back (nothing to undo): Save still lit
|
|
1824
|
+
gobj_send_event(engine, "EV_SAVE_GRAPH", {}, engine); // writes users; Save dark
|
|
1825
|
+
```
|
|
1826
|
+
|
|
1793
1827
|
**Every saved look has a way back, in the context menu** (since `7.23.134`,
|
|
1794
1828
|
replacing `reset sizes` / `reset topic sizes`). In edition, the node, the port
|
|
1795
1829
|
and the edge menus each offer three resets — this one, its kind (`reset topic
|
|
@@ -2094,7 +2128,7 @@ columns**, each in its declared `order`, with the storage composed underneath
|
|
|
2094
2128
|
the qualified id, the fkey to the parent, the place among the siblings, and the
|
|
2095
2129
|
versions that publish the change.
|
|
2096
2130
|
|
|
2097
|
-
**An edit here is a draft** (7.23.196, with
|
|
2131
|
+
**An edit here is a draft** (7.23.196, with SDK 7.25.0). A write moves
|
|
2098
2132
|
no version and reaches no treedb. The HOST publishes it with `C_TREEDB`'s
|
|
2099
2133
|
`save-schema`, which raises the `topic_version` of each topic that changed
|
|
2100
2134
|
(the one that regenerates `topic_cols.json`) and the `schema_version` (the one
|
|
@@ -2187,6 +2221,7 @@ else.
|
|
|
2187
2221
|
master the tranger, so it refuses every write), `base_route`, `$container`.
|
|
2188
2222
|
- In: `EV_SHOW` (`{subpath}` — the tail it owns is `<treedb>[/<topic>]` or
|
|
2189
2223
|
`<treedb>/diagram`), `EV_HIDE`, `EV_TRANSPORT_STATE`, `EV_REFRESH`,
|
|
2224
|
+
`EV_DRAFTS` (`{drafts: {<treedb>: [<topic>, …]}}`, see above),
|
|
2190
2225
|
`EV_LANGUAGE_CHANGED`, `EV_MT_COMMAND_ANSWER`.
|
|
2191
2226
|
- A **drop** of the transport — `EV_TRANSPORT_STATE {connected: false}`, or a
|
|
2192
2227
|
failed answer that arrives while the transport is out of `ST_SESSION` — ends
|
|
@@ -2211,6 +2246,19 @@ else.
|
|
|
2211
2246
|
gobj_send_event(editor, "EV_SHOW", {subpath: "db"}, host); // waits
|
|
2212
2247
|
// ... the three `nodes` answers land -> ST_TOPICS of `db`
|
|
2213
2248
|
```
|
|
2249
|
+
|
|
2250
|
+
**`EV_REFRESH` waits too** (7.25.16). Heard in `ST_SAVING` -- a host that
|
|
2251
|
+
sends it after a Save while the writes are still in flight -- it is logged
|
|
2252
|
+
and run when the writes END, forgetting the drafts as a Refresh does. It
|
|
2253
|
+
ran at once: the load replaced `ST_SAVING`, and what was still queued (the
|
|
2254
|
+
topic of a topic delete, after its columns) was never sent, with no word.
|
|
2255
|
+
|
|
2256
|
+
```js
|
|
2257
|
+
gobj_send_event(editor, "EV_CONFIRMED", {what: "topic", topic: "users",
|
|
2258
|
+
model_gen: n}, editor); // ST_SAVING, 2 deletes
|
|
2259
|
+
gobj_send_event(editor, "EV_REFRESH", {}, host); // logged, waits
|
|
2260
|
+
// ... both deletes answered -> ST_LOADING -> the model is read again
|
|
2261
|
+
```
|
|
2214
2262
|
- **The loading screen is drawn** (7.25.8): the body is cleared, the drawing
|
|
2215
2263
|
destroyed and every toolbar button disabled, as in `ST_SAVING`, because
|
|
2216
2264
|
`ST_LOADING` declares none of a screen's actions. A **dialog** left open is
|
|
@@ -2245,6 +2293,28 @@ else.
|
|
|
2245
2293
|
gobj_send_event(editor, "EV_REFRESH", {}, host); // Save -> "wait for them"
|
|
2246
2294
|
// ... the load lands (model_gen N+1): the form closes, the operator reopens it
|
|
2247
2295
|
```
|
|
2296
|
+
- **A move sent by the host closes the dialog of the screen it left**
|
|
2297
|
+
(7.25.15). `C_YUI_SHELL` keeps the overlays open on a move that changes only
|
|
2298
|
+
the subpath (a url typed in, a link), so a dialog outlived its screen: its
|
|
2299
|
+
Save, its import Preview or an orphan delete sent an event only that screen
|
|
2300
|
+
declares, answered *"Event NOT DEFINED"*, and the edit was lost with no word.
|
|
2301
|
+
Now an `EV_SHOW` that moves the view to another position -- at once, or when
|
|
2302
|
+
a load or a write in flight ends -- closes the column form, the topic form,
|
|
2303
|
+
the import (its plan goes with it) and the orphans, and tells the operator
|
|
2304
|
+
`the view moved: open the dialog again` (an i18n key the consumer's locales
|
|
2305
|
+
carry). The export and the check stay up: they show the texts they were
|
|
2306
|
+
opened with and send nothing a screen declares. The same position sent again
|
|
2307
|
+
closes nothing. A **confirmation** is a shell modal, which the move does not
|
|
2308
|
+
close; it carries the position it was asked on (`seg`), and a Yes answered
|
|
2309
|
+
on another position is refused with the same words. Before, a Yes to "delete
|
|
2310
|
+
this column?" asked on `db/users` and answered after a move to `db2/users`
|
|
2311
|
+
deleted `db2`'s column of the same name.
|
|
2312
|
+
|
|
2313
|
+
```js
|
|
2314
|
+
gobj_send_event(editor, "EV_EDIT_COLUMN", {col: "id"}, host); // on db/users
|
|
2315
|
+
gobj_send_event(editor, "EV_SHOW", {subpath: "db"}, host); // form closed, said
|
|
2316
|
+
gobj_send_event(editor, "EV_SHOW", {subpath: "db"}, host); // same position: nothing
|
|
2317
|
+
```
|
|
2248
2318
|
- **A load refused IN session keeps the model it was replacing** (7.25.9): a
|
|
2249
2319
|
routing adapter's deadline on a slow `nodes` answers -1 while the session
|
|
2250
2320
|
is up. The records are put back, the screen and any open dialog stay, and
|
|
@@ -2274,6 +2344,28 @@ else.
|
|
|
2274
2344
|
// ... the load lands: the same click now opens the form
|
|
2275
2345
|
```
|
|
2276
2346
|
|
|
2347
|
+
**The Save of a form open when the reload is owed keeps what was typed**
|
|
2348
|
+
(7.25.16). It runs the owed reload and says
|
|
2349
|
+
`the schemas shown may be out of date: they are read again, and the form opens again on them with your changes`.
|
|
2350
|
+
The load that lands closes the form and opens it again on the schemas it
|
|
2351
|
+
read, with the fields the operator CHANGED put back on top -- only those,
|
|
2352
|
+
so a field left as it was shows what the store holds now and the next Save
|
|
2353
|
+
does not write the old value over a newer one. A new column or topic comes
|
|
2354
|
+
back whole (nothing of it is in the store). Before, the form was closed and
|
|
2355
|
+
what was typed was lost. It is not opened again when what it edited is not
|
|
2356
|
+
on the schemas read (a column deleted meanwhile, another treedb, another
|
|
2357
|
+
screen): that is said with
|
|
2358
|
+
`the schemas were read again and what the form was editing is not there any more`.
|
|
2359
|
+
A form the operator closed while the load ran stays closed. Both texts are
|
|
2360
|
+
i18n keys the consumer's locales carry.
|
|
2361
|
+
|
|
2362
|
+
```js
|
|
2363
|
+
// reload owed; column form of db.users.id open, header typed "Identifier"
|
|
2364
|
+
// Save -> refused, the model is read again
|
|
2365
|
+
// ... the load lands: the form opens again, header "Identifier", the rest
|
|
2366
|
+
// of the fields as the store holds them now; Save writes them
|
|
2367
|
+
```
|
|
2368
|
+
|
|
2277
2369
|
A write answered with no record reloads the model and
|
|
2278
2370
|
says what it did not send after it
|
|
2279
2371
|
(`the treedb did not describe a write back: the writes after it were not sent`).
|
|
@@ -3239,9 +3331,13 @@ a modal
|
|
|
3239
3331
|
`TOAST*`. Every button of that chrome -- each ✕, a dialog's back arrow, a
|
|
3240
3332
|
confirmation's answers (`CONFIRM_BTN`) -- carries a translatable `title` and
|
|
3241
3333
|
`aria-label` (7.25.10). An answer is named by its own label, so pass i18n
|
|
3242
|
-
KEYS as `yes_label` / `confirm_label` / … (`{yes_label: "install"}`)
|
|
3243
|
-
defaults
|
|
3244
|
-
|
|
3334
|
+
KEYS as `yes_label` / `confirm_label` / … (`{yes_label: "install"}`). The
|
|
3335
|
+
defaults are keys too since 7.25.16 -- `"ok"`, `"yes"`, `"no"`, `"delete"`
|
|
3336
|
+
and `"cancel"` (they were `"OK"`, `"Yes"`, … , which no validated locale can
|
|
3337
|
+
hold) -- so an app that mounts these dialogs defines those five keys, and
|
|
3338
|
+
its `validate-locales` asks for them. `yui_install_ask_once()` asks
|
|
3339
|
+
`"install this app"` (was `"Install this app?"`), answered `"install"` /
|
|
3340
|
+
`"not now"`.
|
|
3245
3341
|
|
|
3246
3342
|
Those names identify the *kind* of block, not the *instance*: every window in
|
|
3247
3343
|
the app is a `C_YUI_WINDOW`, every popup is a `MODAL`. To target **one**
|