@yuneta/gobj-ui 7.26.5 → 7.26.7

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.
@@ -1049,6 +1049,7 @@ function mt_stop$20(gobj) {
1049
1049
  st.items = {};
1050
1050
  st.active_route = null;
1051
1051
  }
1052
+ (0, _yuneta_gobj_js.gobj_stop_children)(gobj);
1052
1053
  }
1053
1054
  /***************************************************************
1054
1055
  * Framework Method: Destroy
@@ -1841,7 +1842,7 @@ function build_toolbar_action_item(gobj, it) {
1841
1842
  btn_attrs["aria-haspopup"] = "menu";
1842
1843
  btn_attrs["aria-expanded"] = "false";
1843
1844
  }
1844
- let tip = it.tooltip || it.aria_label;
1845
+ let tip = it.tooltip || i18n_aria;
1845
1846
  if (tip) {
1846
1847
  btn_attrs.title = tip;
1847
1848
  btn_attrs["data-i18n-title"] = tip;
@@ -1894,6 +1895,11 @@ function build_toolbar_brand_item(gobj, it) {
1894
1895
  Object.assign(attrs, link);
1895
1896
  } else if (action_type === "") tag = "div";
1896
1897
  else attrs.type = "button";
1898
+ let tip = it.tooltip || i18n_aria;
1899
+ if (tag !== "div" && tip) {
1900
+ attrs.title = tip;
1901
+ attrs["data-i18n-title"] = tip;
1902
+ }
1897
1903
  let $item = (0, _yuneta_gobj_js.createElement2)([
1898
1904
  tag,
1899
1905
  attrs,
@@ -1938,7 +1944,7 @@ function build_toolbar_avatar_item(gobj, it) {
1938
1944
  attrs["aria-haspopup"] = "menu";
1939
1945
  attrs["aria-expanded"] = "false";
1940
1946
  }
1941
- let tip = it.tooltip || it.aria_label;
1947
+ let tip = it.tooltip || i18n_aria;
1942
1948
  if (tip) {
1943
1949
  attrs.title = tip;
1944
1950
  attrs["data-i18n-title"] = tip;
@@ -2010,7 +2016,7 @@ function build_toolbar_connection_item(gobj, it) {
2010
2016
  "aria-label": aria_key,
2011
2017
  "data-i18n-aria-label": i18n_aria
2012
2018
  };
2013
- let tip = it.tooltip || it.aria_label;
2019
+ let tip = it.tooltip || i18n_aria;
2014
2020
  if (tip) {
2015
2021
  attrs.title = tip;
2016
2022
  attrs["data-i18n-title"] = tip;
@@ -2143,6 +2149,11 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
2143
2149
  $panel.style.right = "auto";
2144
2150
  $panel.style.left = `${Math.round(left)}px`;
2145
2151
  }
2152
+ let max_h = window.innerHeight - Math.max(0, pos.top) - margin;
2153
+ if (max_h > 0) {
2154
+ $panel.style.maxHeight = `${Math.round(max_h)}px`;
2155
+ $panel.style.overflowY = "auto";
2156
+ }
2146
2157
  yui_shell_translate(gobj, $panel);
2147
2158
  let backdrop = (ev) => {
2148
2159
  if ($panel.contains(ev.target)) return;
@@ -2150,7 +2161,10 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
2150
2161
  close_toolbar_dropdown(gobj);
2151
2162
  };
2152
2163
  document.addEventListener("mousedown", backdrop, true);
2153
- let dismiss = () => close_toolbar_dropdown(gobj);
2164
+ let dismiss = (ev) => {
2165
+ if (ev && ev.type === "scroll" && ev.target && ev.target !== document && $panel.contains(ev.target)) return;
2166
+ close_toolbar_dropdown(gobj);
2167
+ };
2154
2168
  document.addEventListener("scroll", dismiss, {
2155
2169
  capture: true,
2156
2170
  passive: true
@@ -2249,7 +2263,11 @@ function build_dropdown_row(gobj, sub, idx) {
2249
2263
  "data-dropdown-item-id": sub.id || "",
2250
2264
  "aria-label": aria_key
2251
2265
  };
2252
- if (i18n_aria) attrs["data-i18n-aria-label"] = i18n_aria;
2266
+ if (i18n_aria) {
2267
+ attrs["data-i18n-aria-label"] = i18n_aria;
2268
+ attrs.title = i18n_aria;
2269
+ attrs["data-i18n-title"] = i18n_aria;
2270
+ }
2253
2271
  let $btn = (0, _yuneta_gobj_js.createElement2)([
2254
2272
  "button",
2255
2273
  attrs,
@@ -2311,7 +2329,10 @@ function drawers(gobj, menu_id) {
2311
2329
  ************************************************************/
2312
2330
  function push_escape(gobj, layer, handler) {
2313
2331
  let priv = gobj.priv;
2314
- if (!priv || !priv.escape_stack) return;
2332
+ if (!priv || !priv.escape_stack) {
2333
+ (0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: push_escape('${layer}') on a shell that is gone: Escape will not close it`);
2334
+ return;
2335
+ }
2315
2336
  priv.escape_stack.push({
2316
2337
  layer,
2317
2338
  handler
@@ -2367,9 +2388,10 @@ function pop_escape(gobj, handler) {
2367
2388
  function drain_overlays(gobj) {
2368
2389
  let priv = gobj.priv;
2369
2390
  if (!priv || !priv.overlay_stack) return;
2391
+ let entries = priv.overlay_stack.splice(0);
2370
2392
  let kept = [];
2371
- while (priv.overlay_stack.length > 0) {
2372
- let entry = priv.overlay_stack.pop();
2393
+ while (entries.length > 0) {
2394
+ let entry = entries.pop();
2373
2395
  if (entry.keep_on_navigate) {
2374
2396
  kept.unshift(entry);
2375
2397
  continue;
@@ -2380,7 +2402,7 @@ function drain_overlays(gobj) {
2380
2402
  (0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: overlay close on navigation failed: ${e}`);
2381
2403
  }
2382
2404
  }
2383
- for (let entry of kept) priv.overlay_stack.push(entry);
2405
+ priv.overlay_stack.unshift(...kept);
2384
2406
  }
