@yuneta/gobj-ui 7.26.40 → 7.26.42

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.
Files changed (39) hide show
  1. package/README.md +325 -65
  2. package/dist/gobj-ui.cjs.js +418 -176
  3. package/dist/gobj-ui.es.js +418 -176
  4. package/package.json +1 -1
  5. package/scripts/validate-locales.mjs +644 -142
  6. package/src/c_g6_nodes_tree.js +3 -2
  7. package/src/c_yui_form.js +80 -68
  8. package/src/c_yui_fsm_graph.js +3 -2
  9. package/src/c_yui_gobj_tree_js.js +3 -2
  10. package/src/c_yui_json_graph.js +3 -2
  11. package/src/c_yui_nav.js +43 -28
  12. package/src/c_yui_schema_editor.css +16 -0
  13. package/src/c_yui_schema_editor.js +61 -17
  14. package/src/c_yui_shell.js +199 -59
  15. package/src/c_yui_treedb_schema.js +3 -2
  16. package/src/c_yui_window_manager.js +6 -6
  17. package/src/form_table_edits_ask.wiring.test.js +398 -0
  18. package/src/form_table_rearm.wiring.test.js +9 -7
  19. package/src/g6_canvas_tab_order.css +29 -0
  20. package/src/g6_canvas_tab_order.js +41 -9
  21. package/src/g6_canvas_tab_order.wiring.test.js +107 -1
  22. package/src/i18n_key_functions.js +41 -25
  23. package/src/i18n_key_functions.test.js +178 -2
  24. package/src/modal_guard_back.wiring.test.js +135 -0
  25. package/src/named_controls.wiring.test.js +270 -6
  26. package/src/nav_cards_helpers.js +9 -4
  27. package/src/nav_item_badge.wiring.test.js +163 -15
  28. package/src/route_map_model.js +59 -10
  29. package/src/route_map_model.test.js +90 -0
  30. package/src/schema_editor_openers.wiring.test.js +283 -0
  31. package/src/shell_modals.js +24 -4
  32. package/src/shell_route_map.js +15 -3
  33. package/src/shell_section_index.js +3 -1
  34. package/src/window_layer.wiring.test.js +114 -0
  35. package/src/yui_gclass_view.js +16 -1
  36. package/src/yui_tabulator_i18n.js +21 -1
  37. package/src/yui_tabulator_i18n.test.js +39 -0
  38. package/src/yui_text.js +10 -0
  39. package/src/yui_text.test.js +13 -0
