@yuneta/gobj-ui 7.26.41 → 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.
@@ -709,12 +709,42 @@ function paint_badge($badge, value, tone) {
709
709
  * All Rights Reserved.
710
710
  ***********************************************************************/
711
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
+ /************************************************************
712
741
  * One node of the nav map from a declared config item, in
713
742
  * DECLARATION ORDER (never sorted). Recurses into static submenus
714
743
  * and toolbar dropdowns, and merges the LIVE dynamic submenu tabs
715
744
  * (added at runtime via yui_shell_set_submenu) by parent id.
745
+ * `label_of` names it: menu_item_label() or toolbar_item_label().
716
746
  ************************************************************/
717
- function nav_node_from_item(it, index) {
747
+ function nav_node_from_item(it, index, label_of) {
718
748
  if (!it || it.type === "divider" || it.type === "header") return null;
719
749
  let action = it.action || {};
720
750
  let route = it.route || (action.type === "navigate" ? action.route : "") || "";
@@ -727,7 +757,7 @@ function nav_node_from_item(it, index) {
727
757
  }
728
758
  let node = {
729
759
  id: it.id || "",
730
- label: it.name || it.wordmark || it.id || route || "",
760
+ label: label_of(it),
731
761
  icon: it.icon || "",
732
762
  route,
733
763
  event,
@@ -737,14 +767,14 @@ function nav_node_from_item(it, index) {
737
767
  };
738
768
  let sub_items = it.submenu && Array.isArray(it.submenu.items) ? it.submenu.items : action.type === "dropdown" && Array.isArray(action.items) ? action.items : null;
739
769
  if (sub_items) for (let s of sub_items) {
740
- let n = nav_node_from_item(s, index);
770
+ let n = nav_node_from_item(s, index, label_of);
741
771
  if (n) node.children.push(n);
742
772
  }
743
773
  if (it.id && index) for (let r of Object.keys(index)) {
744
774
  let e = index[r];
745
775
  if (e && e.parent_item && e.parent_item.id === it.id && !node.children.some((c) => c.route === r)) node.children.push({
746
776
  id: e.item && e.item.id || "",
747
- label: e.item && e.item.name || r,
777
+ label: e.item ? menu_item_label(e.item) : "",
748
778
  icon: e.item && e.item.icon || "",
749
779
  route: r,
750
780
  event: "",
@@ -860,7 +890,10 @@ function mark_current(groups, current_route) {
860
890
  *
861
891
  * - `nav` walks EVERY declared menu in declaration order: the
862
892
  * `primary` menu contributes its items flat (the common case);
863
- * 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 "".
864
897
  * - `other` lists the routes declared only in the route table
865
898
  * (config.shell.routes) that no rendered node covers — root "/",
866
899
  * URL-only action routes, toolbar-less forms. Brand-covered
@@ -895,7 +928,7 @@ function build_nav_map(input) {
895
928
  };
896
929
  continue;
897
930
  }
898
- let n = nav_node_from_item(it, index);
931
+ let n = nav_node_from_item(it, index, toolbar_item_label);
899
932
  if (n) toolbar.push(n);
900
933
  }
901
934
  let nav = [];
@@ -905,13 +938,14 @@ function build_nav_map(input) {
905
938
  if (!m || !Array.isArray(m.items)) continue;
906
939
  let nodes = [];
907
940
  for (let it of m.items) {
908
- let n = nav_node_from_item(it, index);
941
+ let n = nav_node_from_item(it, index, menu_item_label);
909
942
  if (n) nodes.push(n);
910
943
  }
911
944
  if (menu_id === "primary") nav = nav.concat(nodes);
912
945
  else if (nodes.length) nav.push({
913
946
  id: menu_id,
914
947
  label: menu_id,
948
+ data_label: true,
915
949
  icon: "",
916
950
  route: "",
917
951
  event: "",
@@ -938,7 +972,7 @@ function build_nav_map(input) {
938
972
  let tgt = e && e.target || null;
939
973
  other.push({
940
974
  id: e && e.item && e.item.id || "",
941
- label: e && e.item && (e.item.name || e.item.id) || r,
975
+ label: e && e.item ? menu_item_label(e.item) : "",
942
976
  icon: e && e.item && e.item.icon || "",
943
977
  route: r,
944
978
  event: tgt && tgt.kind === "action" && tgt.event || "",
@@ -1018,7 +1052,7 @@ function section_index_target(menu_id, item) {
1018
1052
  gclass: "C_YUI_NAV",
1019
1053
  kw: {
1020
1054
  menu_id: `index.${menu_id}.${item.id}`,
1021
- nav_label: item.name || item.id || "",
1055
+ nav_label: item.name || item.aria_label || item.id || "",
1022
1056
  menu_items: sub.items,
1023
1057
  layout: "cards",
1024
1058
  level: "secondary"
@@ -1090,7 +1124,7 @@ function secondary_nav_renders(item, layout) {
1090
1124
  * Constants
1091
1125
  ***************************************************************/
1092
1126
  var GCLASS_NAME$22 = "C_YUI_SHELL";
1093
- var __last_shell__ = null;
1127
+ var __live_shells__ = [];
1094
1128
  var __shell_watchers__ = [];
1095
1129
  var __window_z__ = 10;
1096
1130
  var ZONE_IDS = [
@@ -1133,6 +1167,8 @@ var PRIVATE_DATA$22 = {
1133
1167
  item_index: {},
1134
1168
  nav_badges: {},
1135
1169
  badge_status: null,
1170
+ badge_news: [],
1171
+ badge_news_closing: false,
1136
1172
  dynamic_items: {},
1137
1173
  section_pos: {},
1138
1174
  route_mru: [],
@@ -1171,7 +1207,7 @@ var __gclass__$22 = null;
1171
1207
  function mt_create$22(gobj) {
1172
1208
  const subscriber = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "subscriber");
1173
1209
  if (subscriber) (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
1174
- __last_shell__ = gobj;
1210
+ __live_shells__.push(gobj);
1175
1211
  build_ui$19(gobj);
1176
1212
  tell_shell_watchers(gobj);
1177
1213
  }
@@ -1357,7 +1393,8 @@ function mt_stop$20(gobj) {
1357
1393
  ***************************************************************/
1358
1394
  function mt_destroy$22(gobj) {
1359
1395
  close_toolbar_dropdown(gobj);
1360
- 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);
1361
1398
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
1362
1399
  if ($container && $container.parentNode) $container.parentNode.removeChild($container);
1363
1400
  tell_shell_watchers(gobj);
@@ -1740,7 +1777,7 @@ function instantiate_menus(gobj, config) {
1740
1777
  let nav = instantiate_nav_in_zone(gobj, {
1741
1778
  items: sub.items,
1742
1779
  render: { [zone_id]: render_cfg }
1743
- }, sub_menu_id, zone_id, "secondary", item.name || "");
1780
+ }, sub_menu_id, zone_id, "secondary", item.name || item.aria_label || item.id || "");
1744
1781
  let $c = (0, _yuneta_gobj_js.gobj_read_attr)(nav, "$container");
1745
1782
  if ($c) $c.classList.add("is-hidden");
1746
1783
  }
@@ -2108,25 +2145,24 @@ function build_toolbar_action_item(gobj, it) {
2108
2145
  },
2109
2146
  text_node(it.name)
2110
2147
  ]);
2111
- let aria_key = it.aria_label || it.name || it.id || "";
2112
- let i18n_aria = it.aria_label || it.name;
2148
+ let name_key = it.aria_label || it.name || it.id || "";
2113
2149
  let btn_attrs = {
2114
2150
  class: "navbar-item yui-toolbar-item is-unselectable",
2115
2151
  type: "button",
2116
2152
  "data-toolbar-item-id": it.id || "",
2117
- "aria-label": aria_key
2153
+ "aria-label": name_key
2118
2154
  };
2119
- if (i18n_aria) btn_attrs["data-i18n-aria-label"] = i18n_aria;
2155
+ if (name_key) btn_attrs["data-i18n-aria-label"] = name_key;
2120
2156
  if ((it.action && it.action.type || "") === "dropdown") {
2121
2157
  btn_attrs["aria-haspopup"] = "menu";
2122
2158
  btn_attrs["aria-expanded"] = "false";
2123
2159
  }
2124
- let tip = it.tooltip || i18n_aria;
2160
+ let tip = it.tooltip || name_key;
2125
2161
  if (tip) {
2126
2162
  btn_attrs.title = tip;
2127
2163
  btn_attrs["data-i18n-title"] = tip;
2128
2164
  }
2129
- 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);
2130
2166
  let link = toolbar_link_attrs(it);
2131
2167
  if (link) {
2132
2168
  delete btn_attrs.type;
@@ -2210,21 +2246,20 @@ function build_toolbar_brand_item(gobj, it) {
2210
2246
  ************************************************************/
2211
2247
  function build_toolbar_avatar_item(gobj, it) {
2212
2248
  let priv = gobj.priv;
2213
- const aria_key = it.aria_label || it.name || it.id || "user menu";
2214
- const i18n_aria = it.aria_label || it.name || "user menu";
2249
+ const name_key = it.aria_label || it.name || "user menu";
2215
2250
  let action_type = it.action && it.action.type || "";
2216
2251
  let attrs = {
2217
2252
  class: "navbar-item yui-toolbar-item yui-toolbar-avatar is-unselectable",
2218
2253
  type: "button",
2219
2254
  "data-toolbar-item-id": it.id || "",
2220
- "aria-label": aria_key,
2221
- "data-i18n-aria-label": i18n_aria
2255
+ "aria-label": name_key,
2256
+ "data-i18n-aria-label": name_key
2222
2257
  };
2223
2258
  if (action_type === "dropdown") {
2224
2259
  attrs["aria-haspopup"] = "menu";
2225
2260
  attrs["aria-expanded"] = "false";
2226
2261
  }
2227
- let tip = it.tooltip || i18n_aria;
2262
+ let tip = it.tooltip || name_key;
2228
2263
  if (tip) {
2229
2264
  attrs.title = tip;
2230
2265
  attrs["data-i18n-title"] = tip;
@@ -2287,16 +2322,15 @@ function attach_context_action(gobj, $item, it) {
2287
2322
  ************************************************************/
2288
2323
  function build_toolbar_connection_item(gobj, it) {
2289
2324
  let priv = gobj.priv;
2290
- const aria_key = it.aria_label || it.name || it.id || "backend connection";
2291
- const i18n_aria = it.aria_label || it.name || "backend connection";
2325
+ const name_key = it.aria_label || it.name || "backend connection";
2292
2326
  let attrs = {
2293
2327
  class: "navbar-item yui-toolbar-item yui-toolbar-conn is-unselectable is-disconnected",
2294
2328
  type: "button",
2295
2329
  "data-toolbar-item-id": it.id || "",
2296
- "aria-label": aria_key,
2297
- "data-i18n-aria-label": i18n_aria
2330
+ "aria-label": name_key,
2331
+ "data-i18n-aria-label": name_key
2298
2332
  };
2299
- let tip = it.tooltip || i18n_aria;
2333
+ let tip = it.tooltip || name_key;
2300
2334
  if (tip) {
2301
2335
  attrs.title = tip;
2302
2336
  attrs["data-i18n-title"] = tip;
@@ -2394,13 +2428,12 @@ function toggle_toolbar_dropdown(gobj, item, action, $trigger) {
2394
2428
  function open_toolbar_dropdown(gobj, item, action, $trigger) {
2395
2429
  let priv = gobj.priv;
2396
2430
  if (!priv || !priv.layers || !priv.layers.popup) return;
2397
- const aria_key = item && (item.aria_label || item.name || item.id) || "menu";
2398
- 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";
2399
2432
  let $panel = (0, _yuneta_gobj_js.createElement2)(["div", {
2400
2433
  class: "yui-toolbar-dropdown-panel",
2401
2434
  role: "menu",
2402
- "aria-label": aria_key,
2403
- "data-i18n-aria-label": i18n_aria,
2435
+ "aria-label": name_key,
2436
+ "data-i18n-aria-label": name_key,
2404
2437
  "data-toolbar-dropdown-for": item && item.id || ""
2405
2438
  }]);
2406
2439
  let raw_items = (0, _yuneta_gobj_js.is_array)(action.items) ? action.items : [];
@@ -2533,20 +2566,19 @@ function build_dropdown_row(gobj, sub, idx) {
2533
2566
  "aria-hidden": "true"
2534
2567
  }]
2535
2568
  ]);
2536
- let aria_key = sub.aria_label || sub.name || sub.id || "";
2537
- let i18n_aria = sub.aria_label || sub.name;
2569
+ let name_key = sub.aria_label || sub.name || sub.id || "";
2538
2570
  let attrs = {
2539
2571
  class: "yui-toolbar-dropdown-item" + (sub.selected ? " is-selected" : ""),
2540
2572
  type: "button",
2541
2573
  role: "menuitemradio",
2542
2574
  "aria-checked": sub.selected ? "true" : "false",
2543
2575
  "data-dropdown-item-id": sub.id || "",
2544
- "aria-label": aria_key
2576
+ "aria-label": name_key
2545
2577
  };
2546
- if (i18n_aria) {
2547
- attrs["data-i18n-aria-label"] = i18n_aria;
2548
- attrs.title = i18n_aria;
2549
- 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;
2550
2582
  }
2551
2583
  let $btn = (0, _yuneta_gobj_js.createElement2)([
2552
2584
  "button",
@@ -2968,11 +3000,23 @@ function shell_navs(gobj) {
2968
3000
  * `name_key` is the key of the control's name; the phrase is a
2969
3001
  * key of its own, so a language orders and punctuates it its
2970
3002
  * way. Said once: a live region needs no re-translation.
2971
- ************************************************************/
2972
- function announce_badge(gobj, name_key, text) {
2973
- let priv = gobj.priv;
2974
- let $status = priv.badge_status;
2975
- 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) {
2976
3020
  (0, _yuneta_gobj_js.log_error)(`C_YUI_SHELL: no live region to say badge '${name_key}': ${text}`);
2977
3021
  return;
2978
3022
  }
@@ -2981,10 +3025,60 @@ function announce_badge(gobj, name_key, text) {
2981
3025
  const tr = priv.translator;
2982
3026
  message = tr("{{name}}, {{n}}", {
2983
3027
  name: tr(name_key),
2984
- n: text
3028
+ n: text,
3029
+ interpolation: { escapeValue: false }
2985
3030
  });
2986
3031
  } else message = `${name_key}, ${text}`;
2987
- $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);
2988
3082
  }
2989
3083
  /************************************************************
2990
3084
  * A shell was built (mt_create) or is being destroyed
@@ -3057,6 +3151,19 @@ function ac_back_wait_timeout(gobj, event, kw, src) {
3057
3151
  return 0;
3058
3152
  }
3059
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
+ /************************************************************
3060
3167
  * Drawer backdrop click on a C_YUI_NAV child: the nav publishes
3061
3168
  * this so the shell can close the drawer through the canonical
3062
3169
  * flow (DOM + focus-trap + escape-stack pop) instead of mutating
@@ -3134,12 +3241,18 @@ function create_gclass$22(gclass_name) {
3134
3241
  "EV_BACK_WAIT_TIMEOUT",
3135
3242
  ac_back_wait_timeout,
3136
3243
  null
3244
+ ],
3245
+ [
3246
+ "EV_CLOSE_BADGE_NEWS",
3247
+ ac_close_badge_news,
3248
+ null
3137
3249
  ]
3138
3250
  ]]];
3139
3251
  const event_types = [
3140
3252
  ["EV_NAV_CLICKED", 0],
3141
3253
  ["EV_DRAWER_CLOSE_REQUESTED", 0],
3142
3254
  ["EV_BACK_WAIT_TIMEOUT", 0],
3255
+ ["EV_CLOSE_BADGE_NEWS", 0],
3143
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],
3144
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],
3145
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],
@@ -3265,9 +3378,9 @@ function yui_shell_previous_route(shell_gobj) {
3265
3378
  /************************************************************
3266
3379
  * Resolve the shell that governs `gobj`: the nearest
3267
3380
  * C_YUI_SHELL ancestor, else the last shell created on the
3268
- * page (apps have exactly one). Null when no shell exists —
3269
- * callers must degrade loudly (shell_modals logs a warning
3270
- * 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).
3271
3384
  ************************************************************/
3272
3385
  function yui_shell_of(gobj) {
3273
3386
  let g = gobj;
@@ -3275,7 +3388,7 @@ function yui_shell_of(gobj) {
3275
3388
  if ((0, _yuneta_gobj_js.gobj_gclass_name)(g) === GCLASS_NAME$22) return g;
3276
3389
  g = (0, _yuneta_gobj_js.gobj_parent)(g);
3277
3390
  }
3278
- return __last_shell__;
3391
+ return __live_shells__.length > 0 ? __live_shells__[__live_shells__.length - 1] : null;
3279
3392
  }
3280
3393
  /************************************************************
3281
3394
  * The DOM where a C_YUI_WINDOW lives when its host names no
@@ -3613,8 +3726,8 @@ function yui_shell_set_toolbar_item_badge(shell_gobj, item_id, value, tone) {
3613
3726
  let now = badge_text(value);
3614
3727
  if (now && now !== before) {
3615
3728
  let $item = $badge.closest("[data-toolbar-item-id]");
3616
- announce_badge(shell_gobj, $item && $item.getAttribute("data-i18n-aria-label") || item_id, now);
3617
- }
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}`);
3618
3731
  }
3619
3732
  /************************************************************
3620
3733
  * Set (or clear) the badge of a MENU item — the twin of
@@ -3663,7 +3776,8 @@ function yui_shell_set_nav_item_badge(shell_gobj, item_id, value, tone) {
3663
3776
  badge_tone: tone
3664
3777
  }, shell_gobj);
3665
3778
  let now = badge_text(badge);
3666
- 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}`);
3667
3781
  }
3668
3782
  /************************************************************
3669
3783
  * Programmatic close of any open toolbar dropdown. Useful for
@@ -3979,7 +4093,19 @@ function yui_shell_show_modal(shell, content, opts) {
3979
4093
  allow = true;
3980
4094
  }
3981
4095
  if (allow && typeof allow.then === "function") {
3982
- 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
+ });
3983
4109
  return;
3984
4110
  }
3985
4111
  if (allow === false) {
@@ -5581,12 +5707,12 @@ function apply_placement(gobj) {
5581
5707
  * and it covered a toast where they met.
5582
5708
  *
5583
5709
  * The popup layer, not the window layer: the dock has to stay
5584
- * above EVERY window, and windows live in two layers -- the
5585
- * window layer (no `$parent`) and the popup layer, where the
5586
- * site map and the JSON windows of the treedb views put theirs.
5587
- * Above both; below the dialogs, the toasts and the loading
5588
- * cover. No shell (before the first, between a logout and the
5589
- * 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.
5590
5716
  ************************************************************/
5591
5717
  function dock_place(gobj) {
5592
5718
  return yui_shell_popup_layer(yui_shell_of(gobj)) || document.body;
@@ -15026,7 +15152,7 @@ function g6_event_kw(evt) {
15026
15152
  * g6_canvas_tab_order.js
15027
15153
  *
15028
15154
  * The canvases of a G6 graph in the page's Tab order: the main
15029
- * one in its place, the other layers out of it.
15155
+ * one in its place, and NAMED; the other layers out of it.
15030
15156
  *
15031
15157
  * G6 stacks four canvases (background, main, label, transient)
15032
15158
  * and gives each of them `tabIndex = 1` (configCanvasDom, when it
@@ -15039,6 +15165,24 @@ function g6_event_kw(evt) {
15039
15165
  * to the graph's toolbars and buttons in DOM order; the other
15040
15166
  * layers receive nothing (`pointer-events: none`) and take -1.
15041
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
+ *
15042
15186
  * Every view that creates a G6 Graph calls
15043
15187
  * keep_canvas_tab_order() right after `new Graph()`: the order is
15044
15188
  * put right each time G6 writes the 1 -- once the canvas is built
@@ -15051,10 +15195,11 @@ function g6_event_kw(evt) {
15051
15195
  * All Rights Reserved.
15052
15196
  ***********************************************************************/
15053
15197
  /************************************************************
15054
- * Main canvas 0, every other layer -1. Returns 0, or -1 with
15055
- * 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.
15056
15201
  ************************************************************/
15057
- function set_canvas_tab_order(gobj, graph) {
15202
+ function set_canvas_tab_order(gobj, graph, name_key) {
15058
15203
  let canvas = graph ? graph.getCanvas() : null;
15059
15204
  if (!canvas || typeof canvas.getLayers !== "function") {
15060
15205
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no canvas to set the Tab order of`);
@@ -15074,17 +15219,27 @@ function set_canvas_tab_order(gobj, graph) {
15074
15219
  ret = -1;
15075
15220
  continue;
15076
15221
  }
15077
- $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);
15078
15233
  }
15079
15234
  return ret;
15080
15235
  }
15081
15236
  /************************************************************
15082
- * Keep the order for the life of `graph`: on every moment G6
15083
- * writes its own.
15237
+ * Keep the order, and the name, for the life of `graph`: on
15238
+ * every moment G6 writes its own.
15084
15239
  ************************************************************/
15085
- function keep_canvas_tab_order(gobj, graph) {
15240
+ function keep_canvas_tab_order(gobj, graph, name_key) {
15086
15241
  for (let ev of [_antv_g6.GraphEvent.AFTER_CANVAS_INIT, _antv_g6.GraphEvent.AFTER_RENDERER_CHANGE]) graph.on(ev, () => {
15087
- set_canvas_tab_order(gobj, graph);
15242
+ set_canvas_tab_order(gobj, graph, name_key);
15088
15243
  });
15089
15244
  }
15090
15245
  //#endregion
@@ -15593,7 +15748,7 @@ function build_graph$4(gobj) {
15593
15748
  behaviors: BEHAVIORS_READING$1.slice()
15594
15749
  });
15595
15750
  if (priv.theme) graph.setTheme(priv.theme);
15596
- keep_canvas_tab_order(gobj, graph);
15751
+ keep_canvas_tab_order(gobj, graph, "json graph");
15597
15752
  graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
15598
15753
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", g6_event_kw(evt), gobj);
15599
15754
  });
@@ -19513,7 +19668,7 @@ function build_graph$3(gobj) {
19513
19668
  } catch (e) {
19514
19669
  (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the theme was refused: ${e}`);
19515
19670
  }
19516
- keep_canvas_tab_order(gobj, priv.graph);
19671
+ keep_canvas_tab_order(gobj, priv.graph, "fsm graph");
19517
19672
  priv.graph.on("aftertransform", () => {
19518
19673
  yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
19519
19674
  });
@@ -22156,6 +22311,17 @@ function close_gclass_view(handle) {
22156
22311
  * lands BEHIND its opener whatever number it is given, and
22157
22312
  * the button reads as one that did nothing.
22158
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
+ *
22159
22325
  * Opened from no window: null -- the window layer of the
22160
22326
  * shell, where every window lives (the legacy '#top-layer'
22161
22327
  * when a page has one). It was the shell's popup layer: above
@@ -22165,7 +22331,11 @@ function window_layer_of(host) {
22165
22331
  let $c = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(host, "$container");
22166
22332
  if ($c && typeof $c.closest === "function") {
22167
22333
  let $win = $c.closest(".C_YUI_WINDOW");
22168
- 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
+ }
22169
22339
  }
22170
22340
  return typeof document !== "undefined" && document.getElementById("top-layer") || null;
22171
22341
  }
@@ -23026,7 +23196,7 @@ function build_graph$2(gobj) {
23026
23196
  behaviors: BEHAVIORS_READING.slice()
23027
23197
  });
23028
23198
  if (priv.theme) graph.setTheme(priv.theme);
23029
- keep_canvas_tab_order(gobj, graph);
23199
+ keep_canvas_tab_order(gobj, graph, "gobj tree graph");
23030
23200
  graph.on("aftertransform", () => {
23031
23201
  yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
23032
23202
  let z = priv.last_zoom;
@@ -24614,16 +24784,17 @@ function card_descriptor(it, show_label, badge_of) {
24614
24784
  text_node(label)
24615
24785
  ]);
24616
24786
  if (badge && !pinned) children.push(badge);
24787
+ let name_key = label || it.aria_label || it.id || "";
24617
24788
  let a_attrs = {
24618
24789
  class: "yui-nav-item yui-nav-card",
24619
24790
  href: it.route ? "#" + it.route : "#",
24620
24791
  "data-item-id": it.id,
24621
24792
  "data-route": it.route || "",
24622
24793
  "data-disabled": it.disabled ? "1" : "0",
24623
- "aria-label": label || it.id
24794
+ "aria-label": name_key
24624
24795
  };
24625
- if (label) a_attrs["data-i18n-aria-label"] = label;
24626
- 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;
24627
24798
  if (tip) {
24628
24799
  a_attrs.title = tip;
24629
24800
  a_attrs["data-i18n-title"] = tip;
@@ -25022,15 +25193,15 @@ function render_tabs(gobj, items) {
25022
25193
  "aria-hidden": "true"
25023
25194
  }]
25024
25195
  ]);
25025
- let label = it.name || "";
25196
+ let name_key = it.name || it.aria_label || it.id || "";
25026
25197
  let a_attrs = {
25027
25198
  href: it.route ? "#" + it.route : "#",
25028
25199
  "data-item-id": it.id,
25029
25200
  "data-route": it.route || "",
25030
- "aria-label": label || it.id
25201
+ "aria-label": name_key
25031
25202
  };
25032
- if (label) a_attrs["data-i18n-aria-label"] = label;
25033
- 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;
25034
25205
  if (tip) {
25035
25206
  a_attrs.title = tip;
25036
25207
  a_attrs["data-i18n-title"] = tip;
@@ -25110,16 +25281,17 @@ function render_breadcrumb(gobj, items) {
25110
25281
  text_node(label)
25111
25282
  ]);
25112
25283
  }
25284
+ let name_key = it.name || it.aria_label || it.id || "";
25113
25285
  let a_attrs = {
25114
25286
  class: "yui-nav-item yui-nav-crumb",
25115
25287
  href: it.route ? "#" + it.route : "#",
25116
25288
  "data-item-id": it.id,
25117
25289
  "data-route": it.route || "",
25118
25290
  "data-disabled": it.disabled ? "1" : "0",
25119
- "aria-label": it.name || it.id
25291
+ "aria-label": name_key
25120
25292
  };
25121
- if (it.name) a_attrs["data-i18n-aria-label"] = it.name;
25122
- 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;
25123
25295
  if (tip) {
25124
25296
  a_attrs.title = tip;
25125
25297
  a_attrs["data-i18n-title"] = tip;
@@ -25256,12 +25428,14 @@ function render_accordion(gobj, items) {
25256
25428
  "aria-controls": body_id
25257
25429
  };
25258
25430
  let head_badge = item_badge_node(gobj, it, false);
25259
- if (!(0, _yuneta_gobj_js.empty_string)(head_text)) {
25260
- head_attrs.i18n = head_text;
25261
- head_attrs.title = head_text;
25262
- head_attrs["data-i18n-title"] = head_text;
25263
- head_attrs["aria-label"] = head_text;
25264
- 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;
25265
25439
  name_control_with_badge(head_attrs, head_badge);
25266
25440
  }
25267
25441
  let $hdr = (0, _yuneta_gobj_js.createElement2)([
@@ -25337,17 +25511,17 @@ function item_li(gobj, it, opts) {
25337
25511
  if (label_el) children.push(label_el);
25338
25512
  if (!pinned) children.push(badge_el);
25339
25513
  }
25340
- let aria_key = label || it.id;
25514
+ let name_key = it.name || it.aria_label || it.id || "";
25341
25515
  let a_attrs = {
25342
25516
  class: a_class,
25343
25517
  href: it.route ? "#" + it.route : "#",
25344
25518
  "data-item-id": it.id,
25345
25519
  "data-route": it.route || "",
25346
25520
  "data-disabled": it.disabled ? "1" : "0",
25347
- "aria-label": aria_key
25521
+ "aria-label": name_key
25348
25522
  };
25349
- if (label) a_attrs["data-i18n-aria-label"] = label;
25350
- 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;
25351
25525
  if (tip) {
25352
25526
  a_attrs.title = tip;
25353
25527
  a_attrs["data-i18n-title"] = tip;
@@ -25390,15 +25564,16 @@ function item_iconbar(gobj, it, opts) {
25390
25564
  if (label_el) children.push(label_el);
25391
25565
  }
25392
25566
  if (!pinned) children.push(badge_el);
25567
+ let name_key = it.name || it.aria_label || it.id || "";
25393
25568
  let a_attrs = {
25394
25569
  class: "yui-nav-item yui-nav-stacked",
25395
25570
  href: it.route ? "#" + it.route : "#",
25396
25571
  "data-item-id": it.id,
25397
25572
  "data-route": it.route || "",
25398
- "aria-label": label || it.id
25573
+ "aria-label": name_key
25399
25574
  };
25400
- if (label) a_attrs["data-i18n-aria-label"] = label;
25401
- 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;
25402
25577
  if (tip) {
25403
25578
  a_attrs.title = tip;
25404
25579
  a_attrs["data-i18n-title"] = tip;
@@ -25666,7 +25841,12 @@ function render_node(node) {
25666
25841
  "aria-hidden": "true"
25667
25842
  }]]
25668
25843
  ]);
25669
- 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([
25670
25850
  "span",
25671
25851
  {
25672
25852
  class: "ROUTEMAP_NAME",
@@ -25719,10 +25899,10 @@ function render_node(node) {
25719
25899
  href: "#" + node.route,
25720
25900
  title: node.route
25721
25901
  };
25722
- if (node.label) {
25902
+ if (node.label && !node.data_label) {
25723
25903
  a_attrs["aria-label"] = node.label;
25724
25904
  a_attrs["data-i18n-aria-label"] = node.label;
25725
- }
25905
+ } else a_attrs["aria-label"] = node.label || node.route;
25726
25906
  if (node.current) a_attrs["aria-current"] = "page";
25727
25907
  $row = (0, _yuneta_gobj_js.createElement2)([
25728
25908
  "a",
@@ -62883,7 +63063,7 @@ function build_graph$1(gobj) {
62883
63063
  plugins: []
62884
63064
  });
62885
63065
  graph.setTheme(priv.theme);
62886
- keep_canvas_tab_order(gobj, graph);
63066
+ keep_canvas_tab_order(gobj, graph, "treedb graph");
62887
63067
  priv._unforward_wheel = yui_graph_forward_wheel(graph, priv.$container, { selector: ".TREEDB_CARD, .TREEDB_PILLS" });
62888
63068
  graph.setLayout(layout);
62889
63069
  priv.graph_rendered = false;
@@ -74572,7 +74752,7 @@ function build_graph(gobj) {
74572
74752
  }
74573
74753
  priv.graph = graph;
74574
74754
  graph.setTheme(dark ? "dark" : "light");
74575
- keep_canvas_tab_order(gobj, graph);
74755
+ keep_canvas_tab_order(gobj, graph, "schema graph");
74576
74756
  graph.on("aftertransform", () => {
74577
74757
  yui_graph_update_zoom($container, priv.graph);
74578
74758
  });
@@ -76687,6 +76867,7 @@ var PRIVATE_DATA$1 = {
76687
76867
  export_view: null
76688
76868
  };
76689
76869
  var __gclass__$1 = null;
76870
+ var __described_seq__ = 0;
76690
76871
  /******************************
76691
76872
  * Framework Methods
76692
76873
  ******************************/
@@ -77487,6 +77668,15 @@ function render(gobj) {
77487
77668
  * A card that opens something, with its own logical name. The
77488
77669
  * cards grid is the shell's, so a schema card and a nav card
77489
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.
77490
77680
  ***************************************************************/
77491
77681
  function open_card(gobj, logical, title, icon, tags, event, kw) {
77492
77682
  let $tags = tags.map((tag) => {
@@ -77504,13 +77694,36 @@ function open_card(gobj, logical, title, icon, tags, event, kw) {
77504
77694
  ]] : `${tag.text}`
77505
77695
  ];
77506
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
+ }
77507
77724
  return [
77508
77725
  "div",
77509
- {
77510
- class: `${logical} yui-nav-card card`,
77511
- role: "button",
77512
- tabindex: "0"
77513
- },
77726
+ card_attrs,
77514
77727
  [[
77515
77728
  "div",
77516
77729
  { class: `${logical}_BODY card-content p-3` },
@@ -77523,16 +77736,16 @@ function open_card(gobj, logical, title, icon, tags, event, kw) {
77523
77736
  [[
77524
77737
  "span",
77525
77738
  { class: "icon" },
77526
- [["i", { class: icon }]]
77527
- ], [
77528
- "span",
77529
- { class: `${logical}_NAME has-text-weight-semibold` },
77530
- text_node(title)
77531
- ]]
77739
+ [["i", {
77740
+ class: icon,
77741
+ "aria-hidden": "true"
77742
+ }]]
77743
+ ], $name]
77532
77744
  ], [
77533
77745
  "div",
77534
77746
  {
77535
77747
  class: `${logical}_TAGS tags mt-2`,
77748
+ id: tags_id,
77536
77749
  style: "gap:.25rem;"
77537
77750
  },
77538
77751
  $tags
@@ -77580,9 +77793,9 @@ function render_treedbs(gobj, $body) {
77580
77793
  style: "is-warning is-light"
77581
77794
  }] : []
77582
77795
  ];
77583
- $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 }));
77584
77797
  }
77585
- 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", [{
77586
77799
  i18n: "topics",
77587
77800
  text: priv.model.orphan_topics.length
77588
77801
  }, {
@@ -77623,22 +77836,33 @@ function render_topics(gobj, $body) {
77623
77836
  $actions.push(row_icon(gobj, "SCHEMA_TOPIC_EDIT", "yi-pen", "edit topic", "EV_EDIT_TOPIC", { topic: address }));
77624
77837
  $actions.push(row_icon(gobj, "SCHEMA_TOPIC_DELETE", "yi-trash", "delete topic", "EV_DELETE_TOPIC", { topic: address }));
77625
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
+ }
77626
77850
  $rows.push([
77627
77851
  "tr",
77628
- {
77629
- class: "SCHEMA_TOPIC_ROW",
77630
- role: "button",
77631
- tabindex: "0"
77632
- },
77852
+ { class: "SCHEMA_TOPIC_ROW" },
77633
77853
  [
77634
77854
  [
77635
77855
  "td",
77636
77856
  { class: "SCHEMA_TOPIC_NAME" },
77637
77857
  [
77638
77858
  [
77639
- "span",
77640
- { class: "has-text-weight-semibold" },
77641
- 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
+ } }
77642
77866
  ],
77643
77867
  topic.system_topic ? [
77644
77868
  "span",
@@ -77668,7 +77892,7 @@ function render_topics(gobj, $body) {
77668
77892
  ],
77669
77893
  ambiguous ? [
77670
77894
  "div",
77671
- { class: "SCHEMA_TOPIC_ID is-size-7 yui-text-quiet" },
77895
+ id_attrs,
77672
77896
  [[
77673
77897
  "code",
77674
77898
  {},
@@ -77710,17 +77934,10 @@ function render_topics(gobj, $body) {
77710
77934
  $actions
77711
77935
  ]
77712
77936
  ],
77713
- {
77714
- click: (evt) => {
77715
- if (evt.target.closest(".SCHEMA_TOPIC_ACTIONS")) return;
77716
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77717
- },
77718
- keydown: (evt) => {
77719
- if (evt.key !== "Enter" && evt.key !== " ") return;
77720
- evt.preventDefault();
77721
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SELECT_TOPIC", { topic: address }, gobj);
77722
- }
77723
- }
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
+ } }
77724
77941
  ]);
77725
77942
  }
77726
77943
  let $table = (0, _yuneta_gobj_js.createElement2)([