@yuneta/gobj-ui 7.27.28 → 7.27.29

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.
@@ -1,4 +1,4 @@
1
- import { SDATA, SDATA_END, clean_name, createElement2, createOneHtml, create_template_record, data_type_t, debounce, delete_from_list, duplicate_objects, empty_json, empty_string, escapeHtml, event_flag_t, flat_diff, gclass_create, gclass_find_by_name, gclass_flag_t, getPositionRelativeToBody, gobj_bottom_gobj, gobj_change_state, gobj_command, gobj_create, gobj_create_pure_child, gobj_create_service, gobj_current_state, gobj_destroy, gobj_find_child, gobj_find_service, gobj_full_name, gobj_gclass_name, gobj_get_gclass_trace_level2, gobj_global_trace_level, gobj_global_trace_no_level, gobj_has_event, gobj_is_destroying, gobj_is_playing, gobj_is_pure_child, gobj_is_running, gobj_is_service, gobj_is_volatil, gobj_match_children, gobj_name, gobj_parent, gobj_post_event, gobj_publish_event, gobj_read_attr, gobj_read_bool_attr, gobj_read_integer_attr, gobj_read_pointer_attr, gobj_read_str_attr, gobj_save_persistent_attrs, gobj_send_event, gobj_set_trace_machine_format, gobj_short_name, gobj_start, gobj_start_tree, gobj_stop, gobj_stop_children, gobj_subscribe_event, gobj_unsubscribe_event, gobj_write_attr, gobj_write_bool_attr, gobj_write_integer_attr, gobj_write_str_attr, gobj_yuno, gobj_yuno_name, html_markup, is_array, is_boolean, is_date, is_gobj, is_null, is_number, is_object, is_string, json2flat, json_deep_copy, json_is_identical, json_object_size, json_object_update, json_object_update_missing, json_size, kw_clone_by_keys, kw_flag_t, kw_get_dict, kw_get_dict_value, kw_get_int, kw_get_local_storage_value, kw_get_str, kw_has_key, kw_remove_local_storage_value, kw_set_dict_value, kw_set_local_storage_value, kwid_find_one_record, kwid_new_dict, log_error, log_warning, msg_iev_get_stack, parseBoolean, parseSVG, refresh_language, safeSrc, sdata_flag_t, set_console_log_enabled, set_log_callback, sprintf, str_in_list, template_get_field_desc, trace_level_t, trace_msg, treedb_decoder_fkey, treedb_encoder_fkey, treedb_get_field_desc, treedb_hook_data_size } from "@yuneta/gobj-js";
1
+ import { SDATA, SDATA_END, clean_name, clear_timeout, createElement2, createOneHtml, create_template_record, data_type_t, debounce, delete_from_list, duplicate_objects, empty_json, empty_string, escapeHtml, event_flag_t, flat_diff, gclass_create, gclass_find_by_name, gclass_flag_t, getPositionRelativeToBody, gobj_bottom_gobj, gobj_change_state, gobj_command, gobj_create, gobj_create_pure_child, gobj_create_service, gobj_current_state, gobj_destroy, gobj_find_child, gobj_find_service, gobj_full_name, gobj_gclass_name, gobj_get_gclass_trace_level2, gobj_global_trace_level, gobj_global_trace_no_level, gobj_has_event, gobj_is_destroying, gobj_is_playing, gobj_is_pure_child, gobj_is_running, gobj_is_service, gobj_is_volatil, gobj_match_children, gobj_name, gobj_parent, gobj_post_event, gobj_publish_event, gobj_read_attr, gobj_read_bool_attr, gobj_read_integer_attr, gobj_read_pointer_attr, gobj_read_str_attr, gobj_save_persistent_attrs, gobj_send_event, gobj_set_trace_machine_format, gobj_short_name, gobj_start, gobj_start_tree, gobj_stop, gobj_stop_children, gobj_subscribe_event, gobj_unsubscribe_event, gobj_write_attr, gobj_write_bool_attr, gobj_write_integer_attr, gobj_write_str_attr, gobj_yuno, gobj_yuno_name, html_markup, is_array, is_boolean, is_date, is_gobj, is_null, is_number, is_object, is_string, json2flat, json_deep_copy, json_is_identical, json_object_size, json_object_update, json_object_update_missing, json_size, kw_clone_by_keys, kw_flag_t, kw_get_dict, kw_get_dict_value, kw_get_int, kw_get_local_storage_value, kw_get_str, kw_has_key, kw_remove_local_storage_value, kw_set_dict_value, kw_set_local_storage_value, kwid_find_one_record, kwid_new_dict, log_error, log_info, log_warning, msg_iev_get_stack, parseBoolean, parseSVG, refresh_language, safeSrc, sdata_flag_t, set_console_log_enabled, set_log_callback, set_timeout_periodic, sprintf, str_in_list, template_get_field_desc, trace_level_t, trace_msg, treedb_decoder_fkey, treedb_encoder_fkey, treedb_get_field_desc, treedb_hook_data_size } from "@yuneta/gobj-js";
2
2
  import i18next, { t } from "i18next";
3
3
  import TomSelect from "tom-select";
4
4
  import { createJSONEditor } from "vanilla-jsoneditor";