@@ -505,8 +505,16 @@ function text_node(value) {
505
505
  * Tabulator puts a STRING title in with innerHTML, so a title taken
506
506
  * from a schema (`header`, which the schema editor writes) is markup
507
507
  * unless the column carries a formatter that returns a Node.
508
+ *
509
+ * And it APPENDS that Node to the title's holder, which it never
510
+ * empties -- while it runs the formatter again on every setLocale()
511
+ * (yui_tabulator_relocalize()). Until 7.26.40 each change of language
512
+ * added one more copy of every title ("Id dispositivoId dispositivo").
513
+ * The holder (the mock cell's element) is emptied first.
508
514
  ************************************************************/
509
515
  function text_title_formatter(cell) {
516
+ const $holder = typeof cell.getElement === "function" ? cell.getElement() : null;
517
+ if ($holder) $holder.textContent = "";
510
518
  return text_node(cell.getValue());
511
519
  }
512
520
  /************************************************************
@@ -701,12 +709,42 @@ function paint_badge($badge, value, tone) {
701
709
  * All Rights Reserved.
702
710
  ***********************************************************************/
703
711
  /************************************************************
712
+ * The label of a row is the name of its CONTROL: one rule names
713
+ * an item everywhere.
714
+ *
715
+ * - A menu entry, as the nav names it (c_yui_nav.js item_li):
716
+ * its `name`, else its `aria_label`, else its id.
717
+ * - A toolbar item and a row of its dropdown, as the toolbar
718
+ * names them (c_yui_shell.js build_toolbar_*): its
719
+ * `aria_label` first -- the visible `name` of a toolbar
720
+ * button is often a symbol ("ES/EN") --, then its `name`,
721
+ * then, for an avatar or a connection dot, the library's own
722
+ * key, else its id.
723
+ *
724
+ * A route is no key: it has its own column, and an item with
725
+ * none of these has no label. Up to 7.26.41 a row was labelled
726
+ * `name || wordmark || id || route` -- an entry that declares
727
+ * only an `aria_label` had its id here, the language button read
728
+ * "ES/EN" where its control says "toggle language", and a route
729
+ * was asked of the locales as a key.
730
+ ************************************************************/
731
+ function menu_item_label(it) {
732
+ return it.name || it.aria_label || it.id || "";
733
+ }
734
+ function toolbar_item_label(it) {
735
+ let fallback = it.id || "";
736
+ if (it.type === "avatar") fallback = "user menu";
737
+ else if (it.type === "connection") fallback = "backend connection";
738
+ return it.aria_label || it.name || fallback;
739
+ }
740
+ /************************************************************
704
741
  * One node of the nav map from a declared config item, in
705
742
  * DECLARATION ORDER (never sorted). Recurses into static submenus
706
743
  * and toolbar dropdowns, and merges the LIVE dynamic submenu tabs
707
744
  * (added at runtime via yui_shell_set_submenu) by parent id.
745
+ * `label_of` names it: menu_item_label() or toolbar_item_label().
708
746
  ************************************************************/
709
- function nav_node_from_item(it, index) {
747
+ function nav_node_from_item(it, index, label_of) {
710
748
  if (!it || it.type === "divider" || it.type === "header") return null;
711
749
  let action = it.action || {};
712
750
  let route = it.route || (action.type === "navigate" ? action.route : "") || "";
@@ -719,7 +757,7 @@ function nav_node_from_item(it, index) {
719
757
  }
720
758
  let node = {
721
759
  id: it.id || "",
722
- label: it.name || it.wordmark || it.id || route || "",
760
+ label: label_of(it),
723
761
  icon: it.icon || "",
724
762
  route,
725
763
  event,
@@ -729,14 +767,14 @@ function nav_node_from_item(it, index) {
729
767
  };
730
768
  let sub_items = it.submenu && Array.isArray(it.submenu.items) ? it.submenu.items : action.type === "dropdown" && Array.isArray(action.items) ? action.items : null;
731
769
  if (sub_items) for (let s of sub_items) {
732
- let n = nav_node_from_item(s, index);
770
+ let n = nav_node_from_item(s, index, label_of);
733
771
  if (n) node.children.push(n);
734
772
  }
735
773
  if (it.id && index) for (let r of Object.keys(index)) {
736
774
  let e = index[r];
737
775
  if (e && e.parent_item && e.parent_item.id === it.id && !node.children.some((c) => c.route === r)) node.children.push({
738
776
  id: e.item && e.item.id || "",
739
- label: e.item && e.item.name || r,
777
+ label: e.item ? menu_item_label(e.item) : "",
740
778
  icon: e.item && e.item.icon || "",
741
779
  route: r,
742
780
  event: "",
@@ -852,7 +890,10 @@ function mark_current(groups, current_route) {
852
890
  *
853
891
  * - `nav` walks EVERY declared menu in declaration order: the
854
892
  * `primary` menu contributes its items flat (the common case);
855
- * any other menu contributes a group node labelled by its key.
893
+ * any other menu contributes a group node labelled by its key,
894
+ * as data (`data_label: true`).
895
+ * - a node is labelled as its control is named (menu_item_label(),
896
+ * toolbar_item_label()); a node no item names has label "".
856
897
  * - `other` lists the routes declared only in the route table
857
898
  * (config.shell.routes) that no rendered node covers — root "/",
858
899
  * URL-only action routes, toolbar-less forms. Brand-covered
@@ -887,7 +928,7 @@ function build_nav_map(input) {
887
928
  };
888
929
  continue;
889
930
  }
890
- let n = nav_node_from_item(it, index);
931
+ let n = nav_node_from_item(it, index, toolbar_item_label);
891
932
  if (n) toolbar.push(n);
892
933
  }
893
934
  let nav = [];
@@ -897,13 +938,14 @@ function build_nav_map(input) {
897
938
  if (!m || !Array.isArray(m.items)) continue;
898
939
  let nodes = [];
899
940
  for (let it of m.items) {
900
- let n = nav_node_from_item(it, index);
941
+ let n = nav_node_from_item(it, index, menu_item_label);
901
942
  if (n) nodes.push(n);
902
943
  }
903
944
  if (menu_id === "primary") nav = nav.concat(nodes);
904
945
  else if (nodes.length) nav.push({
905
946
  id: menu_id,
906
947
  label: menu_id,
948
+ data_label: true,
907
949
  icon: "",
908
950
  route: "",
909
951
  event: "",
@@ -930,7 +972,7 @@ function build_nav_map(input) {
930
972
  let tgt = e && e.target || null;
931
973
  other.push({
932
974
  id: e && e.item && e.item.id || "",
933
- label: e && e.item && (e.item.name || e.item.id) || r,
975
+ label: e && e.item ? menu_item_label(e.item) : "",
934
976
  icon: e && e.item && e.item.icon || "",
935
977
  route: r,
936
978
  event: tgt && tgt.kind === "action" && tgt.event || "",
@@ -1010,7 +1052,7 @@ function section_index_target(menu_id, item) {
1010
1052
  gclass: "C_YUI_NAV",
1011
1053
  kw: {
1012
1054
  menu_id: `index.${menu_id}.${item.id}`,
1013
- nav_label: item.name || item.id || "",
1055
+ nav_label: item.name || item.aria_label || item.id || "",
1014
1056
  menu_items: sub.items,
1015
1057
  layout: "cards",
1016
1058
  level: "secondary"
@@ -1082,7 +1124,7 @@ function secondary_nav_renders(item, layout) {
1082
1124
  * Constants
1083
1125
  ***************************************************************/
1084
1126
  var GCLASS_NAME$22 = "C_YUI_SHELL";
1085
- var __last_shell__ = null;
1127
+ var __live_shells__ = [];
1086
1128
  var __shell_watchers__ = [];
1087
1129
  var __window_z__ = 10;
1088
1130
  var ZONE_IDS = [
@@ -1125,6 +1167,8 @@ var PRIVATE_DATA$22 = {
1125
1167
  item_index: {},
1126
1168
  nav_badges: {},
1127
1169
  badge_status: null,
1170
+ badge_news: [],
1171
+ badge_news_closing: false,
1128
1172
  dynamic_items: {},
1129
1173
  section_pos: {},
1130
1174
  route_mru: [],
@@ -1163,7 +1207,7 @@ var __gclass__$22 = null;
1163
1207
  function mt_create$22(gobj) {
1164
1208
  const subscriber = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "subscriber");
1165
1209
  if (subscriber) (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
1166
- __last_shell__ = gobj;
1210
+ __live_shells__.push(gobj);
1167
1211
  build_ui$19(gobj);
1168
1212
  tell_shell_watchers(gobj);
1169
1213
  }
@@ -1349,7 +1393,8 @@ function mt_stop$20(gobj) {
1349
1393
  ***************************************************************/
1350
1394
  function mt_destroy$22(gobj) {
1351
1395
  close_toolbar_dropdown(gobj);
1352
- if (__last_shell__ === gobj) __last_shell__ = null;
1396
+ let live_idx = __live_shells__.indexOf(gobj);
1397
+ if (live_idx >= 0) __live_shells__.splice(live_idx, 1);
1353
1398
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
1354
1399
  if ($container && $container.parentNode) $container.parentNode.removeChild($container);
1355
1400
  tell_shell_watchers(gobj);
@@ -1732,7 +1777,7 @@ function instantiate_menus(gobj, config) {
1732
1777
  let nav = instantiate_nav_in_zone(gobj, {
1733
1778
  items: sub.items,
1734
1779
  render: { [zone_id]: render_cfg }
1735
- }, sub_menu_id, zone_id, "secondary", item.name || "");
1780
+ }, sub_menu_id, zone_id, "secondary", item.name || item.aria_label || item.id || "");
1736
1781
  let $c = (0, _yuneta_gobj_js.gobj_read_attr)(nav, "$container");
1737
1782
  if ($c) $c.classList.add("is-hidden");
1738
1783
  }
@@ -2100,25 +2145,24 @@ function build_toolbar_action_item(gobj, it) {
2100
2145
  },
2101
2146
  text_node(it.name)
2102
2147
  ]);
2103
- let aria_key = it.aria_label || it.name || it.id || "";
2104
- let i18n_aria = it.aria_label || it.name;
2148
+ let name_key = it.aria_label || it.name || it.id || "";
2105
2149
  let btn_attrs = {
2106
2150
  class: "navbar-item yui-toolbar-item is-unselectable",
2107
2151
  type: "button",
2108
2152
  "data-toolbar-item-id": it.id || "",
2109
- "aria-label": aria_key
2153
+ "aria-label": name_key
2110
2154
  };
2111
- if (i18n_aria) btn_attrs["data-i18n-aria-label"] = i18n_aria;
2155
+ if (name_key) btn_attrs["data-i18n-aria-label"] = name_key;
2112
2156
  if ((it.action && it.action.type || "") === "dropdown") {
2113
2157
  btn_attrs["aria-haspopup"] = "menu";
2114
2158
  btn_attrs["aria-expanded"] = "false";
2115
2159
  }
2116
- let tip = it.tooltip || i18n_aria;
2160
+ let tip = it.tooltip || name_key;
2117
2161
  if (tip) {
2118
2162
  btn_attrs.title = tip;
2119
2163
  btn_attrs["data-i18n-title"] = tip;
2120
2164
  }
2121
- if (badge && !(0, _yuneta_gobj_js.empty_string)(aria_key)) name_control_with_badge(btn_attrs, badge);
2165
+ if (badge && !(0, _yuneta_gobj_js.empty_string)(name_key)) name_control_with_badge(btn_attrs, badge);
2122
2166
  let link = toolbar_link_attrs(it);
2123
2167
  if (link) {
2124
2168
  delete btn_attrs.type;
@@ -2202,21 +2246,20 @@ function build_toolbar_brand_item(gobj, it) {
2202
2246
  ************************************************************/
2203
2247
  function build_toolbar_avatar_item(gobj, it) {
2204
2248
  let priv = gobj.priv;
2205
- const aria_key = it.aria_label || it.name || it.id || "user menu";
2206
- const i18n_aria = it.aria_label || it.name || "user menu";
2249
+ const name_key = it.aria_label || it.name || "user menu";
2207
2250
  let action_type = it.action && it.action.type || "";
2208
2251
  let attrs = {
2209
2252
  class: "navbar-item yui-toolbar-item yui-toolbar-avatar is-unselectable",
2210
2253
  type: "button",
2211
2254
  "data-toolbar-item-id": it.id || "",
2212
- "aria-label": aria_key,
2213
- "data-i18n-aria-label": i18n_aria
2255
+ "aria-label": name_key,
2256
+ "data-i18n-aria-label": name_key
2214
2257
  };
2215
2258
  if (action_type === "dropdown") {
2216
2259
  attrs["aria-haspopup"] = "menu";
2217
2260
  attrs["aria-expanded"] = "false";
2218
2261
  }
2219
- let tip = it.tooltip || i18n_aria;
2262
+ let tip = it.tooltip || name_key;
2220
2263
  if (tip) {
2221
2264
  attrs.title = tip;
2222
2265
  attrs["data-i18n-title"] = tip;
@@ -2279,16 +2322,15 @@ function attach_context_action(gobj, $item, it) {
2279
2322
  ************************************************************/
2280
2323
  function build_toolbar_connection_item(gobj, it) {
2281
2324
  let priv = gobj.priv;
2282
- const aria_key = it.aria_label || it.name || it.id || "backend connection";
2283
- const i18n_aria = it.aria_label || it.name || "backend connection";
2325
+ const name_key = it.aria_label || it.name || "backend connection";
2284
2326
  let attrs = {
2285
2327
  class: "navbar-item yui-toolbar-item yui-toolbar-conn is-unselectable is-disconnected",
2286
2328
  type: "button",
2287
2329
  "data-toolbar-item-id": it.id || "",
2288
- "aria-label": aria_key,
2289
- "data-i18n-aria-label": i18n_aria
2330
+ "aria-label": name_key,
2331
+ "data-i18n-aria-label": name_key
2290
2332
  };
2291
- let tip = it.tooltip || i18n_aria;
2333
+ let tip = it.tooltip || name_key;
2292
2334
  if (tip) {
2293
2335
  attrs.title = tip;
2294
2336
  attrs["data-i18n-title"] = tip;
@@ -2386,13 +2428,12 @@ function toggle_toolbar_dropdown(gobj, item, action, $trigger) {
2386
2428
  function open_toolbar_dropdown(gobj, item, action, $trigger) {
2387
2429
  let priv = gobj.priv;
2388
2430
  if (!priv || !priv.layers || !priv.layers.popup) return;
2389
- const aria_key = item && (item.aria_label || item.name || item.id) || "menu";
2390
- const i18n_aria = item && (item.aria_label || item.name) || "menu";
2431
+ const name_key = item && (item.aria_label || item.name || (classify_toolbar_item(item) === "avatar" ? "user menu" : item.id)) || "menu";
2391
2432
  let $panel = (0, _yuneta_gobj_js.createElement2)(["div", {
2392
2433
  class: "yui-toolbar-dropdown-panel",
2393
2434
  role: "menu",
2394
- "aria-label": aria_key,
2395
- "data-i18n-aria-label": i18n_aria,
2435
+ "aria-label": name_key,
2436
+ "data-i18n-aria-label": name_key,
2396
2437
  "data-toolbar-dropdown-for": item && item.id || ""
2397
2438
  }]);
2398
2439
  let raw_items = (0, _yuneta_gobj_js.is_array)(action.items) ? action.items : [];
@@ -2525,20 +2566,19 @@ function build_dropdown_row(gobj, sub, idx) {
2525
2566
  "aria-hidden": "true"
2526
2567
  }]
2527
2568
  ]);
2528
- let aria_key = sub.aria_label || sub.name || sub.id || "";
2529
- let i18n_aria = sub.aria_label || sub.name;
2569
+ let name_key = sub.aria_label || sub.name || sub.id || "";
2530
2570
  let attrs = {
2531
2571
  class: "yui-toolbar-dropdown-item" + (sub.selected ? " is-selected" : ""),
2532
2572
  type: "button",
2533
2573
  role: "menuitemradio",
2534
2574
  "aria-checked": sub.selected ? "true" : "false",
2535
2575
  "data-dropdown-item-id": sub.id || "",
2536
- "aria-label": aria_key
2576
+ "aria-label": name_key
2537
2577
  };
2538
- if (i18n_aria) {
2539
- attrs["data-i18n-aria-label"] = i18n_aria;
2540
- attrs.title = i18n_aria;
2541
- attrs["data-i18n-title"] = i18n_aria;
2578
+ if (name_key) {
2579
+ attrs["data-i18n-aria-label"] = name_key;
2580
+ attrs.title = name_key;
2581
+ attrs["data-i18n-title"] = name_key;
2542
2582
  }
2543
2583
  let $btn = (0, _yuneta_gobj_js.createElement2)([
2544
2584
  "button",
@@ -2960,11 +3000,23 @@ function shell_navs(gobj) {
2960
3000
  * `name_key` is the key of the control's name; the phrase is a
2961
3001
  * key of its own, so a language orders and punctuates it its
2962
3002
  * way. Said once: a live region needs no re-translation.
2963
- ************************************************************/
2964
- function announce_badge(gobj, name_key, text) {
2965
- let priv = gobj.priv;
2966
- let $status = priv.badge_status;
2967
- if (!$status) {
3003
+ *
3004
+ * `source` names the badge ("toolbar:<id>", "nav:<id>"). Every
3005
+ * change of ONE turn of the loop is said in ONE message, a line
3006
+ * of the region each, in the order they came; a badge that moves
3007
+ * twice in the turn says its last count. Up to 7.26.41 each
3008
+ * change replaced the region's text, and a reader hears the
3009
+ * region as it is when the turn is over: of two changes in one
3010
+ * action (a feed that updates the toolbar's count and the menu
3011
+ * entry's, which is what a count is for) only the second was
3012
+ * ever said. The turn is closed by EV_CLOSE_BADGE_NEWS, posted to
3013
+ * the shell by its first change: gobj_post_event() delivers it on
3014
+ * the next turn, through the machine -- a deferral, not a time.
3015
+ ************************************************************/
3016
+ function announce_badge(gobj, name_key, text, source) {
3017
+ let priv = gobj.priv;
3018
+ if ((0, _yuneta_gobj_js.gobj_is_destroying)(gobj)) return;
3019
+ if (!priv.badge_status) {
2968
3020
  (0, _yuneta_gobj_js.log_error)(`C_YUI_SHELL: no live region to say badge '${name_key}': ${text}`);
2969
3021
  return;
2970
3022
  }
@@ -2973,10 +3025,60 @@ function announce_badge(gobj, name_key, text) {
2973
3025
  const tr = priv.translator;
2974
3026
  message = tr("{{name}}, {{n}}", {
2975
3027
  name: tr(name_key),
2976
- n: text
3028
+ n: text,
3029
+ interpolation: { escapeValue: false }
2977
3030
  });
2978
3031
  } else message = `${name_key}, ${text}`;
2979
- $status.textContent = message;
3032
+ let news = priv.badge_news.find((n) => n.source === source);
3033
+ if (news) news.message = message;
3034
+ else priv.badge_news.push({
3035
+ source,
3036
+ message
3037
+ });
3038
+ write_badge_news(gobj);
3039
+ if (priv.badge_news_closing) return;
3040
+ if ((0, _yuneta_gobj_js.gobj_post_event)(gobj, "EV_CLOSE_BADGE_NEWS", {}, gobj) < 0) {
3041
+ priv.badge_news = [];
3042
+ return;
3043
+ }
3044
+ priv.badge_news_closing = true;
3045
+ }
3046
+ /************************************************************
3047
+ * A badge whose count went away in the turn it changed: what
3048
+ * this turn said of it is no news any more -- the badge shows
3049
+ * nothing -- and is taken out of the message.
3050
+ ************************************************************/
3051
+ function forget_badge_news(gobj, source) {
3052
+ let priv = gobj.priv;
3053
+ let idx = priv.badge_news.findIndex((n) => n.source === source);
3054
+ if (idx < 0) return;
3055
+ priv.badge_news.splice(idx, 1);
3056
+ write_badge_news(gobj);
3057
+ }
3058
+ /************************************************************
3059
+ * The live region holds the message of this turn: a line per
3060
+ * change, so a reader separates them without a punctuation of
3061
+ * ours, and two controls of one name with one count say it once.
3062
+ *
3063
+ * Written whole, and with new nodes, even when it reads the same:
3064
+ * the callers filter what is no news, and a count that went away
3065
+ * and came back IS news -- a new text node is a change a reader
3066
+ * announces.
3067
+ ************************************************************/
3068
+ function write_badge_news(gobj) {
3069
+ let priv = gobj.priv;
3070
+ let said = [];
3071
+ let $lines = [];
3072
+ for (let news of priv.badge_news) {
3073
+ if (said.includes(news.message)) continue;
3074
+ said.push(news.message);
3075
+ $lines.push((0, _yuneta_gobj_js.createElement2)([
3076
+ "div",
3077
+ { class: "SHELL_BADGE_NEWS" },
3078
+ text_node(news.message)
3079
+ ]));
3080
+ }
3081
+ priv.badge_status.replaceChildren(...$lines);
2980
3082
  }
2981
3083
  /************************************************************
2982
3084
  * A shell was built (mt_create) or is being destroyed
@@ -3049,6 +3151,19 @@ function ac_back_wait_timeout(gobj, event, kw, src) {
3049
3151
  return 0;
3050
3152
  }
3051
3153
  /************************************************************
3154
+ * The turn in which badges changed is over (posted by the first
3155
+ * change, announce_badge()): the message in the live region is
3156
+ * complete, and a reader hears it as it stands. The next change
3157
+ * starts a message of its own -- added to this one, it would say
3158
+ * again what was already said.
3159
+ ************************************************************/
3160
+ function ac_close_badge_news(gobj, event, kw, src) {
3161
+ let priv = gobj.priv;
3162
+ priv.badge_news = [];
3163
+ priv.badge_news_closing = false;
3164
+ return 0;
3165
+ }
3166
+ /************************************************************
3052
3167
  * Drawer backdrop click on a C_YUI_NAV child: the nav publishes
3053
3168
  * this so the shell can close the drawer through the canonical
3054
3169
  * flow (DOM + focus-trap + escape-stack pop) instead of mutating
@@ -3126,12 +3241,18 @@ function create_gclass$22(gclass_name) {
3126
3241
  "EV_BACK_WAIT_TIMEOUT",
3127
3242
  ac_back_wait_timeout,
3128
3243
  null
3244
+ ],
3245
+ [
3246
+ "EV_CLOSE_BADGE_NEWS",
3247
+ ac_close_badge_news,
3248
+ null
3129
3249
  ]
3130
3250
  ]]];
3131
3251
  const event_types = [
3132
3252
  ["EV_NAV_CLICKED", 0],
3133
3253
  ["EV_DRAWER_CLOSE_REQUESTED", 0],
3134
3254
  ["EV_BACK_WAIT_TIMEOUT", 0],
3255
+ ["EV_CLOSE_BADGE_NEWS", 0],
3135
3256
  ["EV_NAV_ITEM_CLOSE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
3136
3257
  ["EV_ROUTE_REQUESTED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
3137
3258
  ["EV_ROUTE_CHANGED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
@@ -3257,9 +3378,9 @@ function yui_shell_previous_route(shell_gobj) {
3257
3378
  /************************************************************
3258
3379
  * Resolve the shell that governs `gobj`: the nearest
3259
3380
  * C_YUI_SHELL ancestor, else the last shell created on the
3260
- * page (apps have exactly one). Null when no shell exists —
3261
- * callers must degrade loudly (shell_modals logs a warning
3262
- * and resolves the safe default).
3381
+ * page that is still alive (apps have exactly one). Null when
3382
+ * no shell exists — callers must degrade loudly (shell_modals
3383
+ * logs a warning and resolves the safe default).
3263
3384
  ************************************************************/
3264
3385
  function yui_shell_of(gobj) {
3265
3386
  let g = gobj;
@@ -3267,7 +3388,7 @@ function yui_shell_of(gobj) {
3267
3388
  if ((0, _yuneta_gobj_js.gobj_gclass_name)(g) === GCLASS_NAME$22) return g;
3268
3389
  g = (0, _yuneta_gobj_js.gobj_parent)(g);
3269
3390
  }
3270
- return __last_shell__;
3391
+ return __live_shells__.length > 0 ? __live_shells__[__live_shells__.length - 1] : null;
3271
3392
  }
3272
3393
  /************************************************************
3273
3394
  * The DOM where a C_YUI_WINDOW lives when its host names no
@@ -3605,8 +3726,8 @@ function yui_shell_set_toolbar_item_badge(shell_gobj, item_id, value, tone) {
3605
3726
  let now = badge_text(value);
3606
3727
  if (now && now !== before) {
3607
3728
  let $item = $badge.closest("[data-toolbar-item-id]");
3608
- announce_badge(shell_gobj, $item && $item.getAttribute("data-i18n-aria-label") || item_id, now);
3609
- }
3729
+ announce_badge(shell_gobj, $item && $item.getAttribute("data-i18n-aria-label") || item_id, now, `toolbar:${item_id}`);
3730
+ } else if (!now) forget_badge_news(shell_gobj, `toolbar:${item_id}`);
3610
3731
  }
3611
3732
  /************************************************************
3612
3733
  * Set (or clear) the badge of a MENU item — the twin of
@@ -3655,7 +3776,8 @@ function yui_shell_set_nav_item_badge(shell_gobj, item_id, value, tone) {
3655
3776
  badge_tone: tone
3656
3777
  }, shell_gobj);
3657
3778
  let now = badge_text(badge);
3658
- if (now && now !== before) announce_badge(shell_gobj, item.name || item_id, now);
3779
+ if (now && now !== before) announce_badge(shell_gobj, item.name || item.aria_label || item_id, now, `nav:${item_id}`);
3780
+ else if (!now) forget_badge_news(shell_gobj, `nav:${item_id}`);
3659
3781
  }
3660
3782
  /************************************************************
3661
3783
  * Programmatic close of any open toolbar dropdown. Useful for
@@ -3971,7 +4093,19 @@ function yui_shell_show_modal(shell, content, opts) {
3971
4093
  allow = true;
3972
4094
  }
3973
4095
  if (allow && typeof allow.then === "function") {
3974
- if (typeof on_veto === "function") allow.then(on_veto, on_veto);
4096
+ let vetoed = function() {
4097
+ if (typeof on_veto === "function") on_veto();
4098
+ };
4099
+ allow.then(function(answer) {
4100
+ if (answer === true) {
4101
+ do_close();
4102
+ return;
4103
+ }
4104
+ vetoed();
4105
+ }, function(e) {
4106
+ (0, _yuneta_gobj_js.log_warning)(`yui_shell_show_modal: before_close rejected: ${e}`);
4107
+ vetoed();
4108
+ });
3975
4109
  return;
3976
4110
  }
3977
4111
  if (allow === false) {
@@ -5573,12 +5707,12 @@ function apply_placement(gobj) {
5573
5707
  * and it covered a toast where they met.
5574
5708
  *
5575
5709
  * The popup layer, not the window layer: the dock has to stay
5576
- * above EVERY window, and windows live in two layers -- the
5577
- * window layer (no `$parent`) and the popup layer, where the
5578
- * site map and the JSON windows of the treedb views put theirs.
5579
- * Above both; below the dialogs, the toasts and the loading
5580
- * cover. No shell (before the first, between a logout and the
5581
- * next login): the body.
5710
+ * above EVERY window, and the windows live in the window layer
5711
+ * -- since 7.26.35 the site map and the JSON windows of the
5712
+ * treedb views too, which put theirs in the popup layer until
5713
+ * then. The popup layer is above it; below the dialogs, the
5714
+ * toasts and the loading cover. No shell (before the first,
5715
+ * between a logout and the next login): the body.
5582
5716
  ************************************************************/
5583
5717
  function dock_place(gobj) {
5584
5718
  return yui_shell_popup_layer(yui_shell_of(gobj)) || document.body;
@@ -7106,6 +7240,12 @@ function register_c_yui_wizard() {
7106
7240
  * new Tabulator($el, {..., ...yui_tabulator_lang(t)});
7107
7241
  * yui_tabulator_relocalize(table, t); // on a language change
7108
7242
  *
7243
+ * A view whose COLUMN TITLES change language hands them too, in the
7244
+ * new language, by field -- Tabulator binds each column's title to its
7245
+ * locale, so they change with it and no column is rebuilt:
7246
+ *
7247
+ * yui_tabulator_relocalize(table, t, {device_id: t("device id")});
7248
+ *
7109
7249
  * Every key carries an English `defaultValue`, so an app that does not
7110
7250
  * define it renders exactly what Tabulator rendered before — the
7111
7251
  * keys are an OPPORTUNITY to translate, never a requirement.
@@ -7264,11 +7404,23 @@ function yui_tabulator_name_editor(column_def, name_of) {
7264
7404
  return Object.assign({}, params, { elementAttributes: attrs });
7265
7405
  };
7266
7406
  }
7267
- function yui_tabulator_relocalize(table, t) {
7407
+ /***************************************************************
7408
+ * yui_tabulator_relocalize() -- see "Put an EXISTING table in the
7409
+ * current language" above.
7410
+ *
7411
+ * `titles`, optional: {field: title}, the titles of the columns in
7412
+ * the new language, already translated. They go in the locale
7413
+ * (`columns`), where Tabulator binds each column's title: setLocale()
7414
+ * draws them again without rebuilding a column -- updateDefinition()
7415
+ * re-renders every row, and a row whose formatter builds something (a
7416
+ * nested table) builds it anew. A field left out keeps its title.
7417
+ ***************************************************************/
7418
+ function yui_tabulator_relocalize(table, t, titles) {
7268
7419
  if (!table) return;
7269
7420
  try {
7270
7421
  let name = next_lang_name();
7271
7422
  let strings = tabulator_strings(t);
7423
+ if (titles && typeof titles === "object") strings.columns = Object.assign({}, titles);
7272
7424
  table.options.langs = table.options.langs || {};
7273
7425
  table.options.langs[name] = strings;
7274
7426
  let localize = table.modules && table.modules.localize;
@@ -9487,7 +9639,7 @@ var attrs_table$17 = [
9487
9639
  (0, _yuneta_gobj_js.SDATA_END)()
9488
9640
  ];
9489
9641
  var PRIVATE_DATA$17 = {
9490
- rearm_timer: null,
9642
+ loading_rows: 0,
9491
9643
  tables: null,
9492
9644
  table_seq: 0,
9493
9645
  json_names_posted: false,
@@ -9543,18 +9695,12 @@ function mt_stop$17(gobj) {
9543
9695
  * Local Methods
9544
9696
  ***************************/
9545
9697
  /************************************************************
9546
- *
9547
- ************************************************************/
9548
- function isEventSet(table, event) {
9549
- let eventListeners = table.externalEvents.events;
9550
- return eventListeners && eventListeners[event] && eventListeners[event].length > 0;
9551
- }
9552
- /************************************************************
9553
- *
9698
+ * `changes` and the save/undo buttons. What the tables say is
9699
+ * not switched here: they always say it (create_tabulator).
9554
9700
  ************************************************************/
9555
9701
  function set_changed_stated(gobj, changed) {
9556
9702
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
9557
- let $form = $container.querySelector("form");
9703
+ $container.querySelector("form");
9558
9704
  const enable = ($btn, on, color) => {
9559
9705
  if (!$btn) return;
9560
9706
  if (on) $btn.removeAttribute("disabled");
@@ -9569,35 +9715,11 @@ function set_changed_stated(gobj, changed) {
9569
9715
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "changes", true);
9570
9716
  enable($button_save, true, "MediumSeaGreen");
9571
9717
  enable($button_undo, true, "Magenta");
9572
- $form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
9573
- if ($table.tabulator && isEventSet($table.tabulator, "dataChanged")) $table.tabulator.off("dataChanged");
9574
- $table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
9575
- if ($table_nested.tabulator && isEventSet($table_nested.tabulator, "dataChanged")) $table_nested.tabulator.off("dataChanged");
9576
- });
9577
- });
9578
9718
  } else {
9579
9719
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "changes", false);
9580
9720
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "edited", false);
9581
9721
  enable($button_save, false, OFF_COLOR);
9582
9722
  enable($button_undo, false, OFF_COLOR);
9583
- if (gobj.priv.rearm_timer) clearTimeout(gobj.priv.rearm_timer);
9584
- gobj.priv.rearm_timer = setTimeout(function() {
9585
- gobj.priv.rearm_timer = null;
9586
- if ((0, _yuneta_gobj_js.gobj_is_destroying)(gobj)) return;
9587
- const rearm = (tabulator) => {
9588
- if (!tabulator) return;
9589
- if (isEventSet(tabulator, "dataChanged")) tabulator.off("dataChanged");
9590
- tabulator.on("dataChanged", function(data) {
9591
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
9592
- });
9593
- };
9594
- $form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
9595
- rearm($table.tabulator);
9596
- $table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
9597
- rearm($table_nested.tabulator);
9598
- });
9599
- });
9600
- }, 200);
9601
9723
  }
9602
9724
  }
9603
9725
  /************************************************************
@@ -9834,10 +9956,6 @@ function build_ui$15(gobj) {
9834
9956
  * Destroy UI
9835
9957
  ************************************************************/
9836
9958
  function destroy_ui$10(gobj) {
9837
- if (gobj.priv && gobj.priv.rearm_timer) {
9838
- clearTimeout(gobj.priv.rearm_timer);
9839
- gobj.priv.rearm_timer = null;
9840
- }
9841
9959
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
9842
9960
  if ($container) {
9843
9961
  destroy_widgets(gobj, $container);
@@ -11231,6 +11349,10 @@ function create_tabulator$1(gobj, $extend, name, template) {
11231
11349
  hozAlign: "center"
11232
11350
  };
11233
11351
  let tabulator = new tabulator_tables.TabulatorFull($extend, tabulator_settings);
11352
+ tabulator.on("dataChanged", function() {
11353
+ if (gobj.priv.loading_rows > 0) return;
11354
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
11355
+ });
11234
11356
  tabulator.on("renderComplete", function() {
11235
11357
  yui_tabulator_name_row_selects(tabulator, i18next.t);
11236
11358
  });
@@ -11248,6 +11370,24 @@ function create_tabulator$1(gobj, $extend, name, template) {
11248
11370
  return tabulator;
11249
11371
  }
11250
11372
  /******************************************************************
11373
+ * The title of a table's column: the schema's header, or the
11374
+ * field's name, translated.
11375
+ ******************************************************************/
11376
+ function column_title(field_desc) {
11377
+ return (0, i18next.t)(field_desc.header || field_desc.name);
11378
+ }
11379
+ /******************************************************************
11380
+ * {field: title} of a table's template, in the current language.
11381
+ ******************************************************************/
11382
+ function table_column_titles(template) {
11383
+ let titles = {};
11384
+ Object.entries(template || {}).forEach(([key, value]) => {
11385
+ const field_desc = (0, _yuneta_gobj_js.template_get_field_desc)(key, value);
11386
+ titles[field_desc.name] = column_title(field_desc);
11387
+ });
11388
+ return titles;
11389
+ }
11390
+ /******************************************************************
11251
11391
  * Convert a template's items in tabulator columns
11252
11392
  ******************************************************************/
11253
11393
  function template2columns(gobj, columns, template, sub_elements) {
@@ -11260,7 +11400,7 @@ function template2columns(gobj, columns, template, sub_elements) {
11260
11400
  let validator = [];
11261
11401
  let column = {
11262
11402
  field: field_desc.name,
11263
- title: (0, i18next.t)(field_desc.header || field_desc.name),
11403
+ title: column_title(field_desc),
11264
11404
  titleFormatter: text_title_formatter,
11265
11405
  editable: get_editable_state,
11266
11406
  editor: false,
@@ -12115,7 +12255,14 @@ function ac_add_table_row(gobj, event, kw, src) {
12115
12255
  }
12116
12256
  let record = kw.record;
12117
12257
  let loading = kw.loading;
12118
- tabulator.addRow(record).then(function(row) {
12258
+ let added;
12259
+ if (loading) gobj.priv.loading_rows++;
12260
+ try {
12261
+ added = tabulator.addRow(record);
12262
+ } finally {
12263
+ if (loading) gobj.priv.loading_rows--;
12264
+ }
12265
+ added.then(function(row) {
12119
12266
  if (loading) {
12120
12267
  let template = $table.template;
12121
12268
  Object.entries(template).forEach(([key, template_value]) => {
@@ -12222,6 +12369,10 @@ function ac_language_changed$10(gobj, event, kw, src) {
12222
12369
  let editor = $editor.jsoneditor;
12223
12370
  if (editor && typeof editor.updateProps === "function") editor.updateProps({ onRenderMenu: json_editor_render_menu(gobj) });
12224
12371
  }
12372
+ for (let $table of $container.querySelectorAll(".yui-tabulator-table, .yui-tabulator-table-nested")) {
12373
+ let tabulator = $table.tabulator;
12374
+ if (tabulator && tabulator.initialized && $table.template) yui_tabulator_relocalize(tabulator, i18next.t, table_column_titles($table.template));
12375
+ }
12225
12376
  return 0;
12226
12377
  }
12227
12378
  /***************************
@@ -15001,7 +15152,7 @@ function g6_event_kw(evt) {
15001
15152
  * g6_canvas_tab_order.js
15002
15153
  *
15003
15154
  * The canvases of a G6 graph in the page's Tab order: the main
15004
- * one in its place, the other layers out of it.
15155
+ * one in its place, and NAMED; the other layers out of it.
15005
15156
  *
15006
15157
  * G6 stacks four canvases (background, main, label, transient)
15007
15158
  * and gives each of them `tabIndex = 1` (configCanvasDom, when it
@@ -15014,6 +15165,24 @@ function g6_event_kw(evt) {
15014
15165
  * to the graph's toolbars and buttons in DOM order; the other
15015
15166
  * layers receive nothing (`pointer-events: none`) and take -1.
15016
15167
  *
15168
+ * A canvas in the Tab order is a control, and a control has a
15169
+ * name: the main canvas carries a `title` and an `aria-label`,
15170
+ * through t() and each with its key, that say WHICH graph it is
15171
+ * -- the key is the view's, one per gclass ("json graph",
15172
+ * "schema graph"...). From 7.26.28 to 7.26.41 Tab landed on it
15173
+ * and a reader announced nothing. The keys are what a language
15174
+ * switch reaches (refresh_language()), as on any control. It is
15175
+ * a `region`, as maplibre makes its own canvas: a name on an
15176
+ * element with no role is one ARIA forbids, and a reader is not
15177
+ * bound to say it.
15178
+ *
15179
+ * And it can be SEEN when it has the focus: G6 writes `outline:
15180
+ * none` on its canvases, inline, so a keyboard that Tabbed onto
15181
+ * the graph had no sign of where it was. The main canvas takes
15182
+ * the `G6_MAIN_CANVAS` class, and g6_canvas_tab_order.css --
15183
+ * imported here, so it comes with the module to every view --
15184
+ * draws a ring on it at `:focus-visible`.
15185
+ *
15017
15186
  * Every view that creates a G6 Graph calls
15018
15187
  * keep_canvas_tab_order() right after `new Graph()`: the order is
15019
15188
  * put right each time G6 writes the 1 -- once the canvas is built
@@ -15026,10 +15195,11 @@ function g6_event_kw(evt) {
15026
15195
  * All Rights Reserved.
15027
15196
  ***********************************************************************/
15028
15197
  /************************************************************
15029
- * Main canvas 0, every other layer -1. Returns 0, or -1 with
15030
- * the cause logged.
15198
+ * Main canvas 0, named by `name_key`, and marked for its
15199
+ * focus ring; every other layer -1. Returns 0, or -1 with the
15200
+ * cause logged.
15031
15201
  ************************************************************/
15032
- function set_canvas_tab_order(gobj, graph) {
15202
+ function set_canvas_tab_order(gobj, graph, name_key) {
15033
15203
  let canvas = graph ? graph.getCanvas() : null;
15034
15204
  if (!canvas || typeof canvas.getLayers !== "function") {
15035
15205
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no canvas to set the Tab order of`);
@@ -15049,17 +15219,27 @@ function set_canvas_tab_order(gobj, graph) {
15049
15219
  ret = -1;
15050
15220
  continue;
15051
15221
  }
15052
- $el.tabIndex = name === "main" ? 0 : -1;
15222
+ if (name !== "main") {
15223
+ $el.tabIndex = -1;
15224
+ continue;
15225
+ }
15226
+ $el.tabIndex = 0;
15227
+ $el.classList.add("G6_MAIN_CANVAS");
15228
+ $el.setAttribute("role", "region");
15229
+ $el.setAttribute("title", (0, i18next.t)(name_key));
15230
+ $el.setAttribute("data-i18n-title", name_key);
15231
+ $el.setAttribute("aria-label", (0, i18next.t)(name_key));
15232
+ $el.setAttribute("data-i18n-aria-label", name_key);
15053
15233
  }
15054
15234
  return ret;
15055
15235
  }
15056
15236
  /************************************************************
15057
- * Keep the order for the life of `graph`: on every moment G6
15058
- * writes its own.
15237
+ * Keep the order, and the name, for the life of `graph`: on
15238
+ * every moment G6 writes its own.
15059
15239
  ************************************************************/
15060
- function keep_canvas_tab_order(gobj, graph) {
15240
+ function keep_canvas_tab_order(gobj, graph, name_key) {
15061
15241
  for (let ev of [_antv_g6.GraphEvent.AFTER_CANVAS_INIT, _antv_g6.GraphEvent.AFTER_RENDERER_CHANGE]) graph.on(ev, () => {
15062
- set_canvas_tab_order(gobj, graph);
15242
+ set_canvas_tab_order(gobj, graph, name_key);
15063
15243
  });
15064
15244
  }
15065
15245
  //#endregion
@@ -15568,7 +15748,7 @@ function build_graph$4(gobj) {
15568
15748
  behaviors: BEHAVIORS_READING$1.slice()
15569
15749
  });
15570
15750
  if (priv.theme) graph.setTheme(priv.theme);
15571
- keep_canvas_tab_order(gobj, graph);
15751
+ keep_canvas_tab_order(gobj, graph, "json graph");
15572
15752
  graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
15573
15753
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", g6_event_kw(evt), gobj);
15574
15754
  });
@@ -19488,7 +19668,7 @@ function build_graph$3(gobj) {
19488
19668
  } catch (e) {
19489
19669
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the theme was refused: ${e}`);
19490
19670
  }
19491
- keep_canvas_tab_order(gobj, priv.graph);
19671
+ keep_canvas_tab_order(gobj, priv.graph, "fsm graph");
19492
19672
  priv.graph.on("aftertransform", () => {
19493
19673
  yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
19494
19674
  });
@@ -22131,6 +22311,17 @@ function close_gclass_view(handle) {
22131
22311
  * lands BEHIND its opener whatever number it is given, and
22132
22312
  * the button reads as one that did nothing.
22133
22313
  *
22314
+ * An opener in the place the shell gives every window -- its
22315
+ * window layer, the body while there is none -- gives the
22316
+ * viewer no `$parent` at all: the viewer takes that place too,
22317
+ * and FOLLOWS the shell with its opener (C_YUI_WINDOW's
22318
+ * ac_shell_changed). Up to 7.26.41 it was handed that element
22319
+ * by name, and a name is a choice its host made: a viewer
22320
+ * opened from the developer window between a logout and the
22321
+ * next login was told "the body", and stayed there after the
22322
+ * login -- above the new shell's dialogs -- while its opener
22323
+ * moved into the shell.
22324
+ *
22134
22325
  * Opened from no window: null -- the window layer of the
22135
22326
  * shell, where every window lives (the legacy '#top-layer'
22136
22327
  * when a page has one). It was the shell's popup layer: above
@@ -22140,7 +22331,11 @@ function window_layer_of(host) {
22140
22331
  let $c = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(host, "$container");
22141
22332
  if ($c && typeof $c.closest === "function") {
22142
22333
  let $win = $c.closest(".C_YUI_WINDOW");
22143
- if ($win && $win.parentNode) return $win.parentNode;
22334
+ if ($win && $win.parentNode) {
22335
+ let $shell_place = yui_shell_window_layer(yui_shell_of(host)) || document.body;
22336
+ if ($win.parentNode === $shell_place) return null;
22337
+ return $win.parentNode;
22338
+ }
22144
22339
  }
22145
22340
  return typeof document !== "undefined" && document.getElementById("top-layer") || null;
22146
22341
  }
@@ -23001,7 +23196,7 @@ function build_graph$2(gobj) {
23001
23196
  behaviors: BEHAVIORS_READING.slice()
23002
23197
  });
23003
23198
  if (priv.theme) graph.setTheme(priv.theme);
23004
- keep_canvas_tab_order(gobj, graph);
23199
+ keep_canvas_tab_order(gobj, graph, "gobj tree graph");
23005
23200
  graph.on("aftertransform", () => {
23006
23201
  yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
23007
23202
  let z = priv.last_zoom;
@@ -24589,16 +24784,17 @@ function card_descriptor(it, show_label, badge_of) {
24589
24784
  text_node(label)
24590
24785
  ]);
24591
24786
  if (badge && !pinned) children.push(badge);
24787
+ let name_key = label || it.aria_label || it.id || "";
24592
24788
  let a_attrs = {
24593
24789
  class: "yui-nav-item yui-nav-card",
24594
24790
  href: it.route ? "#" + it.route : "#",
24595
24791
  "data-item-id": it.id,
24596
24792
  "data-route": it.route || "",
24597
24793
  "data-disabled": it.disabled ? "1" : "0",
24598
- "aria-label": label || it.id
24794
+ "aria-label": name_key
24599
24795
  };
24600
- if (label) a_attrs["data-i18n-aria-label"] = label;
24601
- let tip = it.tooltip || it.aria_label || label;
24796
+ if (name_key) a_attrs["data-i18n-aria-label"] = name_key;
24797
+ let tip = it.tooltip || it.aria_label || name_key;
24602
24798
  if (tip) {
24603
24799
  a_attrs.title = tip;
24604
24800
  a_attrs["data-i18n-title"] = tip;
@@ -24997,15 +25193,15 @@ function render_tabs(gobj, items) {
24997
25193
  "aria-hidden": "true"
24998
25194
  }]
24999
25195
  ]);
25000
- let label = it.name || "";
25196
+ let name_key = it.name || it.aria_label || it.id || "";
25001
25197
  let a_attrs = {
25002
25198
  href: it.route ? "#" + it.route : "#",
25003
25199
  "data-item-id": it.id,
25004
25200
  "data-route": it.route || "",
25005
- "aria-label": label || it.id
25201
+ "aria-label": name_key
25006
25202
  };
25007
- if (label) a_attrs["data-i18n-aria-label"] = label;
25008
- let tip = it.tooltip || it.aria_label || label;
25203
+ if (name_key) a_attrs["data-i18n-aria-label"] = name_key;
25204
+ let tip = it.tooltip || it.aria_label || name_key;
25009
25205
  if (tip) {
25010
25206
  a_attrs.title = tip;
25011
25207
  a_attrs["data-i18n-title"] = tip;
@@ -25085,16 +25281,17 @@ function render_breadcrumb(gobj, items) {
25085
25281
  text_node(label)
25086
25282
  ]);
25087
25283
  }
25284
+ let name_key = it.name || it.aria_label || it.id || "";
25088
25285
  let a_attrs = {
25089
25286
  class: "yui-nav-item yui-nav-crumb",
25090
25287
  href: it.route ? "#" + it.route : "#",
25091
25288
  "data-item-id": it.id,
25092
25289
  "data-route": it.route || "",
25093
25290
  "data-disabled": it.disabled ? "1" : "0",
25094
- "aria-label": it.name || it.id
25291
+ "aria-label": name_key
25095
25292
  };
25096
- if (it.name) a_attrs["data-i18n-aria-label"] = it.name;
25097
- let tip = it.tooltip || it.aria_label || it.name;
25293
+ if (name_key) a_attrs["data-i18n-aria-label"] = name_key;
25294
+ let tip = it.tooltip || it.aria_label || name_key;
25098
25295
  if (tip) {
25099
25296
  a_attrs.title = tip;
25100
25297
  a_attrs["data-i18n-title"] = tip;
@@ -25231,12 +25428,14 @@ function render_accordion(gobj, items) {
25231
25428
  "aria-controls": body_id
25232
25429
  };
25233
25430
  let head_badge = item_badge_node(gobj, it, false);
25234
- if (!(0, _yuneta_gobj_js.empty_string)(head_text)) {
25235
- head_attrs.i18n = head_text;
25236
- head_attrs.title = head_text;
25237
- head_attrs["data-i18n-title"] = head_text;
25238
- head_attrs["aria-label"] = head_text;
25239
- head_attrs["data-i18n-aria-label"] = head_text;
25431
+ if (!(0, _yuneta_gobj_js.empty_string)(head_text)) head_attrs.i18n = head_text;
25432
+ let name_key = it.name || it.aria_label || it.id || "";
25433
+ if (!(0, _yuneta_gobj_js.empty_string)(name_key)) {
25434
+ let tip = it.tooltip || it.aria_label || name_key;
25435
+ head_attrs.title = tip;
25436
+ head_attrs["data-i18n-title"] = tip;
25437
+ head_attrs["aria-label"] = name_key;
25438
+ head_attrs["data-i18n-aria-label"] = name_key;
25240
25439
  name_control_with_badge(head_attrs, head_badge);
25241
25440
  }
25242
25441
  let $hdr = (0, _yuneta_gobj_js.createElement2)([
@@ -25312,17 +25511,17 @@ function item_li(gobj, it, opts) {
25312
25511
  if (label_el) children.push(label_el);
25313
25512
  if (!pinned) children.push(badge_el);
25314
25513
  }
25315
- let aria_key = label || it.id;
25514
+ let name_key = it.name || it.aria_label || it.id || "";
25316
25515
  let a_attrs = {
25317
25516
  class: a_class,
25318
25517
  href: it.route ? "#" + it.route : "#",
25319
25518
  "data-item-id": it.id,
25320
25519
  "data-route": it.route || "",
25321
25520
  "data-disabled": it.disabled ? "1" : "0",
25322
- "aria-label": aria_key
25521
+ "aria-label": name_key
25323
25522
  };
25324
- if (label) a_attrs["data-i18n-aria-label"] = label;
25325
- let tip = it.tooltip || it.aria_label || label;
25523
+ if (name_key) a_attrs["data-i18n-aria-label"] = name_key;
25524
+ let tip = it.tooltip || it.aria_label || name_key;
25326
25525
  if (tip) {
25327
25526
  a_attrs.title = tip;
25328
25527
  a_attrs["data-i18n-title"] = tip;
@@ -25365,15 +25564,16 @@ function item_iconbar(gobj, it, opts) {
25365
25564
  if (label_el) children.push(label_el);
25366
25565
  }
25367
25566
  if (!pinned) children.push(badge_el);
25567
+ let name_key = it.name || it.aria_label || it.id || "";
25368
25568
  let a_attrs = {
25369
25569
  class: "yui-nav-item yui-nav-stacked",
25370
25570
  href: it.route ? "#" + it.route : "#",
25371
25571
  "data-item-id": it.id,
25372
25572
  "data-route": it.route || "",
25373
- "aria-label": label || it.id
25573
+ "aria-label": name_key
25374
25574
  };
25375
- if (label) a_attrs["data-i18n-aria-label"] = label;
25376
- let tip = it.tooltip || it.aria_label || label;
25575
+ if (name_key) a_attrs["data-i18n-aria-label"] = name_key;
25576
+ let tip = it.tooltip || it.aria_label || name_key;
25377
25577
  if (tip) {
25378
25578
  a_attrs.title = tip;
25379
25579
  a_attrs["data-i18n-title"] = tip;
@@ -25641,7 +25841,12 @@ function render_node(node) {
25641
25841
  "aria-hidden": "true"
25642
25842
  }]]
25643
25843
  ]);
25644
- row.push([
25844
+ if (node.label && node.data_label) row.push([
25845
+ "span",
25846
+ { class: "ROUTEMAP_NAME" },
25847
+ text_node(node.label)
25848
+ ]);
25849
+ else if (node.label) row.push([
25645
25850
  "span",
25646
25851
  {
25647
25852
  class: "ROUTEMAP_NAME",
@@ -25694,10 +25899,10 @@ function render_node(node) {
25694
25899
  href: "#" + node.route,
25695
25900
  title: node.route
25696
25901
  };
25697
- if (node.label) {
25902
+ if (node.label && !node.data_label) {
25698
25903
  a_attrs["aria-label"] = node.label;
25699
25904
  a_attrs["data-i18n-aria-label"] = node.label;
25700
- }
25905
+ } else a_attrs["aria-label"] = node.label || node.route;
25701
25906
  if (node.current) a_attrs["aria-current"] = "page";
25702
25907
  $row = (0, _yuneta_gobj_js.createElement2)([
25703
25908
  "a",
@@ -62858,7 +63063,7 @@ function build_graph$1(gobj) {
62858
63063
  plugins: []
62859
63064
  });
62860
63065
  graph.setTheme(priv.theme);
62861
- keep_canvas_tab_order(gobj, graph);
63066
+ keep_canvas_tab_order(gobj, graph, "treedb graph");
62862
63067
  priv._unforward_wheel = yui_graph_forward_wheel(graph, priv.$container, { selector: ".TREEDB_CARD, .TREEDB_PILLS" });
62863
63068
  graph.setLayout(layout);
62864
63069
  priv.graph_rendered = false;
@@ -74547,7 +74752,7 @@ function build_graph(gobj) {
74547
74752
  }
74548
74753
  priv.graph = graph;
74549
74754
  graph.setTheme(dark ? "dark" : "light");
74550
- keep_canvas_tab_order(gobj, graph);
74755
+ keep_canvas_tab_order(gobj, graph, "schema graph");
74551
74756
  graph.on("aftertransform", () => {
74552
74757
  yui_graph_update_zoom($container, priv.graph);
74553
74758
  });
@@ -76662,6 +76867,7 @@ var PRIVATE_DATA$1 = {
76662
76867
  export_view: null
76663
76868
  };
76664
76869
  var __gclass__$1 = null;
76870
+ var __described_seq__ = 0;
76665
76871
  /******************************
76666
76872
  * Framework Methods
76667
76873
  ******************************/
@@ -77462,6 +77668,15 @@ function render(gobj) {
77462
77668
  * A card that opens something, with its own logical name. The
77463
77669
  * cards grid is the shell's, so a schema card and a nav card
77464
77670
  * look alike on purpose.
77671
+ *
77672
+ * `title` is the card's name: `{i18n: key}`, or `{text: data}` for
77673
+ * a name no locale holds (a treedb's id). The card is a control --
77674
+ * a role=button that Enter and Space press -- and a control is
77675
+ * NAMED: a title and an aria-label, with their keys when the name
77676
+ * is one, and its tags (the counts) as its description, which an
77677
+ * aria-label alone would hide from a reader. Up to 7.26.41 it had
77678
+ * neither, and the orphans card was handed its name translated,
77679
+ * in the language it was drawn in for good.
77465
77680
  ***************************************************************/
77466
77681
  function open_card(gobj, logical, title, icon, tags, event, kw) {
77467
77682
  let $tags = tags.map((tag) => {
@@ -77479,13 +77694,36 @@ function open_card(gobj, logical, title, icon, tags, event, kw) {
77479
77694
  ]] : `${tag.text}`
77480
77695
  ];
77481
77696
  });
77697
+ let tags_id = `yui-schema-described-${++__described_seq__}`;
77698
+ let card_attrs = {
77699
+ class: `${logical} yui-nav-card card`,
77700
+ role: "button",
77701
+ tabindex: "0",
77702
+ "aria-describedby": tags_id
77703
+ };
77704
+ let $name;
77705
+ if (title.i18n) {
77706
+ Object.assign(card_attrs, name_attrs(title.i18n, {}));
77707
+ $name = [
77708
+ "span",
77709
+ {
77710
+ class: `${logical}_NAME has-text-weight-semibold`,
77711
+ i18n: title.i18n
77712
+ },
77713
+ (0, i18next.t)(title.i18n)
77714
+ ];
77715
+ } else {
77716
+ card_attrs.title = String(title.text);
77717
+ card_attrs["aria-label"] = String(title.text);
77718
+ $name = [
77719
+ "span",
77720
+ { class: `${logical}_NAME has-text-weight-semibold` },
77721
+ text_node(title.text)
77722
+ ];
77723
+ }
77482
77724
  return [
77483
77725
  "div",
77484
- {
77485
- class: `${logical} yui-nav-card card`,
77486
- role: "button",
77487
- tabindex: "0"
77488
- },
77726
+ card_attrs,
77489
77727
  [[
77490
77728
  "div",
77491
77729
  { class: `${logical}_BODY card-content p-3` },
@@ -77498,16 +77736,16 @@ function open_card(gobj, logical, title, icon, tags, event, kw) {
77498
77736
  [[
77499
77737
  "span",
77500
77738
  { class: "icon" },
77501
- [["i", { class: icon }]]
77502
- ], [
77503
- "span",
77504
- { class: `${logical}_NAME has-text-weight-semibold` },
77505
- text_node(title)
77506
- ]]
77739
+ [["i", {
77740
+ class: icon,
77741
+ "aria-hidden": "true"
77742
+ }]]
77743
+ ], $name]
77507
77744
  ], [
77508
77745
  "div",
77509
77746
  {
77510
77747
  class: `${logical}_TAGS tags mt-2`,
77748
+ id: tags_id,
77511
77749
  style: "gap:.25rem;"
77512
77750
  },
77513
77751
  $tags
@@ -77555,9 +77793,9 @@ function render_treedbs(gobj, $body) {
77555
77793
  style: "is-warning is-light"
77556
77794
  }] : []
77557
77795
  ];
77558
- $cards.push(open_card(gobj, "SCHEMA_TREEDB_CARD", treedb.id, "yi-database", tags, "EV_SELECT_TREEDB", { treedb: treedb.id }));
77796
+ $cards.push(open_card(gobj, "SCHEMA_TREEDB_CARD", { text: treedb.id }, "yi-database", tags, "EV_SELECT_TREEDB", { treedb: treedb.id }));
77559
77797
  }
77560
- if (priv.model.orphan_topics.length > 0 || priv.model.orphan_cols.length > 0) $cards.push(open_card(gobj, "SCHEMA_ORPHAN_CARD", (0, i18next.t)("orphans"), "yi-triangle-exclamation", [{
77798
+ if (priv.model.orphan_topics.length > 0 || priv.model.orphan_cols.length > 0) $cards.push(open_card(gobj, "SCHEMA_ORPHAN_CARD", { i18n: "orphans" }, "yi-triangle-exclamation", [{
77561
77799
  i18n: "topics",
77562
77800
  text: priv.model.orphan_topics.length
77563
77801
  }, {
@@ -77598,22 +77836,33 @@ function render_topics(gobj, $body) {
77598
77836
  $actions.push(row_icon(gobj, "SCHEMA_TOPIC_EDIT", "yi-pen", "edit topic", "EV_EDIT_TOPIC", { topic: address }));
77599
77837
  $actions.push(row_icon(gobj, "SCHEMA_TOPIC_DELETE", "yi-trash", "delete topic", "EV_DELETE_TOPIC", { topic: address }));
77600
77838
  }
77839
+ let open_attrs = {
77840
+ class: "SCHEMA_TOPIC_OPEN has-text-weight-semibold",
77841
+ type: "button",
77842
+ title: topic.name,
77843
+ "aria-label": topic.name
77844
+ };
77845
+ let id_attrs = { class: "SCHEMA_TOPIC_ID is-size-7 yui-text-quiet" };
77846
+ if (ambiguous) {
77847
+ id_attrs.id = `yui-schema-described-${++__described_seq__}`;
77848
+ open_attrs["aria-describedby"] = id_attrs.id;
77849
+ }
77601
77850
  $rows.push([
77602
77851
  "tr",
77603
- {
77604
- class: "SCHEMA_TOPIC_ROW",
77605
- role: "button",
77606
- tabindex: "0"
77607
- },
77852
+ { class: "SCHEMA_TOPIC_ROW" },
77608
77853
  [
77609
77854
  [
77610
77855
  "td",
77611
77856
  { class: "SCHEMA_TOPIC_NAME" },
77612
77857
  [
77613
77858
  [
77614
- "span",
77615
- { class: "has-text-weight-semibold" },
77616
- text_node(topic.name)
77859
+ "button",
77860
+ open_attrs,
77861
+ text_node(topic.name),
77862
+ { click: (evt) => {
77863
+ evt.stopPropagation();
77864
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77865
+ } }
77617
77866
  ],
77618
77867
  topic.system_topic ? [
77619
77868
  "span",
@@ -77643,7 +77892,7 @@ function render_topics(gobj, $body) {
77643
77892
  ],
77644
77893
  ambiguous ? [
77645
77894
  "div",
77646
- { class: "SCHEMA_TOPIC_ID is-size-7 yui-text-quiet" },
77895
+ id_attrs,
77647
77896
  [[
77648
77897
  "code",
77649
77898
  {},
@@ -77685,17 +77934,10 @@ function render_topics(gobj, $body) {
77685
77934
  $actions
77686
77935
  ]
77687
77936
  ],
77688
- {
77689
- click: (evt) => {
77690
- if (evt.target.closest(".SCHEMA_TOPIC_ACTIONS")) return;
77691
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77692
- },
77693
- keydown: (evt) => {
77694
- if (evt.key !== "Enter" && evt.key !== " ") return;
77695
- evt.preventDefault();
77696
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77697
- }
77698
- }
77937
+ { click: (evt) => {
77938
+ if (evt.target.closest(".SCHEMA_TOPIC_ACTIONS")) return;
77939
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77940
+ } }
77699
77941
  ]);
77700
77942
  }
77701
77943
  let $table = (0, _yuneta_gobj_js.createElement2)([