2385
2407
  function retag_overlay_hash(gobj, st, hash) {
2386
2408
  let priv = gobj.priv;
@@ -2519,7 +2541,10 @@ function update_secondary_nav_visibility(gobj, entry) {
2519
2541
  ************************************************************/
2520
2542
  function ac_nav_clicked(gobj, event, kw, src) {
2521
2543
  let route = kw && kw.route || "";
2522
- if ((0, _yuneta_gobj_js.empty_string)(route)) return 0;
2544
+ if ((0, _yuneta_gobj_js.empty_string)(route)) {
2545
+ (0, _yuneta_gobj_js.log_warning)(`C_YUI_SHELL: ${event} with no route, from ${(0, _yuneta_gobj_js.gobj_short_name)(src)}`);
2546
+ return -1;
2547
+ }
2523
2548
  route = remembered_position(gobj, route);
2524
2549
  if ((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "use_hash") && !route_restores_url(gobj, route)) {
2525
2550
  let target_hash = route_to_hash(route);
@@ -2557,17 +2582,19 @@ function ac_nav_item_close(gobj, event, kw, src) {
2557
2582
  * FSM
2558
2583
  ***************************************************************/
2559
2584
  /***************************************************************
2560
- * EV_CONNECTION_STATE is an OPTIONAL fact: a view that waits for a
2561
- * backend answer subscribes to it by name. An app that subscribed
2562
- * to EVERY event of its shell with one attr (`subscriber`) did not
2563
- * ask for it and does not declare it -- published to it anyway, the
2564
- * event would be an FSM error in the app on every connection edge,
2565
- * and adding it to the shell a breaking change for every such app.
2566
- * So it reaches only the subscribers that declare it. Every other
2567
- * event of the shell goes out as before.
2585
+ * EV_CONNECTION_STATE and EV_ICONS_CHANGED are OPTIONAL facts: a
2586
+ * view that needs one subscribes to it by name. An app that
2587
+ * subscribed to EVERY event of its shell with one attr
2588
+ * (`subscriber`) did not ask for them and does not declare them --
2589
+ * published to it anyway, each would be an FSM error in the app
2590
+ * every time it fires, and adding one to the shell a breaking
2591
+ * change for every such app (7.26.6 did exactly that with
2592
+ * EV_ICONS_CHANGED). So they reach only the subscribers that
2593
+ * declare them. Every other event of the shell goes out as before.
2568
2594
  ***************************************************************/
2595
+ var OPTIONAL_EVENTS = /* @__PURE__ */ new Set(["EV_CONNECTION_STATE", "EV_ICONS_CHANGED"]);
2569
2596
  function mt_publication_pre_filter(gobj, subs, event, kw) {
2570
- if (event !== "EV_CONNECTION_STATE") return 1;
2597
+ if (!OPTIONAL_EVENTS.has(event)) return 1;
2571
2598
  let subscriber = subs && subs.subscriber;
2572
2599
  if (!subscriber || !(0, _yuneta_gobj_js.gobj_has_event)(subscriber, event, 0)) return 0;
2573
2600
  return 1;
@@ -2608,6 +2635,7 @@ function create_gclass$22(gclass_name) {
2608
2635
  ["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],
2609
2636
  ["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],
2610
2637
  ["EV_LANGUAGE_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],
2638
+ ["EV_ICONS_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],
2611
2639
  ["EV_CONNECTION_STATE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS]
2612
2640
  ];
2613
2641
  __gclass__$22 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, _yuneta_gobj_js.gclass_flag_t.gcflag_no_check_output_events);
@@ -2898,7 +2926,7 @@ function yui_shell_set_translator(shell_gobj, t) {
2898
2926
  *
2899
2927
  * The division of labour, unchanged: LIBRARY-built DOM is
2900
2928
  * translated through here; APP view gclasses translate their own
2901
- * DOM (they own a `t` — see mount_view).
2929
+ * DOM (they own a `t` — see build_view_gobj).
2902
2930
  *
2903
2931
  * Silent no-op with no shell or no translator: an app that never
2904
2932
  * registered one keeps the previous behaviour instead of losing
@@ -2911,6 +2939,22 @@ function yui_shell_translate(shell_gobj, $el) {
2911
2939
  (0, _yuneta_gobj_js.refresh_language)($el, priv.translator);
2912
2940
  }
2913
2941
  /************************************************************
2942
+ * The user icons changed (lib_icons.js: yui_icons_set_user,
2943
+ * yui_icons_put_user, yui_icons_remove_user): PUBLISH it, so
2944
+ * the views that decided at render time whether a name is an
2945
+ * icon draw it again.
2946
+ *
2947
+ * The registry is a module and knows no shell; the view that
2948
+ * fed it calls this.
2949
+ ************************************************************/
2950
+ function yui_shell_icons_changed(shell_gobj) {
2951
+ if (!shell_gobj || !(0, _yuneta_gobj_js.is_gobj)(shell_gobj)) {
2952
+ (0, _yuneta_gobj_js.log_error)("yui_shell_icons_changed(): no shell");
2953
+ return;
2954
+ }
2955
+ (0, _yuneta_gobj_js.gobj_publish_event)(shell_gobj, "EV_ICONS_CHANGED", {});
2956
+ }
2957
+ /************************************************************
2914
2958
  * Set the backend-connection state painted by every
2915
2959
  * type:"connection" toolbar item. Host/event-driven: the
2916
2960
  * app calls this from its transport handlers (EV_ON_OPEN →
@@ -3559,7 +3603,7 @@ function yui_shell_confirm_yesnocancel(shell, message, opts) {
3559
3603
  *
3560
3604
  * Window - position fixed
3561
3605
  *
3562
- * Copyright (c) 2025, ArtGins.
3606
+ * Copyright (c) 2025-2026, ArtGins.
3563
3607
  * All Rights Reserved.
3564
3608
  ***********************************************************************/
3565
3609
  /***************************************************************
@@ -3642,15 +3686,7 @@ function mt_create$21(gobj) {
3642
3686
  title_prefix: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "title_prefix") || "",
3643
3687
  icon: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "icon") || ""
3644
3688
  }, gobj);
3645
- } else if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "back_dismissable")) {
3646
- let shell = yui_shell_of(gobj);
3647
- if (shell) {
3648
- let overlay = yui_shell_register_overlay(shell, function() {
3649
- close_window(gobj);
3650
- }, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") });
3651
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", overlay);
3652
- }
3653
- }
3689
+ } else if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "back_dismissable")) register_back_overlay(gobj);
3654
3690
  let on_win_resize = function() {
3655
3691
  handleResize(gobj);
3656
3692
  };
@@ -3770,7 +3806,7 @@ function build_default_header(gobj) {
3770
3806
  if (!(0, _yuneta_gobj_js.empty_string)(prefix)) items.push([
3771
3807
  "span",
3772
3808
  { class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
3773
- prefix
3809
+ document.createTextNode(String(prefix))
3774
3810
  ]);
3775
3811
  if (!(0, _yuneta_gobj_js.empty_string)(title)) items.push([
3776
3812
  "span",
@@ -3813,7 +3849,9 @@ function resolve_manager(gobj) {
3813
3849
  let m = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "manager");
3814
3850
  if (!m) return null;
3815
3851
  if (typeof m === "string") {
3816
- m = (0, _yuneta_gobj_js.gobj_find_service)(m, false) || null;
3852
+ let name = m;
3853
+ m = (0, _yuneta_gobj_js.gobj_find_service)(name, false) || null;
3854
+ if (!m) (0, _yuneta_gobj_js.log_warning)(`${GCLASS_NAME$21}: window manager '${name}' not found: no dock, no minimize`);
3817
3855
  (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "manager", m);
3818
3856
  }
3819
3857
  return m;
@@ -3923,6 +3961,8 @@ function build_ui$18(gobj) {
3923
3961
  {
3924
3962
  class: "WINDOW_MIN yui-wc wc-min",
3925
3963
  type: "button",
3964
+ title: (0, i18next.t)("minimize"),
3965
+ "data-i18n-title": "minimize",
3926
3966
  "aria-label": (0, i18next.t)("minimize"),
3927
3967
  "data-i18n-aria-label": "minimize",
3928
3968
  style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMin") && (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "manager") ? "" : "display:none;"
@@ -3938,6 +3978,8 @@ function build_ui$18(gobj) {
3938
3978
  {
3939
3979
  class: "WINDOW_MAX yui-wc wc-max",
3940
3980
  type: "button",
3981
+ title: (0, i18next.t)("maximize"),
3982
+ "data-i18n-title": "maximize",
3941
3983
  "aria-label": (0, i18next.t)("maximize"),
3942
3984
  "data-i18n-aria-label": "maximize",
3943
3985
  style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMax") ? "" : "display:none;"
@@ -3953,13 +3995,15 @@ function build_ui$18(gobj) {
3953
3995
  {
3954
3996
  class: "WINDOW_CLOSE yui-wc wc-close",
3955
3997
  type: "button",
3998
+ title: (0, i18next.t)("close"),
3999
+ "data-i18n-title": "close",
3956
4000
  "aria-label": (0, i18next.t)("close"),
3957
4001
  "data-i18n-aria-label": "close"
3958
4002
  },
3959
4003
  WC_CLOSE,
3960
4004
  { click: (evt) => {
3961
4005
  evt.stopPropagation();
3962
- close_window(gobj);
4006
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_CLOSE_WINDOW", {}, gobj);
3963
4007
  } }
3964
4008
  ]
3965
4009
  ]
@@ -4095,6 +4139,27 @@ function destroy_ui$13(gobj) {
4095
4139
  }
4096
4140
  }
4097
4141
  /************************************************************
4142
+ * Register this floating window in the shell's overlay history,
4143
+ * so the browser Back closes it.
4144
+ *
4145
+ * The shell takes the entry off its stack BEFORE it calls the
4146
+ * close function (Back, or a route change draining overlays). When
4147
+ * a subscriber of EV_WINDOW_TO_CLOSE vetoes the close, the window
4148
+ * stays up with no entry: Back would no longer close it, and it
4149
+ * would float over the next views. So a window that survives its
4150
+ * own close function registers again.
4151
+ ************************************************************/
4152
+ function register_back_overlay(gobj) {
4153
+ let shell = yui_shell_of(gobj);
4154
+ if (!shell) return;
4155
+ let overlay = yui_shell_register_overlay(shell, function() {
4156
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", null);
4157
+ close_window(gobj);
4158
+ if (!(0, _yuneta_gobj_js.gobj_is_destroying)(gobj) && !(0, _yuneta_gobj_js.gobj_read_attr)(gobj, "back_overlay")) register_back_overlay(gobj);
4159
+ }, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") });
4160
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", overlay);
4161
+ }
4162
+ /************************************************************
4098
4163
  *
4099
4164
  ************************************************************/
4100
4165
  function close_window(gobj) {
@@ -4112,12 +4177,12 @@ function close_window(gobj) {
4112
4177
  no_label: "no",
4113
4178
  cancel_label: "cancel"
4114
4179
  }).then(function(answer) {
4115
- if (answer === "yes") {
4116
- if (on_close) on_close();
4117
- (0, _yuneta_gobj_js.gobj_stop)(gobj);
4118
- (0, _yuneta_gobj_js.gobj_stop_children)(gobj);
4119
- (0, _yuneta_gobj_js.gobj_destroy)(gobj);
4120
- }
4180
+ if (answer !== "yes") return;
4181
+ if ((0, _yuneta_gobj_js.gobj_is_destroying)(gobj)) return;
4182
+ if (on_close) on_close();
4183
+ if ((0, _yuneta_gobj_js.gobj_is_running)(gobj)) (0, _yuneta_gobj_js.gobj_stop)(gobj);
4184
+ (0, _yuneta_gobj_js.gobj_stop_children)(gobj);
4185
+ (0, _yuneta_gobj_js.gobj_destroy)(gobj);
4121
4186
  });
4122
4187
  }
4123
4188
  /************************************************************
@@ -4152,8 +4217,12 @@ function set_max_icon(gobj, maximized) {
4152
4217
  if (!$container) return;
4153
4218
  let $btn = $container.querySelector(".wc-max");
4154
4219
  if ($btn) {
4220
+ let key = maximized ? "restore" : "maximize";
4155
4221
  $btn.innerHTML = maximized ? WC_RESTORE : WC_MAX;
4156
- $btn.setAttribute("aria-label", maximized ? "restore" : "maximize");
4222
+ $btn.setAttribute("title", (0, i18next.t)(key));
4223
+ $btn.setAttribute("data-i18n-title", key);
4224
+ $btn.setAttribute("aria-label", (0, i18next.t)(key));
4225
+ $btn.setAttribute("data-i18n-aria-label", key);
4157
4226
  }
4158
4227
  }
4159
4228
  /************************************************************
@@ -4796,7 +4865,7 @@ function ac_register_window(gobj, event, kw, src) {
4796
4865
  if (prefix) label_items.push([
4797
4866
  "span",
4798
4867
  { class: "yui-dock-label-prefix" },
4799
- prefix
4868
+ document.createTextNode(String(prefix))
4800
4869
  ]);
4801
4870
  if (title_key) label_items.push([
4802
4871
  "span",
@@ -4809,7 +4878,7 @@ function ac_register_window(gobj, event, kw, src) {
4809
4878
  if (label_items.length === 0) label_items.push([
4810
4879
  "span",
4811
4880
  { class: "yui-dock-label-kind" },
4812
- title
4881
+ document.createTextNode(String(title))
4813
4882
  ]);
4814
4883
  let entry = {
4815
4884
  gobj: win,
@@ -4836,6 +4905,8 @@ function ac_register_window(gobj, event, kw, src) {
4836
4905
  {
4837
4906
  class: "yui-dock-close",
4838
4907
  type: "button",
4908
+ title: (0, i18next.t)("close"),
4909
+ "data-i18n-title": "close",
4839
4910
  "aria-label": (0, i18next.t)("close"),
4840
4911
  "data-i18n-aria-label": "close"
4841
4912
  },
@@ -5100,6 +5171,8 @@ function build_ui$17(gobj) {
5100
5171
  "button",
5101
5172
  {
5102
5173
  class: "yui-pager-back button is-white is-hidden",
5174
+ title: (0, i18next.t)("back"),
5175
+ "data-i18n-title": "back",
5103
5176
  "aria-label": (0, i18next.t)("back"),
5104
5177
  "data-i18n-aria-label": "back"
5105
5178
  },
@@ -5125,6 +5198,8 @@ function build_ui$17(gobj) {
5125
5198
  "button",
5126
5199
  {
5127
5200
  class: "yui-pager-discard button is-white is-hidden",
5201
+ title: (0, i18next.t)("discard"),
5202
+ "data-i18n-title": "discard",
5128
5203
  "aria-label": (0, i18next.t)("discard"),
5129
5204
  "data-i18n-aria-label": "discard"
5130
5205
  },
@@ -5205,13 +5280,12 @@ function render_header(gobj) {
5205
5280
  let $discard = $container.querySelector(".yui-pager-discard");
5206
5281
  $back.classList.toggle("is-hidden", !model.show_back);
5207
5282
  let $back_icon = $back.querySelector("i");
5208
- if (model.back_kind === "close") {
5209
- $back_icon.className = "yi-xmark";
5210
- $back.setAttribute("aria-label", "close");
5211
- } else {
5212
- $back_icon.className = "yi-arrow-left";
5213
- $back.setAttribute("aria-label", "back");
5214
- }
5283
+ let back_key = model.back_kind === "close" ? "close" : "back";
5284
+ $back_icon.className = back_key === "close" ? "yi-xmark" : "yi-arrow-left";
5285
+ $back.setAttribute("title", (0, i18next.t)(back_key));
5286
+ $back.setAttribute("data-i18n-title", back_key);
5287
+ $back.setAttribute("aria-label", (0, i18next.t)(back_key));
5288
+ $back.setAttribute("data-i18n-aria-label", back_key);
5215
5289
  $discard.classList.toggle("is-hidden", !model.show_discard);
5216
5290
  $title.setAttribute("data-i18n", model.title);
5217
5291
  $title.textContent = (0, i18next.t)(model.title);
@@ -5619,6 +5693,8 @@ function mt_destroy$18(gobj) {
5619
5693
  * Build UI
5620
5694
  ************************************************************/
5621
5695
  function build_ui$16(gobj) {
5696
+ let back_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "back_label");
5697
+ let next_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "next_label");
5622
5698
  let $container = (0, _yuneta_gobj_js.createElement2)([
5623
5699
  "div",
5624
5700
  {
@@ -5666,8 +5742,10 @@ function build_ui$16(gobj) {
5666
5742
  "button",
5667
5743
  {
5668
5744
  class: "yui-wizard-back button",
5669
- "aria-label": (0, i18next.t)("back"),
5670
- "data-i18n-aria-label": "back"
5745
+ title: (0, i18next.t)(back_label),
5746
+ "data-i18n-title": back_label,
5747
+ "aria-label": (0, i18next.t)(back_label),
5748
+ "data-i18n-aria-label": back_label
5671
5749
  },
5672
5750
  [[
5673
5751
  "span",
@@ -5677,9 +5755,9 @@ function build_ui$16(gobj) {
5677
5755
  "span",
5678
5756
  {
5679
5757
  class: "is-hidden-mobile",
5680
- i18n: "back"
5758
+ i18n: back_label
5681
5759
  },
5682
- "back"
5760
+ back_label
5683
5761
  ]],
5684
5762
  { click: function(evt) {
5685
5763
  evt.stopPropagation();
@@ -5689,16 +5767,18 @@ function build_ui$16(gobj) {
5689
5767
  "button",
5690
5768
  {
5691
5769
  class: "yui-wizard-primary button is-link",
5692
- "aria-label": (0, i18next.t)("next"),
5693
- "data-i18n-aria-label": "next"
5770
+ title: (0, i18next.t)(next_label),
5771
+ "data-i18n-title": next_label,
5772
+ "aria-label": (0, i18next.t)(next_label),
5773
+ "data-i18n-aria-label": next_label
5694
5774
  },
5695
5775
  [[
5696
5776
  "span",
5697
5777
  {
5698
5778
  class: "yui-wizard-primary-label",
5699
- i18n: "next"
5779
+ i18n: next_label
5700
5780
  },
5701
- "next"
5781
+ next_label
5702
5782
  ]],
5703
5783
  { click: function(evt) {
5704
5784
  evt.stopPropagation();
@@ -5757,14 +5837,19 @@ function render_chrome(gobj) {
5757
5837
  let $title = $container.querySelector(".yui-wizard-title");
5758
5838
  let $counter = $container.querySelector(".yui-wizard-counter");
5759
5839
  let $back = $container.querySelector(".yui-wizard-back");
5840
+ let $primary = $container.querySelector(".yui-wizard-primary");
5760
5841
  let $plabel = $container.querySelector(".yui-wizard-primary-label");
5761
- $title.setAttribute("i18n", model.title);
5762
- $title.textContent = model.title;
5842
+ $title.setAttribute("data-i18n", model.title);
5843
+ $title.textContent = (0, i18next.t)(model.title);
5763
5844
  if (model.count > 0) $counter.textContent = `${model.idx + 1} / ${model.count}`;
5764
5845
  else $counter.textContent = "";
5765
5846
  $back.classList.toggle("is-hidden", !model.show_back);
5766
- $plabel.setAttribute("i18n", model.primary_label);
5767
- $plabel.textContent = model.primary_label;
5847
+ $plabel.setAttribute("data-i18n", model.primary_label);
5848
+ $plabel.textContent = (0, i18next.t)(model.primary_label);
5849
+ $primary.setAttribute("title", (0, i18next.t)(model.primary_label));
5850
+ $primary.setAttribute("data-i18n-title", model.primary_label);
5851
+ $primary.setAttribute("aria-label", (0, i18next.t)(model.primary_label));
5852
+ $primary.setAttribute("data-i18n-aria-label", model.primary_label);
5768
5853
  for (let i = 0; i < priv.steps.length; i++) {
5769
5854
  let s = priv.steps[i];
5770
5855
  if (s.$el) s.$el.classList.toggle("is-hidden", i !== model.idx);
@@ -7090,6 +7175,496 @@ function yui_watch_theme(gobj, event = "EV_THEME") {
7090
7175
  }
7091
7176
  } };
7092
7177
  }
7178
+ //#endregion
7179
+ //#region src/lib_icons.js
7180
+ /*********************************************************
7181
+ * lib_icons.js
7182
+ *
7183
+ * Two icon systems are managed here:
7184
+ *
7185
+ * 1. FA-style CSS icons (yui_icons.css)
7186
+ * Usage: <i class="yi-save"></i>
7187
+ * Color: inherits currentColor from parent via CSS mask.
7188
+ *
7189
+ * 2. SVG symbol icons for G6 toolbar (and any other component
7190
+ * that uses <use xlink:href="#id">).
7191
+ * Symbols are injected once into the DOM.
7192
+ * All symbol ids are prefixed with "g6-icon-" to avoid
7193
+ * conflicts with other DOM elements.
7194
+ * Icon paths come from:
7195
+ * fontawesome-free-7.1.0-web/sprites/solid.svg
7196
+ *
7197
+ * G6 toolbar items are managed via CSS class names (className
7198
+ * field in getItems()) using YuiToolbar in c_g6_nodes_tree.js.
7199
+ * This lets lib_graph.js state functions (set_submit_state,
7200
+ * disableElements, …) work on toolbar icons exactly like on
7201
+ * regular Bulma/FA buttons — no icon-specific helpers needed.
7202
+ *
7203
+ * 3. User icons: the icons a user adds as DATA, one node of the
7204
+ * treedb system topic `__icons__` each (id = name, svg = drawing).
7205
+ * They join system 1 at run time: each becomes a rule
7206
+ * `.yi-u-<id>::before` in a stylesheet of their own, so every
7207
+ * component that draws an icon by class name draws them too.
7208
+ * `yi-u-` is the user's namespace, and the reason a user icon can
7209
+ * never replace an icon of the library.
7210
+ *
7211
+ * Copyright (c) 2025-2026, ArtGins.
7212
+ * All Rights Reserved.
7213
+ *********************************************************/
7214
+ var CUSTOM_SVG_ICONS_ID = "g6-custom-svgicons";
7215
+ var ICONS = `<svg xmlns="http://www.w3.org/2000/svg">
7216
+ <!-- magnifying-glass-plus -->
7217
+ <symbol id="g6-icon-zoom-in" viewBox="0 0 512 512">
7218
+ <path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 112c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z"/>
7219
+ </symbol>
7220
+ <!-- magnifying-glass-minus -->
7221
+ <symbol id="g6-icon-zoom-out" viewBox="0 0 512 512">
7222
+ <path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"/>
7223
+ </symbol>
7224
+ <!-- house (reset zoom: back to original 100% view) -->
7225
+ <symbol id="g6-icon-home" viewBox="0 0 512 512">
7226
+ <path fill="currentColor" d="M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM240 320l32 0c26.5 0 48 21.5 48 48l0 96-128 0 0-96c0-26.5 21.5-48 48-48z"/>
7227
+ </symbol>
7228
+ <!-- expand (zoom to fit) -->
7229
+ <symbol id="g6-icon-fit" viewBox="0 0 448 512">
7230
+ <path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
7231
+ </symbol>
7232
+ <!-- fit to selection: the same corner brackets as the fit icon,
7233
+ around a marked object. The two sit side by side in the
7234
+ toolbar and have to read as a family, which a borrowed glyph
7235
+ would not. (No backticks in here: the sprite lives inside a
7236
+ template literal.) -->
7237
+ <symbol id="g6-icon-fit-selection" viewBox="0 0 448 512">
7238
+ <path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
7239
+ <rect fill="currentColor" x="144" y="176" width="160" height="160" rx="24"/>
7240
+ </symbol>
7241
+ <!-- crosshairs (center) -->
7242
+ <symbol id="g6-icon-center" viewBox="0 0 576 512">
7243
+ <path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM131.2 288c12.7 62.7 62.1 112.1 124.8 124.8l0-12.8c0-17.7 14.3-32 32-32s32 14.3 32 32l0 12.8c62.7-12.7 112.1-62.1 124.8-124.8L432 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l12.8 0C432.1 161.3 382.7 111.9 320 99.2l0 12.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-12.8C193.3 111.9 143.9 161.3 131.2 224l12.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-12.8 0zM288 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/>
7244
+ </symbol>
7245
+ <!-- up-right-and-down-left-from-center (enter fullscreen) -->
7246
+ <symbol id="g6-icon-fullscreen" viewBox="0 0 512 512">
7247
+ <path fill="currentColor" d="M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2S34.1 320.2 41 327l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S177.7 512 168 512z"/>
7248
+ </symbol>
7249
+ <!-- down-left-and-up-right-to-center (exit fullscreen) -->
7250
+ <symbol id="g6-icon-fullscreen-exit" viewBox="0 0 512 512">
7251
+ <path fill="currentColor" d="M439.5 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S450.2 240 440.5 240l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87zM72.5 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S62.8 272 72.5 272z"/>
7252
+ </symbol>
7253
+ <!-- arrow-rotate-left (undo) -->
7254
+ <symbol id="g6-icon-undo" viewBox="0 0 512 512">
7255
+ <path fill="currentColor" d="M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"/>
7256
+ </symbol>
7257
+ <!-- arrow-rotate-right (redo) -->
7258
+ <symbol id="g6-icon-redo" viewBox="0 0 512 512">
7259
+ <path fill="currentColor" d="M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"/>
7260
+ </symbol>
7261
+ <!-- pen (edit node) -->
7262
+ <symbol id="g6-icon-edit" viewBox="0 0 512 512">
7263
+ <path fill="currentColor" d="M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"/>
7264
+ </symbol>
7265
+ <!-- trash-can (delete) -->
7266
+ <symbol id="g6-icon-delete" viewBox="0 0 448 512">
7267
+ <path fill="currentColor" d="M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z"/>
7268
+ </symbol>
7269
+ <!-- link (link nodes) -->
7270
+ <symbol id="g6-icon-link" viewBox="0 0 576 512">
7271
+ <path fill="currentColor" d="M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"/>
7272
+ </symbol>
7273
+ <!-- link-slash (unlink) -->
7274
+ <symbol id="g6-icon-unlink" viewBox="0 0 576 512">
7275
+ <path fill="currentColor" d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"/>
7276
+ </symbol>
7277
+ <!-- play (run node) -->
7278
+ <symbol id="g6-icon-run" viewBox="0 0 448 512">
7279
+ <path fill="currentColor" d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/>
7280
+ </symbol>
7281
+ <!-- clone (copy size to other nodes/ports) -->
7282
+ <symbol id="g6-icon-resize" viewBox="0 0 512 512">
7283
+ <path fill="currentColor" d="M288 448l-224 0 0-224 48 0 0-64-48 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-48-64 0 0 48zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"/>
7284
+ </symbol>
7285
+ <!-- plus (create node). Deliberately NOT the FA7 solid plus:
7286
+ its arms are ~14% of the width and read thin next to the
7287
+ other solid glyphs. Bold geometric plus (~23% arm
7288
+ thickness) with long arms (32..480) so it reads as a "+",
7289
+ not a stubby Red-Cross square. -->
7290
+ <symbol id="g6-icon-plus" viewBox="0 0 512 512">
7291
+ <path fill="currentColor" d="M316 32 L316 196 L480 196 L480 316 L316 316 L316 480 L196 480 L196 316 L32 316 L32 196 L196 196 L196 32 Z"/>
7292
+ </symbol>
7293
+ <!-- ellipsis-vertical (unfold the floating toolbar).
7294
+ The strip it stands for is a vertical stack, and a vertical
7295
+ ellipsis is what "there is more of this here" is drawn as
7296
+ everywhere else. -->
7297
+ <symbol id="g6-icon-toolbar-show" viewBox="0 0 128 512">
7298
+ <path fill="currentColor" d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/>
7299
+ </symbol>
7300
+ <!-- xmark (fold the floating toolbar away).
7301
+ Not a chevron: the two toolbars sit on OPPOSITE edges, so a
7302
+ direction would point the wrong way on one of them. What the
7303
+ button does is close an overlay, and that is an x. -->
7304
+ <symbol id="g6-icon-toolbar-hide" viewBox="0 0 384 512">
7305
+ <path fill="currentColor" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
7306
+ </symbol>
7307
+ <!-- dashed marquee (selection mode).
7308
+ The band ITSELF, because that is what the button turns on: a
7309
+ drag on the canvas draws one and a tap picks a card. Not the
7310
+ fit-to-selection glyph next to it in the other toolbar -- that
7311
+ one is solid brackets around a solid object and means "put the
7312
+ camera on what is picked", which is the opposite end of the
7313
+ gesture. Dashes: 16 segments of 59 with gaps of 36 over a
7314
+ perimeter of 1520, so they land on the corners. -->
7315
+ <symbol id="g6-icon-select-mode" viewBox="0 0 512 512">
7316
+ <rect x="46" y="86" width="420" height="340" fill="none"
7317
+ stroke="currentColor" stroke-width="40"
7318
+ stroke-dasharray="59 36"/>
7319
+ </symbol>
7320
+ <!-- location-crosshairs (anchor the camera on one element).
7321
+ The SAME path as the DOM toolbars and their yi-location-crosshairs
7322
+ mask: the two toolbars sit in one console, and a control that
7323
+ does one thing has to be drawn one way. -->
7324
+ <symbol id="g6-icon-anchor" viewBox="0 0 576 512">
7325
+ <path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM128 256a160 160 0 1 0 320 0 160 160 0 1 0 -320 0zm160-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/>
7326
+ </symbol>
7327
+ <!-- floppy-disk (save) -->
7328
+ <symbol id="g6-icon-save" viewBox="0 0 448 512">
7329
+ <path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm32 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"/>
7330
+ </symbol>
7331
+ </svg>`;
7332
+ function inject_svg_icons() {
7333
+ if (document.getElementById(CUSTOM_SVG_ICONS_ID)) return;
7334
+ const div = document.createElement("div");
7335
+ div.id = CUSTOM_SVG_ICONS_ID;
7336
+ div.style.display = "none";
7337
+ div.innerHTML = ICONS;
7338
+ document.body.appendChild(div);
7339
+ }
7340
+ var __icon_defined__ = {};
7341
+ function yui_icon_is_defined(name) {
7342
+ if (!name || typeof name !== "string") return false;
7343
+ if (__icon_defined__[name] !== void 0) return __icon_defined__[name];
7344
+ let defined = false;
7345
+ try {
7346
+ const el = document.createElement("i");
7347
+ el.className = name;
7348
+ el.style.position = "absolute";
7349
+ el.style.visibility = "hidden";
7350
+ el.style.pointerEvents = "none";
7351
+ document.body.appendChild(el);
7352
+ const st = window.getComputedStyle(el, "::before");
7353
+ const mask = st.maskImage || st.webkitMaskImage || "";
7354
+ defined = !!mask && mask !== "none";
7355
+ document.body.removeChild(el);
7356
+ } catch (e) {
7357
+ defined = false;
7358
+ }
7359
+ __icon_defined__[name] = defined;
7360
+ return defined;
7361
+ }
7362
+ /************************************************************
7363
+ *
7364
+ * User icons
7365
+ *
7366
+ ************************************************************/
7367
+ var ICONS_TOPIC = "__icons__";
7368
+ var ICONS_SVG_COL = "svg";
7369
+ var USER_ICON_PREFIX = "yi-u-";
7370
+ var USER_ICON_ID_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
7371
+ var USER_ICON_MAX_SVG = 32768;
7372
+ var USER_ICONS_STYLE_ID = "yui-user-icons";
7373
+ var SVG_NS = "http://www.w3.org/2000/svg";
7374
+ var SVG_ELEMENTS = [
7375
+ "svg",
7376
+ "g",
7377
+ "path",
7378
+ "circle",
7379
+ "ellipse",
7380
+ "rect",
7381
+ "line",
7382
+ "polyline",
7383
+ "polygon"
7384
+ ];
7385
+ var SVG_ATTRIBUTES = [
7386
+ "d",
7387
+ "cx",
7388
+ "cy",
7389
+ "r",
7390
+ "rx",
7391
+ "ry",
7392
+ "x",
7393
+ "y",
7394
+ "x1",
7395
+ "y1",
7396
+ "x2",
7397
+ "y2",
7398
+ "width",
7399
+ "height",
7400
+ "points",
7401
+ "transform",
7402
+ "fill",
7403
+ "fill-rule",
7404
+ "fill-opacity",
7405
+ "clip-rule",
7406
+ "opacity",
7407
+ "stroke",
7408
+ "stroke-width",
7409
+ "stroke-linecap",
7410
+ "stroke-linejoin",
7411
+ "stroke-miterlimit",
7412
+ "stroke-opacity",
7413
+ "stroke-dasharray"
7414
+ ];
7415
+ var SVG_VALUE_RE = /^[a-zA-Z0-9\s.,#%()+-]*$/;
7416
+ var __user_icons__ = /* @__PURE__ */ new Map();
7417
+ /************************************************************
7418
+ * Is this field the drawing of an icon of __icons__?
7419
+ * The form edits it as a text area with a preview, and the
7420
+ * table shows the icon instead of the svg source.
7421
+ ************************************************************/
7422
+ function yui_icons_is_svg_field(topic_name, field_name) {
7423
+ return topic_name === "__icons__" && field_name === ICONS_SVG_COL;
7424
+ }
7425
+ /************************************************************
7426
+ * The class of the user icon named `id`.
7427
+ ************************************************************/
7428
+ function yui_user_icon_class(id) {
7429
+ return USER_ICON_PREFIX + id;
7430
+ }
7431
+ /************************************************************
7432
+ * Rebuild an svg from its SHAPES only.
7433
+ *
7434
+ * Return {svg, dropped} -- svg is the clean markup, dropped the
7435
+ * names of what was left out -- or {error} when there is
7436
+ * nothing to draw. The error is one of a FIXED set, so a GUI
7437
+ * can translate it: "empty svg", "svg too big", "not an svg
7438
+ * document", "svg without size", "svg without shapes". The markup is never inserted anywhere as
7439
+ * it came: it is parsed, and a new one is written from the
7440
+ * elements and attributes allowed above.
7441
+ ************************************************************/
7442
+ function yui_svg_sanitize(svg_text) {
7443
+ if (typeof svg_text !== "string" || !svg_text.trim()) return { error: "empty svg" };
7444
+ if (svg_text.length > USER_ICON_MAX_SVG) return { error: "svg too big" };
7445
+ let doc;
7446
+ try {
7447
+ doc = new DOMParser().parseFromString(svg_text, "image/svg+xml");
7448
+ } catch (e) {
7449
+ return { error: "not an svg document" };
7450
+ }
7451
+ let root = doc && doc.documentElement;
7452
+ if (!root || root.getElementsByTagName("parsererror").length > 0) return { error: "not an svg document" };
7453
+ return rebuild_svg_from_shapes(root);
7454
+ }
7455
+ /************************************************************
7456
+ * The second half of yui_svg_sanitize(), on a PARSED tree:
7457
+ * anything with `localName`, `attributes` ({name, localName,
7458
+ * prefix, value}), `children` and `getAttribute()` -- a DOM
7459
+ * element, or the plain objects a test builds.
7460
+ ************************************************************/
7461
+ function rebuild_svg_from_shapes(root) {
7462
+ if (!root || root.localName !== "svg") return { error: "not an svg document" };
7463
+ let dropped = /* @__PURE__ */ new Set();
7464
+ let shapes = 0;
7465
+ function value_is_safe(value) {
7466
+ return SVG_VALUE_RE.test(value) && !/url\s*\(/i.test(value);
7467
+ }
7468
+ function clean_attrs(el, allowed) {
7469
+ let out = "";
7470
+ for (const attr of Array.from(el.attributes || [])) {
7471
+ let name = attr.localName || attr.name;
7472
+ if (attr.prefix || !allowed.includes(name)) {
7473
+ if (name !== "xmlns" && attr.prefix !== "xmlns") dropped.add(`@${attr.name}`);
7474
+ continue;
7475
+ }
7476
+ let value = String(attr.value).trim();
7477
+ if (!value_is_safe(value)) {
7478
+ dropped.add(`@${attr.name}`);
7479
+ continue;
7480
+ }
7481
+ out += ` ${name}="${value}"`;
7482
+ }
7483
+ return out;
7484
+ }
7485
+ function clean_node(el) {
7486
+ let name = el.localName;
7487
+ if (!SVG_ELEMENTS.includes(name) || name === "svg") {
7488
+ dropped.add(name);
7489
+ return "";
7490
+ }
7491
+ if (name !== "g") shapes++;
7492
+ let inner = "";
7493
+ for (const child of Array.from(el.children || [])) inner += clean_node(child);
7494
+ return `<${name}${clean_attrs(el, SVG_ATTRIBUTES)}>${inner}</${name}>`;
7495
+ }
7496
+ let view_box = (root.getAttribute("viewBox") || "").trim();
7497
+ if (!/^-?[\d.]+([\s,]+-?[\d.]+){3}$/.test(view_box)) {
7498
+ let w = parseFloat(root.getAttribute("width"));
7499
+ let h = parseFloat(root.getAttribute("height"));
7500
+ if (!(w > 0 && h > 0)) return { error: "svg without size" };
7501
+ view_box = `0 0 ${w} ${h}`;
7502
+ }
7503
+ const ROOT_ATTRIBUTES = [
7504
+ "fill",
7505
+ "fill-rule",
7506
+ "stroke",
7507
+ "stroke-width",
7508
+ "stroke-linecap",
7509
+ "stroke-linejoin"
7510
+ ];
7511
+ let root_attrs = "";
7512
+ for (const name of ROOT_ATTRIBUTES) {
7513
+ let value = (root.getAttribute(name) || "").trim();
7514
+ if (value && value_is_safe(value)) root_attrs += ` ${name}="${value}"`;
7515
+ else if (value) dropped.add(`@${name}`);
7516
+ }
7517
+ for (const attr of Array.from(root.attributes || [])) {
7518
+ let name = attr.localName || attr.name;
7519
+ if (attr.prefix === "xmlns" || name === "xmlns" || [
7520
+ "viewBox",
7521
+ "width",
7522
+ "height",
7523
+ "version"
7524
+ ].includes(name) || !attr.prefix && ROOT_ATTRIBUTES.includes(name)) continue;
7525
+ dropped.add(`@${attr.name}`);
7526
+ }
7527
+ let inner = "";
7528
+ for (const child of Array.from(root.children || [])) inner += clean_node(child);
7529
+ if (shapes === 0) return { error: "svg without shapes" };
7530
+ return {
7531
+ svg: `<svg xmlns="${SVG_NS}" viewBox="${view_box}"${root_attrs}>${inner}</svg>`,
7532
+ dropped: Array.from(dropped)
7533
+ };
7534
+ }
7535
+ /************************************************************
7536
+ * The CSS `url(...)` of an svg, to be used as a mask.
7537
+ * Every character that could end the string or the url is
7538
+ * percent-encoded.
7539
+ ************************************************************/
7540
+ function svg_mask_url(svg) {
7541
+ return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
7542
+ }
7543
+ /************************************************************
7544
+ * An element that shows an svg as an icon, before it is
7545
+ * registered (a form preview, a cell of __icons__ itself).
7546
+ * Return {element} or {error}.
7547
+ ************************************************************/
7548
+ function yui_svg_icon_element(svg_text) {
7549
+ let clean = yui_svg_sanitize(svg_text);
7550
+ if (clean.error) return { error: clean.error };
7551
+ let el = document.createElement("span");
7552
+ el.className = "USER_ICON_PREVIEW";
7553
+ let mask = svg_mask_url(clean.svg);
7554
+ el.style.setProperty("-webkit-mask-image", mask);
7555
+ el.style.setProperty("mask-image", mask);
7556
+ return {
7557
+ element: el,
7558
+ dropped: clean.dropped
7559
+ };
7560
+ }
7561
+ /************************************************************
7562
+ * Write the stylesheet of the user icons again, from the map.
7563
+ ************************************************************/
7564
+ function rebuild_user_icons_stylesheet() {
7565
+ let css = "";
7566
+ for (const [id, icon] of __user_icons__) css += `.${yui_user_icon_class(id)}::before {-webkit-mask-image: ${icon.mask}; mask-image: ${icon.mask};}\n`;
7567
+ try {
7568
+ let el = document.getElementById(USER_ICONS_STYLE_ID);
7569
+ if (!el) {
7570
+ el = document.createElement("style");
7571
+ el.id = USER_ICONS_STYLE_ID;
7572
+ document.head.appendChild(el);
7573
+ }
7574
+ el.textContent = css;
7575
+ } catch (e) {
7576
+ (0, _yuneta_gobj_js.log_error)(`user icons: cannot write the stylesheet: ${e}`);
7577
+ }
7578
+ for (const name of Object.keys(__icon_defined__)) if (name.startsWith("yi-u-")) delete __icon_defined__[name];
7579
+ }
7580
+ /************************************************************
7581
+ * Validate one node of __icons__.
7582
+ * Return the entry to keep, or null (warning logged).
7583
+ ************************************************************/
7584
+ function user_icon_entry(node) {
7585
+ let id = node && node.id;
7586
+ if (typeof id !== "string" || !USER_ICON_ID_RE.test(id)) {
7587
+ (0, _yuneta_gobj_js.log_warning)(`user icons: bad icon name '${id}': lowercase letters, digits and '-' only`);
7588
+ return null;
7589
+ }
7590
+ let clean = yui_svg_sanitize(node.svg);
7591
+ if (clean.error) {
7592
+ (0, _yuneta_gobj_js.log_warning)(`user icons: icon '${id}' not drawn: ${clean.error}`);
7593
+ return null;
7594
+ }
7595
+ return {
7596
+ svg: clean.svg,
7597
+ mask: svg_mask_url(clean.svg)
7598
+ };
7599
+ }
7600
+ /************************************************************
7601
+ * Replace every user icon with the nodes of __icons__.
7602
+ * Return the number of icons registered.
7603
+ ************************************************************/
7604
+ function yui_icons_set_user(nodes) {
7605
+ __user_icons__.clear();
7606
+ if (Array.isArray(nodes)) for (const node of nodes) {
7607
+ let entry = user_icon_entry(node);
7608
+ if (entry) __user_icons__.set(node.id, entry);
7609
+ }
7610
+ else if (nodes) (0, _yuneta_gobj_js.log_error)(`user icons: the nodes of ${ICONS_TOPIC} must be a list`);
7611
+ rebuild_user_icons_stylesheet();
7612
+ return __user_icons__.size;
7613
+ }
7614
+ /************************************************************
7615
+ * A node of __icons__ was created or updated.
7616
+ * Return true if the icon is drawn.
7617
+ ************************************************************/
7618
+ function yui_icons_put_user(node) {
7619
+ let entry = user_icon_entry(node);
7620
+ if (entry) __user_icons__.set(node.id, entry);
7621
+ else if (node && typeof node.id === "string") __user_icons__.delete(node.id);
7622
+ rebuild_user_icons_stylesheet();
7623
+ return !!entry;
7624
+ }
7625
+ /************************************************************
7626
+ * A node of __icons__ was deleted.
7627
+ ************************************************************/
7628
+ function yui_icons_remove_user(id) {
7629
+ __user_icons__.delete(id);
7630
+ rebuild_user_icons_stylesheet();
7631
+ }
7632
+ /************************************************************
7633
+ * Every icon a user can choose: the library's, read from the
7634
+ * loaded stylesheets (an app may extend yui_icons.css, so it
7635
+ * is asked, not listed), then the user's.
7636
+ * Return [{name, user}], each half sorted by name.
7637
+ ************************************************************/
7638
+ function yui_icons_list() {
7639
+ let library = /* @__PURE__ */ new Set();
7640
+ try {
7641
+ for (const sheet of Array.from(document.styleSheets || [])) {
7642
+ if (sheet.ownerNode && sheet.ownerNode.id === USER_ICONS_STYLE_ID) continue;
7643
+ let rules;
7644
+ try {
7645
+ rules = sheet.cssRules;
7646
+ } catch (e) {
7647
+ continue;
7648
+ }
7649
+ for (const rule of Array.from(rules || [])) {
7650
+ let selector = rule.selectorText || "";
7651
+ for (const m of selector.matchAll(/\.(yi-[a-z0-9-]+)::?before/g)) if (!m[1].startsWith("yi-u-")) library.add(m[1]);
7652
+ }
7653
+ }
7654
+ } catch (e) {
7655
+ (0, _yuneta_gobj_js.log_error)(`user icons: cannot read the stylesheets: ${e}`);
7656
+ }
7657
+ let list = Array.from(library).sort().map((name) => ({
7658
+ name,
7659
+ user: false
7660
+ }));
7661
+ let users = Array.from(__user_icons__.keys()).sort();
7662
+ for (const id of users) list.push({
7663
+ name: yui_user_icon_class(id),
7664
+ user: true
7665
+ });
7666
+ return list;
7667
+ }
7093
7668
  /************************************************************
7094
7669
  * JSON type discriminator (viewer vocabulary)
7095
7670
  ************************************************************/
@@ -7488,6 +8063,107 @@ function datetime_local_to_epoch(value) {
7488
8063
  return Math.floor(date.getTime() / 1e3);
7489
8064
  }
7490
8065
  //#endregion
8066
+ //#region src/form_json_field.js
8067
+ /***********************************************************************
8068
+ * form_json_field.js
8069
+ *
8070
+ * Pure logic of a json field of C_YUI_FORM: what a jsoneditor
8071
+ * holds, read as the value its column stores.
8072
+ *
8073
+ * The editor answers its content in one of two shapes -- {json}
8074
+ * (tree mode) or {text} (text mode, whatever the reader typed).
8075
+ * A text that does not parse used to be caught and replaced by
8076
+ * `{}` or `[]`, and SAVED: a trailing comma wiped the column, with
8077
+ * no log and no message. A text that is not json, or json of the
8078
+ * wrong shape (a list in a dict column), is an error now, and the
8079
+ * form refuses to save while a field holds one.
8080
+ *
8081
+ * Copyright (c) 2026, ArtGins.
8082
+ * All Rights Reserved.
8083
+ ***********************************************************************/
8084
+ var SHAPE_OF_TYPE = {
8085
+ object: "dict",
8086
+ dict: "dict",
8087
+ template: "dict",
8088
+ array: "list",
8089
+ list: "list",
8090
+ table: "list",
8091
+ coordinates: "container"
8092
+ };
8093
+ /************************************************************
8094
+ * The shape `type` stores: "dict", "list", "container" or "any".
8095
+ ************************************************************/
8096
+ function json_field_shape(type) {
8097
+ return SHAPE_OF_TYPE[type] || "any";
8098
+ }
8099
+ /************************************************************
8100
+ * The empty value of a shape: what a blank editor stores.
8101
+ ************************************************************/
8102
+ function json_field_empty(shape) {
8103
+ if (shape === "list") return [];
8104
+ return {};
8105
+ }
8106
+ function value_fits(value, shape) {
8107
+ let is_list = Array.isArray(value);
8108
+ let is_dict = value !== null && typeof value === "object" && !is_list;
8109
+ switch (shape) {
8110
+ case "dict": return is_dict;
8111
+ case "list": return is_list;
8112
+ case "container": return is_dict || is_list;
8113
+ default: return true;
8114
+ }
8115
+ }
8116
+ /************************************************************
8117
+ * Parse what a json field holds.
8118
+ *
8119
+ * `value` is a json string (what the form reads out of an editor)
8120
+ * or an already parsed value; an editor's content goes through
8121
+ * json_editor_value() first.
8122
+ * Returns {value, error}: `error` is "" when the value is good, else
8123
+ * an i18n key; `value` is then the empty value of the shape and must
8124
+ * NOT be stored.
8125
+ *
8126
+ * A blank text is not an error: it is the empty value.
8127
+ ************************************************************/
8128
+ function parse_json_field(value, type) {
8129
+ let shape = json_field_shape(type);
8130
+ if (typeof value === "string") {
8131
+ if (value.trim() === "") return {
8132
+ value: json_field_empty(shape),
8133
+ error: ""
8134
+ };
8135
+ try {
8136
+ value = JSON.parse(value);
8137
+ } catch (e) {
8138
+ return {
8139
+ value: json_field_empty(shape),
8140
+ error: "invalid json"
8141
+ };
8142
+ }
8143
+ }
8144
+ if (value === void 0) return {
8145
+ value: json_field_empty(shape),
8146
+ error: ""
8147
+ };
8148
+ if (!value_fits(value, shape)) return {
8149
+ value: json_field_empty(shape),
8150
+ error: "invalid json"
8151
+ };
8152
+ return {
8153
+ value,
8154
+ error: ""
8155
+ };
8156
+ }
8157
+ /************************************************************
8158
+ * What a jsoneditor content ({text} or {json}) holds: the
8159
+ * text as typed, or the tree-mode json.
8160
+ ************************************************************/
8161
+ function json_editor_value(content) {
8162
+ if (!content) return;
8163
+ if (content.text !== void 0) return content.text;
8164
+ return content.json;
8165
+ }
8166
+ //#endregion
7491
8167
  //#region src/c_yui_form.js
7492
8168
  /***********************************************************************
7493
8169
  * c_yui_form.js
@@ -7852,10 +8528,61 @@ function build_ui$15(gobj) {
7852
8528
  function destroy_ui$10(gobj) {
7853
8529
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
7854
8530
  if ($container) {
8531
+ destroy_widgets(gobj, $container);
7855
8532
  if ($container.parentNode) $container.parentNode.removeChild($container);
7856
8533
  (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", null);
7857
8534
  }
7858
8535
  }
8536
+ /************************************************************
8537
+ * The icon a table cell draws as its control (delete the row,
8538
+ * add a nested row): an element, so it carries its name. Drawn
8539
+ * by Tabulator on every render, so t() at render time is
8540
+ * current.
8541
+ ************************************************************/
8542
+ function cell_icon(icon_class, key) {
8543
+ let $i = document.createElement("i");
8544
+ $i.className = icon_class;
8545
+ $i.setAttribute("title", (0, i18next.t)(key));
8546
+ $i.setAttribute("aria-label", (0, i18next.t)(key));
8547
+ return $i;
8548
+ }
8549
+ /************************************************************
8550
+ * Destroy the third-party widgets the form built. Removing
8551
+ * their DOM is not enough: Tom Select keeps listeners on
8552
+ * `document` and `window`, the jsoneditor is a live Svelte app
8553
+ * and a Tabulator keeps its observers -- each one a closure over
8554
+ * this form, alive for the life of the page. Nested tables go
8555
+ * first: their parent's destroy drops the rows they hang from.
8556
+ ************************************************************/
8557
+ function destroy_widgets(gobj, $container) {
8558
+ let destroy = (what, widget) => {
8559
+ try {
8560
+ widget.destroy();
8561
+ } catch (e) {
8562
+ (0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot destroy ${what}: ${e}`);
8563
+ }
8564
+ };
8565
+ $container.querySelectorAll(".yui-tabulator-table-nested").forEach(($el) => {
8566
+ if ($el.tabulator) {
8567
+ destroy("nested table", $el.tabulator);
8568
+ $el.tabulator = null;
8569
+ }
8570
+ });
8571
+ $container.querySelectorAll(".yui-form-data-input").forEach(($el) => {
8572
+ if ($el.tom_select) {
8573
+ destroy("select", $el.tom_select);
8574
+ $el.tom_select = null;
8575
+ }
8576
+ if ($el.jsoneditor) {
8577
+ destroy("json editor", $el.jsoneditor);
8578
+ $el.jsoneditor = null;
8579
+ }
8580
+ if ($el.tabulator) {
8581
+ destroy("table", $el.tabulator);
8582
+ $el.tabulator = null;
8583
+ }
8584
+ });
8585
+ }
7859
8586
  /******************************************************************
7860
8587
  * Build form with bulma and createElement2
7861
8588
  ******************************************************************/
@@ -7913,6 +8640,7 @@ function build_form(gobj) {
7913
8640
  function build_html_form(gobj, $form, prefix, template) {
7914
8641
  Object.entries(template).forEach(([key, value]) => {
7915
8642
  const field_desc = (0, _yuneta_gobj_js.template_get_field_desc)(key, value);
8643
+ if (!prefix && yui_icons_is_svg_field((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"), field_desc.name)) field_desc.type = "svg";
7916
8644
  let html_field_conf = build_form_field_conf(gobj, field_desc);
7917
8645
  html_field_conf.name = field_desc.name;
7918
8646
  let topic_name = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name");
@@ -8010,8 +8738,17 @@ function build_form_field_conf(gobj, field_desc) {
8010
8738
  case "file":
8011
8739
  field_conf.tag = "file";
8012
8740
  break;
8013
- case "image":
8014
8741
  case "icon":
8742
+ field_conf.tag = "select2";
8743
+ field_conf.options = yui_icons_list().map((icon) => icon.name);
8744
+ break;
8745
+ case "svg":
8746
+ field_conf.tag = "textarea";
8747
+ field_conf.extras.rows = 6;
8748
+ field_conf.extras.spellcheck = "false";
8749
+ field_conf.extras.class = "textarea is-family-monospace";
8750
+ break;
8751
+ case "image":
8015
8752
  case "string":
8016
8753
  field_conf.tag = "input";
8017
8754
  field_conf.inputType = "text";
@@ -8399,7 +9136,13 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8399
9136
  { class: "" },
8400
9137
  [[
8401
9138
  "button",
8402
- { class: "button p-1" },
9139
+ {
9140
+ class: "button p-1",
9141
+ title: (0, i18next.t)("add"),
9142
+ "data-i18n-title": "add",
9143
+ "aria-label": (0, i18next.t)("add"),
9144
+ "data-i18n-aria-label": "add"
9145
+ },
8403
9146
  [[
8404
9147
  "span",
8405
9148
  { class: "icon m-0" },
@@ -8536,6 +9279,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8536
9279
  else if (required) attrs.required = "";
8537
9280
  $extend = (0, _yuneta_gobj_js.createElement2)(["textarea", attrs]);
8538
9281
  $control.appendChild($extend);
9282
+ if (field_desc.type === "svg") attach_svg_preview(gobj, $control, $extend);
8539
9283
  break;
8540
9284
  }
8541
9285
  case "select": {
@@ -8556,7 +9300,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8556
9300
  value: option,
8557
9301
  i18n: option
8558
9302
  },
8559
- option
9303
+ document.createTextNode(String(option))
8560
9304
  ]),
8561
9305
  { "change": function(evt) {
8562
9306
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
@@ -8574,6 +9318,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8574
9318
  (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: select2 field '%s' options not an array (type=%s, real_type=%s); rendering empty", (0, _yuneta_gobj_js.gobj_short_name)(gobj), name, field_desc.type, field_desc.real_type));
8575
9319
  opts = [];
8576
9320
  }
9321
+ let is_icon = field_desc.type === "icon";
8577
9322
  let extend = [
8578
9323
  "select",
8579
9324
  {
@@ -8581,7 +9326,11 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8581
9326
  class: "",
8582
9327
  multiple: true
8583
9328
  },
8584
- opts.map((option) => [
9329
+ opts.map((option) => is_icon ? [
9330
+ "option",
9331
+ { value: option },
9332
+ option
9333
+ ] : [
8585
9334
  "option",
8586
9335
  {
8587
9336
  value: option,
@@ -8595,7 +9344,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8595
9344
  $extend.tom_select = new tom_select.default($extend, {
8596
9345
  allowEmptyOption: true,
8597
9346
  placeholder,
8598
- maxItems: field_desc.type === "fkey" && field_desc.real_type === "string" ? 1 : null,
9347
+ maxItems: is_icon || field_desc.type === "fkey" && field_desc.real_type === "string" ? 1 : null,
9348
+ render: is_icon ? icon_select_render() : void 0,
8599
9349
  plugins: {
8600
9350
  "clear_button": { "title": (0, i18next.t)("remove all selected options") },
8601
9351
  "no_active_items": {},
@@ -8629,13 +9379,19 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8629
9379
  break;
8630
9380
  }
8631
9381
  case "radio": {
8632
- let elm = `
8633
- <label class="radio">
8634
- <input type="radio" name="${name}">
8635
- ${(0, i18next.t)(options)}
8636
- </label>
8637
- `;
8638
- $extend = (0, _yuneta_gobj_js.createOneHtml)(elm);
9382
+ let label_key = String(options === void 0 || options === null ? "" : options);
9383
+ $extend = (0, _yuneta_gobj_js.createElement2)([
9384
+ "label",
9385
+ { class: "radio" },
9386
+ [["input", {
9387
+ type: "radio",
9388
+ name
9389
+ }], [
9390
+ "span",
9391
+ { i18n: label_key },
9392
+ label_key
9393
+ ]]
9394
+ ]);
8639
9395
  $control.appendChild($extend);
8640
9396
  break;
8641
9397
  }
@@ -8655,6 +9411,10 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
8655
9411
  props: {
8656
9412
  readOnly: !!readonly,
8657
9413
  onChange: function() {
9414
+ if ($extend.yui_json_error) {
9415
+ check_json_editor($extend);
9416
+ mark_field_validity($extend);
9417
+ }
8658
9418
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
8659
9419
  },
8660
9420
  timestampTag: function({ field, value, path }) {
@@ -8763,6 +9523,71 @@ function attach_color_value($control, $input) {
8763
9523
  $control.appendChild($value);
8764
9524
  }
8765
9525
  /******************************************************************
9526
+ * How the icon picker draws a name: the icon, then the name.
9527
+ * The names come from yui_icons_list() -- class names, already
9528
+ * [a-z0-9-] -- and are escaped anyway, because they are written
9529
+ * as markup.
9530
+ ******************************************************************/
9531
+ function icon_select_render() {
9532
+ function draw(data, escape) {
9533
+ return `<div class="ICON_SELECT_ITEM"><span class="icon"><i class="${escape(data.value)}" aria-hidden="true"></i></span><span>${escape(data.text)}</span></div>`;
9534
+ }
9535
+ return {
9536
+ option: draw,
9537
+ item: draw
9538
+ };
9539
+ }
9540
+ /******************************************************************
9541
+ * Why a drawing cannot be an icon, in the reader's language.
9542
+ * The causes are the fixed set yui_svg_sanitize() answers, each
9543
+ * written here as a literal t() so validate-locales sees it.
9544
+ ******************************************************************/
9545
+ function svg_error_text(error) {
9546
+ switch (error) {
9547
+ case "empty svg": return (0, i18next.t)("empty svg");
9548
+ case "svg too big": return (0, i18next.t)("svg too big");
9549
+ case "not an svg document": return (0, i18next.t)("not an svg document");
9550
+ case "svg without size": return (0, i18next.t)("svg without size");
9551
+ case "svg without shapes": return (0, i18next.t)("svg without shapes");
9552
+ default:
9553
+ (0, _yuneta_gobj_js.log_error)(`svg_error_text(): unknown cause '${error}'`);
9554
+ return error;
9555
+ }
9556
+ }
9557
+ /******************************************************************
9558
+ * The icon a drawing (`svg` of __icons__) makes, below its text
9559
+ * area, redrawn as it is typed: what is saved is what the app
9560
+ * will show. A drawing that cannot be drawn says why, and what
9561
+ * the sanitizer left out is named.
9562
+ ******************************************************************/
9563
+ function attach_svg_preview(gobj, $control, $textarea) {
9564
+ let $preview = (0, _yuneta_gobj_js.createElement2)([
9565
+ "div",
9566
+ { class: "SVG_PREVIEW is-flex is-align-items-center mt-2" },
9567
+ [["span", { class: "SVG_PREVIEW_ICON icon is-large is-size-3" }], ["span", { class: "SVG_PREVIEW_NOTE is-size-7 yui-text-quiet ml-2" }]]
9568
+ ]);
9569
+ $control.appendChild($preview);
9570
+ let $icon = $preview.querySelector(".SVG_PREVIEW_ICON");
9571
+ let $note = $preview.querySelector(".SVG_PREVIEW_NOTE");
9572
+ function redraw() {
9573
+ $icon.replaceChildren();
9574
+ $note.textContent = "";
9575
+ if (!$textarea.value || !$textarea.value.trim()) return;
9576
+ let preview = yui_svg_icon_element($textarea.value);
9577
+ if (preview.error) {
9578
+ $note.textContent = svg_error_text(preview.error);
9579
+ return;
9580
+ }
9581
+ $icon.appendChild(preview.element);
9582
+ if (preview.dropped && preview.dropped.length > 0) $note.textContent = `${(0, i18next.t)("left out")}: ${preview.dropped.join(" ")}`;
9583
+ }
9584
+ $textarea.yui_svg_preview = redraw;
9585
+ $textarea.addEventListener("input", function() {
9586
+ redraw();
9587
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
9588
+ });
9589
+ }
9590
+ /******************************************************************
8766
9591
  * `readonly` is an attribute of a TEXT control and of nothing else.
8767
9592
  *
8768
9593
  * A `<select>` ignores it. So does a checkbox, and so does a radio:
@@ -8913,7 +9738,7 @@ function create_tabulator$1(gobj, $extend, name, template) {
8913
9738
  };
8914
9739
  if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_delete_row_btn")) columns.push({
8915
9740
  formatter: function(cell, formatterParams) {
8916
- return "<i style=\"\" class=\"yi-trash has-text-danger\"></i>";
9741
+ return cell_icon("yi-trash has-text-danger", "delete");
8917
9742
  },
8918
9743
  width: 40,
8919
9744
  hozAlign: "center",
@@ -8994,7 +9819,7 @@ function template2columns(gobj, columns, template, sub_elements) {
8994
9819
  });
8995
9820
  Object.assign(column, {
8996
9821
  formatter: function(cell, formatterParams) {
8997
- return "<i style=\"\" class=\"yi-plus has-text-link\"></i>";
9822
+ return cell_icon("yi-plus has-text-link", "add");
8998
9823
  },
8999
9824
  hozAlign: "center",
9000
9825
  cellClick: function(evt, cell) {
@@ -9136,6 +9961,7 @@ function template2columns(gobj, columns, template, sub_elements) {
9136
9961
  * out-of-range number is more precise than anything generic here.
9137
9962
  ************************************************************/
9138
9963
  function field_validation_message($input) {
9964
+ if ($input.yui_json_error) return (0, i18next.t)($input.yui_json_error);
9139
9965
  let v = $input.validity;
9140
9966
  if (v && v.valueMissing) return (0, i18next.t)("this field is required");
9141
9967
  return $input.validationMessage;
@@ -9148,7 +9974,7 @@ function field_validation_message($input) {
9148
9974
  function mark_field_validity($input) {
9149
9975
  let $h = $input.parentNode ? $input.parentNode.querySelector(".help") : null;
9150
9976
  let v = $input.validity;
9151
- if (!v || v.valid) {
9977
+ if ((!v || v.valid) && !$input.yui_json_error) {
9152
9978
  $input.classList.remove("is-danger");
9153
9979
  if ($h) {
9154
9980
  $h.textContent = "";
@@ -9169,6 +9995,12 @@ function mark_field_validity($input) {
9169
9995
  function validate_form(gobj, $form) {
9170
9996
  let validated = true;
9171
9997
  if (!$form.checkValidity()) validated = false;
9998
+ $form.querySelectorAll(".jsoneditor.yui-form-data-input").forEach(($editor) => {
9999
+ if (!check_json_editor($editor)) {
10000
+ validated = false;
10001
+ mark_field_validity($editor);
10002
+ }
10003
+ });
9172
10004
  $form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
9173
10005
  if (!$table.tabulator.validate()) validated = false;
9174
10006
  $table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
@@ -9178,6 +10010,22 @@ function validate_form(gobj, $form) {
9178
10010
  return validated;
9179
10011
  }
9180
10012
  /************************************************************
10013
+ * Does the jsoneditor `$editor` hold json its column can store?
10014
+ * Leaves the answer on the element (`yui_json_error`, an i18n key
10015
+ * or ""), where mark_field_validity() reads it.
10016
+ ************************************************************/
10017
+ function check_json_editor($editor) {
10018
+ let jsoneditor = $editor.jsoneditor;
10019
+ let field_desc = $editor.field_desc;
10020
+ if (!jsoneditor || !field_desc || $editor.hasAttribute("readonly")) {
10021
+ $editor.yui_json_error = "";
10022
+ return true;
10023
+ }
10024
+ let r = parse_json_field(json_editor_value(jsoneditor.get()), field_desc.type);
10025
+ $editor.yui_json_error = r.error;
10026
+ return !r.error;
10027
+ }
10028
+ /************************************************************
9181
10029
  * Function to get input value based on its type
9182
10030
  ************************************************************/
9183
10031
  function getInputValue($input) {
@@ -9277,7 +10125,10 @@ function clear_data(gobj, $form) {
9277
10125
  else if ($input.type === "radio") $input.checked = false;
9278
10126
  else if ($input.type === "datetime-local") $input.value = null;
9279
10127
  else if ($input.type === "select-multiple") $input.tom_select.clear();
9280
- else $input.value = null;
10128
+ else {
10129
+ $input.value = null;
10130
+ if ($input.yui_svg_preview) $input.yui_svg_preview();
10131
+ }
9281
10132
  }
9282
10133
  });
9283
10134
  $form.querySelectorAll(".FILE_FIELD").forEach(($file) => {
@@ -9378,12 +10229,17 @@ function set_form_values(gobj, template, $form, record) {
9378
10229
  break;
9379
10230
  case "textarea":
9380
10231
  $input.value = value;
10232
+ if ($input.yui_svg_preview) $input.yui_svg_preview();
9381
10233
  break;
9382
10234
  case "select":
9383
10235
  $input.value = value;
9384
10236
  break;
9385
10237
  case "select2":
9386
10238
  $input.tom_select.clear();
10239
+ if (field_desc && field_desc.type === "icon" && (0, _yuneta_gobj_js.is_string)(value) && value && !$input.tom_select.options[value]) $input.tom_select.addOption({
10240
+ value,
10241
+ text: value
10242
+ });
9387
10243
  $input.tom_select.setValue(value);
9388
10244
  break;
9389
10245
  case "checkbox":
@@ -9480,6 +10336,7 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
9480
10336
  case "color":
9481
10337
  case "image":
9482
10338
  case "icon":
10339
+ case "svg":
9483
10340
  case "tel":
9484
10341
  case "template":
9485
10342
  case "table":
@@ -9526,23 +10383,23 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
9526
10383
  return value;
9527
10384
  }
9528
10385
  /************************************************************
10386
+ * A json field's value, parsed. validate_form() refuses a field
10387
+ * that does not parse, so reaching the error here is a path that
10388
+ * skipped it: logged, never quiet.
10389
+ ************************************************************/
10390
+ function parse_json_value(gobj, field_desc, value) {
10391
+ let r = parse_json_field(value, field_desc.type);
10392
+ if (r.error) (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: field '${field_desc.name}' (${field_desc.type}) holds no valid json, stored as empty`);
10393
+ return r.value;
10394
+ }
10395
+ /************************************************************
9529
10396
  * Convert from frontend to backend
9530
10397
  * operation: "create" "update"
9531
10398
  ************************************************************/
9532
10399
  function form_value_2_treedb_value(gobj, field_desc, value) {
9533
10400
  let type = field_desc.type;
9534
10401
  let real_type = field_desc.real_type;
9535
- if ((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates")) {
9536
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
9537
- value = JSON.parse(value);
9538
- } catch (e) {
9539
- value = type === "table" ? [] : {};
9540
- }
9541
- if (type === "table") {
9542
- if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
9543
- } else if (!(0, _yuneta_gobj_js.is_object)(value) && !(0, _yuneta_gobj_js.is_array)(value)) value = {};
9544
- return value;
9545
- }
10402
+ if ((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates")) return parse_json_value(gobj, field_desc, value);
9546
10403
  switch (type) {
9547
10404
  case "file": break;
9548
10405
  case "fkey":
@@ -9570,19 +10427,16 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
9570
10427
  default: (0, _yuneta_gobj_js.log_error)("incompatible type for time: " + real_type);
9571
10428
  }
9572
10429
  break;
10430
+ case "icon":
10431
+ if (Array.isArray(value)) value = value.length > 0 ? value[0] : "";
10432
+ break;
9573
10433
  case "date":
9574
10434
  case "color":
9575
10435
  case "image":
9576
- case "icon":
9577
- case "tel": break;
10436
+ case "tel":
10437
+ case "svg": break;
9578
10438
  case "template":
9579
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
9580
- value = JSON.parse(value);
9581
- } catch (e) {
9582
- value = {};
9583
- }
9584
- else if ((0, _yuneta_gobj_js.is_object)(value)) {}
9585
- if (!(0, _yuneta_gobj_js.is_object)(value)) value = {};
10439
+ value = parse_json_value(gobj, field_desc, value);
9586
10440
  break;
9587
10441
  case "table":
9588
10442
  case "id":
@@ -9599,13 +10453,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
9599
10453
  case "dict": break;
9600
10454
  case "array":
9601
10455
  case "list":
9602
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
9603
- value = JSON.parse(value);
9604
- } catch (e) {
9605
- value = [];
9606
- }
9607
- else if ((0, _yuneta_gobj_js.is_array)(value)) {}
9608
- if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
10456
+ value = parse_json_value(gobj, field_desc, value);
9609
10457
  break;
9610
10458
  case "real":
9611
10459
  value = parseFloat(value) || 0;
@@ -9614,12 +10462,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
9614
10462
  value = (0, _yuneta_gobj_js.parseBoolean)(value);
9615
10463
  break;
9616
10464
  case "blob":
9617
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
9618
- value = JSON.parse(value);
9619
- } catch (e) {
9620
- value = {};
9621
- }
9622
- else if ((0, _yuneta_gobj_js.is_object)(value)) {} else if ((0, _yuneta_gobj_js.is_array)(value)) {} else value = {};
10465
+ value = parse_json_value(gobj, field_desc, value);
9623
10466
  break;
9624
10467
  case "number": break;
9625
10468
  case "coordinates":
@@ -9759,7 +10602,9 @@ function ac_add_table_row(gobj, event, kw, src) {
9759
10602
  }
9760
10603
  });
9761
10604
  }
9762
- }).catch(function(error) {});
10605
+ }).catch(function(error) {
10606
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot add a table row: ${error}`);
10607
+ });
9763
10608
  setTimeout(function() {
9764
10609
  if ($row) {
9765
10610
  let $tabulator = $row.closest(".yui-tabulator-table");
@@ -10232,7 +11077,7 @@ function yui_maplibre_relocalize(map, t) {
10232
11077
  *
10233
11078
  * Map Manager
10234
11079
  *
10235
- * Copyright (c) 2025, ArtGins.
11080
+ * Copyright (c) 2025-2026, ArtGins.
10236
11081
  * All Rights Reserved.
10237
11082
  ***********************************************************************/
10238
11083
  /***************************************************************
@@ -10378,6 +11223,7 @@ function mt_start$16(gobj) {
10378
11223
  function mt_stop$16(gobj) {
10379
11224
  let shell = yui_shell_of(gobj);
10380
11225
  if (shell) (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
11226
+ (0, _yuneta_gobj_js.gobj_stop_children)(gobj);
10381
11227
  return 0;
10382
11228
  }
10383
11229
  /***************************************************************
@@ -10667,52 +11513,24 @@ function find_device(gobj, id) {
10667
11513
  return null;
10668
11514
  }
10669
11515
  /************************************************************
10670
- * Event handler for click
11516
+ * Event handler for click: maplibre's callback only turns the
11517
+ * click into an event; the work is ac_marker_clicked().
11518
+ * Plain json: the marker's identity and where it is.
10671
11519
  ************************************************************/
10672
11520
  function onClick(gobj, e) {
10673
- const map = gobj.priv.xmap;
10674
- const coordinates = e.features[0].geometry.coordinates.slice();
10675
- const properties = e.features[0].properties;
10676
- const gobj_service = properties.gobj_service_name ? (0, _yuneta_gobj_js.gobj_find_service)(properties.gobj_service_name, false) : null;
10677
- if (gobj_service) {
10678
- let window_service_name = `window-map-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj_service))}`;
10679
- let popupContent = (0, _yuneta_gobj_js.createElement2)([
10680
- "div",
10681
- { class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
10682
- (0, _yuneta_gobj_js.gobj_read_attr)(gobj_service, "$container")
10683
- ]);
10684
- let gobj_window = (0, _yuneta_gobj_js.gobj_create_service)(window_service_name, "C_YUI_WINDOW", {
10685
- $parent: document.getElementById("top-layer"),
10686
- width: 700,
10687
- height: 500,
10688
- auto_save_size_and_position: false,
10689
- center: true,
10690
- showMax: false,
10691
- content_size: true,
10692
- title_prefix: (0, _yuneta_gobj_js.gobj_name)(gobj_service),
10693
- title: "",
10694
- icon: "yi-location-dot",
10695
- logical_class: "MAP_MARKER_WINDOW",
10696
- body: popupContent
10697
- }, gobj);
10698
- if (!gobj_window) {
10699
- (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: cannot create the marker window`);
10700
- return;
10701
- }
10702
- (0, _yuneta_gobj_js.gobj_start)(gobj_window);
10703
- } else {
10704
- const popup = new maplibre_gl.Popup({
10705
- closeButton: true,
10706
- closeOnClick: true,
10707
- closeOnMove: true,
10708
- anchor: "center",
10709
- maxWidth: "none"
10710
- });
10711
- const popupContent = `
10712
- <b>${properties.name}</b><br>Id: ${properties.id}
10713
- `;
10714
- popup.setLngLat(coordinates).setHTML(popupContent).addTo(map);
11521
+ let feature = e && e.features && e.features[0];
11522
+ if (!feature) {
11523
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: marker click with no feature`);
11524
+ return;
10715
11525
  }
11526
+ let properties = feature.properties || {};
11527
+ let coordinates = feature.geometry.coordinates.slice();
11528
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_MARKER_CLICKED", {
11529
+ gobj_service_name: properties.gobj_service_name || "",
11530
+ name: properties.name !== void 0 ? String(properties.name) : "",
11531
+ id: properties.id !== void 0 ? String(properties.id) : "",
11532
+ coordinates
11533
+ }, gobj);
10716
11534
  }
10717
11535
  /************************************************************
10718
11536
  * Event handlers for dragging
@@ -10821,6 +11639,68 @@ function ac_refresh$7(gobj, event, kw, src) {
10821
11639
  return 0;
10822
11640
  }
10823
11641
  /************************************************************
11642
+ * EV_MARKER_CLICKED {gobj_service_name, name, id, coordinates}
11643
+ *
11644
+ * A marker backed by a gobj service opens that service's view in
11645
+ * a window -- ONE per marker: a second click is told to the open
11646
+ * one (EV_SHOW). (It created a second window under the same service
11647
+ * name, moved the one $container into it and left the first one
11648
+ * empty; closing the first then unregistered the second's name.)
11649
+ * A marker without a service gets a popup with its name and id.
11650
+ ************************************************************/
11651
+ function ac_marker_clicked(gobj, event, kw, src) {
11652
+ const map = gobj.priv.xmap;
11653
+ const gobj_service = kw.gobj_service_name ? (0, _yuneta_gobj_js.gobj_find_service)(kw.gobj_service_name, false) : null;
11654
+ if (gobj_service) {
11655
+ let window_service_name = `window-map-${(0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj_service))}`;
11656
+ let gobj_window = (0, _yuneta_gobj_js.gobj_find_service)(window_service_name, false);
11657
+ if (gobj_window) {
11658
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj_window, "EV_SHOW", {}, gobj);
11659
+ return 0;
11660
+ }
11661
+ let popupContent = (0, _yuneta_gobj_js.createElement2)([
11662
+ "div",
11663
+ { class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
11664
+ (0, _yuneta_gobj_js.gobj_read_attr)(gobj_service, "$container")
11665
+ ]);
11666
+ gobj_window = (0, _yuneta_gobj_js.gobj_create_service)(window_service_name, "C_YUI_WINDOW", {
11667
+ $parent: document.getElementById("top-layer"),
11668
+ width: 700,
11669
+ height: 500,
11670
+ auto_save_size_and_position: false,
11671
+ center: true,
11672
+ showMax: false,
11673
+ content_size: true,
11674
+ title_prefix: (0, _yuneta_gobj_js.gobj_name)(gobj_service),
11675
+ title: "",
11676
+ icon: "yi-location-dot",
11677
+ logical_class: "MAP_MARKER_WINDOW",
11678
+ body: popupContent
11679
+ }, gobj);
11680
+ if (!gobj_window) {
11681
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}: cannot create the marker window`);
11682
+ return -1;
11683
+ }
11684
+ (0, _yuneta_gobj_js.gobj_start)(gobj_window);
11685
+ return 0;
11686
+ }
11687
+ const popup = new maplibre_gl.Popup({
11688
+ closeButton: true,
11689
+ closeOnClick: true,
11690
+ closeOnMove: true,
11691
+ anchor: "center",
11692
+ maxWidth: "none"
11693
+ });
11694
+ let $content = document.createElement("div");
11695
+ let $name = document.createElement("b");
11696
+ $name.textContent = kw.name;
11697
+ $content.appendChild($name);
11698
+ $content.appendChild(document.createElement("br"));
11699
+ $content.appendChild(document.createTextNode(`Id: ${kw.id}`));
11700
+ popup.setLngLat(kw.coordinates).setDOMContent($content).addTo(map);
11701
+ return 0;
11702
+ }
11703
+ /************************************************************
10824
11704
  *
10825
11705
  ************************************************************/
10826
11706
  function ac_select(gobj, event, kw, src) {
@@ -10868,6 +11748,7 @@ function create_gclass$16(gclass_name) {
10868
11748
  ["EV_MAP_ON_LOAD", 0],
10869
11749
  ["EV_REFRESH", 0],
10870
11750
  ["EV_SELECT", 0],
11751
+ ["EV_MARKER_CLICKED", 0],
10871
11752
  ["EV_SHOW", 0],
10872
11753
  ["EV_HIDE", 0]
10873
11754
  ], [["ST_IDLE", [
@@ -10901,6 +11782,11 @@ function create_gclass$16(gclass_name) {
10901
11782
  ac_select,
10902
11783
  null
10903
11784
  ],
11785
+ [
11786
+ "EV_MARKER_CLICKED",
11787
+ ac_marker_clicked,
11788
+ null
11789
+ ],
10904
11790
  [
10905
11791
  "EV_SHOW",
10906
11792
  ac_show$11,
@@ -11067,7 +11953,7 @@ function build_ui$14(gobj) {
11067
11953
  class: "C_YUI_UPLOT",
11068
11954
  style: "overflow:auto;"
11069
11955
  }]);
11070
- (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "$container", $container);
11956
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
11071
11957
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "own_container", true);
11072
11958
  }
11073
11959
  let uPlot_options = {
@@ -12429,7 +13315,7 @@ function ensure_drag_canvas_patch() {
12429
13315
  * Displays JSON data as a hierarchical graph visualization
12430
13316
  * Migrated from mx_json_viewer.js (mxGraph)
12431
13317
  *
12432
- * Copyright (c) 2025, ArtGins.
13318
+ * Copyright (c) 2025-2026, ArtGins.
12433
13319
  * All Rights Reserved.
12434
13320
  ***********************************************************************/
12435
13321
  /***************************************************************
@@ -12925,7 +13811,12 @@ function build_graph$4(gobj) {
12925
13811
  });
12926
13812
  if (priv.theme) graph.setTheme(priv.theme);
12927
13813
  graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
12928
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", { evt }, gobj);
13814
+ let client = evt && evt.client ? evt.client : null;
13815
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", {
13816
+ id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
13817
+ client_x: client && typeof client.x === "number" ? client.x : 0,
13818
+ client_y: client && typeof client.y === "number" ? client.y : 0
13819
+ }, gobj);
12929
13820
  });
12930
13821
  graph.on("aftertransform", () => {
12931
13822
  yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
@@ -13856,7 +14747,7 @@ function ac_center$4(gobj, event, kw, src) {
13856
14747
  function ac_node_click$4(gobj, event, kw, src) {
13857
14748
  let priv = gobj.priv;
13858
14749
  let graph = priv.graph;
13859
- let node_id = kw.evt.target.id;
14750
+ let node_id = kw.id;
13860
14751
  let nodedata;
13861
14752
  try {
13862
14753
  nodedata = graph.getNodeData(node_id);
@@ -17932,6 +18823,10 @@ function build_zone(gobj, zone) {
17932
18823
  {
17933
18824
  class: "GCLASS_ZONE_TOGGLE",
17934
18825
  type: "button",
18826
+ title: (0, i18next.t)(zone.key),
18827
+ "data-i18n-title": zone.key,
18828
+ "aria-label": (0, i18next.t)(zone.key),
18829
+ "data-i18n-aria-label": zone.key,
17935
18830
  "aria-expanded": collapsed ? "false" : "true"
17936
18831
  },
17937
18832
  [
@@ -18061,12 +18956,12 @@ function build_attrs(attrs) {
18061
18956
  [
18062
18957
  "td",
18063
18958
  { class: "GCLASS_CELL_DEFAULT" },
18064
- a.default_value
18959
+ document.createTextNode(String(a.default_value ?? ""))
18065
18960
  ],
18066
18961
  [
18067
18962
  "td",
18068
18963
  { class: "GCLASS_CELL_DESC" },
18069
- a.description
18964
+ document.createTextNode(String(a.description ?? ""))
18070
18965
  ]
18071
18966
  ]
18072
18967
  ];
@@ -19942,6 +20837,10 @@ function mt_destroy$9(gobj) {
19942
20837
  cancelAnimationFrame(priv._resize_raf);
19943
20838
  priv._resize_raf = 0;
19944
20839
  }
20840
+ if (priv.find_timer) {
20841
+ clearTimeout(priv.find_timer);
20842
+ priv.find_timer = null;
20843
+ }
19945
20844
  if (priv.graph) {
19946
20845
  priv.graph.destroy();
19947
20846
  priv.graph = null;
@@ -20348,7 +21247,12 @@ function build_graph$2(gobj) {
20348
21247
  save_view_state(gobj);
20349
21248
  });
20350
21249
  graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
20351
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", { evt }, gobj);
21250
+ let client = evt && evt.client ? evt.client : null;
21251
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", {
21252
+ id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
21253
+ client_x: client && typeof client.x === "number" ? client.x : 0,
21254
+ client_y: client && typeof client.y === "number" ? client.y : 0
21255
+ }, gobj);
20352
21256
  });
20353
21257
  graph.on(_antv_g6.CanvasEvent.CLICK, (evt) => {
20354
21258
  hide_popover(gobj);
@@ -21360,7 +22264,7 @@ function ac_center$2(gobj, event, kw, src) {
21360
22264
  function ac_node_click$3(gobj, event, kw, src) {
21361
22265
  let priv = gobj.priv;
21362
22266
  let graph = priv.graph;
21363
- let node_id = kw.evt.target.id;
22267
+ let node_id = kw.id;
21364
22268
  let node_data = priv.node_by_id && priv.node_by_id[node_id] || null;
21365
22269
  if (!node_data) try {
21366
22270
  let nd = graph.getNodeData(node_id);
@@ -21376,8 +22280,8 @@ function ac_node_click$3(gobj, event, kw, src) {
21376
22280
  (0, _yuneta_gobj_js.gobj_post_event)(gobj, "EV_CENTER_ANCHOR", {}, gobj);
21377
22281
  return 0;
21378
22282
  }
21379
- let client_x = kw.evt && kw.evt.client ? kw.evt.client.x : 0;
21380
- let client_y = kw.evt && kw.evt.client ? kw.evt.client.y : 0;
22283
+ let client_x = kw.client_x || 0;
22284
+ let client_y = kw.client_y || 0;
21381
22285
  show_popover(gobj, node_data, client_x, client_y);
21382
22286
  return 0;
21383
22287
  }
@@ -22028,7 +22932,7 @@ function is_decorative(it) {
22028
22932
  var attrs_table$7 = [
22029
22933
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
22030
22934
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "menu_id", 0, "", "Id of the menu this nav renders"),
22031
- (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "nav_label", 0, "", "Human-readable label for aria/heading; falls back to menu_id"),
22935
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "nav_label", 0, "", "i18n key of the label for aria/heading; falls back to 'navigation'"),
22032
22936
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_JSON, "menu_items", 0, null, "Array of menu items to render"),
22033
22937
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "zone", 0, "", "Zone id where this nav lives"),
22034
22938
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "layout", 0, "vertical", "vertical|icon-bar|tabs|drawer|submenu|accordion"),
@@ -22043,7 +22947,10 @@ var attrs_table$7 = [
22043
22947
  (0, _yuneta_gobj_js.SDATA_END)()
22044
22948
  ];
22045
22949
  var __nav_aria_seq__ = 0;
22046
- var PRIVATE_DATA$7 = { click_handler: null };
22950
+ var PRIVATE_DATA$7 = {
22951
+ click_handler: null,
22952
+ key_handler: null
22953
+ };
22047
22954
  var __gclass__$7 = null;
22048
22955
  /******************************
22049
22956
  * Framework Methods
@@ -22079,6 +22986,7 @@ function mt_destroy$7(gobj) {
22079
22986
  let $c = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
22080
22987
  let priv = gobj.priv;
22081
22988
  if ($c && priv && priv.click_handler) $c.removeEventListener("click", priv.click_handler);
22989
+ if ($c && priv && priv.key_handler) $c.removeEventListener("keydown", priv.key_handler);
22082
22990
  if ($c && $c.parentNode) $c.parentNode.removeChild($c);
22083
22991
  (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", null);
22084
22992
  }
@@ -22096,7 +23004,7 @@ function build_ui$7(gobj) {
22096
23004
  }
22097
23005
  let items = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_items") || [];
22098
23006
  let zone = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "zone") || "";
22099
- let menu_id = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_id") || "nav";
23007
+ (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_id");
22100
23008
  let $container;
22101
23009
  switch (layout) {
22102
23010
  case "vertical":
@@ -22140,8 +23048,9 @@ function build_ui$7(gobj) {
22140
23048
  if (layout !== "drawer") {
22141
23049
  $container.setAttribute("role", "navigation");
22142
23050
  if (!$container.hasAttribute("aria-label")) {
22143
- let label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") || menu_id;
22144
- $container.setAttribute("aria-label", label);
23051
+ let label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") || "navigation";
23052
+ $container.setAttribute("aria-label", (0, i18next.t)(label));
23053
+ $container.setAttribute("data-i18n-aria-label", label);
22145
23054
  }
22146
23055
  }
22147
23056
  wire_clicks(gobj, $container);
@@ -22160,6 +23069,7 @@ function rebuild(gobj) {
22160
23069
  let next = $old ? $old.nextSibling : null;
22161
23070
  let was_hidden = !!($old && $old.classList.contains("is-hidden"));
22162
23071
  if ($old && priv.click_handler) $old.removeEventListener("click", priv.click_handler);
23072
+ if ($old && priv.key_handler) $old.removeEventListener("keydown", priv.key_handler);
22163
23073
  build_ui$7(gobj);
22164
23074
  let $new = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
22165
23075
  if ($new && was_hidden) $new.classList.add("is-hidden");
@@ -22264,6 +23174,7 @@ function render_tabs(gobj, items) {
22264
23174
  class: "icon is-small yui-nav-close ml-2",
22265
23175
  "data-close-item": it.id,
22266
23176
  role: "button",
23177
+ tabindex: "0",
22267
23178
  "aria-label": (0, i18next.t)("close"),
22268
23179
  "data-i18n-aria-label": "close",
22269
23180
  title: (0, i18next.t)("close"),
@@ -22274,12 +23185,15 @@ function render_tabs(gobj, items) {
22274
23185
  "aria-hidden": "true"
22275
23186
  }]
22276
23187
  ]);
23188
+ let label = it.name || "";
22277
23189
  let a_attrs = {
22278
23190
  href: it.route ? "#" + it.route : "#",
22279
23191
  "data-item-id": it.id,
22280
- "data-route": it.route || ""
23192
+ "data-route": it.route || "",
23193
+ "aria-label": label || it.id
22281
23194
  };
22282
- let tip = it.tooltip || it.aria_label;
23195
+ if (label) a_attrs["data-i18n-aria-label"] = label;
23196
+ let tip = it.tooltip || it.aria_label || label;
22283
23197
  if (tip) {
22284
23198
  a_attrs.title = tip;
22285
23199
  a_attrs["data-i18n-title"] = tip;
@@ -22425,12 +23339,13 @@ function render_backbar(gobj) {
22425
23339
  ]);
22426
23340
  }
22427
23341
  function render_drawer(gobj, items) {
22428
- let menu_id = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "menu_id") || "drawer";
22429
23342
  let wrap = document.createElement("div");
22430
23343
  wrap.className = "yui-drawer";
22431
23344
  wrap.setAttribute("role", "dialog");
22432
23345
  wrap.setAttribute("aria-modal", "true");
22433
- wrap.setAttribute("aria-label", menu_id);
23346
+ let nav_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "nav_label") || "navigation";
23347
+ wrap.setAttribute("aria-label", (0, i18next.t)(nav_label));
23348
+ wrap.setAttribute("data-i18n-aria-label", nav_label);
22434
23349
  let back = document.createElement("div");
22435
23350
  back.className = "yui-drawer-backdrop";
22436
23351
  back.setAttribute("data-close-drawer", "1");
@@ -22438,7 +23353,8 @@ function render_drawer(gobj, items) {
22438
23353
  let panel = document.createElement("div");
22439
23354
  panel.className = "yui-drawer-panel";
22440
23355
  panel.setAttribute("role", "navigation");
22441
- panel.setAttribute("aria-label", menu_id);
23356
+ panel.setAttribute("aria-label", (0, i18next.t)(nav_label));
23357
+ panel.setAttribute("data-i18n-aria-label", nav_label);
22442
23358
  panel.appendChild(render_vertical(gobj, items));
22443
23359
  wrap.appendChild(back);
22444
23360
  wrap.appendChild(panel);
@@ -22492,7 +23408,13 @@ function render_accordion(gobj, items) {
22492
23408
  "aria-expanded": "false",
22493
23409
  "aria-controls": body_id
22494
23410
  };
22495
- if (!(0, _yuneta_gobj_js.empty_string)(head_text)) head_attrs.i18n = head_text;
23411
+ if (!(0, _yuneta_gobj_js.empty_string)(head_text)) {
23412
+ head_attrs.i18n = head_text;
23413
+ head_attrs.title = head_text;
23414
+ head_attrs["data-i18n-title"] = head_text;
23415
+ head_attrs["aria-label"] = head_text;
23416
+ head_attrs["data-i18n-aria-label"] = head_text;
23417
+ }
22496
23418
  let $hdr = (0, _yuneta_gobj_js.createElement2)([
22497
23419
  "button",
22498
23420
  head_attrs,
@@ -22578,7 +23500,7 @@ function item_li(gobj, it, opts) {
22578
23500
  "aria-label": aria_key
22579
23501
  };
22580
23502
  if (label) a_attrs["data-i18n-aria-label"] = label;
22581
- let tip = it.tooltip || it.aria_label;
23503
+ let tip = it.tooltip || it.aria_label || label;
22582
23504
  if (tip) {
22583
23505
  a_attrs.title = tip;
22584
23506
  a_attrs["data-i18n-title"] = tip;
@@ -22632,7 +23554,7 @@ function item_iconbar(gobj, it, opts) {
22632
23554
  "aria-label": label || it.id
22633
23555
  };
22634
23556
  if (label) a_attrs["data-i18n-aria-label"] = label;
22635
- let tip = it.tooltip || it.aria_label;
23557
+ let tip = it.tooltip || it.aria_label || label;
22636
23558
  if (tip) {
22637
23559
  a_attrs.title = tip;
22638
23560
  a_attrs["data-i18n-title"] = tip;
@@ -22700,6 +23622,14 @@ function wire_clicks(gobj, $container) {
22700
23622
  };
22701
23623
  $container.addEventListener("click", handler);
22702
23624
  priv.click_handler = handler;
23625
+ let key_handler = (ev) => {
23626
+ if (ev.key !== "Enter" && ev.key !== " ") return;
23627
+ let target = ev.target;
23628
+ if (!target || !target.closest || !target.closest("[data-close-item]")) return;
23629
+ handler(ev);
23630
+ };
23631
+ $container.addEventListener("keydown", key_handler);
23632
+ priv.key_handler = key_handler;
22703
23633
  }
22704
23634
  /***************************
22705
23635
  * Actions
@@ -22754,7 +23684,7 @@ function ac_route_changed(gobj, event, kw, src) {
22754
23684
  return 0;
22755
23685
  }
22756
23686
  function css_escape(s) {
22757
- return String(s).replace(/"/g, "\\\"");
23687
+ return String(s).replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
22758
23688
  }
22759
23689
  /***************************************************************
22760
23690
  * FSM
@@ -22974,6 +23904,8 @@ function build_body(shell, t) {
22974
23904
  type: "text",
22975
23905
  placeholder: t("filter", { defaultValue: "Filter…" }),
22976
23906
  "data-i18n-placeholder": "filter",
23907
+ title: t("filter", { defaultValue: "Filter" }),
23908
+ "data-i18n-title": "filter",
22977
23909
  "aria-label": t("filter", { defaultValue: "Filter" }),
22978
23910
  "data-i18n-aria-label": "filter"
22979
23911
  }]);
@@ -23061,6 +23993,10 @@ function build_body(shell, t) {
23061
23993
  "button",
23062
23994
  {
23063
23995
  class: "button is-small ROUTEMAP_PRINT",
23996
+ title: t("print", { defaultValue: "Print" }),
23997
+ "data-i18n-title": "print",
23998
+ "aria-label": t("print", { defaultValue: "Print" }),
23999
+ "data-i18n-aria-label": "print",
23064
24000
  i18n: "print"
23065
24001
  },
23066
24002
  t("print", { defaultValue: "Print" })
@@ -24817,6 +25753,43 @@ function request_treedb_descs$1(gobj) {
24817
25753
  if (ret) (0, _yuneta_gobj_js.log_error)(ret);
24818
25754
  }
24819
25755
  /************************************************************
25756
+ * A user view shows the topics of the user and, of the system
25757
+ * topics, only __icons__: its nodes are what the user ADDS to
25758
+ * the app (the icons a column `icon` can name), so editing them
25759
+ * is the user's business. The other `__` topics are the
25760
+ * treedb's own bookkeeping.
25761
+ ************************************************************/
25762
+ function topic_is_shown(topic_name) {
25763
+ return topic_name.substring(0, 2) !== "__" || topic_name === "__icons__";
25764
+ }
25765
+ /************************************************************
25766
+ * The nodes of __icons__ are the user icons of the app: each
25767
+ * load and each write of them goes to the icon registry
25768
+ * (lib_icons.js), and the shell tells the views that decided
25769
+ * at render time whether a name was an icon.
25770
+ *
25771
+ * how: "load" (nodes = the whole topic), "put" (one node
25772
+ * created or updated) or "remove" (one node deleted).
25773
+ ************************************************************/
25774
+ function feed_user_icons(gobj, how, nodes) {
25775
+ switch (how) {
25776
+ case "load":
25777
+ yui_icons_set_user(nodes);
25778
+ break;
25779
+ case "put":
25780
+ for (const node of nodes) yui_icons_put_user(node);
25781
+ break;
25782
+ case "remove":
25783
+ for (const node of nodes) if (node && typeof node.id === "string") yui_icons_remove_user(node.id);
25784
+ break;
25785
+ default:
25786
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: feed_user_icons(): unknown '${how}'`);
25787
+ return;
25788
+ }
25789
+ let shell = yui_shell_of(gobj);
25790
+ if (shell) yui_shell_icons_changed(shell);
25791
+ }
25792
+ /************************************************************
24820
25793
  * Response of remote command
24821
25794
  ************************************************************/
24822
25795
  function process_treedb_descs$1(gobj) {
@@ -24826,7 +25799,7 @@ function process_treedb_descs$1(gobj) {
24826
25799
  let treedb_name = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name");
24827
25800
  let readonly = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "readonly");
24828
25801
  for (const [key, desc] of Object.entries(descs)) {
24829
- if (system) {} else if (key.substring(0, 2) === "__") continue;
25802
+ if (!system && !topic_is_shown(key)) continue;
24830
25803
  let kw_topic_form = {
24831
25804
  subscriber: gobj,
24832
25805
  readonly,
@@ -24835,7 +25808,7 @@ function process_treedb_descs$1(gobj) {
24835
25808
  treedb_name,
24836
25809
  topic_name: key,
24837
25810
  desc,
24838
- with_remote_paging: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_remote_paging"),
25811
+ with_remote_paging: key !== "__icons__" && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_remote_paging"),
24839
25812
  page_size: (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "page_size"),
24840
25813
  with_selection_bar: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_selection_bar"),
24841
25814
  form_waits_for_answer: true
@@ -24887,7 +25860,7 @@ function register_sub_routes$1(gobj) {
24887
25860
  gclass: "C_YUI_TREEDB_SCHEMA"
24888
25861
  });
24889
25862
  if ((0, _yuneta_gobj_js.is_object)(descs)) for (let topic of Object.keys(descs)) {
24890
- if (!system && topic.substring(0, 2) === "__") continue;
25863
+ if (!system && !topic_is_shown(topic)) continue;
24891
25864
  nodes.push({
24892
25865
  route: base + "/" + topic,
24893
25866
  label: topic,
@@ -25488,6 +26461,7 @@ function ac_mt_command_answer$2(gobj, event, kw, src) {
25488
26461
  }, gobj);
25489
26462
  } else {
25490
26463
  forget_topic_rereads(gobj, topic_name);
26464
+ if (topic_name === "__icons__") feed_user_icons(gobj, "load", answer.rows);
25491
26465
  (0, _yuneta_gobj_js.gobj_send_event)(gobj_topic_form, "EV_LOAD_NODES", answer.rows, gobj);
25492
26466
  }
25493
26467
  }
@@ -25736,6 +26710,7 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
25736
26710
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
25737
26711
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
25738
26712
  if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
26713
+ if (topic_name === "__icons__") feed_user_icons(gobj, "put", [node]);
25739
26714
  let gobj_formtable = get_gobj_formtable(gobj, topic_name);
25740
26715
  (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_LOAD_NODE_CREATED", [node], gobj);
25741
26716
  }
@@ -25749,6 +26724,7 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
25749
26724
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
25750
26725
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
25751
26726
  if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
26727
+ if (topic_name === "__icons__") feed_user_icons(gobj, "put", [node]);
25752
26728
  let gobj_formtable = get_gobj_formtable(gobj, topic_name);
25753
26729
  (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_LOAD_NODE_UPDATED", [node], gobj);
25754
26730
  }
@@ -25783,6 +26759,7 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
25783
26759
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
25784
26760
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
25785
26761
  if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
26762
+ if (topic_name === "__icons__") feed_user_icons(gobj, "remove", [node]);
25786
26763
  let gobj_formtable = get_gobj_formtable(gobj, topic_name);
25787
26764
  (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_NODE_DELETED", [node], gobj);
25788
26765
  }
@@ -26560,46 +27537,46 @@ function yui_selection_bar(t, opts) {
26560
27537
  /***********************************************************************
26561
27538
  * yui_table_filter_clear.js
26562
27539
  *
26563
- * LA ✕ DE LOS FILTROS DE CABECERA DE UNA TABULATOR.
26564
- *
26565
- * Un filtro de columna se pone escribiendo y se quita BORRANDO lo
26566
- * escrito, letra a letra, y no hay nada en la cabecera que diga
26567
- * que se puede quitar. Con varias columnas filtradas, volver a
26568
- * ver la tabla entera es un ejercicio de memoria: cuáles toqué.
26569
- * La ✕ lo dice y lo hace.
26570
- *
26571
- * TRES DECISIONES QUE NO SON OBVIAS:
26572
- *
26573
- * - **Se ve mientras el filtro tenga contenido, con foco o sin
26574
- * él.** Es al revés que la ✕ de un formulario
26575
- * (`yui_inputs.js`), que sólo aparece en el campo que se está
26576
- * editando para no encender un aspa en cada campo relleno. Aquí
26577
- * el caso de uso es justo el contrario: el filtro ya está puesto,
26578
- * el foco está en otra parte, y lo que se quiere es verlo y
26579
- * quitarlo. Escondida tras el foco harían falta dos clics.
26580
- *
26581
- * - **Se borra con la API, no simulando teclas.**
26582
- * `setHeaderFilterValue(field, "")` es lo que Tabulator ofrece, y
26583
- * deja el valor y el filtro consistentes. Sintetizar un `input`
26584
- * sobre el `<input>` depende de a qué escuche el editor de ese
26585
- * filtro, que cambia con el tipo de columna.
26586
- *
26587
- * - **Se recorre la cabecera, no se envuelve el editor.** Las
26588
- * columnas se construyen del esquema del topic, así que no hay un
26589
- * sitio único donde envolver el editor; y la cabecera se rehace
26590
- * sola cuando cambian las columnas. El recorrido es idempotente
26591
- * -- marca lo que ya tiene aspa -- y se dispara con un
26592
- * `querySelector` de una sola pasada, así que repetirlo en cada
26593
- * render no cuesta nada.
27540
+ * THE ✕ OF A TABULATOR'S HEADER FILTERS.
27541
+ *
27542
+ * A column filter is set by typing and removed by DELETING what
27543
+ * was typed, letter by letter, and nothing in the header says it
27544
+ * can be removed. With several columns filtered, getting the
27545
+ * whole table back is an exercise of memory: which ones did I
27546
+ * touch. The ✕ says it and does it.
27547
+ *
27548
+ * THREE DECISIONS THAT ARE NOT OBVIOUS:
27549
+ *
27550
+ * - **It shows while the filter has content, focused or not.**
27551
+ * The opposite of a form's ✕ (`yui_inputs.js`), which appears
27552
+ * only on the field being edited so as not to light a cross on
27553
+ * every filled field. Here the use case is the reverse: the
27554
+ * filter is already set, the focus is elsewhere, and what is
27555
+ * wanted is to see it and remove it. Hidden behind the focus it
27556
+ * would take two clicks.
27557
+ *
27558
+ * - **It clears through the API, not by faking keys.**
27559
+ * `setHeaderFilterValue(field, "")` is what Tabulator offers,
27560
+ * and it keeps the value and the filter consistent. Synthesising
27561
+ * an `input` on the `<input>` depends on what that filter's
27562
+ * editor listens to, which changes with the column type.
27563
+ *
27564
+ * - **The header is walked, the editor is not wrapped.** The
27565
+ * columns are built from the topic's schema, so there is no
27566
+ * single place to wrap the editor; and the header rebuilds
27567
+ * itself when the columns change. The walk is idempotent -- it
27568
+ * marks what already has its cross -- and is triggered by a
27569
+ * one-pass `querySelector`, so repeating it on every render
27570
+ * costs nothing.
26594
27571
  *
26595
27572
  * Copyright (c) 2026, ArtGins.
26596
27573
  * All Rights Reserved.
26597
27574
  ***********************************************************************/
26598
27575
  var MARK = "data-yui-filter-clear";
26599
27576
  /***************************************************************
26600
- * Pon (o repón) la ✕ de cada filtro de cabecera de `table`.
27577
+ * Put (or put back) the ✕ of every header filter of `table`.
26601
27578
  *
26602
- * Idempotente: los que ya la tienen se saltan.
27579
+ * Idempotent: the ones that already have it are skipped.
26603
27580
  ***************************************************************/
26604
27581
  function decorate(table) {
26605
27582
  if (!table || !table.element) return;
@@ -26637,11 +27614,11 @@ function decorate(table) {
26637
27614
  }
26638
27615
  }
26639
27616
  /***************************************************************
26640
- * Engancha la ✕ a una tabla ya creada.
27617
+ * Hook the ✕ onto a table already created.
26641
27618
  *
26642
- * Se llama una vez, con la tabla construida. Los enganches
26643
- * cubren los dos momentos en que la cabecera aparece o se
26644
- * rehace: cuando se construye y cuando cambian las columnas.
27619
+ * Called once, with the table built. The hooks cover the two
27620
+ * moments the header appears or is rebuilt: when it is built
27621
+ * and when the columns change.
26645
27622
  ***************************************************************/
26646
27623
  function yui_table_filter_clear(table) {
26647
27624
  if (!table) return;
@@ -26654,182 +27631,6 @@ function yui_table_filter_clear(table) {
26654
27631
  });
26655
27632
  }
26656
27633
  //#endregion
26657
- //#region src/lib_icons.js
26658
- /*********************************************************
26659
- * lib_icons.js
26660
- *
26661
- * Two icon systems are managed here:
26662
- *
26663
- * 1. FA-style CSS icons (yui_icons.css)
26664
- * Usage: <i class="yi-save"></i>
26665
- * Color: inherits currentColor from parent via CSS mask.
26666
- *
26667
- * 2. SVG symbol icons for G6 toolbar (and any other component
26668
- * that uses <use xlink:href="#id">).
26669
- * Symbols are injected once into the DOM.
26670
- * All symbol ids are prefixed with "g6-icon-" to avoid
26671
- * conflicts with other DOM elements.
26672
- * Icon paths come from:
26673
- * fontawesome-free-7.1.0-web/sprites/solid.svg
26674
- *
26675
- * G6 toolbar items are managed via CSS class names (className
26676
- * field in getItems()) using YuiToolbar in c_g6_nodes_tree.js.
26677
- * This lets lib_graph.js state functions (set_submit_state,
26678
- * disableElements, …) work on toolbar icons exactly like on
26679
- * regular Bulma/FA buttons — no icon-specific helpers needed.
26680
- *
26681
- * Copyright (c) 2025-2026, ArtGins.
26682
- * All Rights Reserved.
26683
- *********************************************************/
26684
- var CUSTOM_SVG_ICONS_ID = "g6-custom-svgicons";
26685
- var ICONS = `<svg xmlns="http://www.w3.org/2000/svg">
26686
- <!-- magnifying-glass-plus -->
26687
- <symbol id="g6-icon-zoom-in" viewBox="0 0 512 512">
26688
- <path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 112c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z"/>
26689
- </symbol>
26690
- <!-- magnifying-glass-minus -->
26691
- <symbol id="g6-icon-zoom-out" viewBox="0 0 512 512">
26692
- <path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"/>
26693
- </symbol>
26694
- <!-- house (reset zoom: back to original 100% view) -->
26695
- <symbol id="g6-icon-home" viewBox="0 0 512 512">
26696
- <path fill="currentColor" d="M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM240 320l32 0c26.5 0 48 21.5 48 48l0 96-128 0 0-96c0-26.5 21.5-48 48-48z"/>
26697
- </symbol>
26698
- <!-- expand (zoom to fit) -->
26699
- <symbol id="g6-icon-fit" viewBox="0 0 448 512">
26700
- <path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
26701
- </symbol>
26702
- <!-- fit to selection: the same corner brackets as the fit icon,
26703
- around a marked object. The two sit side by side in the
26704
- toolbar and have to read as a family, which a borrowed glyph
26705
- would not. (No backticks in here: the sprite lives inside a
26706
- template literal.) -->
26707
- <symbol id="g6-icon-fit-selection" viewBox="0 0 448 512">
26708
- <path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
26709
- <rect fill="currentColor" x="144" y="176" width="160" height="160" rx="24"/>
26710
- </symbol>
26711
- <!-- crosshairs (center) -->
26712
- <symbol id="g6-icon-center" viewBox="0 0 576 512">
26713
- <path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM131.2 288c12.7 62.7 62.1 112.1 124.8 124.8l0-12.8c0-17.7 14.3-32 32-32s32 14.3 32 32l0 12.8c62.7-12.7 112.1-62.1 124.8-124.8L432 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l12.8 0C432.1 161.3 382.7 111.9 320 99.2l0 12.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-12.8C193.3 111.9 143.9 161.3 131.2 224l12.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-12.8 0zM288 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/>
26714
- </symbol>
26715
- <!-- up-right-and-down-left-from-center (enter fullscreen) -->
26716
- <symbol id="g6-icon-fullscreen" viewBox="0 0 512 512">
26717
- <path fill="currentColor" d="M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2S34.1 320.2 41 327l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S177.7 512 168 512z"/>
26718
- </symbol>
26719
- <!-- down-left-and-up-right-to-center (exit fullscreen) -->
26720
- <symbol id="g6-icon-fullscreen-exit" viewBox="0 0 512 512">
26721
- <path fill="currentColor" d="M439.5 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S450.2 240 440.5 240l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87zM72.5 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S62.8 272 72.5 272z"/>
26722
- </symbol>
26723
- <!-- arrow-rotate-left (undo) -->
26724
- <symbol id="g6-icon-undo" viewBox="0 0 512 512">
26725
- <path fill="currentColor" d="M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"/>
26726
- </symbol>
26727
- <!-- arrow-rotate-right (redo) -->
26728
- <symbol id="g6-icon-redo" viewBox="0 0 512 512">
26729
- <path fill="currentColor" d="M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"/>
26730
- </symbol>
26731
- <!-- pen (edit node) -->
26732
- <symbol id="g6-icon-edit" viewBox="0 0 512 512">
26733
- <path fill="currentColor" d="M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"/>
26734
- </symbol>
26735
- <!-- trash-can (delete) -->
26736
- <symbol id="g6-icon-delete" viewBox="0 0 448 512">
26737
- <path fill="currentColor" d="M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z"/>
26738
- </symbol>
26739
- <!-- link (link nodes) -->
26740
- <symbol id="g6-icon-link" viewBox="0 0 576 512">
26741
- <path fill="currentColor" d="M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"/>
26742
- </symbol>
26743
- <!-- link-slash (unlink) -->
26744
- <symbol id="g6-icon-unlink" viewBox="0 0 576 512">
26745
- <path fill="currentColor" d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"/>
26746
- </symbol>
26747
- <!-- play (run node) -->
26748
- <symbol id="g6-icon-run" viewBox="0 0 448 512">
26749
- <path fill="currentColor" d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/>
26750
- </symbol>
26751
- <!-- clone (copy size to other nodes/ports) -->
26752
- <symbol id="g6-icon-resize" viewBox="0 0 512 512">
26753
- <path fill="currentColor" d="M288 448l-224 0 0-224 48 0 0-64-48 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-48-64 0 0 48zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"/>
26754
- </symbol>
26755
- <!-- plus (create node). Deliberately NOT the FA7 solid plus:
26756
- its arms are ~14% of the width and read thin next to the
26757
- other solid glyphs. Bold geometric plus (~23% arm
26758
- thickness) with long arms (32..480) so it reads as a "+",
26759
- not a stubby Red-Cross square. -->
26760
- <symbol id="g6-icon-plus" viewBox="0 0 512 512">
26761
- <path fill="currentColor" d="M316 32 L316 196 L480 196 L480 316 L316 316 L316 480 L196 480 L196 316 L32 316 L32 196 L196 196 L196 32 Z"/>
26762
- </symbol>
26763
- <!-- ellipsis-vertical (unfold the floating toolbar).
26764
- The strip it stands for is a vertical stack, and a vertical
26765
- ellipsis is what "there is more of this here" is drawn as
26766
- everywhere else. -->
26767
- <symbol id="g6-icon-toolbar-show" viewBox="0 0 128 512">
26768
- <path fill="currentColor" d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/>
26769
- </symbol>
26770
- <!-- xmark (fold the floating toolbar away).
26771
- Not a chevron: the two toolbars sit on OPPOSITE edges, so a
26772
- direction would point the wrong way on one of them. What the
26773
- button does is close an overlay, and that is an x. -->
26774
- <symbol id="g6-icon-toolbar-hide" viewBox="0 0 384 512">
26775
- <path fill="currentColor" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
26776
- </symbol>
26777
- <!-- dashed marquee (selection mode).
26778
- The band ITSELF, because that is what the button turns on: a
26779
- drag on the canvas draws one and a tap picks a card. Not the
26780
- fit-to-selection glyph next to it in the other toolbar -- that
26781
- one is solid brackets around a solid object and means "put the
26782
- camera on what is picked", which is the opposite end of the
26783
- gesture. Dashes: 16 segments of 59 with gaps of 36 over a
26784
- perimeter of 1520, so they land on the corners. -->
26785
- <symbol id="g6-icon-select-mode" viewBox="0 0 512 512">
26786
- <rect x="46" y="86" width="420" height="340" fill="none"
26787
- stroke="currentColor" stroke-width="40"
26788
- stroke-dasharray="59 36"/>
26789
- </symbol>
26790
- <!-- location-crosshairs (anchor the camera on one element).
26791
- The SAME path as the DOM toolbars and their yi-location-crosshairs
26792
- mask: the two toolbars sit in one console, and a control that
26793
- does one thing has to be drawn one way. -->
26794
- <symbol id="g6-icon-anchor" viewBox="0 0 576 512">
26795
- <path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM128 256a160 160 0 1 0 320 0 160 160 0 1 0 -320 0zm160-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/>
26796
- </symbol>
26797
- <!-- floppy-disk (save) -->
26798
- <symbol id="g6-icon-save" viewBox="0 0 448 512">
26799
- <path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm32 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"/>
26800
- </symbol>
26801
- </svg>`;
26802
- function inject_svg_icons() {
26803
- if (document.getElementById(CUSTOM_SVG_ICONS_ID)) return;
26804
- const div = document.createElement("div");
26805
- div.id = CUSTOM_SVG_ICONS_ID;
26806
- div.style.display = "none";
26807
- div.innerHTML = ICONS;
26808
- document.body.appendChild(div);
26809
- }
26810
- var __icon_defined__ = {};
26811
- function yui_icon_is_defined(name) {
26812
- if (!name || typeof name !== "string") return false;
26813
- if (__icon_defined__[name] !== void 0) return __icon_defined__[name];
26814
- let defined = false;
26815
- try {
26816
- const el = document.createElement("i");
26817
- el.className = name;
26818
- el.style.position = "absolute";
26819
- el.style.visibility = "hidden";
26820
- el.style.pointerEvents = "none";
26821
- document.body.appendChild(el);
26822
- const st = window.getComputedStyle(el, "::before");
26823
- const mask = st.maskImage || st.webkitMaskImage || "";
26824
- defined = !!mask && mask !== "none";
26825
- document.body.removeChild(el);
26826
- } catch (e) {
26827
- defined = false;
26828
- }
26829
- __icon_defined__[name] = defined;
26830
- return defined;
26831
- }
26832
- //#endregion
26833
27634
  //#region src/yui_row_search.js
26834
27635
  /***********************************************************************
26835
27636
  * yui_row_search.js
@@ -27445,7 +28246,10 @@ function mt_create$5(gobj) {
27445
28246
  ***************************************************************/
27446
28247
  function mt_start$5(gobj) {
27447
28248
  let shell = yui_shell_of(gobj);
27448
- if (shell) (0, _yuneta_gobj_js.gobj_subscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
28249
+ if (shell) {
28250
+ (0, _yuneta_gobj_js.gobj_subscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
28251
+ (0, _yuneta_gobj_js.gobj_subscribe_event)(shell, "EV_ICONS_CHANGED", {}, gobj);
28252
+ }
27449
28253
  create_tabulator(gobj);
27450
28254
  }
27451
28255
  /***************************************************************
@@ -27453,7 +28257,10 @@ function mt_start$5(gobj) {
27453
28257
  ***************************************************************/
27454
28258
  function mt_stop$5(gobj) {
27455
28259
  let shell = yui_shell_of(gobj);
27456
- if (shell) (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
28260
+ if (shell) {
28261
+ (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
28262
+ (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_ICONS_CHANGED", {}, gobj);
28263
+ }
27457
28264
  close_form_dialog(gobj);
27458
28265
  close_schema_dialog(gobj);
27459
28266
  close_cell_json_dialog(gobj);
@@ -27461,6 +28268,7 @@ function mt_stop$5(gobj) {
27461
28268
  close_cell_file_dialog(gobj);
27462
28269
  close_hook_choice(gobj);
27463
28270
  drop_pending_assets(gobj);
28271
+ drop_pending_pages(gobj);
27464
28272
  table__destroy(gobj);
27465
28273
  }
27466
28274
  /***************************************************************
@@ -28170,7 +28978,13 @@ function create_tabulator(gobj) {
28170
28978
  let formatterParams;
28171
28979
  const field_desc = (0, _yuneta_gobj_js.treedb_get_field_desc)(col);
28172
28980
  if (field_desc.is_hidden) continue;
28981
+ if (yui_icons_is_svg_field((0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"), col.id)) field_desc.type = "svg";
28173
28982
  switch (field_desc.type) {
28983
+ case "svg":
28984
+ hozAlign = "center";
28985
+ vertAlign = "middle";
28986
+ colFormatter = svg_cell_formatter;
28987
+ break;
28174
28988
  case "hook":
28175
28989
  hozAlign = "center";
28176
28990
  cellClick = function(e, cell) {
@@ -28374,6 +29188,7 @@ function create_tabulator(gobj) {
28374
29188
  else try {
28375
29189
  n = tabulator.getDataCount("active");
28376
29190
  } catch (e) {
29191
+ (0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot count the table's rows: ${e}`);
28377
29192
  n = 0;
28378
29193
  }
28379
29194
  let paged = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_remote_paging");
@@ -28559,6 +29374,30 @@ function icon_formatter(cell) {
28559
29374
  }]);
28560
29375
  }
28561
29376
  /************************************************************
29377
+ * Cell of the drawing of a user icon (`svg` of __icons__): the
29378
+ * icon itself, as the app will draw it. A drawing that cannot
29379
+ * be drawn says why, in plain grey -- the same honest half as
29380
+ * an unknown icon name in icon_formatter.
29381
+ ************************************************************/
29382
+ function svg_cell_formatter(cell) {
29383
+ let svg = cell.getValue();
29384
+ if (!(0, _yuneta_gobj_js.is_string)(svg) || (0, _yuneta_gobj_js.empty_string)(svg)) return "";
29385
+ let preview = yui_svg_icon_element(svg);
29386
+ if (preview.error) {
29387
+ let text = svg_error_text(preview.error);
29388
+ return (0, _yuneta_gobj_js.createElement2)([
29389
+ "span",
29390
+ {
29391
+ class: "ICON_CELL_UNKNOWN is-size-7 yui-text-quiet",
29392
+ title: text
29393
+ },
29394
+ text
29395
+ ]);
29396
+ }
29397
+ preview.element.classList.add("ICON_CELL");
29398
+ return preview.element;
29399
+ }
29400
+ /************************************************************
28562
29401
  * Cell of a col holding a JSON document (dict/list/blob/
28563
29402
  * template/coordinates/…): a one-line truncated preview,
28564
29403
  * marked as a link because the click opens the whole value
@@ -28579,7 +29418,9 @@ function build_json_cell_preview(value) {
28579
29418
  {
28580
29419
  class: "JSON_CELL",
28581
29420
  title: (0, i18next.t)("show json"),
28582
- "data-i18n-title": "show json"
29421
+ "data-i18n-title": "show json",
29422
+ "aria-label": (0, i18next.t)("show json"),
29423
+ "data-i18n-aria-label": "show json"
28583
29424
  },
28584
29425
  [["span", { class: "JSON_CELL_ICON icon yi-eye" }], [
28585
29426
  "span",
@@ -29579,33 +30420,15 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
29579
30420
  case "object":
29580
30421
  case "dict":
29581
30422
  case "template":
29582
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
29583
- value = JSON.parse(value);
29584
- } catch (e) {
29585
- value = {};
29586
- }
29587
- else if ((0, _yuneta_gobj_js.is_object)(value)) {}
29588
- if (!(0, _yuneta_gobj_js.is_object)(value)) value = {};
29589
- break;
29590
30423
  case "array":
29591
30424
  case "list":
29592
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
29593
- value = JSON.parse(value);
29594
- } catch (e) {
29595
- value = [];
29596
- }
29597
- else if ((0, _yuneta_gobj_js.is_array)(value)) {}
29598
- if (!(0, _yuneta_gobj_js.is_array)(value)) value = [];
29599
- break;
29600
30425
  case "coordinates":
29601
- case "blob":
29602
- if ((0, _yuneta_gobj_js.is_string)(value)) try {
29603
- value = JSON.parse(value);
29604
- } catch (e) {
29605
- value = {};
29606
- }
29607
- else if ((0, _yuneta_gobj_js.is_object)(value)) {} else if ((0, _yuneta_gobj_js.is_array)(value)) {} else value = {};
30426
+ case "blob": {
30427
+ let r = parse_json_field(value, field_desc.type);
30428
+ if (r.error) (0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: column '${col.id}' (${field_desc.type}) holds no valid json, taken as empty`);
30429
+ value = r.value;
29608
30430
  break;
30431
+ }
29609
30432
  case "enum":
29610
30433
  switch (field_desc.real_type) {
29611
30434
  case "string":
@@ -29786,6 +30609,24 @@ function ac_language_changed$4(gobj, event, kw, src) {
29786
30609
  }
29787
30610
  return 0;
29788
30611
  }
30612
+ /************************************************************
30613
+ * The user icons changed (published by the shell): the cells
30614
+ * of an `icon` column decided when they were drawn whether
30615
+ * their name was an icon, so they are drawn again.
30616
+ ************************************************************/
30617
+ function ac_icons_changed(gobj, event, kw, src) {
30618
+ let tabulator = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "tabulator");
30619
+ if (!tabulator) return 0;
30620
+ let desc = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "desc");
30621
+ if ((desc && Array.isArray(desc.cols) ? desc.cols : []).filter((col) => col && col.id && (0, _yuneta_gobj_js.treedb_get_field_desc)(col).type === "icon").length === 0) return 0;
30622
+ try {
30623
+ for (const row of tabulator.getRows()) row.reformat();
30624
+ } catch (e) {
30625
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot redraw the icon cells: ${e}`);
30626
+ return -1;
30627
+ }
30628
+ return 0;
30629
+ }
29789
30630
  function ac_load_nodes(gobj, event, kw, src) {
29790
30631
  let data = kw;
29791
30632
  if (!(0, _yuneta_gobj_js.is_array)(data)) {
@@ -30546,6 +31387,21 @@ function request_page(gobj, page, size) {
30546
31387
  });
30547
31388
  }
30548
31389
  /************************************************************
31390
+ * The view stops: no page request is waited for any more. Each
31391
+ * one's watchdog would otherwise fire EV_PAGE_TIMEOUT on a gobj
31392
+ * stopped -- or destroyed -- 20 s later.
31393
+ ************************************************************/
31394
+ function drop_pending_pages(gobj) {
31395
+ let priv = gobj.priv;
31396
+ let pending = priv._pending_pages || {};
31397
+ priv._pending_pages = {};
31398
+ for (let req_id of Object.keys(pending)) {
31399
+ let pend = pending[req_id];
31400
+ if (pend.timer) window.clearTimeout(pend.timer);
31401
+ pend.reject(/* @__PURE__ */ new Error("the view stopped"));
31402
+ }
31403
+ }
31404
+ /************************************************************
30549
31405
  * Settle a parked page request, however it ended.
30550
31406
  ************************************************************/
30551
31407
  function settle_page(gobj, req_id, value, error) {
@@ -30906,6 +31762,11 @@ function create_gclass$5(gclass_name) {
30906
31762
  ac_language_changed$4,
30907
31763
  null
30908
31764
  ],
31765
+ [
31766
+ "EV_ICONS_CHANGED",
31767
+ ac_icons_changed,
31768
+ null
31769
+ ],
30909
31770
  [
30910
31771
  "EV_LOAD_NODES",
30911
31772
  ac_load_nodes,
@@ -31144,6 +32005,7 @@ function create_gclass$5(gclass_name) {
31144
32005
  ]]];
31145
32006
  const event_types = [
31146
32007
  ["EV_LANGUAGE_CHANGED", 0],
32008
+ ["EV_ICONS_CHANGED", 0],
31147
32009
  ["EV_LOAD_NODES", 0],
31148
32010
  ["EV_LOAD_NODE_CREATED", 0],
31149
32011
  ["EV_LOAD_NODE_UPDATED", 0],
@@ -62828,6 +63690,7 @@ function start_node_resize(gobj, e, mx, my) {
62828
63690
  function onPointerUp(ev) {
62829
63691
  document.removeEventListener("pointermove", onPointerMove);
62830
63692
  document.removeEventListener("pointerup", onPointerUp);
63693
+ document.removeEventListener("pointercancel", onPointerCancel);
62831
63694
  const dLeft = (currentRect.left - origVpRect.left) / zoom;
62832
63695
  const dTop = (currentRect.top - origVpRect.top) / zoom;
62833
63696
  const dRight = (currentRect.right - origVpRect.right) / zoom;
@@ -62861,8 +63724,15 @@ function start_node_resize(gobj, e, mx, my) {
62861
63724
  mark_graph_dirty(gobj);
62862
63725
  });
62863
63726
  }
63727
+ function onPointerCancel(ev) {
63728
+ document.removeEventListener("pointermove", onPointerMove);
63729
+ document.removeEventListener("pointerup", onPointerUp);
63730
+ document.removeEventListener("pointercancel", onPointerCancel);
63731
+ update_resize_handles_position(gobj);
63732
+ }
62864
63733
  document.addEventListener("pointermove", onPointerMove);
62865
63734
  document.addEventListener("pointerup", onPointerUp);
63735
+ document.addEventListener("pointercancel", onPointerCancel);
62866
63736
  }
62867
63737
  /************************************************************
62868
63738
  * Port selection and individual port resizing
@@ -63450,6 +64320,7 @@ function start_link_drag(gobj, e) {
63450
64320
  function onPointerUp(ev) {
63451
64321
  document.removeEventListener("pointermove", onPointerMove);
63452
64322
  document.removeEventListener("pointerup", onPointerUp);
64323
+ document.removeEventListener("pointercancel", onPointerCancel);
63453
64324
  priv.$container.style.cursor = "";
63454
64325
  if (priv._link_drag_svg) {
63455
64326
  priv._link_drag_svg.remove();
@@ -63463,8 +64334,20 @@ function start_link_drag(gobj, e) {
63463
64334
  if (target) try_complete_link(gobj, target.node_id, target.port_key);
63464
64335
  else exit_linking_mode(gobj);
63465
64336
  }
64337
+ function onPointerCancel(ev) {
64338
+ document.removeEventListener("pointermove", onPointerMove);
64339
+ document.removeEventListener("pointerup", onPointerUp);
64340
+ document.removeEventListener("pointercancel", onPointerCancel);
64341
+ priv.$container.style.cursor = "";
64342
+ if (priv._link_drag_svg) {
64343
+ priv._link_drag_svg.remove();
64344
+ priv._link_drag_svg = null;
64345
+ }
64346
+ exit_linking_mode(gobj);
64347
+ }
63466
64348
  document.addEventListener("pointermove", onPointerMove);
63467
64349
  document.addEventListener("pointerup", onPointerUp);
64350
+ document.addEventListener("pointercancel", onPointerCancel);
63468
64351
  }
63469
64352
  /************************************************************
63470
64353
  * Find if a canvas point hits a valid hook port during
@@ -63651,6 +64534,7 @@ function start_port_resize(gobj, e) {
63651
64534
  function onPointerUp(ev) {
63652
64535
  document.removeEventListener("pointermove", onPointerMove);
63653
64536
  document.removeEventListener("pointerup", onPointerUp);
64537
+ document.removeEventListener("pointercancel", onPointerCancel);
63654
64538
  const dx = ev.clientX - clientCx;
63655
64539
  const dy = ev.clientY - clientCy;
63656
64540
  let vpR = Math.max(PORT_HANDLE_SIZE, Math.sqrt(dx * dx + dy * dy));
@@ -63673,8 +64557,15 @@ function start_port_resize(gobj, e) {
63673
64557
  mark_graph_dirty(gobj);
63674
64558
  });
63675
64559
  }
64560
+ function onPointerCancel(ev) {
64561
+ document.removeEventListener("pointermove", onPointerMove);
64562
+ document.removeEventListener("pointerup", onPointerUp);
64563
+ document.removeEventListener("pointercancel", onPointerCancel);
64564
+ update_port_resize_handles_position(gobj);
64565
+ }
63676
64566
  document.addEventListener("pointermove", onPointerMove);
63677
64567
  document.addEventListener("pointerup", onPointerUp);
64568
+ document.addEventListener("pointercancel", onPointerCancel);
63678
64569
  }
63679
64570
  /************************************************************
63680
64571
  * Edge selection: show a floating properties icon near
@@ -71733,6 +72624,7 @@ var JSON_FIELDS$1 = [
71733
72624
  "properties",
71734
72625
  "pkey2s"
71735
72626
  ];
72627
+ var C_BACKSLASH = "\\\\";
71736
72628
  var JSON_BACKSLASH = "\\\\\\\\";
71737
72629
  var JSON_DQUOTE = "\\\\\\\"";
71738
72630
  var JSON_QUOTE = "\\\\u0027";
@@ -71838,7 +72730,19 @@ function c_scalar(value, key) {
71838
72730
  * themselves.
71839
72731
  ***************************************************************/
71840
72732
  function c_text(text) {
71841
- return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE);
72733
+ return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE).replace(/[\u0000-\u001f\u007f]/g, json_control);
72734
+ }
72735
+ var JSON_SHORT_ESCAPES = {
72736
+ "\n": "n",
72737
+ "\r": "r",
72738
+ " ": "t",
72739
+ "\b": "b",
72740
+ "\f": "f"
72741
+ };
72742
+ function json_control(ch) {
72743
+ let short = JSON_SHORT_ESCAPES[ch];
72744
+ if (short) return C_BACKSLASH + short;
72745
+ return "\\\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0");
71842
72746
  }
71843
72747
  /***************************************************************
71844
72748
  * Render a value at `indent`, appending its lines to `lines`.
@@ -78159,16 +79063,19 @@ function build_ui(gobj) {
78159
79063
  (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
78160
79064
  }
78161
79065
  function build_mode_button(gobj, mode) {
79066
+ let name = mode_name(mode);
78162
79067
  let $btn = (0, _yuneta_gobj_js.createElement2)([
78163
79068
  "button",
78164
79069
  {
78165
79070
  class: `button YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
78166
- type: "button"
79071
+ type: "button",
79072
+ title: name,
79073
+ "aria-label": name
78167
79074
  },
78168
79075
  [[
78169
79076
  "span",
78170
79077
  { class: "YUI_PERIOD_MODE_TEXT" },
78171
- mode_name(mode)
79078
+ name
78172
79079
  ]]
78173
79080
  ]);
78174
79081
  $btn.addEventListener("click", () => {
@@ -78190,16 +79097,19 @@ function build_more_menu(gobj) {
78190
79097
  ]);
78191
79098
  for (let mode of priv.modes) {
78192
79099
  if (!mode.overflow) continue;
79100
+ let name = mode_name(mode);
78193
79101
  let $item = (0, _yuneta_gobj_js.createElement2)([
78194
79102
  "a",
78195
79103
  {
78196
79104
  class: `dropdown-item YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
78197
- href: "#"
79105
+ href: "#",
79106
+ title: name,
79107
+ "aria-label": name
78198
79108
  },
78199
79109
  [[
78200
79110
  "span",
78201
79111
  { class: "YUI_PERIOD_MODE_TEXT" },
78202
- mode_name(mode)
79112
+ name
78203
79113
  ]]
78204
79114
  ]);
78205
79115
  $item.addEventListener("click", (ev) => {
@@ -78497,7 +79407,11 @@ function render_calendar(gobj) {
78497
79407
  "button",
78498
79408
  {
78499
79409
  class: "button is-ghost mt-2 YUI_PERIOD_CAL_TODAY",
78500
- type: "button"
79410
+ type: "button",
79411
+ title: (0, i18next.t)("today"),
79412
+ "data-i18n-title": "today",
79413
+ "aria-label": (0, i18next.t)("today"),
79414
+ "data-i18n-aria-label": "today"
78501
79415
  },
78502
79416
  [[
78503
79417
  "span",
@@ -78825,8 +79739,11 @@ function ac_language_changed(gobj, event, kw, src) {
78825
79739
  let priv = gobj.priv;
78826
79740
  for (let mode of priv.modes) {
78827
79741
  if (!mode.$btn) continue;
79742
+ let name = mode_name(mode);
78828
79743
  let $text = mode.$btn.querySelector(".YUI_PERIOD_MODE_TEXT");
78829
- if ($text) $text.textContent = mode_name(mode);
79744
+ if ($text) $text.textContent = name;
79745
+ mode.$btn.setAttribute("title", name);
79746
+ mode.$btn.setAttribute("aria-label", name);
78830
79747
  }
78831
79748
  repaint(gobj);
78832
79749
  if (priv.$calendar) render_calendar(gobj);
@@ -80258,7 +81175,9 @@ function build_control_bar() {
80258
81175
  "data-dir": key,
80259
81176
  type: "button",
80260
81177
  title: (0, i18next.t)(title),
80261
- "data-i18n-title": title
81178
+ "data-i18n-title": title,
81179
+ "aria-label": (0, i18next.t)(title),
81180
+ "data-i18n-aria-label": title
80262
81181
  },
80263
81182
  glyph,
80264
81183
  { click: (ev) => {
@@ -80691,7 +81610,9 @@ function setup_json_pad(self) {
80691
81610
  }
80692
81611
  //#endregion
80693
81612
  exports.EditControl = EditControl;
81613
+ exports.ICONS_TOPIC = ICONS_TOPIC;
80694
81614
  exports.MarkerControl = MarkerControl;
81615
+ exports.USER_ICON_PREFIX = USER_ICON_PREFIX;
80695
81616
  exports.YUI_FILE_ACCEPT = YUI_FILE_ACCEPT;
80696
81617
  exports.YUI_PERIODS = YUI_PERIODS;
80697
81618
  exports.YUI_PERIODS_DEFAULT = YUI_PERIODS_DEFAULT;
@@ -80770,6 +81691,11 @@ exports.yui_file_read = yui_file_read;
80770
81691
  exports.yui_file_sha256 = yui_file_sha256;
80771
81692
  exports.yui_file_size_label = yui_file_size_label;
80772
81693
  exports.yui_files_manifest = yui_files_manifest;
81694
+ exports.yui_icon_is_defined = yui_icon_is_defined;
81695
+ exports.yui_icons_list = yui_icons_list;
81696
+ exports.yui_icons_put_user = yui_icons_put_user;
81697
+ exports.yui_icons_remove_user = yui_icons_remove_user;
81698
+ exports.yui_icons_set_user = yui_icons_set_user;
80773
81699
  exports.yui_is_dark = yui_is_dark;
80774
81700
  exports.yui_mount_service_view = yui_mount_service_view;
80775
81701
  exports.yui_shell_close_drawer = yui_shell_close_drawer;
@@ -80799,8 +81725,11 @@ exports.yui_shell_show_route_map = yui_shell_show_route_map;
80799
81725
  exports.yui_shell_show_warning = yui_shell_show_warning;
80800
81726
  exports.yui_shell_toggle_drawer = yui_shell_toggle_drawer;
80801
81727
  exports.yui_shell_unpark_route = yui_shell_unpark_route;
81728
+ exports.yui_svg_icon_element = yui_svg_icon_element;
81729
+ exports.yui_svg_sanitize = yui_svg_sanitize;
80802
81730
  exports.yui_theme_now = yui_theme_now;
80803
81731
  exports.yui_toolbar = yui_toolbar;
81732
+ exports.yui_user_icon_class = yui_user_icon_class;
80804
81733
  exports.yui_watch_theme = yui_watch_theme;
80805
81734
 
80806
81735
  //# sourceMappingURL=gobj-ui.cjs.js.map