@@ -1219,7 +1219,7 @@ function secondary_nav_renders(item, layout) {
1219
1219
  /***************************************************************
1220
1220
  * Constants
1221
1221
  ***************************************************************/
1222
- var GCLASS_NAME$22 = "C_YUI_SHELL";
1222
+ var GCLASS_NAME$23 = "C_YUI_SHELL";
1223
1223
  var __live_shells__ = [];
1224
1224
  var __retiring_shell__ = null;
1225
1225
  var __dead_entries__ = /* @__PURE__ */ new Set();
@@ -1246,7 +1246,7 @@ var LAYER_DEFS = [
1246
1246
  /***************************************************************
1247
1247
  * Attrs
1248
1248
  ***************************************************************/
1249
- var attrs_table$22 = [
1249
+ var attrs_table$23 = [
1250
1250
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
1251
1251
  SDATA(data_type_t.DTP_JSON, "config", 0, null, "Shell declarative config (zones, menu, stages, toolbar)"),
1252
1252
  SDATA(data_type_t.DTP_STRING, "default_route", 0, "", "Fallback route if hash is empty"),
@@ -1257,7 +1257,7 @@ var attrs_table$22 = [
1257
1257
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Root HTMLElement of the shell"),
1258
1258
  SDATA_END()
1259
1259
  ];
1260
- var PRIVATE_DATA$22 = {
1260
+ var PRIVATE_DATA$23 = {
1261
1261
  zones: {},
1262
1262
  layers: {},
1263
1263
  window_layer: null,
@@ -1300,14 +1300,14 @@ var PRIVATE_DATA$22 = {
1300
1300
  connected: null,
1301
1301
  active_dropdown: null
1302
1302
  };
1303
- var __gclass__$22 = null;
1303
+ var __gclass__$23 = null;
1304
1304
  /******************************
1305
1305
  * Framework Methods
1306
1306
  ******************************/
1307
1307
  /***************************************************************
1308
1308
  * Framework Method: Create
1309
1309
  ***************************************************************/
1310
- function mt_create$22(gobj) {
1310
+ function mt_create$23(gobj) {
1311
1311
  const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
1312
1312
  if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
1313
1313
  __live_shells__.push(gobj);
@@ -1317,7 +1317,7 @@ function mt_create$22(gobj) {
1317
1317
  /***************************************************************
1318
1318
  * Framework Method: Start
1319
1319
  ***************************************************************/
1320
- function mt_start$21(gobj) {
1320
+ function mt_start$22(gobj) {
1321
1321
  let config = gobj_read_attr(gobj, "config") || {};
1322
1322
  let priv = gobj.priv;
1323
1323
  if (!validate_config(config)) {
@@ -1461,7 +1461,7 @@ function mt_start$21(gobj) {
1461
1461
  /***************************************************************
1462
1462
  * Framework Method: Stop
1463
1463
  ***************************************************************/
1464
- function mt_stop$20(gobj) {
1464
+ function mt_stop$21(gobj) {
1465
1465
  let priv = gobj.priv;
1466
1466
  if (!priv) return 0;
1467
1467
  retire_overlays(gobj);
@@ -1525,7 +1525,7 @@ function mt_stop$20(gobj) {
1525
1525
  /***************************************************************
1526
1526
  * Framework Method: Destroy
1527
1527
  ***************************************************************/
1528
- function mt_destroy$22(gobj) {
1528
+ function mt_destroy$23(gobj) {
1529
1529
  retire_overlays(gobj);
1530
1530
  close_toolbar_dropdown(gobj);
1531
1531
  let live_idx = __live_shells__.indexOf(gobj);
@@ -3658,15 +3658,15 @@ function mt_publication_pre_filter(gobj, subs, event, kw) {
3658
3658
  if (!subscriber || !gobj_has_event(subscriber, event, 0)) return 0;
3659
3659
  return 1;
3660
3660
  }
3661
- var gmt$22 = {
3662
- mt_create: mt_create$22,
3663
- mt_start: mt_start$21,
3664
- mt_stop: mt_stop$20,
3665
- mt_destroy: mt_destroy$22,
3661
+ var gmt$23 = {
3662
+ mt_create: mt_create$23,
3663
+ mt_start: mt_start$22,
3664
+ mt_stop: mt_stop$21,
3665
+ mt_destroy: mt_destroy$23,
3666
3666
  mt_publication_pre_filter
3667
3667
  };
3668
- function create_gclass$22(gclass_name) {
3669
- if (__gclass__$22) {
3668
+ function create_gclass$23(gclass_name) {
3669
+ if (__gclass__$23) {
3670
3670
  log_error(`GClass ALREADY created: ${gclass_name}`);
3671
3671
  return -1;
3672
3672
  }
@@ -3709,12 +3709,12 @@ function create_gclass$22(gclass_name) {
3709
3709
  ["EV_ICONS_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3710
3710
  ["EV_CONNECTION_STATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
3711
3711
  ];
3712
- __gclass__$22 = gclass_create(gclass_name, event_types, states, gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
3713
- if (!__gclass__$22) return -1;
3712
+ __gclass__$23 = gclass_create(gclass_name, event_types, states, gmt$23, 0, attrs_table$23, PRIVATE_DATA$23, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
3713
+ if (!__gclass__$23) return -1;
3714
3714
  return 0;
3715
3715
  }
3716
3716
  function register_c_yui_shell() {
3717
- return create_gclass$22(GCLASS_NAME$22);
3717
+ return create_gclass$23(GCLASS_NAME$23);
3718
3718
  }
3719
3719
  /***************************************************************
3720
3720
  * Public helpers — exported alongside register_c_yui_shell().
@@ -3834,7 +3834,7 @@ function yui_shell_previous_route(shell_gobj) {
3834
3834
  function yui_shell_of(gobj) {
3835
3835
  let g = gobj;
3836
3836
  while (g) {
3837
- if (gobj_gclass_name(g) === GCLASS_NAME$22) return g;
3837
+ if (gobj_gclass_name(g) === GCLASS_NAME$23) return g;
3838
3838
  g = gobj_parent(g);
3839
3839
  }
3840
3840
  return __live_shells__.length > 0 ? __live_shells__[__live_shells__.length - 1] : null;
@@ -4335,6 +4335,9 @@ function yui_shell_popup_layer(shell) {
4335
4335
  let priv = shell.priv;
4336
4336
  return priv && priv.layers && priv.layers.popup || null;
4337
4337
  }
4338
+ function yui_shell_notification_layer(shell) {
4339
+ return notification_layer(shell) || null;
4340
+ }
4338
4341
  /***************************************************************
4339
4342
  * i18n bridge:
4340
4343
  * - `text` is rendered as the canonical English key.
@@ -4947,7 +4950,7 @@ function yui_shell_confirm_yesnocancel(shell, message, opts) {
4947
4950
  /***************************************************************
4948
4951
  * Constants
4949
4952
  ***************************************************************/
4950
- var GCLASS_NAME$21 = "C_YUI_WINDOW";
4953
+ var GCLASS_NAME$22 = "C_YUI_WINDOW";
4951
4954
  var WC_MIN = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"3\" y=\"11\" width=\"10\" height=\"1.6\" rx=\"0.8\" fill=\"currentColor\"/></svg>";
4952
4955
  var WC_MAX = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"3.3\" y=\"3.3\" width=\"9.4\" height=\"9.4\" rx=\"1.6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"/></svg>";
4953
4956
  var WC_RESTORE = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"5.2\" y=\"3\" width=\"7.8\" height=\"7.8\" rx=\"1.3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"/><rect x=\"3\" y=\"5.2\" width=\"7.8\" height=\"7.8\" rx=\"1.3\" fill=\"var(--bulma-scheme-main)\" stroke=\"currentColor\" stroke-width=\"1.4\"/></svg>";
@@ -4960,7 +4963,7 @@ var __title_seq__ = 0;
4960
4963
  /***************************************************************
4961
4964
  * Data
4962
4965
  ***************************************************************/
4963
- var attrs_table$21 = [
4966
+ var attrs_table$22 = [
4964
4967
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
4965
4968
  SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to the window layer of the shell (document.body while there is none), following the shell when it is destroyed or another is built"),
4966
4969
  SDATA(data_type_t.DTP_INTEGER, "x", 0, "300", "X position"),
@@ -4998,7 +5001,7 @@ var attrs_table$21 = [
4998
5001
  SDATA(data_type_t.DTP_POINTER, "win_resize_handler", 0, null, "Internal: native window 'resize' listener"),
4999
5002
  SDATA_END()
5000
5003
  ];
5001
- var PRIVATE_DATA$21 = {
5004
+ var PRIVATE_DATA$22 = {
5002
5005
  prevSize: 0,
5003
5006
  placed_by_shell: false,
5004
5007
  back_shell: null,
@@ -5007,14 +5010,14 @@ var PRIVATE_DATA$21 = {
5007
5010
  release_focus: null,
5008
5011
  escape_order: 0
5009
5012
  };
5010
- var __gclass__$21 = null;
5013
+ var __gclass__$22 = null;
5011
5014
  /******************************
5012
5015
  * Framework Methods
5013
5016
  ******************************/
5014
5017
  /***************************************************************
5015
5018
  * Framework Method: Create
5016
5019
  ***************************************************************/
5017
- function mt_create$21(gobj) {
5020
+ function mt_create$22(gobj) {
5018
5021
  const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
5019
5022
  if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
5020
5023
  let window_id = "window-" + clean_name(gobj_short_name(gobj));
@@ -5077,7 +5080,7 @@ function mt_create$21(gobj) {
5077
5080
  * it could not be seen, and the next Tab gave it back to the
5078
5081
  * overlay; it opens under it now, and is there when it goes.
5079
5082
  ***************************************************************/
5080
- function mt_start$20(gobj) {
5083
+ function mt_start$21(gobj) {
5081
5084
  let priv = gobj.priv;
5082
5085
  let $container = gobj_read_attr(gobj, "$container");
5083
5086
  if (!$container) {
@@ -5096,7 +5099,7 @@ function mt_start$20(gobj) {
5096
5099
  /***************************************************************
5097
5100
  * Framework Method: Destroy
5098
5101
  ***************************************************************/
5099
- function mt_destroy$21(gobj) {
5102
+ function mt_destroy$22(gobj) {
5100
5103
  let priv = gobj.priv;
5101
5104
  give_focus_back(gobj);
5102
5105
  yui_shell_unwatch_changes(gobj);
@@ -5380,7 +5383,7 @@ function resolve_manager(gobj) {
5380
5383
  if (typeof m === "string") {
5381
5384
  let name = m;
5382
5385
  m = gobj_find_service(name, false) || null;
5383
- if (!m) log_warning(`${GCLASS_NAME$21}: window manager '${name}' not found: no dock, no minimize`);
5386
+ if (!m) log_warning(`${GCLASS_NAME$22}: window manager '${name}' not found: no dock, no minimize`);
5384
5387
  gobj_write_attr(gobj, "manager", m);
5385
5388
  }
5386
5389
  return m;
@@ -6131,7 +6134,7 @@ function ac_close(gobj, event, kw, src) {
6131
6134
  * still being built would sit under its first route. Back no
6132
6135
  * longer closes such a window; its ✕ does, as before 7.26.31.
6133
6136
  ************************************************************/
6134
- function ac_shell_changed$1(gobj, event, kw, src) {
6137
+ function ac_shell_changed$2(gobj, event, kw, src) {
6135
6138
  let priv = gobj.priv;
6136
6139
  let going = gobj_is_destroying(src);
6137
6140
  if (going && priv.back_shell === src) {
@@ -6157,16 +6160,16 @@ function ac_shell_changed$1(gobj, event, kw, src) {
6157
6160
  /***************************
6158
6161
  * FSM
6159
6162
  ***************************/
6160
- var gmt$21 = {
6161
- mt_create: mt_create$21,
6162
- mt_start: mt_start$20,
6163
- mt_destroy: mt_destroy$21
6163
+ var gmt$22 = {
6164
+ mt_create: mt_create$22,
6165
+ mt_start: mt_start$21,
6166
+ mt_destroy: mt_destroy$22
6164
6167
  };
6165
6168
  /***************************************************************
6166
6169
  * Create the GClass
6167
6170
  ***************************************************************/
6168
- function create_gclass$21(gclass_name) {
6169
- if (__gclass__$21) {
6171
+ function create_gclass$22(gclass_name) {
6172
+ if (__gclass__$22) {
6170
6173
  log_error(`GClass ALREADY created: ${gclass_name}`);
6171
6174
  return -1;
6172
6175
  }
@@ -6193,7 +6196,7 @@ function create_gclass$21(gclass_name) {
6193
6196
  ],
6194
6197
  [
6195
6198
  "EV_SHELL_CHANGED",
6196
- ac_shell_changed$1,
6199
+ ac_shell_changed$2,
6197
6200
  null
6198
6201
  ]
6199
6202
  ]]];
@@ -6207,15 +6210,15 @@ function create_gclass$21(gclass_name) {
6207
6210
  ["EV_CLOSE_WINDOW", 0],
6208
6211
  ["EV_SHELL_CHANGED", 0]
6209
6212
  ];
6210
- __gclass__$21 = gclass_create(gclass_name, event_types, states, gmt$21, 0, attrs_table$21, PRIVATE_DATA$21, 0, 0, 0, 0);
6211
- if (!__gclass__$21) return -1;
6213
+ __gclass__$22 = gclass_create(gclass_name, event_types, states, gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, 0);
6214
+ if (!__gclass__$22) return -1;
6212
6215
  return 0;
6213
6216
  }
6214
6217
  /***************************************************************
6215
6218
  * Register GClass
6216
6219
  ***************************************************************/
6217
6220
  function register_c_yui_window() {
6218
- return create_gclass$21(GCLASS_NAME$21);
6221
+ return create_gclass$22(GCLASS_NAME$22);
6219
6222
  }
6220
6223
  //#endregion
6221
6224
  //#region src/c_yui_window_manager.js
@@ -6262,14 +6265,14 @@ function register_c_yui_window() {
6262
6265
  /***************************************************************
6263
6266
  * Constants
6264
6267
  ***************************************************************/
6265
- var GCLASS_NAME$20 = "C_YUI_WINDOW_MANAGER";
6268
+ var GCLASS_NAME$21 = "C_YUI_WINDOW_MANAGER";
6266
6269
  var DOCK_Z = 1e6;
6267
6270
  var WC_X = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/></svg>";
6268
6271
  var __chip_seq__ = 0;
6269
6272
  /***************************************************************
6270
6273
  * Data
6271
6274
  ***************************************************************/
6272
- var attrs_table$20 = [
6275
+ var attrs_table$21 = [
6273
6276
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
6274
6277
  SDATA(data_type_t.DTP_STRING, "dock_mode", 0, "floating", "floating | inline | responsive (floating on wide screens, inline on narrow)"),
6275
6278
  SDATA(data_type_t.DTP_STRING, "dock_corner", 0, "bottom-left", "Floating placement: top-left | top-right | bottom-left | bottom-right"),
@@ -6279,20 +6282,20 @@ var attrs_table$20 = [
6279
6282
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Internal: the dock element"),
6280
6283
  SDATA_END()
6281
6284
  ];
6282
- var PRIVATE_DATA$20 = {
6285
+ var PRIVATE_DATA$21 = {
6283
6286
  windows: null,
6284
6287
  mql: null,
6285
6288
  mql_handler: null,
6286
6289
  lang_shell: null
6287
6290
  };
6288
- var __gclass__$20 = null;
6291
+ var __gclass__$21 = null;
6289
6292
  /******************************
6290
6293
  * Framework Methods
6291
6294
  ******************************/
6292
6295
  /***************************************************************
6293
6296
  * Framework Method: Create
6294
6297
  ***************************************************************/
6295
- function mt_create$20(gobj) {
6298
+ function mt_create$21(gobj) {
6296
6299
  let priv = gobj.priv;
6297
6300
  priv.windows = [];
6298
6301
  if ((gobj_read_attr(gobj, "dock_mode") || "floating") === "responsive") {
@@ -6305,14 +6308,14 @@ function mt_create$20(gobj) {
6305
6308
  }
6306
6309
  build_dock(gobj);
6307
6310
  yui_shell_watch_changes(gobj);
6308
- follow_language(gobj);
6311
+ follow_language$1(gobj);
6309
6312
  const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
6310
6313
  if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
6311
6314
  }
6312
6315
  /***************************************************************
6313
6316
  * Framework Method: Destroy
6314
6317
  ***************************************************************/
6315
- function mt_destroy$20(gobj) {
6318
+ function mt_destroy$21(gobj) {
6316
6319
  let priv = gobj.priv;
6317
6320
  yui_shell_unwatch_changes(gobj);
6318
6321
  if (priv.lang_shell) {
@@ -6338,7 +6341,7 @@ function mt_destroy$20(gobj) {
6338
6341
  * composed title, which no key carries: it is written again in
6339
6342
  * the new language (ac_language_changed).
6340
6343
  ************************************************************/
6341
- function follow_language(gobj) {
6344
+ function follow_language$1(gobj) {
6342
6345
  let priv = gobj.priv;
6343
6346
  let shell = yui_shell_of(gobj);
6344
6347
  if (shell && gobj_is_destroying(shell)) shell = null;
@@ -6849,9 +6852,9 @@ function ac_toggle_window(gobj, event, kw, src) {
6849
6852
  * logout, detached, until a window registered. Its language
6850
6853
  * is the new shell's too.
6851
6854
  ************************************************************/
6852
- function ac_shell_changed(gobj, event, kw, src) {
6855
+ function ac_shell_changed$1(gobj, event, kw, src) {
6853
6856
  apply_placement(gobj);
6854
- follow_language(gobj);
6857
+ follow_language$1(gobj);
6855
6858
  return 0;
6856
6859
  }
6857
6860
  /************************************************************
@@ -6863,7 +6866,7 @@ function ac_shell_changed(gobj, event, kw, src) {
6863
6866
  * language the window was opened in (a reader took the
6864
6867
  * aria-labelledby, which changed; the tooltip did not).
6865
6868
  ************************************************************/
6866
- function ac_language_changed$12(gobj, event, kw, src) {
6869
+ function ac_language_changed$13(gobj, event, kw, src) {
6867
6870
  let priv = gobj.priv;
6868
6871
  for (let entry of priv.windows) {
6869
6872
  if (!entry.title_prefix || !entry.$chip) continue;
@@ -6881,19 +6884,19 @@ function ac_language_changed$12(gobj, event, kw, src) {
6881
6884
  /***************************
6882
6885
  * FSM
6883
6886
  ***************************/
6884
- var gmt$20 = {
6885
- mt_create: mt_create$20,
6886
- mt_destroy: mt_destroy$20
6887
+ var gmt$21 = {
6888
+ mt_create: mt_create$21,
6889
+ mt_destroy: mt_destroy$21
6887
6890
  };
6888
6891
  /***************************************************************
6889
6892
  * Create the GClass
6890
6893
  ***************************************************************/
6891
- function create_gclass$20(gclass_name) {
6892
- if (__gclass__$20) {
6894
+ function create_gclass$21(gclass_name) {
6895
+ if (__gclass__$21) {
6893
6896
  log_error(`GClass ALREADY created: ${gclass_name}`);
6894
6897
  return -1;
6895
6898
  }
6896
- __gclass__$20 = gclass_create(gclass_name, [
6899
+ __gclass__$21 = gclass_create(gclass_name, [
6897
6900
  ["EV_REGISTER_WINDOW", 0],
6898
6901
  ["EV_UNREGISTER_WINDOW", 0],
6899
6902
  ["EV_MINIMIZE_WINDOW", 0],
@@ -6927,6 +6930,607 @@ function create_gclass$20(gclass_name) {
6927
6930
  ac_toggle_window,
6928
6931
  null
6929
6932
  ],
6933
+ [
6934
+ "EV_SHELL_CHANGED",
6935
+ ac_shell_changed$1,
6936
+ null
6937
+ ],
6938
+ [
6939
+ "EV_LANGUAGE_CHANGED",
6940
+ ac_language_changed$13,
6941
+ null
6942
+ ]
6943
+ ]]], gmt$21, 0, attrs_table$21, PRIVATE_DATA$21, 0, 0, 0, 0);
6944
+ if (!__gclass__$21) return -1;
6945
+ return 0;
6946
+ }
6947
+ /***************************************************************
6948
+ * Register GClass
6949
+ ***************************************************************/
6950
+ function register_c_yui_window_manager() {
6951
+ return create_gclass$21(GCLASS_NAME$21);
6952
+ }
6953
+ //#endregion
6954
+ //#region src/yui_build_stamp.js
6955
+ /***********************************************************************
6956
+ * yui_build_stamp.js
6957
+ *
6958
+ * Which build is this page, and which build does the server
6959
+ * hand out now.
6960
+ *
6961
+ * The build writes its own identity into index.html as
6962
+ *
6963
+ * <meta name="yuneta-build" content="<stamp>" data-version="<version>">
6964
+ *
6965
+ * (vite-plugin-yuneta-html.js, at build time only). The stamp is
6966
+ * a hash of the NAMES of every file of the bundle, and those
6967
+ * names carry the hash of their content: the same code built
6968
+ * twice gives the same stamp, and any change of a chunk, of a
6969
+ * lazy chunk or of a stylesheet gives another. A build date
6970
+ * would announce a "new version" after every rebuild of
6971
+ * unchanged code, and the deploy round rebuilds every app after
6972
+ * each publication of this library.
6973
+ *
6974
+ * The page that runs reads its stamp from its own DOM, where the
6975
+ * meta is never touched again; the deployed one is read from the
6976
+ * text of the same document fetched again. Pure functions: the
6977
+ * gclass that compares them is C_YUI_UPDATE_WATCH.
6978
+ *
6979
+ * Copyright (c) 2026, ArtGins.
6980
+ * All Rights Reserved.
6981
+ ***********************************************************************/
6982
+ var BUILD_META_NAME = "yuneta-build";
6983
+ /************************************************************
6984
+ * The build of the page that runs: {stamp, version}, or
6985
+ * null when its document carries no stamp (`vite dev`, or
6986
+ * an app built without the plugin).
6987
+ ************************************************************/
6988
+ function running_build(doc) {
6989
+ if (!doc || typeof doc.querySelector !== "function") return null;
6990
+ let $meta = doc.querySelector(`meta[name="${BUILD_META_NAME}"]`);
6991
+ if (!$meta) return null;
6992
+ let stamp = $meta.getAttribute("content") || "";
6993
+ if (!stamp) return null;
6994
+ return {
6995
+ stamp,
6996
+ version: $meta.getAttribute("data-version") || ""
6997
+ };
6998
+ }
6999
+ /************************************************************
7000
+ * The build named by the text of an index.html: {stamp,
7001
+ * version}, or null when the text carries no stamp -- an
7002
+ * error page, a captive portal, or a build older than the
7003
+ * stamp. Null is NOT "another build": a hotel wifi that
7004
+ * answers 200 with its own login page must not tell the
7005
+ * reader to reload into it.
7006
+ ************************************************************/
7007
+ function parse_build(html) {
7008
+ if (typeof html !== "string" || !html) return null;
7009
+ let metas = html.match(/<meta\b[^>]*>/gi) || [];
7010
+ for (let tag of metas) {
7011
+ if (read_html_attr(tag, "name") !== "yuneta-build") continue;
7012
+ let stamp = read_html_attr(tag, "content");
7013
+ if (!stamp) return null;
7014
+ return {
7015
+ stamp,
7016
+ version: read_html_attr(tag, "data-version")
7017
+ };
7018
+ }
7019
+ return null;
7020
+ }
7021
+ /************************************************************
7022
+ * The value of one attribute of one tag's text, quoted
7023
+ * with " or ' (the plugin writes ", a minifier may not).
7024
+ * The entities the plugin escapes are read back.
7025
+ ************************************************************/
7026
+ function read_html_attr(tag, name) {
7027
+ let re = new RegExp(`\\s${name}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i");
7028
+ let m = tag.match(re);
7029
+ if (!m) return "";
7030
+ return (m[2] !== void 0 ? m[2] : m[3]).replace(/&quot;/g, "\"").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
7031
+ }
7032
+ /************************************************************
7033
+ * The url to ask for the deployed document: the page's own,
7034
+ * without its hash. Every route of these apps is a hash, so
7035
+ * this is the deploy root, whatever path the app is served
7036
+ * under.
7037
+ ************************************************************/
7038
+ function build_page_url(loc) {
7039
+ if (!loc) return "";
7040
+ return `${loc.origin || ""}${loc.pathname || "/"}${loc.search || ""}`;
7041
+ }
7042
+ //#endregion
7043
+ //#region src/c_yui_update_watch.js
7044
+ /***********************************************************************
7045
+ * c_yui_update_watch.js
7046
+ *
7047
+ * Is this page still running the build that is deployed?
7048
+ *
7049
+ * Every route of these apps is a hash: moving around reloads
7050
+ * nothing, and neither does a login or a logout. A page opened
7051
+ * before a deploy runs the old bundle until somebody reloads it
7052
+ * by hand, and the only symptom is that a fix "did not work" --
7053
+ * or worse: the deploy deleted the old lazy chunks, and the old
7054
+ * page breaks the first time it opens a view it had not loaded.
7055
+ *
7056
+ * This service compares the build of the page (yui_build_stamp.js,
7057
+ * the stamp the build writes into index.html) with the one the
7058
+ * server hands out now, fetching that same document with
7059
+ * `cache: "no-store"`. A difference is SAID, never acted on: a
7060
+ * bar with the new version, a reload button and a ✕. Reloading
7061
+ * is the reader's call -- they may be in the middle of something.
7062
+ *
7063
+ * When it asks (every one an event, through the FSM):
7064
+ * - at start;
7065
+ * - the tab comes back to the front, or the window gets the
7066
+ * focus (at most once each `min_interval_ms`);
7067
+ * - the browser is online again;
7068
+ * - a lazy chunk failed to load (`vite:preloadError`): the
7069
+ * symptom of exactly this, so it asks at once;
7070
+ * - every `period_ms`: a screen that is always in view (a
7071
+ * control room, a wall display) never gets the focus back.
7072
+ * A periodic query is a discarded pattern in Yuneta; THIS
7073
+ * one is a deliberate exception approved by the user
7074
+ * (2026-10-21), for every SPA. 0 turns it off;
7075
+ * - whenever the app sends EV_CHECK_BUILD -- on its backend's
7076
+ * EV_ON_OPEN, typically: a backend deploy often comes with
7077
+ * a deploy of the SPA.
7078
+ *
7079
+ * A build that comes back to the running one (a rollback) takes
7080
+ * the bar away again. A page with no stamp (`vite dev`) watches
7081
+ * nothing.
7082
+ *
7083
+ * The bar lives in the shell's notification layer, above its
7084
+ * dialogs; with no shell (the login, between a logout and the
7085
+ * next login) in document.body. It follows the shell across a
7086
+ * logout (yui_shell_watch_changes()), as the dock does.
7087
+ *
7088
+ * Usage (an app, once, after creating the yuno):
7089
+ *
7090
+ * register_c_yui_update_watch();
7091
+ * const watch = gobj_create_service(
7092
+ * "__update_watch__", "C_YUI_UPDATE_WATCH", {}, yuno
7093
+ * );
7094
+ * gobj_start(watch);
7095
+ *
7096
+ * // on its backend's EV_ON_OPEN:
7097
+ * gobj_send_event(watch, "EV_CHECK_BUILD", {}, gobj);
7098
+ *
7099
+ * Input events:
7100
+ * EV_CHECK_BUILD {force?} ask the server (force skips
7101
+ * the minimum interval)
7102
+ * EV_RELOAD {} the bar's reload button
7103
+ * EV_DISMISS {} the bar's ✕: hidden for THIS
7104
+ * build, a later one shows it
7105
+ *
7106
+ * Output events (optional subscribers):
7107
+ * EV_NEW_BUILD {running, deployed, version}
7108
+ * EV_BUILD_CURRENT {running} the deployed build is the
7109
+ * running one again
7110
+ *
7111
+ * Copyright (c) 2026, ArtGins.
7112
+ * All Rights Reserved.
7113
+ ***********************************************************************/
7114
+ /***************************************************************
7115
+ * Constants
7116
+ ***************************************************************/
7117
+ var GCLASS_NAME$20 = "C_YUI_UPDATE_WATCH";
7118
+ /***************************************************************
7119
+ * Data
7120
+ ***************************************************************/
7121
+ var attrs_table$20 = [
7122
+ SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
7123
+ SDATA(data_type_t.DTP_INTEGER, "min_interval_ms", 0, "60000", "Minimum time between two checks, except a forced one"),
7124
+ SDATA(data_type_t.DTP_INTEGER, "period_ms", 0, "3600000", "Periodic check, for a screen that never gets the focus back; 0 = off (user-approved exception to No polling)"),
7125
+ SDATA(data_type_t.DTP_BOOLEAN, "with_bar", 0, "1", "Show the bar; false leaves EV_NEW_BUILD to the app"),
7126
+ SDATA(data_type_t.DTP_POINTER, "before_reload", 0, null, "fn() -> bool|Promise<bool>, asked before the reload; false vetoes it (unsaved edits)"),
7127
+ SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "Where the bar mounts (default: the shell's notification layer, document.body while there is none)"),
7128
+ SDATA_END()
7129
+ ];
7130
+ var PRIVATE_DATA$20 = {
7131
+ running: null,
7132
+ deployed: null,
7133
+ dismissed: "",
7134
+ in_flight: false,
7135
+ last_check: 0,
7136
+ failing: false,
7137
+ gobj_timer: null,
7138
+ $bar: null,
7139
+ lang_shell: null,
7140
+ dom_handlers: null
7141
+ };
7142
+ var __gclass__$20 = null;
7143
+ /******************************
7144
+ * Framework Methods
7145
+ ******************************/
7146
+ /***************************************************************
7147
+ * Framework Method: Create
7148
+ ***************************************************************/
7149
+ function mt_create$20(gobj) {
7150
+ let priv = gobj.priv;
7151
+ priv.running = running_build(typeof document !== "undefined" ? document : null);
7152
+ priv.dom_handlers = [];
7153
+ priv.gobj_timer = gobj_create_pure_child(gobj_name(gobj), "C_TIMER", {}, gobj);
7154
+ yui_shell_watch_changes(gobj);
7155
+ follow_language(gobj);
7156
+ const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
7157
+ if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
7158
+ }
7159
+ /***************************************************************
7160
+ * Framework Method: Start
7161
+ ***************************************************************/
7162
+ function mt_start$20(gobj) {
7163
+ let priv = gobj.priv;
7164
+ gobj_start(priv.gobj_timer);
7165
+ if (!priv.running) {
7166
+ log_info(`${gobj_short_name(gobj)}: this page carries no build stamp (vite dev?): nothing to watch`);
7167
+ return 0;
7168
+ }
7169
+ listen_dom(gobj, document, "visibilitychange", () => {
7170
+ if (document.visibilityState === "visible") gobj_send_event(gobj, "EV_CHECK_BUILD", {}, gobj);
7171
+ });
7172
+ listen_dom(gobj, window, "focus", () => {
7173
+ gobj_send_event(gobj, "EV_CHECK_BUILD", {}, gobj);
7174
+ });
7175
+ listen_dom(gobj, window, "online", () => {
7176
+ gobj_send_event(gobj, "EV_CHECK_BUILD", { force: true }, gobj);
7177
+ });
7178
+ listen_dom(gobj, window, "vite:preloadError", () => {
7179
+ gobj_send_event(gobj, "EV_CHECK_BUILD", { force: true }, gobj);
7180
+ });
7181
+ let period = gobj_read_integer_attr(gobj, "period_ms");
7182
+ if (period > 0) set_timeout_periodic(priv.gobj_timer, period);
7183
+ gobj_send_event(gobj, "EV_CHECK_BUILD", { force: true }, gobj);
7184
+ return 0;
7185
+ }
7186
+ /***************************************************************
7187
+ * Framework Method: Stop
7188
+ ***************************************************************/
7189
+ function mt_stop$20(gobj) {
7190
+ let priv = gobj.priv;
7191
+ for (let [target, type, fn] of priv.dom_handlers) target.removeEventListener(type, fn);
7192
+ priv.dom_handlers = [];
7193
+ clear_timeout(priv.gobj_timer);
7194
+ if (gobj_is_running(priv.gobj_timer)) gobj_stop(priv.gobj_timer);
7195
+ }
7196
+ /***************************************************************
7197
+ * Framework Method: Destroy
7198
+ ***************************************************************/
7199
+ function mt_destroy$20(gobj) {
7200
+ let priv = gobj.priv;
7201
+ yui_shell_unwatch_changes(gobj);
7202
+ if (priv.lang_shell) {
7203
+ if (!gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
7204
+ priv.lang_shell = null;
7205
+ }
7206
+ remove_bar(gobj);
7207
+ }
7208
+ /***************************
7209
+ * Local Methods
7210
+ ***************************/
7211
+ /************************************************************
7212
+ * Add a DOM listener, kept to be removed in mt_stop.
7213
+ ************************************************************/
7214
+ function listen_dom(gobj, target, type, fn) {
7215
+ target.addEventListener(type, fn);
7216
+ gobj.priv.dom_handlers.push([
7217
+ target,
7218
+ type,
7219
+ fn
7220
+ ]);
7221
+ }
7222
+ /************************************************************
7223
+ * Hear the language of the shell that holds the bar -- the
7224
+ * bar outlives a shell, so it follows them.
7225
+ ************************************************************/
7226
+ function follow_language(gobj) {
7227
+ let priv = gobj.priv;
7228
+ let shell = yui_shell_of(gobj);
7229
+ if (shell && gobj_is_destroying(shell)) shell = null;
7230
+ if (shell === priv.lang_shell) return;
7231
+ if (priv.lang_shell && !gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
7232
+ priv.lang_shell = null;
7233
+ if (shell) {
7234
+ gobj_subscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
7235
+ priv.lang_shell = shell;
7236
+ }
7237
+ }
7238
+ /************************************************************
7239
+ * Where the bar goes: the host's `$parent`, else the toasts'
7240
+ * layer of the live shell, else the body.
7241
+ ************************************************************/
7242
+ function bar_place(gobj) {
7243
+ let $parent = gobj_read_pointer_attr(gobj, "$parent");
7244
+ if ($parent) return $parent;
7245
+ let shell = yui_shell_of(gobj);
7246
+ if (shell && gobj_is_destroying(shell)) shell = null;
7247
+ return yui_shell_notification_layer(shell) || document.body;
7248
+ }
7249
+ /************************************************************
7250
+ * Show the bar for the deployed build, or move it to its
7251
+ * place. Not shown for a build the reader dismissed.
7252
+ ************************************************************/
7253
+ function show_bar(gobj) {
7254
+ let priv = gobj.priv;
7255
+ if (!gobj_read_bool_attr(gobj, "with_bar")) return;
7256
+ if (!priv.deployed || priv.deployed.stamp === priv.dismissed) {
7257
+ remove_bar(gobj);
7258
+ return;
7259
+ }
7260
+ remove_bar(gobj);
7261
+ priv.$bar = createElement2([
7262
+ "div",
7263
+ {
7264
+ class: `C_YUI_UPDATE_WATCH UPDATE_BAR notification ${yui_tint("info")}`,
7265
+ role: "status"
7266
+ },
7267
+ [
7268
+ [
7269
+ "span",
7270
+ {
7271
+ class: "UPDATE_TEXT",
7272
+ i18n: "new version available"
7273
+ },
7274
+ t("new version available")
7275
+ ],
7276
+ [
7277
+ "span",
7278
+ { class: "UPDATE_VERSION" },
7279
+ text_node(priv.deployed.version)
7280
+ ],
7281
+ [
7282
+ "button",
7283
+ {
7284
+ class: "UPDATE_RELOAD button is-info",
7285
+ type: "button",
7286
+ i18n: "reload",
7287
+ title: t("reload"),
7288
+ "data-i18n-title": "reload",
7289
+ "aria-label": t("reload"),
7290
+ "data-i18n-aria-label": "reload"
7291
+ },
7292
+ t("reload"),
7293
+ { click: () => gobj_send_event(gobj, "EV_RELOAD", {}, gobj) }
7294
+ ],
7295
+ [
7296
+ "button",
7297
+ {
7298
+ class: "UPDATE_DISMISS delete",
7299
+ type: "button",
7300
+ title: t("close"),
7301
+ "data-i18n-title": "close",
7302
+ "aria-label": t("close"),
7303
+ "data-i18n-aria-label": "close"
7304
+ },
7305
+ null,
7306
+ { click: () => gobj_send_event(gobj, "EV_DISMISS", {}, gobj) }
7307
+ ]
7308
+ ]
7309
+ ]);
7310
+ bar_place(gobj).appendChild(priv.$bar);
7311
+ }
7312
+ /************************************************************
7313
+ * Take the bar off the page.
7314
+ ************************************************************/
7315
+ function remove_bar(gobj) {
7316
+ let priv = gobj.priv;
7317
+ if (priv.$bar && priv.$bar.parentNode) priv.$bar.parentNode.removeChild(priv.$bar);
7318
+ priv.$bar = null;
7319
+ }
7320
+ /************************************************************
7321
+ * Ask the server which build it hands out. The answer comes
7322
+ * back as an event (a resolved promise is an OS notification).
7323
+ ************************************************************/
7324
+ function fetch_deployed_build(gobj) {
7325
+ let priv = gobj.priv;
7326
+ priv.in_flight = true;
7327
+ priv.last_check = performance.now();
7328
+ fetch(build_page_url(window.location), {
7329
+ cache: "no-store",
7330
+ credentials: "same-origin"
7331
+ }).then((response) => {
7332
+ if (!response.ok) throw { status: response.status };
7333
+ return response.text();
7334
+ }).then((html) => {
7335
+ if (gobj_is_destroying(gobj)) return;
7336
+ let deployed = parse_build(html);
7337
+ if (!deployed) {
7338
+ gobj_send_event(gobj, "EV_CHECK_FAILED", {
7339
+ reason: "the page served carries no build stamp",
7340
+ network: false
7341
+ }, gobj);
7342
+ return;
7343
+ }
7344
+ gobj_send_event(gobj, "EV_DEPLOYED_BUILD", deployed, gobj);
7345
+ }).catch((err) => {
7346
+ if (gobj_is_destroying(gobj)) return;
7347
+ let http = err && err.status;
7348
+ gobj_send_event(gobj, "EV_CHECK_FAILED", {
7349
+ reason: http ? `HTTP ${err.status}` : String(err && err.message || err),
7350
+ network: !http
7351
+ }, gobj);
7352
+ });
7353
+ }
7354
+ /***************************
7355
+ * Actions
7356
+ ***************************/
7357
+ /************************************************************
7358
+ * Ask the server, unless a question is out or the last one
7359
+ * is too recent (a focus and a visibilitychange come
7360
+ * together), or the browser says it is offline -- false is
7361
+ * the one answer of navigator.onLine that can be trusted.
7362
+ ************************************************************/
7363
+ function ac_check_build(gobj, event, kw, src) {
7364
+ let priv = gobj.priv;
7365
+ if (!priv.running) return 0;
7366
+ if (priv.in_flight) return 0;
7367
+ if (!kw.force) {
7368
+ let min_interval = gobj_read_integer_attr(gobj, "min_interval_ms");
7369
+ if (priv.last_check && performance.now() - priv.last_check < min_interval) return 0;
7370
+ }
7371
+ if (navigator.onLine === false) return 0;
7372
+ fetch_deployed_build(gobj);
7373
+ return 0;
7374
+ }
7375
+ /************************************************************
7376
+ * EV_TIMEOUT_PERIODIC -- the screen that never gets the
7377
+ * focus back asks too.
7378
+ ************************************************************/
7379
+ function ac_periodic(gobj, event, kw, src) {
7380
+ gobj_send_event(gobj, "EV_CHECK_BUILD", {}, gobj);
7381
+ return 0;
7382
+ }
7383
+ /************************************************************
7384
+ * The server answered with a build.
7385
+ ************************************************************/
7386
+ function ac_deployed_build(gobj, event, kw, src) {
7387
+ let priv = gobj.priv;
7388
+ priv.in_flight = false;
7389
+ if (priv.failing) {
7390
+ log_info(`${gobj_short_name(gobj)}: the deployed build can be read again`);
7391
+ priv.failing = false;
7392
+ }
7393
+ let deployed = {
7394
+ stamp: kw.stamp,
7395
+ version: kw.version || ""
7396
+ };
7397
+ if (deployed.stamp === priv.running.stamp) {
7398
+ if (gobj_current_state(gobj) === "ST_STALE") {
7399
+ priv.deployed = null;
7400
+ remove_bar(gobj);
7401
+ gobj_change_state(gobj, "ST_CURRENT");
7402
+ gobj_publish_event(gobj, "EV_BUILD_CURRENT", { running: priv.running.stamp });
7403
+ }
7404
+ return 0;
7405
+ }
7406
+ if (priv.deployed && priv.deployed.stamp === deployed.stamp) return 0;
7407
+ priv.deployed = deployed;
7408
+ log_info(`${gobj_short_name(gobj)}: a new build is deployed: ${deployed.version} ${deployed.stamp} (this page runs ${priv.running.version} ${priv.running.stamp})`);
7409
+ gobj_change_state(gobj, "ST_STALE");
7410
+ show_bar(gobj);
7411
+ gobj_publish_event(gobj, "EV_NEW_BUILD", {
7412
+ running: priv.running.stamp,
7413
+ deployed: deployed.stamp,
7414
+ version: deployed.version
7415
+ });
7416
+ return 0;
7417
+ }
7418
+ /************************************************************
7419
+ * The server did not say. Offline is a normal state, so a
7420
+ * network failure is info; an answer that is not the app
7421
+ * (an HTTP error, a page with no stamp) is a warning. Both
7422
+ * are said on the transition only, not on every attempt.
7423
+ ************************************************************/
7424
+ function ac_check_failed(gobj, event, kw, src) {
7425
+ let priv = gobj.priv;
7426
+ priv.in_flight = false;
7427
+ if (priv.failing) return 0;
7428
+ priv.failing = true;
7429
+ let msg = `${gobj_short_name(gobj)}: cannot read the deployed build: ${kw.reason}`;
7430
+ if (kw.network) log_info(msg);
7431
+ else log_warning(msg);
7432
+ return 0;
7433
+ }
7434
+ /************************************************************
7435
+ * The bar's reload button. The host may veto it (unsaved
7436
+ * edits): its answer comes back as an event.
7437
+ ************************************************************/
7438
+ function ac_reload(gobj, event, kw, src) {
7439
+ let before_reload = gobj_read_pointer_attr(gobj, "before_reload");
7440
+ if (typeof before_reload !== "function") {
7441
+ gobj_send_event(gobj, "EV_RELOAD_ALLOWED", {}, gobj);
7442
+ return 0;
7443
+ }
7444
+ Promise.resolve().then(() => before_reload()).then((allowed) => {
7445
+ if (gobj_is_destroying(gobj)) return;
7446
+ if (allowed === false) {
7447
+ log_info(`${gobj_short_name(gobj)}: the host vetoed the reload`);
7448
+ return;
7449
+ }
7450
+ gobj_send_event(gobj, "EV_RELOAD_ALLOWED", {}, gobj);
7451
+ }, (err) => {
7452
+ log_error(`${gobj_short_name(gobj)}: before_reload() failed: ${err && err.message || err}`);
7453
+ });
7454
+ return 0;
7455
+ }
7456
+ /************************************************************
7457
+ * Load the deployed build. The hash stays: the reader comes
7458
+ * back to the same route.
7459
+ ************************************************************/
7460
+ function ac_reload_allowed(gobj, event, kw, src) {
7461
+ window.location.reload();
7462
+ return 0;
7463
+ }
7464
+ /************************************************************
7465
+ * The bar's ✕: hidden for this build; a later deploy shows
7466
+ * it again.
7467
+ ************************************************************/
7468
+ function ac_dismiss(gobj, event, kw, src) {
7469
+ let priv = gobj.priv;
7470
+ priv.dismissed = priv.deployed ? priv.deployed.stamp : "";
7471
+ remove_bar(gobj);
7472
+ return 0;
7473
+ }
7474
+ /************************************************************
7475
+ * EV_SHELL_CHANGED -- a shell was built, or is being
7476
+ * destroyed: the bar's place may have gone with it, or be in
7477
+ * the new one. Its language is the new shell's too.
7478
+ ************************************************************/
7479
+ function ac_shell_changed(gobj, event, kw, src) {
7480
+ let priv = gobj.priv;
7481
+ follow_language(gobj);
7482
+ if (priv.$bar) show_bar(gobj);
7483
+ return 0;
7484
+ }
7485
+ /************************************************************
7486
+ * EV_LANGUAGE_CHANGED -- from the shell that holds the bar.
7487
+ * Every text of the bar carries its key; it may live outside
7488
+ * the shell's container, where the app's refresh does not
7489
+ * reach.
7490
+ ************************************************************/
7491
+ function ac_language_changed$12(gobj, event, kw, src) {
7492
+ let priv = gobj.priv;
7493
+ if (priv.$bar) refresh_language(priv.$bar, t);
7494
+ return 0;
7495
+ }
7496
+ /***************************
7497
+ * FSM
7498
+ ***************************/
7499
+ var gmt$20 = {
7500
+ mt_create: mt_create$20,
7501
+ mt_start: mt_start$20,
7502
+ mt_stop: mt_stop$20,
7503
+ mt_destroy: mt_destroy$20
7504
+ };
7505
+ /***************************************************************
7506
+ * Create the GClass
7507
+ ***************************************************************/
7508
+ function create_gclass$20(gclass_name) {
7509
+ if (__gclass__$20) {
7510
+ log_error(`GClass ALREADY created: ${gclass_name}`);
7511
+ return -1;
7512
+ }
7513
+ const states = [["ST_CURRENT", [
7514
+ [
7515
+ "EV_CHECK_BUILD",
7516
+ ac_check_build,
7517
+ null
7518
+ ],
7519
+ [
7520
+ "EV_TIMEOUT_PERIODIC",
7521
+ ac_periodic,
7522
+ null
7523
+ ],
7524
+ [
7525
+ "EV_DEPLOYED_BUILD",
7526
+ ac_deployed_build,
7527
+ null
7528
+ ],
7529
+ [
7530
+ "EV_CHECK_FAILED",
7531
+ ac_check_failed,
7532
+ null
7533
+ ],
6930
7534
  [
6931
7535
  "EV_SHELL_CHANGED",
6932
7536
  ac_shell_changed,
@@ -6937,14 +7541,74 @@ function create_gclass$20(gclass_name) {
6937
7541
  ac_language_changed$12,
6938
7542
  null
6939
7543
  ]
6940
- ]]], gmt$20, 0, attrs_table$20, PRIVATE_DATA$20, 0, 0, 0, 0);
7544
+ ]], ["ST_STALE", [
7545
+ [
7546
+ "EV_CHECK_BUILD",
7547
+ ac_check_build,
7548
+ null
7549
+ ],
7550
+ [
7551
+ "EV_TIMEOUT_PERIODIC",
7552
+ ac_periodic,
7553
+ null
7554
+ ],
7555
+ [
7556
+ "EV_DEPLOYED_BUILD",
7557
+ ac_deployed_build,
7558
+ null
7559
+ ],
7560
+ [
7561
+ "EV_CHECK_FAILED",
7562
+ ac_check_failed,
7563
+ null
7564
+ ],
7565
+ [
7566
+ "EV_RELOAD",
7567
+ ac_reload,
7568
+ null
7569
+ ],
7570
+ [
7571
+ "EV_RELOAD_ALLOWED",
7572
+ ac_reload_allowed,
7573
+ null
7574
+ ],
7575
+ [
7576
+ "EV_DISMISS",
7577
+ ac_dismiss,
7578
+ null
7579
+ ],
7580
+ [
7581
+ "EV_SHELL_CHANGED",
7582
+ ac_shell_changed,
7583
+ null
7584
+ ],
7585
+ [
7586
+ "EV_LANGUAGE_CHANGED",
7587
+ ac_language_changed$12,
7588
+ null
7589
+ ]
7590
+ ]]];
7591
+ const event_types = [
7592
+ ["EV_CHECK_BUILD", 0],
7593
+ ["EV_TIMEOUT_PERIODIC", 0],
7594
+ ["EV_DEPLOYED_BUILD", 0],
7595
+ ["EV_CHECK_FAILED", 0],
7596
+ ["EV_RELOAD", 0],
7597
+ ["EV_RELOAD_ALLOWED", 0],
7598
+ ["EV_DISMISS", 0],
7599
+ ["EV_SHELL_CHANGED", 0],
7600
+ ["EV_LANGUAGE_CHANGED", 0],
7601
+ ["EV_NEW_BUILD", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
7602
+ ["EV_BUILD_CURRENT", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
7603
+ ];
7604
+ __gclass__$20 = gclass_create(gclass_name, event_types, states, gmt$20, 0, attrs_table$20, PRIVATE_DATA$20, 0, 0, 0, 0);
6941
7605
  if (!__gclass__$20) return -1;
6942
7606
  return 0;
6943
7607
  }
6944
7608
  /***************************************************************
6945
7609
  * Register GClass
6946
7610
  ***************************************************************/
6947
- function register_c_yui_window_manager() {
7611
+ function register_c_yui_update_watch() {
6948
7612
  return create_gclass$20(GCLASS_NAME$20);
6949
7613
  }
6950
7614
  //#endregion
@@ -88332,6 +88996,6 @@ function setup_json_pad(self) {
88332
88996
  return win;
88333
88997
  }
88334
88998
  //#endregion
88335
- export { EditControl, ICONS_TOPIC, MarkerControl, USER_ICON_PREFIX, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_date_time, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_icon_is_defined, yui_icons_list, yui_icons_put_user, yui_icons_remove_user, yui_icons_set_user, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_escape_order, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_nav_item_badge, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_svg_icon_element, yui_svg_sanitize, yui_theme_now, yui_toolbar, yui_user_icon_class, yui_watch_theme };
88999
+ export { EditControl, ICONS_TOPIC, MarkerControl, USER_ICON_PREFIX, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_date_time, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_update_watch, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_icon_is_defined, yui_icons_list, yui_icons_put_user, yui_icons_remove_user, yui_icons_set_user, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_escape_order, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_nav_item_badge, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_svg_icon_element, yui_svg_sanitize, yui_theme_now, yui_toolbar, yui_user_icon_class, yui_watch_theme };
88336
89000
 
88337
89001
  //# sourceMappingURL=gobj-ui.es.js.map