@yuneta/gobj-ui 7.27.32 → 7.27.33
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 +38 -5
- package/dist/gobj-ui.cjs.js +139 -37
- package/dist/gobj-ui.es.js +139 -37
- package/package.json +2 -1
- package/src/c_yui_form.js +3 -2
- package/src/c_yui_fsm_graph.js +2 -1
- package/src/c_yui_gobj_tree_js.js +60 -15
- package/src/c_yui_json_graph.js +5 -4
- package/src/c_yui_nav.js +5 -11
- package/src/c_yui_schema_editor.js +2 -1
- package/src/c_yui_shell.js +3 -2
- package/src/c_yui_treedb_graph.js +2 -1
- package/src/c_yui_treedb_schema.js +5 -1
- package/src/c_yui_treedb_topic_with_form.js +5 -4
- package/src/c_yui_treedb_topics.js +4 -3
- package/src/g6_patches_first_graph.wiring.test.js +179 -0
- package/src/gobj_tree_remote.wiring.test.js +119 -3
- package/src/selector_from_data.wiring.test.js +296 -0
- package/src/yui_selector.js +79 -0
package/README.md
CHANGED
|
@@ -3349,15 +3349,34 @@ and it declares the four output events in its FSM:
|
|
|
3349
3349
|
| Direction | Event | kw | The host does |
|
|
3350
3350
|
|---|---|---|---|
|
|
3351
3351
|
| out | `EV_TREE_WANTED` | `{}` | `view-gobj-tree`, then `EV_LOAD_TREE` (Refresh was pressed) |
|
|
3352
|
-
| in | `EV_LOAD_TREE` | `{tree}` | — the `view-gobj-tree` answer's `data` |
|
|
3353
|
-
| out | `EV_TRACE_INFO_WANTED` | `{gclass}` | `info-gclass-trace gclass=G`, `info-global-trace`, `get-gclass-trace gclass=G`, `get-global-trace`, then `EV_TRACE_INFO` (a card was opened) |
|
|
3354
|
-
| in | `EV_TRACE_INFO` | `{gclass, gclass_levels, global_levels, gclass_on, global_on, error}` | — the four answers (`{name: description}`, `{name: description}`, `[name]`, `[name]`), or `error` |
|
|
3355
|
-
| out | `EV_SET_TRACE_LEVEL` | `{scope, gobj, gclass, levels, set}` | per level `set-gobj-trace gobj=<gobj> level=L set=0\|1` (scope `gobj`) or `set-gclass-trace gclass=G level=L set=0\|1` (scope `gclass`), then the tree and the trace info again |
|
|
3352
|
+
| in | `EV_LOAD_TREE` | `{tree, set_id}` | — the `view-gobj-tree` answer's `data` |
|
|
3353
|
+
| out | `EV_TRACE_INFO_WANTED` | `{gclass, set_id}` | `info-gclass-trace gclass=G`, `info-global-trace`, `get-gclass-trace gclass=G`, `get-global-trace`, then `EV_TRACE_INFO` (a card was opened) |
|
|
3354
|
+
| in | `EV_TRACE_INFO` | `{gclass, gclass_levels, global_levels, gclass_on, global_on, error, set_id}` | — the four answers (`{name: description}`, `{name: description}`, `[name]`, `[name]`), or `error` |
|
|
3355
|
+
| out | `EV_SET_TRACE_LEVEL` | `{scope, gobj, gclass, levels, set, set_id}` | per level `set-gobj-trace gobj=<gobj> level=L set=0\|1` (scope `gobj`) or `set-gclass-trace gclass=G level=L set=0\|1` (scope `gclass`), then the tree and the trace info again |
|
|
3356
3356
|
| out | `EV_GCLASS_WANTED` | `{gclass}` | `view-gclass gclass=G`, then `EV_GCLASS_DESCRIPTION` |
|
|
3357
3357
|
| in | `EV_GCLASS_DESCRIPTION` | `{gclass, description}` | — opens the gclass viewer on that description |
|
|
3358
3358
|
|
|
3359
3359
|
The host loads the **first** tree itself (it opened the view); after that the
|
|
3360
|
-
view asks only on Refresh.
|
|
3360
|
+
view asks only on Refresh.
|
|
3361
|
+
|
|
3362
|
+
**`set_id` says which set an answer follows** (7.27.33). Every
|
|
3363
|
+
`EV_SET_TRACE_LEVEL` carries a new number. A host that echoes it puts it in the
|
|
3364
|
+
two answers it reads after that set (`EV_LOAD_TREE`, `EV_TRACE_INFO`) and in the
|
|
3365
|
+
answer of an `EV_TRACE_INFO_WANTED` that carried one, and puts `set_id: null`
|
|
3366
|
+
in every other answer. Then a read asked BEFORE a set and answered after it
|
|
3367
|
+
does not unlock what the set locked: without it, a card's own read answered
|
|
3368
|
+
after a tick showed the levels before the set, enabled, for one round trip. A
|
|
3369
|
+
host that leaves `set_id` out of its answers keeps working as before: the view
|
|
3370
|
+
matches an answer by its gclass.
|
|
3371
|
+
|
|
3372
|
+
```js
|
|
3373
|
+
/* the host, after the last command of a set: */
|
|
3374
|
+
gobj_send_event(priv.view.tree, "EV_TRACE_INFO",
|
|
3375
|
+
Object.assign({gclass: "C_TCP", set_id: kw_of_the_set.set_id}, the_four_answers), gobj);
|
|
3376
|
+
/* a plain read (a card was opened): */
|
|
3377
|
+
gobj_send_event(priv.view.tree, "EV_TRACE_INFO",
|
|
3378
|
+
Object.assign({gclass: "C_TCP", set_id: null}, the_four_answers), gobj);
|
|
3379
|
+
``` Ask `view-gobj-tree` for the fields the view reads,
|
|
3361
3380
|
by name (`options=[...]`): its default leaves out `gclass` and `fullname`, and
|
|
3362
3381
|
`play_methods` is what keeps a gobj with nothing to play from reading paused.
|
|
3363
3382
|
|
|
@@ -4393,6 +4412,20 @@ text is in the yunetas `CLAUDE.md` ("JS GUI conventions"); in short:
|
|
|
4393
4412
|
|
|
4394
4413
|
`npm run check-markup` runs the check here, and `prebuild` / `pretest` run
|
|
4395
4414
|
it, so a new markup literal fails the build.
|
|
4415
|
+
- **Data never goes into a CSS selector as it is.** A gobj name, a topic, a
|
|
4416
|
+
route or a key may hold `~`, `.`, `%`, `"`... Pasted into
|
|
4417
|
+
`querySelector()`, it changes what the selector says (`#a~b` matches no
|
|
4418
|
+
element) or makes it invalid, and then `querySelector()` THROWS out of the
|
|
4419
|
+
action that called it. Find an element by its id with `find_by_id($root,
|
|
4420
|
+
id)`, and quote a value for an attribute selector with `css_string()`
|
|
4421
|
+
(`yui_selector.js`, 7.27.33):
|
|
4422
|
+
|
|
4423
|
+
```js
|
|
4424
|
+
import {find_by_id, css_string} from "@yuneta/gobj-ui/src/yui_selector.js";
|
|
4425
|
+
|
|
4426
|
+
let $canvas = find_by_id($container, priv.canvas_id);
|
|
4427
|
+
let $a = $c.querySelector(`a[data-route="${css_string(route)}"]`);
|
|
4428
|
+
```
|
|
4396
4429
|
|
|
4397
4430
|
### `index.html`: title, metadata and the Content-Security-Policy
|
|
4398
4431
|
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -1102,6 +1102,72 @@ function build_nav_map(input) {
|
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
1104
|
//#endregion
|
|
1105
|
+
//#region src/yui_selector.js
|
|
1106
|
+
/***********************************************************************
|
|
1107
|
+
* yui_selector.js
|
|
1108
|
+
*
|
|
1109
|
+
* A NAME IS DATA, NOT A SELECTOR.
|
|
1110
|
+
*
|
|
1111
|
+
* A gobj name, a topic, a route, a key: any of them may hold a
|
|
1112
|
+
* character that means something to CSS. Pasted into a selector,
|
|
1113
|
+
* it changes what the selector says or breaks it:
|
|
1114
|
+
*
|
|
1115
|
+
* - `~ + > space` are combinators: `#a~b` is "a b after an #a",
|
|
1116
|
+
* and the lookup answers null;
|
|
1117
|
+
* - `.` `#` `:` `[` start another simple selector: `#a.b` is the
|
|
1118
|
+
* element #a with the class b;
|
|
1119
|
+
* - `%` `^` `"` `\` and the rest make it INVALID: querySelector
|
|
1120
|
+
* THROWS a SyntaxError, out of whatever action was running.
|
|
1121
|
+
*
|
|
1122
|
+
* REV-CLOUD V40.3.1: the gobj tree found its canvas with
|
|
1123
|
+
* `querySelector("#" + id)`, and gui_agent named the window
|
|
1124
|
+
* `node~key` -- every open logged "no canvas mount" and the
|
|
1125
|
+
* canvas never resized; a `^` in the key (`%5E`) threw out of
|
|
1126
|
+
* mt_start and left an orphan window behind it.
|
|
1127
|
+
*
|
|
1128
|
+
* So data reaches a selector in one of two ways only:
|
|
1129
|
+
*
|
|
1130
|
+
* find_by_id($root, id) the element below $root whose id is
|
|
1131
|
+
* `id` -- no selector is built at all.
|
|
1132
|
+
* It works in a tree that is not in the
|
|
1133
|
+
* document yet, where getElementById()
|
|
1134
|
+
* answers null.
|
|
1135
|
+
*
|
|
1136
|
+
* css_string(value) the value written inside a DOUBLE
|
|
1137
|
+
* quoted CSS string, for an attribute
|
|
1138
|
+
* selector:
|
|
1139
|
+
* '[data-x="' + css_string(v) + '"]'
|
|
1140
|
+
*
|
|
1141
|
+
* `CSS.escape()` is not used: it does not exist in node, where the
|
|
1142
|
+
* wiring tests run, and inside a quoted string only the quote, the
|
|
1143
|
+
* backslash and the control characters have to be escaped.
|
|
1144
|
+
*
|
|
1145
|
+
* Copyright (c) 2026, ArtGins.
|
|
1146
|
+
* All Rights Reserved.
|
|
1147
|
+
***********************************************************************/
|
|
1148
|
+
/************************************************************
|
|
1149
|
+
* The element below `$root` (not `$root` itself, as with
|
|
1150
|
+
* querySelector) whose id is exactly `id`, or null.
|
|
1151
|
+
************************************************************/
|
|
1152
|
+
function find_by_id($root, id) {
|
|
1153
|
+
if (!$root || typeof $root.querySelectorAll !== "function") return null;
|
|
1154
|
+
if (id === null || id === void 0 || id === "") return null;
|
|
1155
|
+
let wanted = String(id);
|
|
1156
|
+
for (let $el of $root.querySelectorAll("[id]")) if ($el.id === wanted) return $el;
|
|
1157
|
+
return null;
|
|
1158
|
+
}
|
|
1159
|
+
/************************************************************
|
|
1160
|
+
* `value` as the body of a double-quoted CSS string.
|
|
1161
|
+
*
|
|
1162
|
+
* The quote and the backslash take a backslash; a control
|
|
1163
|
+
* character (a newline ends a CSS string, it is a parse
|
|
1164
|
+
* error inside one) is written as its hex escape, which a
|
|
1165
|
+
* space ends so the next character is never read as hex.
|
|
1166
|
+
************************************************************/
|
|
1167
|
+
function css_string(value) {
|
|
1168
|
+
return String(value).replace(/[\\"]/g, "\\$&").replace(/[\u0000-\u001f\u007f]/g, (c) => "\\" + c.charCodeAt(0).toString(16) + " ");
|
|
1169
|
+
}
|
|
1170
|
+
//#endregion
|
|
1105
1171
|
//#region src/shell_section_index.js
|
|
1106
1172
|
/***********************************************************************
|
|
1107
1173
|
* shell_section_index.js
|
|
@@ -4184,7 +4250,7 @@ function yui_shell_set_connection_state(shell_gobj, connected) {
|
|
|
4184
4250
|
function yui_shell_set_toolbar_item_icon(shell_gobj, item_id, icon_class) {
|
|
4185
4251
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(shell_gobj, "$container");
|
|
4186
4252
|
if (!$container || (0, _yuneta_gobj_js.empty_string)(item_id) || (0, _yuneta_gobj_js.empty_string)(icon_class)) return;
|
|
4187
|
-
let $i = $container.querySelector(`[data-toolbar-item-id="${item_id}"] .icon i`);
|
|
4253
|
+
let $i = $container.querySelector(`[data-toolbar-item-id="${css_string(item_id)}"] .icon i`);
|
|
4188
4254
|
if ($i) $i.className = icon_class;
|
|
4189
4255
|
}
|
|
4190
4256
|
/************************************************************
|
|
@@ -4218,7 +4284,7 @@ function yui_shell_set_toolbar_item_badge(shell_gobj, item_id, value, tone) {
|
|
|
4218
4284
|
if (!shell_gobj || !(0, _yuneta_gobj_js.is_gobj)(shell_gobj) || (0, _yuneta_gobj_js.empty_string)(item_id)) return;
|
|
4219
4285
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(shell_gobj, "$container");
|
|
4220
4286
|
if (!$container) return;
|
|
4221
|
-
let $badge = $container.querySelector(`[data-toolbar-item-id="${item_id}"] .yui-toolbar-badge`);
|
|
4287
|
+
let $badge = $container.querySelector(`[data-toolbar-item-id="${css_string(item_id)}"] .yui-toolbar-badge`);
|
|
4222
4288
|
if (!$badge) return;
|
|
4223
4289
|
let before = $badge.hasAttribute("hidden") ? "" : $badge.textContent;
|
|
4224
4290
|
paint_badge($badge, value, tone);
|
|
@@ -12583,7 +12649,7 @@ function apply_form_mode(gobj, $form) {
|
|
|
12583
12649
|
let mode = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "form_mode");
|
|
12584
12650
|
if ((0, _yuneta_gobj_js.empty_string)(mode)) return;
|
|
12585
12651
|
let pkey = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "pkey");
|
|
12586
|
-
let $input = $form.querySelector(`[name="${pkey}"]`);
|
|
12652
|
+
let $input = $form.querySelector(`[name="${css_string(pkey)}"]`);
|
|
12587
12653
|
if (!$input) {
|
|
12588
12654
|
(0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: form_mode '%s' but form has no pkey field '%s'", (0, _yuneta_gobj_js.gobj_short_name)(gobj), mode, pkey));
|
|
12589
12655
|
return;
|
|
@@ -13651,7 +13717,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
13651
13717
|
hozAlign: "center",
|
|
13652
13718
|
cellClick: function(evt, cell) {
|
|
13653
13719
|
evt.stopPropagation();
|
|
13654
|
-
let $extend = cell.getRow().getElement().querySelector(`[name="${field_desc.name}"]`);
|
|
13720
|
+
let $extend = cell.getRow().getElement().querySelector(`[name="${css_string(field_desc.name)}"]`);
|
|
13655
13721
|
if (!$extend) {
|
|
13656
13722
|
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: nested table '${field_desc.name}' not found in its row`);
|
|
13657
13723
|
return;
|
|
@@ -18109,7 +18175,7 @@ function build_ui$13(gobj) {
|
|
|
18109
18175
|
]]
|
|
18110
18176
|
]);
|
|
18111
18177
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
|
|
18112
|
-
let $mount = $container
|
|
18178
|
+
let $mount = find_by_id($container, priv.canvas_id);
|
|
18113
18179
|
if ($mount) {
|
|
18114
18180
|
priv.fold_listener = function(evt) {
|
|
18115
18181
|
let $handle = evt.target && evt.target.closest ? evt.target.closest("[data-fold-path]") : null;
|
|
@@ -18138,7 +18204,7 @@ function destroy_ui$8(gobj) {
|
|
|
18138
18204
|
let priv = gobj.priv;
|
|
18139
18205
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
18140
18206
|
if (priv.fold_listener) {
|
|
18141
|
-
let $mount = $container
|
|
18207
|
+
let $mount = find_by_id($container, priv.canvas_id);
|
|
18142
18208
|
if ($mount) for (let type of FOLD_SWALLOWED_EVENTS$1) $mount.removeEventListener(type, priv.fold_listener, true);
|
|
18143
18209
|
priv.fold_listener = null;
|
|
18144
18210
|
}
|
|
@@ -18279,7 +18345,7 @@ function make_toolbar$5(gobj) {
|
|
|
18279
18345
|
function canvas_mount$2(gobj) {
|
|
18280
18346
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
18281
18347
|
if (!$container) return null;
|
|
18282
|
-
return $container
|
|
18348
|
+
return find_by_id($container, gobj.priv.canvas_id);
|
|
18283
18349
|
}
|
|
18284
18350
|
/************************************************************
|
|
18285
18351
|
* Build a G6 graph instance
|
|
@@ -19150,7 +19216,7 @@ function paint_anchor_mark$1(gobj) {
|
|
|
19150
19216
|
if (!$container) return;
|
|
19151
19217
|
for (let $card of $container.querySelectorAll(".JSON_CARD_ANCHORED")) $card.classList.remove("JSON_CARD_ANCHORED");
|
|
19152
19218
|
if (priv.anchor_state !== "on" || !priv.anchor_path) return;
|
|
19153
|
-
let $it = $container.querySelector(".JSON_CARD[data-json-path=\"" +
|
|
19219
|
+
let $it = $container.querySelector(".JSON_CARD[data-json-path=\"" + css_string(priv.anchor_path) + "\"]");
|
|
19154
19220
|
if ($it) $it.classList.add("JSON_CARD_ANCHORED");
|
|
19155
19221
|
}
|
|
19156
19222
|
/************************************************************
|
|
@@ -22616,7 +22682,7 @@ function make_toolbar$3(gobj) {
|
|
|
22616
22682
|
function canvas_mount$1(gobj) {
|
|
22617
22683
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
22618
22684
|
if (!$container) return null;
|
|
22619
|
-
return $container
|
|
22685
|
+
return find_by_id($container, (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "canvas_id"));
|
|
22620
22686
|
}
|
|
22621
22687
|
/************************************************************
|
|
22622
22688
|
* Build the G6 graph instance.
|
|
@@ -52248,12 +52314,13 @@ function yui_graph_minimap_repaint(plugin) {
|
|
|
52248
52314
|
* it WANTS and the host answers with the data:
|
|
52249
52315
|
*
|
|
52250
52316
|
* out EV_TREE_WANTED {} Refresh pressed
|
|
52251
|
-
* in EV_LOAD_TREE {tree}
|
|
52252
|
-
* out EV_TRACE_INFO_WANTED {gclass}
|
|
52317
|
+
* in EV_LOAD_TREE {tree, set_id} the `view-gobj-tree` answer
|
|
52318
|
+
* out EV_TRACE_INFO_WANTED {gclass, set_id} a card was opened
|
|
52253
52319
|
* in EV_TRACE_INFO {gclass, gclass_levels, global_levels,
|
|
52254
|
-
* gclass_on, global_on, error}
|
|
52320
|
+
* gclass_on, global_on, error, set_id}
|
|
52255
52321
|
* out EV_SET_TRACE_LEVEL {scope: "gobj"|"gclass"|"global",
|
|
52256
|
-
* gobj, gclass, levels: [...], set
|
|
52322
|
+
* gobj, gclass, levels: [...], set,
|
|
52323
|
+
* set_id}
|
|
52257
52324
|
* out EV_GCLASS_WANTED {gclass} the gclass button
|
|
52258
52325
|
* in EV_GCLASS_DESCRIPTION {gclass, description}
|
|
52259
52326
|
*
|
|
@@ -52263,6 +52330,14 @@ function yui_graph_minimap_repaint(plugin) {
|
|
|
52263
52330
|
* trace info of `gclass` again: what the reader is on stays
|
|
52264
52331
|
* open.
|
|
52265
52332
|
*
|
|
52333
|
+
* `set_id` (7.27.33) numbers each set. A host that echoes
|
|
52334
|
+
* it says WHICH set an answer follows: the set_id of the
|
|
52335
|
+
* set in the two reads made after it (and in the answer of
|
|
52336
|
+
* a WANTED that carried one), null in any other answer. A
|
|
52337
|
+
* read asked BEFORE a set and answered after it then no
|
|
52338
|
+
* longer unlocks what the set locked. A host that leaves
|
|
52339
|
+
* it out is matched by gclass, as before.
|
|
52340
|
+
*
|
|
52266
52341
|
* TRACES, in "remote": three scopes, each where it belongs.
|
|
52267
52342
|
* The kernel's levels (`machine`, `create_delete`...; the
|
|
52268
52343
|
* table gobj.c calls "global") are valid in all three, a
|
|
@@ -52477,6 +52552,9 @@ var PRIVATE_DATA$9 = {
|
|
|
52477
52552
|
viewer_awaits: "",
|
|
52478
52553
|
viewer_stale: "",
|
|
52479
52554
|
set_in_flight: null,
|
|
52555
|
+
set_serial: 0,
|
|
52556
|
+
pending_set_id: 0,
|
|
52557
|
+
viewer_awaits_set: 0,
|
|
52480
52558
|
view_refused: false
|
|
52481
52559
|
};
|
|
52482
52560
|
var __gclass__$9 = null;
|
|
@@ -53208,7 +53286,7 @@ function make_toolbar$1(gobj) {
|
|
|
53208
53286
|
function canvas_mount(gobj) {
|
|
53209
53287
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
53210
53288
|
if (!$container) return null;
|
|
53211
|
-
return $container
|
|
53289
|
+
return find_by_id($container, gobj.priv.canvas_id);
|
|
53212
53290
|
}
|
|
53213
53291
|
/************************************************************
|
|
53214
53292
|
* Build a G6 graph instance
|
|
@@ -54682,7 +54760,7 @@ function paint_anchor_mark(gobj) {
|
|
|
54682
54760
|
if (!$container) return;
|
|
54683
54761
|
for (let $card of $container.querySelectorAll(".GOBJ_CARD_ANCHORED")) $card.classList.remove("GOBJ_CARD_ANCHORED");
|
|
54684
54762
|
if (priv.anchor_state !== "on" || !priv.anchor_name) return;
|
|
54685
|
-
let $it = $container.querySelector(".GOBJ_CARD[data-gobj-name=\"" +
|
|
54763
|
+
let $it = $container.querySelector(".GOBJ_CARD[data-gobj-name=\"" + css_string(priv.anchor_name) + "\"]");
|
|
54686
54764
|
if ($it) $it.classList.add("GOBJ_CARD_ANCHORED");
|
|
54687
54765
|
}
|
|
54688
54766
|
/************************************************************
|
|
@@ -54922,7 +55000,7 @@ function ac_load_tree(gobj, event, kw, src) {
|
|
|
54922
55000
|
}
|
|
54923
55001
|
let first = !priv.remote_root;
|
|
54924
55002
|
priv.remote_root = root;
|
|
54925
|
-
priv.trace_pending = false;
|
|
55003
|
+
if (answers_set(kw, priv.pending_set_id)) priv.trace_pending = false;
|
|
54926
55004
|
reload_keeping_popover(gobj, first ? {} : { preserve_view: true });
|
|
54927
55005
|
return 0;
|
|
54928
55006
|
}
|
|
@@ -54944,24 +55022,29 @@ function ac_trace_info(gobj, event, kw, src) {
|
|
|
54944
55022
|
global_on: list(kw.global_on),
|
|
54945
55023
|
error: kw.error || ""
|
|
54946
55024
|
};
|
|
54947
|
-
priv.trace_pending = false;
|
|
54948
|
-
if (priv.set_in_flight && priv.set_in_flight.gclass === kw.gclass) priv.set_in_flight = null;
|
|
55025
|
+
if (answers_set(kw, priv.pending_set_id)) priv.trace_pending = false;
|
|
55026
|
+
if (priv.set_in_flight && priv.set_in_flight.gclass === kw.gclass && answers_set(kw, priv.set_in_flight.set_id)) priv.set_in_flight = null;
|
|
54949
55027
|
let d = priv.popover_node;
|
|
54950
55028
|
let root = priv.remote_root;
|
|
54951
55029
|
if (priv.popover_mode === "node" && d && d.gclass === kw.gclass || priv.popover_mode === "yuno" && root && root.gclass === kw.gclass) render_current_popover(gobj);
|
|
54952
55030
|
let viewer = gclass_viewer_gobj(gobj);
|
|
54953
55031
|
if (viewer) {
|
|
54954
55032
|
let shown = (0, _yuneta_gobj_js.gobj_read_str_attr)(viewer, "gclass_name");
|
|
54955
|
-
if (priv.viewer_awaits === kw.gclass) {
|
|
55033
|
+
if (priv.viewer_awaits === kw.gclass && answers_set(kw, priv.viewer_awaits_set)) {
|
|
54956
55034
|
priv.viewer_awaits = "";
|
|
54957
55035
|
if (priv.viewer_stale === shown && shown !== kw.gclass) {
|
|
55036
|
+
let set_id = priv.viewer_awaits_set;
|
|
54958
55037
|
priv.viewer_stale = "";
|
|
54959
55038
|
priv.viewer_awaits = shown;
|
|
54960
55039
|
priv.set_in_flight = {
|
|
54961
55040
|
gclass: shown,
|
|
54962
|
-
scope: "gclass"
|
|
55041
|
+
scope: "gclass",
|
|
55042
|
+
set_id
|
|
54963
55043
|
};
|
|
54964
|
-
(0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_TRACE_INFO_WANTED", {
|
|
55044
|
+
(0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_TRACE_INFO_WANTED", {
|
|
55045
|
+
gclass: shown,
|
|
55046
|
+
set_id
|
|
55047
|
+
});
|
|
54965
55048
|
}
|
|
54966
55049
|
}
|
|
54967
55050
|
if (shown === kw.gclass) (0, _yuneta_gobj_js.gobj_send_event)(viewer, "EV_SET_TRACES", viewer_traces(gobj, shown), gobj);
|
|
@@ -54969,6 +55052,22 @@ function ac_trace_info(gobj, event, kw, src) {
|
|
|
54969
55052
|
return 0;
|
|
54970
55053
|
}
|
|
54971
55054
|
/************************************************************
|
|
55055
|
+
* Is this answer (EV_LOAD_TREE, EV_TRACE_INFO) the one that
|
|
55056
|
+
* follows the set `set_id`?
|
|
55057
|
+
*
|
|
55058
|
+
* A host that echoes `set_id` says so itself: null for a read
|
|
55059
|
+
* that is no set's, which is a read asked BEFORE the set when
|
|
55060
|
+
* it arrives after it (REV-CLOUD V40.2: the card's own read,
|
|
55061
|
+
* answered after a tick, unlocked the block and showed the
|
|
55062
|
+
* levels before the set, enabled, for one round trip). A host
|
|
55063
|
+
* that leaves it out (before 7.27.33) cannot say: any answer
|
|
55064
|
+
* will do, and the caller matches by gclass.
|
|
55065
|
+
************************************************************/
|
|
55066
|
+
function answers_set(kw, set_id) {
|
|
55067
|
+
if (!kw || kw.set_id === void 0) return true;
|
|
55068
|
+
return !!set_id && kw.set_id === set_id;
|
|
55069
|
+
}
|
|
55070
|
+
/************************************************************
|
|
54972
55071
|
* The gclass viewer this view opened, while it is open.
|
|
54973
55072
|
************************************************************/
|
|
54974
55073
|
function gclass_viewer_gobj(gobj) {
|
|
@@ -55064,11 +55163,14 @@ function ac_set_gclass_trace(gobj, event, kw, src) {
|
|
|
55064
55163
|
}
|
|
55065
55164
|
function set_trace_levels(gobj, target, scope, levels, set) {
|
|
55066
55165
|
let priv = gobj.priv;
|
|
55166
|
+
let set_id = ++priv.set_serial;
|
|
55067
55167
|
priv.trace_pending = true;
|
|
55168
|
+
priv.pending_set_id = set_id;
|
|
55068
55169
|
render_current_popover(gobj);
|
|
55069
55170
|
priv.set_in_flight = {
|
|
55070
55171
|
gclass: target.gclass,
|
|
55071
|
-
scope
|
|
55172
|
+
scope,
|
|
55173
|
+
set_id
|
|
55072
55174
|
};
|
|
55073
55175
|
let viewer = gclass_viewer_gobj(gobj);
|
|
55074
55176
|
if (viewer) {
|
|
@@ -55080,13 +55182,15 @@ function set_trace_levels(gobj, target, scope, levels, set) {
|
|
|
55080
55182
|
gobj: target.full_name || "",
|
|
55081
55183
|
gclass: target.gclass,
|
|
55082
55184
|
levels,
|
|
55083
|
-
set
|
|
55185
|
+
set,
|
|
55186
|
+
set_id
|
|
55084
55187
|
});
|
|
55085
55188
|
}
|
|
55086
55189
|
function lock_viewer_for_set(gobj, shown, set) {
|
|
55087
55190
|
let priv = gobj.priv;
|
|
55088
55191
|
if (!(shown === set.gclass || set.scope === "global")) return false;
|
|
55089
55192
|
priv.viewer_awaits = set.gclass;
|
|
55193
|
+
priv.viewer_awaits_set = set.set_id;
|
|
55090
55194
|
priv.viewer_stale = shown !== set.gclass ? shown : "";
|
|
55091
55195
|
return true;
|
|
55092
55196
|
}
|
|
@@ -55937,7 +56041,7 @@ function apply_active_route(gobj) {
|
|
|
55937
56041
|
let $c = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
55938
56042
|
let route = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "active_route") || "";
|
|
55939
56043
|
if (!$c || (0, _yuneta_gobj_js.empty_string)(route)) return;
|
|
55940
|
-
let $a = $c.querySelector(`a[data-route="${
|
|
56044
|
+
let $a = $c.querySelector(`a[data-route="${css_string(route)}"]`);
|
|
55941
56045
|
if ($a) {
|
|
55942
56046
|
let $li = $a.closest("li");
|
|
55943
56047
|
if ($li) $li.classList.add("is-active");
|
|
@@ -56565,7 +56669,7 @@ function ac_set_item_badge(gobj, event, kw, src) {
|
|
|
56565
56669
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "badges", badges);
|
|
56566
56670
|
let $c = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
56567
56671
|
if (!$c) return 0;
|
|
56568
|
-
let $badges = $c.querySelectorAll(`[data-item-id="${
|
|
56672
|
+
let $badges = $c.querySelectorAll(`[data-item-id="${css_string(item_id)}"] .NAV_ITEM_BADGE`);
|
|
56569
56673
|
for (let $badge of $badges) paint_badge($badge, badge, tone);
|
|
56570
56674
|
return 0;
|
|
56571
56675
|
}
|
|
@@ -56589,7 +56693,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56589
56693
|
id_to_mark = parent_item ? parent_item.id : item && item.id;
|
|
56590
56694
|
} else id_to_mark = item && item.id;
|
|
56591
56695
|
if (!id_to_mark) return 0;
|
|
56592
|
-
let $a = $c.querySelector(`[data-item-id="${
|
|
56696
|
+
let $a = $c.querySelector(`[data-item-id="${css_string(id_to_mark)}"]`);
|
|
56593
56697
|
if ($a) {
|
|
56594
56698
|
let $li = $a.closest("li");
|
|
56595
56699
|
if ($li) $li.classList.add("is-active");
|
|
@@ -56600,7 +56704,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56600
56704
|
$c.querySelectorAll(".yui-accordion-head").forEach(($hd) => {
|
|
56601
56705
|
let $body = $hd.nextElementSibling;
|
|
56602
56706
|
if (!$body || !$body.classList.contains("yui-accordion-body")) return;
|
|
56603
|
-
let contains_active = !!$body.querySelector(`[data-item-id="${
|
|
56707
|
+
let contains_active = !!$body.querySelector(`[data-item-id="${css_string(active_leaf_id)}"]`);
|
|
56604
56708
|
$body.classList.toggle("is-hidden", !contains_active);
|
|
56605
56709
|
$hd.classList.toggle("is-open", contains_active);
|
|
56606
56710
|
$hd.setAttribute("aria-expanded", contains_active ? "true" : "false");
|
|
@@ -56608,9 +56712,6 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
56608
56712
|
}
|
|
56609
56713
|
return 0;
|
|
56610
56714
|
}
|
|
56611
|
-
function css_escape(s) {
|
|
56612
|
-
return String(s).replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
56613
|
-
}
|
|
56614
56715
|
/***************************************************************
|
|
56615
56716
|
* FSM
|
|
56616
56717
|
***************************************************************/
|
|
@@ -59490,7 +59591,7 @@ function ac_show$5(gobj, event, kw, src) {
|
|
|
59490
59591
|
}
|
|
59491
59592
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
59492
59593
|
let $current_item = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$current_item");
|
|
59493
|
-
let $a = $container.querySelector(`a[href="${href}"]`);
|
|
59594
|
+
let $a = $container.querySelector(`a[href="${css_string(href)}"]`);
|
|
59494
59595
|
if ($a) {
|
|
59495
59596
|
if ($current_item && $current_item !== $a.parentNode) {
|
|
59496
59597
|
$current_item.classList.remove("is-active");
|
|
@@ -61525,7 +61626,7 @@ function build_ui$5(gobj) {
|
|
|
61525
61626
|
[yui_toolbar_icon("yi-magnifying-glass")]
|
|
61526
61627
|
]]
|
|
61527
61628
|
]);
|
|
61528
|
-
let $search_input = $search_box
|
|
61629
|
+
let $search_input = find_by_id($search_box, search_id);
|
|
61529
61630
|
attach_clear($search_box, $search_input);
|
|
61530
61631
|
if ($search_input) $search_input.addEventListener("input", (event) => {
|
|
61531
61632
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SEARCH", { text: event.target.value.trim() }, gobj);
|
|
@@ -61685,7 +61786,7 @@ function build_ui$5(gobj) {
|
|
|
61685
61786
|
});
|
|
61686
61787
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "selection_bar", bar);
|
|
61687
61788
|
bar.$el.style.flex = "none";
|
|
61688
|
-
$container.insertBefore(bar.$el, $container
|
|
61789
|
+
$container.insertBefore(bar.$el, find_by_id($container, table_id));
|
|
61689
61790
|
}
|
|
61690
61791
|
let $parent_filter = (0, _yuneta_gobj_js.createElement2)([
|
|
61691
61792
|
"div",
|
|
@@ -61730,7 +61831,7 @@ function build_ui$5(gobj) {
|
|
|
61730
61831
|
]
|
|
61731
61832
|
]);
|
|
61732
61833
|
gobj.priv.$parent_filter = $parent_filter;
|
|
61733
|
-
$container.insertBefore($parent_filter, $container
|
|
61834
|
+
$container.insertBefore($parent_filter, find_by_id($container, table_id));
|
|
61734
61835
|
let $toolbar_slot = $container.querySelector(".toolbar_tabulator_table");
|
|
61735
61836
|
if ($table_toolbar instanceof Element) $toolbar_slot.appendChild($table_toolbar);
|
|
61736
61837
|
else $toolbar_slot.appendChild((0, _yuneta_gobj_js.createElement2)(["div", {}]));
|
|
@@ -62177,7 +62278,7 @@ function create_tabulator(gobj) {
|
|
|
62177
62278
|
autoResize: false
|
|
62178
62279
|
});
|
|
62179
62280
|
let $view_container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
62180
|
-
let $table_el = $view_container ? $view_container
|
|
62281
|
+
let $table_el = $view_container ? find_by_id($view_container, table_id) : null;
|
|
62181
62282
|
if (!$table_el) {
|
|
62182
62283
|
(0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: table element '#${table_id}' not found in $container`);
|
|
62183
62284
|
return;
|
|
@@ -75878,7 +75979,7 @@ function mt_create$3(gobj) {
|
|
|
75878
75979
|
if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "readonly") && priv.operation_mode === "edition") (0, _yuneta_gobj_js.gobj_write_str_attr)(gobj, "operation_mode", "reading");
|
|
75879
75980
|
let canvas_id = (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)) + "-canvas";
|
|
75880
75981
|
(0, _yuneta_gobj_js.gobj_write_attr)(gobj, "canvas_id", canvas_id);
|
|
75881
|
-
let $container_canvas = build_ui$3(gobj)
|
|
75982
|
+
let $container_canvas = find_by_id(build_ui$3(gobj), priv.canvas_id);
|
|
75882
75983
|
priv.gobj_nodes_tree = (0, _yuneta_gobj_js.gobj_create_service)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}-g6`, "C_G6_NODES_TREE", {
|
|
75883
75984
|
$container: $container_canvas,
|
|
75884
75985
|
subscriber: gobj,
|
|
@@ -78586,6 +78687,7 @@ var __gclass__$2 = null;
|
|
|
78586
78687
|
* Framework Methods
|
|
78587
78688
|
******************************/
|
|
78588
78689
|
function mt_create$2(gobj) {
|
|
78690
|
+
ensure_drag_canvas_patch();
|
|
78589
78691
|
ensure_pinch_zoom_patch();
|
|
78590
78692
|
build_ui$2(gobj);
|
|
78591
78693
|
let subscriber = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "subscriber");
|
|
@@ -82929,7 +83031,7 @@ function form_changes(initial, values) {
|
|
|
82929
83031
|
function apply_form_changes(gobj, $form, changes) {
|
|
82930
83032
|
for (let name of Object.keys(changes)) {
|
|
82931
83033
|
if (name === "flag") continue;
|
|
82932
|
-
let $control = $form.querySelector(`[data-name="${name}"]`);
|
|
83034
|
+
let $control = $form.querySelector(`[data-name="${css_string(name)}"]`);
|
|
82933
83035
|
if (!$control) {
|
|
82934
83036
|
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: a change of '${name}' has no field in the form opened again: not put back`);
|
|
82935
83037
|
continue;
|