@yuneta/gobj-ui 5.11.1 → 5.13.0

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.
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
26
26
  }
27
27
  return to;
28
28
  };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
30
30
  value: mod,
31
31
  enumerable: true
32
32
  }) : target, mod));
@@ -1350,10 +1350,11 @@ function instantiate_menus(gobj, config) {
1350
1350
  let renders = secondary_nav_renders(item, render_to_obj(layout));
1351
1351
  let sub_menu_id = `secondary.${menu_id}.${item.id}`;
1352
1352
  for (let render_cfg of renders) {
1353
- let $c = (0, _yuneta_gobj_js.gobj_read_attr)(instantiate_nav_in_zone(gobj, {
1353
+ let nav = instantiate_nav_in_zone(gobj, {
1354
1354
  items: sub.items,
1355
1355
  render: { [zone_id]: render_cfg }
1356
- }, sub_menu_id, zone_id, "secondary", item.name || ""), "$container");
1356
+ }, sub_menu_id, zone_id, "secondary", item.name || "");
1357
+ let $c = (0, _yuneta_gobj_js.gobj_read_attr)(nav, "$container");
1357
1358
  if ($c) $c.classList.add("is-hidden");
1358
1359
  }
1359
1360
  }
@@ -1370,7 +1371,8 @@ function instantiate_nav_in_zone(gobj, menu, menu_id, zone_id, level, nav_label)
1370
1371
  let render_cfg = menu.render && (menu.render[zone_id] || menu.render["*"]) || { layout: "vertical" };
1371
1372
  if ((0, _yuneta_gobj_js.is_string)(render_cfg)) render_cfg = { layout: render_cfg };
1372
1373
  let layout = render_cfg.layout || "vertical";
1373
- let nav = (0, _yuneta_gobj_js.gobj_create)(`nav_${menu_id.replace(/\./g, "_")}_${zone_id}` + (layout === "backbar" ? "_backbar" : ""), "C_YUI_NAV", {
1374
+ let nav_name = `nav_${menu_id.replace(/\./g, "_")}_${zone_id}` + (layout === "backbar" ? "_backbar" : "");
1375
+ let nav = (0, _yuneta_gobj_js.gobj_create)(nav_name, "C_YUI_NAV", {
1374
1376
  menu_id,
1375
1377
  nav_label: nav_label || "",
1376
1378
  menu_items: menu.items || [],
@@ -1896,14 +1898,15 @@ function build_toolbar_connection_item(gobj, it) {
1896
1898
  attrs.title = tip;
1897
1899
  attrs["data-i18n-title"] = tip;
1898
1900
  }
1901
+ let $dot = (0, _yuneta_gobj_js.createElement2)([
1902
+ "span",
1903
+ { class: "yui-conn-dot" },
1904
+ ""
1905
+ ]);
1899
1906
  let $item = (0, _yuneta_gobj_js.createElement2)([
1900
1907
  "button",
1901
1908
  attrs,
1902
- [(0, _yuneta_gobj_js.createElement2)([
1903
- "span",
1904
- { class: "yui-conn-dot" },
1905
- ""
1906
- ])]
1909
+ [$dot]
1907
1910
  ]);
1908
1911
  if ((it.action && it.action.type || "") !== "") $item.addEventListener("click", (ev) => {
1909
1912
  ev.preventDefault();
@@ -1940,11 +1943,13 @@ function handle_toolbar_action(gobj, item, $trigger) {
1940
1943
  let action = item && item.action || {};
1941
1944
  switch (action.type) {
1942
1945
  case "navigate":
1943
- if (!(0, _yuneta_gobj_js.empty_string)(action.route)) if ((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "use_hash") && !route_restores_url(gobj, action.route)) {
1944
- let h = route_to_hash(action.route);
1945
- if (window.location.hash !== h) window.location.hash = h;
1946
- else navigate_to(gobj, action.route);
1947
- } else navigate_to(gobj, action.route);
1946
+ if (!(0, _yuneta_gobj_js.empty_string)(action.route)) {
1947
+ if ((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "use_hash") && !route_restores_url(gobj, action.route)) {
1948
+ let h = route_to_hash(action.route);
1949
+ if (window.location.hash !== h) window.location.hash = h;
1950
+ else navigate_to(gobj, action.route);
1951
+ } else navigate_to(gobj, action.route);
1952
+ }
1948
1953
  break;
1949
1954
  case "drawer": {
1950
1955
  let op = action.op || "toggle";
@@ -1980,11 +1985,13 @@ function toggle_toolbar_dropdown(gobj, item, action, $trigger) {
1980
1985
  function open_toolbar_dropdown(gobj, item, action, $trigger) {
1981
1986
  let priv = gobj.priv;
1982
1987
  if (!priv || !priv.layers || !priv.layers.popup) return;
1988
+ let aria_key = item && (item.aria_label || item.name || item.id) || "Menu";
1989
+ let i18n_aria = item && (item.aria_label || item.name) || "Menu";
1983
1990
  let $panel = (0, _yuneta_gobj_js.createElement2)(["div", {
1984
1991
  class: "yui-toolbar-dropdown-panel",
1985
1992
  role: "menu",
1986
- "aria-label": item && (item.aria_label || item.name || item.id) || "Menu",
1987
- "data-i18n-aria-label": item && (item.aria_label || item.name) || "Menu",
1993
+ "aria-label": aria_key,
1994
+ "data-i18n-aria-label": i18n_aria,
1988
1995
  "data-toolbar-dropdown-for": item && item.id || ""
1989
1996
  }]);
1990
1997
  let raw_items = (0, _yuneta_gobj_js.is_array)(action.items) ? action.items : [];
@@ -2454,14 +2461,15 @@ function create_gclass$18(gclass_name) {
2454
2461
  null
2455
2462
  ]
2456
2463
  ]]];
2457
- __gclass__$18 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
2464
+ const event_types = [
2458
2465
  ["EV_NAV_CLICKED", 0],
2459
2466
  ["EV_DRAWER_CLOSE_REQUESTED", 0],
2460
2467
  ["EV_NAV_ITEM_CLOSE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
2461
2468
  ["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],
2462
2469
  ["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],
2463
2470
  ["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]
2464
- ], states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, _yuneta_gobj_js.gclass_flag_t.gcflag_no_check_output_events);
2471
+ ];
2472
+ __gclass__$18 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, _yuneta_gobj_js.gclass_flag_t.gcflag_no_check_output_events);
2465
2473
  if (!__gclass__$18) return -1;
2466
2474
  return 0;
2467
2475
  }
@@ -3141,10 +3149,11 @@ function build_dialog(shell, message, buttons, opts) {
3141
3149
  { class: "CONFIRM_FOOT modal-card-foot" },
3142
3150
  $footer_children
3143
3151
  ]);
3152
+ let logical = opts && opts.logical_class ? " " + opts.logical_class : "";
3144
3153
  let $modal = (0, _yuneta_gobj_js.createElement2)([
3145
3154
  "div",
3146
3155
  {
3147
- class: `CONFIRM${opts && opts.logical_class ? " " + opts.logical_class : ""} modal yui-modal yui-confirm is-active is-${type}`,
3156
+ class: `CONFIRM${logical} modal yui-modal yui-confirm is-active is-${type}`,
3148
3157
  role: "dialog",
3149
3158
  "aria-modal": "true"
3150
3159
  },
@@ -3330,7 +3339,8 @@ var __gclass__$17 = null;
3330
3339
  function mt_create$17(gobj) {
3331
3340
  const subscriber = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "subscriber");
3332
3341
  if (subscriber) (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
3333
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "window_id", "window-" + (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_short_name)(gobj)));
3342
+ let window_id = "window-" + (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_short_name)(gobj));
3343
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "window_id", window_id);
3334
3344
  let manager = resolve_manager(gobj);
3335
3345
  build_ui$14(gobj);
3336
3346
  if (manager) {
@@ -3350,9 +3360,12 @@ function mt_create$17(gobj) {
3350
3360
  }, gobj);
3351
3361
  } else if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "back_dismissable")) {
3352
3362
  let shell = yui_shell_of(gobj);
3353
- if (shell) (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", yui_shell_register_overlay(shell, function() {
3354
- close_window(gobj);
3355
- }, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") }));
3363
+ if (shell) {
3364
+ let overlay = yui_shell_register_overlay(shell, function() {
3365
+ close_window(gobj);
3366
+ }, { keep_on_navigate: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "keep_on_navigate") });
3367
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "back_overlay", overlay);
3368
+ }
3356
3369
  }
3357
3370
  let on_win_resize = function() {
3358
3371
  handleResize(gobj);
@@ -3458,16 +3471,18 @@ function build_default_header(gobj) {
3458
3471
  if ((0, _yuneta_gobj_js.empty_string)(title) && (0, _yuneta_gobj_js.empty_string)(prefix)) return null;
3459
3472
  let icon = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "icon");
3460
3473
  let items = [];
3461
- if (!(0, _yuneta_gobj_js.empty_string)(icon)) if (icon.charAt(0) === "<") items.push([
3462
- "span",
3463
- { class: "icon" },
3464
- icon
3465
- ]);
3466
- else items.push([
3467
- "span",
3468
- { class: "icon" },
3469
- [["i", { class: icon }]]
3470
- ]);
3474
+ if (!(0, _yuneta_gobj_js.empty_string)(icon)) {
3475
+ if (icon.charAt(0) === "<") items.push([
3476
+ "span",
3477
+ { class: "icon" },
3478
+ icon
3479
+ ]);
3480
+ else items.push([
3481
+ "span",
3482
+ { class: "icon" },
3483
+ [["i", { class: icon }]]
3484
+ ]);
3485
+ }
3471
3486
  if (!(0, _yuneta_gobj_js.empty_string)(prefix)) items.push([
3472
3487
  "span",
3473
3488
  { class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
@@ -4126,7 +4141,7 @@ function create_gclass$17(gclass_name) {
4126
4141
  null
4127
4142
  ]
4128
4143
  ]]];
4129
- __gclass__$17 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
4144
+ const event_types = [
4130
4145
  ["EV_WINDOW_TO_CLOSE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
4131
4146
  ["EV_WINDOW_MOVED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
4132
4147
  ["EV_WINDOW_RESIZED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
@@ -4134,7 +4149,8 @@ function create_gclass$17(gclass_name) {
4134
4149
  ["EV_SHOW", 0],
4135
4150
  ["EV_HIDE", 0],
4136
4151
  ["EV_CLOSE_WINDOW", 0]
4137
- ], states, gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
4152
+ ];
4153
+ __gclass__$17 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
4138
4154
  if (!__gclass__$17) return -1;
4139
4155
  return 0;
4140
4156
  }
@@ -4315,11 +4331,12 @@ function ensure_dock_style() {
4315
4331
  ************************************************************/
4316
4332
  function build_dock(gobj) {
4317
4333
  ensure_dock_style();
4318
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", (0, _yuneta_gobj_js.createElement2)([
4334
+ let $dock = (0, _yuneta_gobj_js.createElement2)([
4319
4335
  "div",
4320
4336
  { class: "C_YUI_WINDOW_MANAGER yui-dock is-empty" },
4321
4337
  []
4322
- ]));
4338
+ ]);
4339
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $dock);
4323
4340
  apply_placement(gobj);
4324
4341
  }
4325
4342
  /************************************************************
@@ -4770,7 +4787,7 @@ function mt_destroy$15(gobj) {
4770
4787
  * Build UI
4771
4788
  ************************************************************/
4772
4789
  function build_ui$13(gobj) {
4773
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", (0, _yuneta_gobj_js.createElement2)([
4790
+ let $container = (0, _yuneta_gobj_js.createElement2)([
4774
4791
  "div",
4775
4792
  {
4776
4793
  class: "C_YUI_PAGER",
@@ -4839,7 +4856,8 @@ function build_ui$13(gobj) {
4839
4856
  },
4840
4857
  []
4841
4858
  ]]
4842
- ]));
4859
+ ]);
4860
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
4843
4861
  }
4844
4862
  /************************************************************
4845
4863
  * Destroy UI
@@ -5099,7 +5117,7 @@ function create_gclass$15(gclass_name) {
5099
5117
  null
5100
5118
  ]
5101
5119
  ]]];
5102
- __gclass__$15 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
5120
+ const event_types = [
5103
5121
  ["EV_PUSH_PAGE", 0],
5104
5122
  ["EV_POP_PAGE", 0],
5105
5123
  ["EV_BACK", 0],
@@ -5112,7 +5130,8 @@ function create_gclass$15(gclass_name) {
5112
5130
  ["EV_PAGE_SHOWN", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
5113
5131
  ["EV_PAGE_DISCARD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
5114
5132
  ["EV_PAGER_EXIT", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT]
5115
- ], states, gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
5133
+ ];
5134
+ __gclass__$15 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
5116
5135
  if (!__gclass__$15) return -1;
5117
5136
  return 0;
5118
5137
  }
@@ -5302,7 +5321,7 @@ function mt_destroy$14(gobj) {
5302
5321
  * Build UI
5303
5322
  ************************************************************/
5304
5323
  function build_ui$12(gobj) {
5305
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", (0, _yuneta_gobj_js.createElement2)([
5324
+ let $container = (0, _yuneta_gobj_js.createElement2)([
5306
5325
  "div",
5307
5326
  {
5308
5327
  class: "C_YUI_WIZARD",
@@ -5388,7 +5407,8 @@ function build_ui$12(gobj) {
5388
5407
  ]]
5389
5408
  ]
5390
5409
  ]
5391
- ]));
5410
+ ]);
5411
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
5392
5412
  }
5393
5413
  /************************************************************
5394
5414
  * Destroy UI
@@ -5714,7 +5734,7 @@ function create_gclass$14(gclass_name) {
5714
5734
  null
5715
5735
  ]
5716
5736
  ]]];
5717
- __gclass__$14 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
5737
+ const event_types = [
5718
5738
  ["EV_SET_STEPS", 0],
5719
5739
  ["EV_NEXT", 0],
5720
5740
  ["EV_PREV", 0],
@@ -5730,7 +5750,8 @@ function create_gclass$14(gclass_name) {
5730
5750
  ["EV_WIZARD_DONE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
5731
5751
  ["EV_WIZARD_CANCEL", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
5732
5752
  ["EV_STEP_VALIDATE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS]
5733
- ], states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
5753
+ ];
5754
+ __gclass__$14 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
5734
5755
  if (!__gclass__$14) return -1;
5735
5756
  return 0;
5736
5757
  }
@@ -6013,7 +6034,8 @@ function mt_create$13(gobj) {
6013
6034
  let subscriber = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "subscriber");
6014
6035
  if (!subscriber) subscriber = (0, _yuneta_gobj_js.gobj_parent)(gobj);
6015
6036
  (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
6016
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "form_id", "form" + (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)));
6037
+ let name = (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj));
6038
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "form_id", "form" + name);
6017
6039
  build_ui$11(gobj);
6018
6040
  }
6019
6041
  /************************************************************
@@ -6097,7 +6119,8 @@ function set_changed_stated(gobj, changed) {
6097
6119
  async function readClipboard$1(gobj) {
6098
6120
  try {
6099
6121
  const text = await navigator.clipboard.readText();
6100
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_RECORD", JSON.parse(text), gobj);
6122
+ let kw = JSON.parse(text);
6123
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_RECORD", kw, gobj);
6101
6124
  } catch (error) {
6102
6125
  (0, _yuneta_gobj_js.log_error)(`Failed to read clipboard contents: ${error}`);
6103
6126
  }
@@ -6314,8 +6337,9 @@ function destroy_ui$7(gobj) {
6314
6337
  * Build form with bulma and createElement2
6315
6338
  ******************************************************************/
6316
6339
  function build_form(gobj) {
6340
+ let form_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "form_id");
6317
6341
  let $form = (0, _yuneta_gobj_js.createElement2)(["form", {
6318
- id: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "form_id"),
6342
+ id: form_id,
6319
6343
  class: "yui-form"
6320
6344
  }]);
6321
6345
  let template = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "template");
@@ -6422,7 +6446,6 @@ function build_form_field_conf(gobj, field_desc) {
6422
6446
  case "list":
6423
6447
  field_conf.tag = "select2";
6424
6448
  field_conf.options = field_desc.enum_list;
6425
- break;
6426
6449
  }
6427
6450
  break;
6428
6451
  case "hook": break;
@@ -6459,18 +6482,12 @@ function build_form_field_conf(gobj, field_desc) {
6459
6482
  case "time":
6460
6483
  field_conf.tag = "input";
6461
6484
  field_conf.inputType = "datetime-local";
6462
- switch (field_desc.real_type) {
6463
- case "string": break;
6464
- case "integer": break;
6465
- }
6485
+ field_desc.real_type;
6466
6486
  break;
6467
6487
  case "color":
6468
6488
  field_conf.tag = "input";
6469
6489
  field_conf.inputType = "color";
6470
- switch (field_desc.real_type) {
6471
- case "string": break;
6472
- case "integer": break;
6473
- }
6490
+ field_desc.real_type;
6474
6491
  break;
6475
6492
  case "email":
6476
6493
  field_conf.tag = "input";
@@ -6588,9 +6605,7 @@ function build_fkey_ref$1(gobj, field_desc, value) {
6588
6605
  refs[ref] = true;
6589
6606
  break;
6590
6607
  case "array":
6591
- case "list":
6592
- refs.push(ref);
6593
- break;
6608
+ case "list": refs.push(ref);
6594
6609
  }
6595
6610
  }
6596
6611
  return refs;
@@ -6696,40 +6711,38 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
6696
6711
  ]]
6697
6712
  ]);
6698
6713
  break;
6699
- default:
6700
- $element = (0, _yuneta_gobj_js.createElement2)([
6714
+ default: $element = (0, _yuneta_gobj_js.createElement2)([
6715
+ "div",
6716
+ { class: "xfield field is-horizontal" },
6717
+ [[
6701
6718
  "div",
6702
- { class: "xfield field is-horizontal" },
6719
+ { class: "field-label is-normal" },
6720
+ [[
6721
+ "label",
6722
+ {
6723
+ class: "label ",
6724
+ i18n: label_i18n || label,
6725
+ for: name
6726
+ },
6727
+ label
6728
+ ]]
6729
+ ], [
6730
+ "div",
6731
+ { class: "field-body" },
6703
6732
  [[
6704
6733
  "div",
6705
- { class: "field-label is-normal" },
6734
+ { class: "field" },
6706
6735
  [[
6707
- "label",
6736
+ "div",
6708
6737
  {
6709
- class: "label ",
6710
- i18n: label_i18n || label,
6711
- for: name
6738
+ class: "xcontrol control",
6739
+ style: ""
6712
6740
  },
6713
- label
6714
- ]]
6715
- ], [
6716
- "div",
6717
- { class: "field-body" },
6718
- [[
6719
- "div",
6720
- { class: "field" },
6721
- [[
6722
- "div",
6723
- {
6724
- class: "xcontrol control",
6725
- style: ""
6726
- },
6727
- []
6728
- ]]
6741
+ []
6729
6742
  ]]
6730
6743
  ]]
6731
- ]);
6732
- break;
6744
+ ]]
6745
+ ]);
6733
6746
  }
6734
6747
  break;
6735
6748
  case "textarea":
@@ -6982,7 +6995,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
6982
6995
  (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: select 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));
6983
6996
  opts = [];
6984
6997
  }
6985
- let $wrapper = (0, _yuneta_gobj_js.createElement2)([
6998
+ let extend = [
6986
6999
  "div",
6987
7000
  { class: "select" },
6988
7001
  [
@@ -7000,7 +7013,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
7000
7013
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_RECORD_CHANGED", {}, gobj);
7001
7014
  } }
7002
7015
  ]
7003
- ]);
7016
+ ];
7017
+ let $wrapper = (0, _yuneta_gobj_js.createElement2)(extend);
7004
7018
  $control.appendChild($wrapper);
7005
7019
  $extend = $wrapper.querySelector("select");
7006
7020
  break;
@@ -7011,7 +7025,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
7011
7025
  (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));
7012
7026
  opts = [];
7013
7027
  }
7014
- $extend = (0, _yuneta_gobj_js.createElement2)([
7028
+ let extend = [
7015
7029
  "select",
7016
7030
  {
7017
7031
  name,
@@ -7026,7 +7040,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
7026
7040
  },
7027
7041
  option
7028
7042
  ])
7029
- ]);
7043
+ ];
7044
+ $extend = (0, _yuneta_gobj_js.createElement2)(extend);
7030
7045
  $control.appendChild($extend);
7031
7046
  $extend.tom_select = new tom_select.default($extend, {
7032
7047
  allowEmptyOption: true,
@@ -7064,15 +7079,17 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
7064
7079
  $extend = $wrapper.querySelector("input");
7065
7080
  break;
7066
7081
  }
7067
- case "radio":
7068
- $extend = (0, _yuneta_gobj_js.createOneHtml)(`
7082
+ case "radio": {
7083
+ let elm = `
7069
7084
  <label class="radio">
7070
7085
  <input type="radio" name="${name}">
7071
7086
  ${(0, i18next.t)(options)}
7072
7087
  </label>
7073
- `);
7088
+ `;
7089
+ $extend = (0, _yuneta_gobj_js.createOneHtml)(elm);
7074
7090
  $control.appendChild($extend);
7075
7091
  break;
7092
+ }
7076
7093
  case "jsoneditor": {
7077
7094
  let attrs = {
7078
7095
  class: "jsoneditor" + (yui_is_dark() ? " jse-theme-dark" : ""),
@@ -7179,9 +7196,7 @@ function create_coordinates(gobj, attrs) {
7179
7196
  case error.TIMEOUT:
7180
7197
  errorMsg = (0, i18next.t)("timed out");
7181
7198
  break;
7182
- default:
7183
- errorMsg = (0, i18next.t)("unknown error");
7184
- break;
7199
+ default: errorMsg = (0, i18next.t)("unknown error");
7185
7200
  }
7186
7201
  $input.classList.add("is-danger");
7187
7202
  let $h = $input.closest(".xcontrol").parentNode.querySelector(".help");
@@ -7196,7 +7211,7 @@ function create_coordinates(gobj, attrs) {
7196
7211
  $h.style.display = "block";
7197
7212
  }
7198
7213
  }
7199
- let $extend = (0, _yuneta_gobj_js.createElement2)([
7214
+ let extend = [
7200
7215
  "div",
7201
7216
  { class: "field is-flex is-align-items-center" },
7202
7217
  [[
@@ -7223,7 +7238,8 @@ function create_coordinates(gobj, attrs) {
7223
7238
  } }
7224
7239
  ]]
7225
7240
  ]]
7226
- ]);
7241
+ ];
7242
+ let $extend = (0, _yuneta_gobj_js.createElement2)(extend);
7227
7243
  let $control = $extend.querySelector(".control");
7228
7244
  attach_clear($control, $control.querySelector("input"));
7229
7245
  return $extend;
@@ -7250,10 +7266,11 @@ function create_tabulator$1(gobj, $extend, name, template) {
7250
7266
  tabulator_settings.columns = template2columns(gobj, columns, template, sub_elements);
7251
7267
  if (sub_elements.length > 0) tabulator_settings.rowFormatter = function(row) {
7252
7268
  for (let sub_element of sub_elements) {
7253
- let $extend = (0, _yuneta_gobj_js.createElement2)(["div", {
7269
+ let extend = ["div", {
7254
7270
  class: "yui-tabulator-table-nested pl-6 is-bordered is-striped",
7255
7271
  "name": sub_element.name
7256
- }]);
7272
+ }];
7273
+ let $extend = (0, _yuneta_gobj_js.createElement2)(extend);
7257
7274
  $extend.tabulator = create_tabulator$1(gobj, $extend, sub_element.name, sub_element.template);
7258
7275
  row.getElement().appendChild($extend);
7259
7276
  }
@@ -7341,9 +7358,10 @@ function template2columns(gobj, columns, template, sub_elements) {
7341
7358
  cellClick: function(evt, cell) {
7342
7359
  evt.stopPropagation();
7343
7360
  let $row = cell.getRow().getElement();
7361
+ let $extend = $row.querySelector(`[name="${field_desc.name}"]`);
7344
7362
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_ADD_TABLE_ROW", {
7345
7363
  $row,
7346
- $table: $row.querySelector(`[name="${field_desc.name}"]`),
7364
+ $table: $extend,
7347
7365
  record: {},
7348
7366
  loading: false
7349
7367
  }, gobj);
@@ -7358,9 +7376,7 @@ function template2columns(gobj, columns, template, sub_elements) {
7358
7376
  case "object":
7359
7377
  case "dict":
7360
7378
  case "array":
7361
- case "list":
7362
- column.editorParams.values = field_desc.enum_list;
7363
- break;
7379
+ case "list": column.editorParams.values = field_desc.enum_list;
7364
7380
  }
7365
7381
  break;
7366
7382
  case "hook": break;
@@ -7405,18 +7421,12 @@ function template2columns(gobj, columns, template, sub_elements) {
7405
7421
  verticalNavigation: "table",
7406
7422
  elementAttributes: { title: "slide bar to choose option" }
7407
7423
  };
7408
- switch (field_desc.real_type) {
7409
- case "string": break;
7410
- case "integer": break;
7411
- }
7424
+ field_desc.real_type;
7412
7425
  break;
7413
7426
  case "color":
7414
7427
  column.editor = "input";
7415
7428
  column.editorParams = {};
7416
- switch (field_desc.real_type) {
7417
- case "string": break;
7418
- case "integer": break;
7419
- }
7429
+ field_desc.real_type;
7420
7430
  break;
7421
7431
  case "email":
7422
7432
  column.editor = "input";
@@ -7512,9 +7522,7 @@ function get_form_values(gobj, $form) {
7512
7522
  const date = new Date($input.value);
7513
7523
  value = Math.floor(date.getTime() / 1e3);
7514
7524
  break;
7515
- default:
7516
- value = getInputValue($input);
7517
- break;
7525
+ default: value = getInputValue($input);
7518
7526
  }
7519
7527
  break;
7520
7528
  case "textarea":
@@ -7561,9 +7569,7 @@ function get_form_values(gobj, $form) {
7561
7569
  if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
7562
7570
  value = getInputValue($input);
7563
7571
  break;
7564
- default:
7565
- (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: $form type unknown: '%s'", (0, _yuneta_gobj_js.gobj_short_name)(gobj), tag));
7566
- break;
7572
+ default: (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: $form type unknown: '%s'", (0, _yuneta_gobj_js.gobj_short_name)(gobj), tag));
7567
7573
  }
7568
7574
  value = form_value_2_treedb_value(gobj, field_desc, value);
7569
7575
  let path;
@@ -7579,14 +7585,16 @@ function get_form_values(gobj, $form) {
7579
7585
  function clear_data(gobj, $form) {
7580
7586
  let pkey = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "pkey");
7581
7587
  $form.querySelectorAll("input, select, textarea, .jsoneditor").forEach(($input) => {
7582
- if ($input.name !== pkey) if ($input.classList.contains("jsoneditor")) {
7583
- let jsoneditor = $input.jsoneditor;
7584
- if (jsoneditor) jsoneditor.set({ text: "" });
7585
- } else if ($input.type === "checkbox") $input.checked = false;
7586
- else if ($input.type === "radio") $input.checked = false;
7587
- else if ($input.type === "datetime-local") $input.value = null;
7588
- else if ($input.type === "select-multiple") $input.tom_select.clear();
7589
- else $input.value = null;
7588
+ if ($input.name !== pkey) {
7589
+ if ($input.classList.contains("jsoneditor")) {
7590
+ let jsoneditor = $input.jsoneditor;
7591
+ if (jsoneditor) jsoneditor.set({ text: "" });
7592
+ } else if ($input.type === "checkbox") $input.checked = false;
7593
+ else if ($input.type === "radio") $input.checked = false;
7594
+ else if ($input.type === "datetime-local") $input.value = null;
7595
+ else if ($input.type === "select-multiple") $input.tom_select.clear();
7596
+ else $input.value = null;
7597
+ }
7590
7598
  });
7591
7599
  $form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
7592
7600
  if ($table.tabulator.initialized) $table.tabulator.clearData();
@@ -7668,9 +7676,7 @@ function set_form_values(gobj, template, $form, record) {
7668
7676
  case "color":
7669
7677
  $input.value = convertColor(value);
7670
7678
  break;
7671
- default:
7672
- $input.value = value;
7673
- break;
7679
+ default: $input.value = value;
7674
7680
  }
7675
7681
  break;
7676
7682
  case "textarea":
@@ -7701,9 +7707,7 @@ function set_form_values(gobj, template, $form, record) {
7701
7707
  if ($input.tagName !== "INPUT") $input = $input.querySelector("input");
7702
7708
  $input.value = value;
7703
7709
  break;
7704
- default:
7705
- (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: $form type unknown: '%s'", (0, _yuneta_gobj_js.gobj_short_name)(gobj), tag));
7706
- break;
7710
+ default: (0, _yuneta_gobj_js.log_error)((0, _yuneta_gobj_js.sprintf)("%s: $form type unknown: '%s'", (0, _yuneta_gobj_js.gobj_short_name)(gobj), tag));
7707
7711
  }
7708
7712
  refresh_clear($input);
7709
7713
  });
@@ -7817,9 +7821,7 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
7817
7821
  }
7818
7822
  value = `${longitude}, ${latitude}`;
7819
7823
  break;
7820
- default:
7821
- (0, _yuneta_gobj_js.log_error)("treedb_value_2_form_value() type unknown: " + type);
7822
- break;
7824
+ default: (0, _yuneta_gobj_js.log_error)("treedb_value_2_form_value() type unknown: " + type);
7823
7825
  }
7824
7826
  return value;
7825
7827
  }
@@ -7863,9 +7865,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
7863
7865
  case "integer":
7864
7866
  if (value && (0, _yuneta_gobj_js.is_date)(value)) value = value.getTime() / 1e3;
7865
7867
  break;
7866
- default:
7867
- (0, _yuneta_gobj_js.log_error)("incompatible type for time: " + real_type);
7868
- break;
7868
+ default: (0, _yuneta_gobj_js.log_error)("incompatible type for time: " + real_type);
7869
7869
  }
7870
7870
  break;
7871
7871
  case "date":
@@ -7926,9 +7926,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
7926
7926
  "coordinates": [lnglat[0], lnglat[1]]
7927
7927
  } };
7928
7928
  break;
7929
- default:
7930
- (0, _yuneta_gobj_js.log_error)("form_value_2_treedb_value() type unknown: " + type);
7931
- break;
7929
+ default: (0, _yuneta_gobj_js.log_error)("form_value_2_treedb_value() type unknown: " + type);
7932
7930
  }
7933
7931
  return value;
7934
7932
  }
@@ -7965,7 +7963,8 @@ function ac_load_record(gobj, event, kw, src) {
7965
7963
  function ac_save_record(gobj, event, kw, src) {
7966
7964
  let $form = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container").querySelector("form");
7967
7965
  if (validate_form(gobj, $form)) {
7968
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_SAVE_RECORD", get_form_values(gobj, $form));
7966
+ let values = get_form_values(gobj, $form);
7967
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_SAVE_RECORD", values);
7969
7968
  set_changed_stated(gobj, false);
7970
7969
  } else {
7971
7970
  kw.abort_close = true;
@@ -8171,7 +8170,7 @@ function create_gclass$13(gclass_name) {
8171
8170
  null
8172
8171
  ]
8173
8172
  ]]];
8174
- __gclass__$13 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
8173
+ const event_types = [
8175
8174
  ["EV_LOAD_RECORD", 0],
8176
8175
  ["EV_SAVE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
8177
8176
  ["EV_UNDO_RECORD", 0],
@@ -8187,7 +8186,8 @@ function create_gclass$13(gclass_name) {
8187
8186
  ["EV_SHOW", 0],
8188
8187
  ["EV_HIDE", 0],
8189
8188
  ["EV_TIMEOUT", 0]
8190
- ], states, gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
8189
+ ];
8190
+ __gclass__$13 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
8191
8191
  if (!__gclass__$13) return -1;
8192
8192
  return 0;
8193
8193
  }
@@ -8786,14 +8786,16 @@ function xtouchStart(gobj, e) {
8786
8786
  function ac_edit_map(gobj, event, kw, src) {
8787
8787
  let priv = gobj.priv;
8788
8788
  const map = priv.xmap;
8789
- if ((0, _yuneta_gobj_js.kw_has_key)(kw, "enable_moving_markers")) if (kw.enable_moving_markers) {
8790
- map.on("mousedown", "unclustered-point", priv.xmouseDown);
8791
- map.on("touchstart", "unclustered-point", priv.xtouchStart);
8792
- map.off("click", "unclustered-point", priv.onClick);
8793
- } else {
8794
- map.off("mousedown", "unclustered-point", priv.xmouseDown);
8795
- map.off("touchstart", "unclustered-point", priv.xtouchStart);
8796
- map.on("click", "unclustered-point", priv.onClick);
8789
+ if ((0, _yuneta_gobj_js.kw_has_key)(kw, "enable_moving_markers")) {
8790
+ if (kw.enable_moving_markers) {
8791
+ map.on("mousedown", "unclustered-point", priv.xmouseDown);
8792
+ map.on("touchstart", "unclustered-point", priv.xtouchStart);
8793
+ map.off("click", "unclustered-point", priv.onClick);
8794
+ } else {
8795
+ map.off("mousedown", "unclustered-point", priv.xmouseDown);
8796
+ map.off("touchstart", "unclustered-point", priv.xtouchStart);
8797
+ map.on("click", "unclustered-point", priv.onClick);
8798
+ }
8797
8799
  }
8798
8800
  return 0;
8799
8801
  }
@@ -9036,14 +9038,15 @@ function build_ui$10(gobj) {
9036
9038
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "$container", $container);
9037
9039
  (0, _yuneta_gobj_js.gobj_write_bool_attr)(gobj, "own_container", true);
9038
9040
  }
9039
- let uplot$2 = new uplot.default({
9041
+ let uPlot_options = {
9040
9042
  title: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "title"),
9041
9043
  width: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "width"),
9042
9044
  height: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "height"),
9043
9045
  series: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "series"),
9044
9046
  axes: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "axes"),
9045
9047
  scales: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "scales")
9046
- }, (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "data"), $container);
9048
+ };
9049
+ let uplot$2 = new uplot.default(uPlot_options, (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "data"), $container);
9047
9050
  (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "uplot", uplot$2);
9048
9051
  let fixed_height = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "height");
9049
9052
  function fit_to_container() {
@@ -9098,11 +9101,13 @@ function ac_load_data$2(gobj, event, kw, src) {
9098
9101
  for (let idx = 1; idx < uplot$3.series.length; idx++) {
9099
9102
  let serie = uplot$3.series[idx];
9100
9103
  let value = kw[i][serie.id];
9101
- if ((0, _yuneta_gobj_js.is_string)(value)) if (value.toLowerCase() === "on") value = 1;
9102
- else if (value.toLowerCase() === "off") value = 0;
9103
- else {
9104
- (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)} value not contemplated: '${value}'`);
9105
- value = 0;
9104
+ if ((0, _yuneta_gobj_js.is_string)(value)) {
9105
+ if (value.toLowerCase() === "on") value = 1;
9106
+ else if (value.toLowerCase() === "off") value = 0;
9107
+ else {
9108
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)} value not contemplated: '${value}'`);
9109
+ value = 0;
9110
+ }
9106
9111
  }
9107
9112
  data[idx].push(value);
9108
9113
  }
@@ -9578,6 +9583,7 @@ function mt_destroy$10(gobj) {
9578
9583
  ************************************************************/
9579
9584
  function build_ui$9(gobj) {
9580
9585
  let priv = gobj.priv;
9586
+ let $toolbar = make_toolbar$3(gobj);
9581
9587
  let $container = (0, _yuneta_gobj_js.createElement2)([
9582
9588
  "div",
9583
9589
  {
@@ -9587,7 +9593,7 @@ function build_ui$9(gobj) {
9587
9593
  [[
9588
9594
  "div",
9589
9595
  { class: "is-flex-grow-0 is-flex toolbar_yui_json_graph" },
9590
- make_toolbar$3(gobj)
9596
+ $toolbar
9591
9597
  ], [
9592
9598
  "div",
9593
9599
  {
@@ -9770,9 +9776,7 @@ function build_cell_html(key, value, type, dark) {
9770
9776
  case "dict":
9771
9777
  display_value = `{${(0, _yuneta_gobj_js.json_object_size)(value)}}`;
9772
9778
  break;
9773
- default:
9774
- display_value = String(value);
9775
- break;
9779
+ default: display_value = String(value);
9776
9780
  }
9777
9781
  return `<span style="color:${key_color}">• ${(0, _yuneta_gobj_js.escapeHtml)(String(key))}: </span><span style="color:${color}">${display_value}</span>`;
9778
9782
  }
@@ -10217,7 +10221,7 @@ function create_gclass$10(gclass_name) {
10217
10221
  null
10218
10222
  ]
10219
10223
  ]]];
10220
- __gclass__$10 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
10224
+ const event_types = [
10221
10225
  ["EV_LOAD_DATA", 0],
10222
10226
  ["EV_REFRESH", 0],
10223
10227
  ["EV_THEME", 0],
@@ -10230,7 +10234,8 @@ function create_gclass$10(gclass_name) {
10230
10234
  ["EV_SHOW", 0],
10231
10235
  ["EV_HIDE", 0],
10232
10236
  ["EV_JSON_ITEM_CLICKED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT]
10233
- ], states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
10237
+ ];
10238
+ __gclass__$10 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
10234
10239
  if (!__gclass__$10) return -1;
10235
10240
  return 0;
10236
10241
  }
@@ -10480,6 +10485,7 @@ function mt_destroy$9(gobj) {
10480
10485
  ************************************************************/
10481
10486
  function build_ui$8(gobj) {
10482
10487
  let priv = gobj.priv;
10488
+ let $toolbar = make_toolbar$2(gobj);
10483
10489
  let $container = (0, _yuneta_gobj_js.createElement2)([
10484
10490
  "div",
10485
10491
  {
@@ -10489,7 +10495,7 @@ function build_ui$8(gobj) {
10489
10495
  [[
10490
10496
  "div",
10491
10497
  { class: "JSON_TOOLBAR is-flex-grow-0" },
10492
- [make_toolbar$2(gobj)]
10498
+ [$toolbar]
10493
10499
  ], [
10494
10500
  "div",
10495
10501
  {
@@ -10846,9 +10852,7 @@ function leaf_row(key, value, depth) {
10846
10852
  case "boolean":
10847
10853
  text = value ? "true" : "false";
10848
10854
  break;
10849
- default:
10850
- text = String(value);
10851
- break;
10855
+ default: text = String(value);
10852
10856
  }
10853
10857
  let body = [];
10854
10858
  if (key !== null && key !== "") {
@@ -11196,7 +11200,7 @@ function create_gclass$9(gclass_name) {
11196
11200
  null
11197
11201
  ]
11198
11202
  ]]];
11199
- __gclass__$9 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
11203
+ const event_types = [
11200
11204
  ["EV_SET_JSON", 0],
11201
11205
  ["EV_SUBTREE_LOADED", 0],
11202
11206
  ["EV_SUBTREE_ERROR", 0],
@@ -11211,7 +11215,8 @@ function create_gclass$9(gclass_name) {
11211
11215
  ["EV_SHOW", 0],
11212
11216
  ["EV_HIDE", 0],
11213
11217
  ["EV_EXPAND_PATH", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS]
11214
- ], states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
11218
+ ];
11219
+ __gclass__$9 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
11215
11220
  if (!__gclass__$9) return -1;
11216
11221
  return 0;
11217
11222
  }
@@ -11219,6 +11224,7 @@ function create_gclass$9(gclass_name) {
11219
11224
  * Register GClass
11220
11225
  ***************************************************************/
11221
11226
  function register_c_yui_json() {
11227
+ if ((0, _yuneta_gobj_js.gclass_find_by_name)(GCLASS_NAME$9, false)) return 0;
11222
11228
  return create_gclass$9(GCLASS_NAME$9);
11223
11229
  }
11224
11230
  //#endregion
@@ -11509,6 +11515,7 @@ function mt_destroy$8(gobj) {
11509
11515
  ************************************************************/
11510
11516
  function build_ui$7(gobj) {
11511
11517
  let priv = gobj.priv;
11518
+ let $toolbar = make_toolbar$1(gobj);
11512
11519
  let $container = (0, _yuneta_gobj_js.createElement2)([
11513
11520
  "div",
11514
11521
  {
@@ -11518,7 +11525,7 @@ function build_ui$7(gobj) {
11518
11525
  [[
11519
11526
  "div",
11520
11527
  { class: "is-flex-grow-0 is-flex toolbar_yui_gobj_tree" },
11521
- make_toolbar$1(gobj)
11528
+ $toolbar
11522
11529
  ], [
11523
11530
  "div",
11524
11531
  {
@@ -13487,7 +13494,8 @@ function render_tabs(gobj, items) {
13487
13494
  ]);
13488
13495
  }
13489
13496
  function render_cards(gobj, items) {
13490
- return (0, _yuneta_gobj_js.createElement2)(cards_grid_descriptor(items, (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "show_label")));
13497
+ let show_label = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "show_label");
13498
+ return (0, _yuneta_gobj_js.createElement2)(cards_grid_descriptor(items, show_label));
13491
13499
  }
13492
13500
  /************************************************************
13493
13501
  * "backbar": a single "← <section>" link back to the section
@@ -13954,13 +13962,14 @@ function create_gclass$6(gclass_name) {
13954
13962
  ac_set_items,
13955
13963
  null
13956
13964
  ]]]];
13957
- __gclass__$6 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
13965
+ const event_types = [
13958
13966
  ["EV_ROUTE_CHANGED", 0],
13959
13967
  ["EV_SET_ITEMS", 0],
13960
13968
  ["EV_NAV_CLICKED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
13961
13969
  ["EV_NAV_ITEM_CLOSE", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
13962
13970
  ["EV_DRAWER_CLOSE_REQUESTED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT]
13963
- ], states, gmt$6, 0, attrs_table$6, PRIVATE_DATA$6, 0, 0, 0, 0);
13971
+ ];
13972
+ __gclass__$6 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$6, 0, attrs_table$6, PRIVATE_DATA$6, 0, 0, 0, 0);
13964
13973
  if (!__gclass__$6) return -1;
13965
13974
  return 0;
13966
13975
  }
@@ -14126,20 +14135,21 @@ function build_body(shell, t) {
14126
14135
  kind: "group",
14127
14136
  children: map.other
14128
14137
  });
14138
+ let root = {
14139
+ label: map.brand.label || "app",
14140
+ icon: "",
14141
+ route: map.brand.route || "",
14142
+ event: "",
14143
+ current: !!map.brand.current,
14144
+ children
14145
+ };
14129
14146
  let $tree = (0, _yuneta_gobj_js.createElement2)([
14130
14147
  "div",
14131
14148
  { class: "ROUTEMAP_TREE" },
14132
14149
  [(0, _yuneta_gobj_js.createElement2)([
14133
14150
  "ul",
14134
14151
  { class: "ROUTEMAP_UL ROUTEMAP_ROOT" },
14135
- [render_node({
14136
- label: map.brand.label || "app",
14137
- icon: "",
14138
- route: map.brand.route || "",
14139
- event: "",
14140
- current: !!map.brand.current,
14141
- children
14142
- })]
14152
+ [render_node(root)]
14143
14153
  ])]
14144
14154
  ]);
14145
14155
  let $search = (0, _yuneta_gobj_js.createElement2)(["input", {
@@ -14742,7 +14752,8 @@ function add_tab(gobj, gobj2, id, text, icon) {
14742
14752
  ************************************************************/
14743
14753
  function select_topic_by_id(gobj, id) {
14744
14754
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW", { href: id }, gobj);
14745
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_TOPIC_SELECTED", { topic: id.indexOf("?") >= 0 ? id.split("?")[1] : id });
14755
+ let topic = id.indexOf("?") >= 0 ? id.split("?")[1] : id;
14756
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_TOPIC_SELECTED", { topic });
14746
14757
  }
14747
14758
  /************************************************************
14748
14759
  * One icon-action anchor of a topic card: a REAL hash link
@@ -15190,13 +15201,14 @@ function process_treedb_descs$1(gobj) {
15190
15201
  (0, _yuneta_gobj_js.gobj_start)(gobj_topic_form);
15191
15202
  }
15192
15203
  let href = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "last_selection");
15193
- if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_cards_landing")) if (gobj.priv._pending_info) {
15194
- let ti = gobj.priv._pending_info;
15195
- gobj.priv._pending_info = null;
15196
- show_topic_info(gobj, ti);
15197
- } else if (href && href.indexOf("?") >= 0) (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW", { href }, gobj);
15198
- else show_topics_landing(gobj);
15199
- else {
15204
+ if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_cards_landing")) {
15205
+ if (gobj.priv._pending_info) {
15206
+ let ti = gobj.priv._pending_info;
15207
+ gobj.priv._pending_info = null;
15208
+ show_topic_info(gobj, ti);
15209
+ } else if (href && href.indexOf("?") >= 0) (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW", { href }, gobj);
15210
+ else show_topics_landing(gobj);
15211
+ } else {
15200
15212
  if (!href) try {
15201
15213
  let topic = window.localStorage.getItem(`yui_treedb_topics:${(0, _yuneta_gobj_js.gobj_name)(gobj)}`);
15202
15214
  if (topic) href = `${(0, _yuneta_gobj_js.gobj_name)(gobj)}?${topic}`;
@@ -15538,7 +15550,10 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
15538
15550
  break;
15539
15551
  case "nodes":
15540
15552
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw_command, "topic_name", "", _yuneta_gobj_js.kw_flag_t.KW_REQUIRED);
15541
- if (result >= 0) (0, _yuneta_gobj_js.gobj_send_event)((0, _yuneta_gobj_js.gobj_find_child)(gobj, { __gobj_name__: `${(0, _yuneta_gobj_js.gobj_name)(gobj)}?${topic_name}` }), "EV_LOAD_NODES", data, gobj);
15553
+ if (result >= 0) {
15554
+ let gobj_topic_form = (0, _yuneta_gobj_js.gobj_find_child)(gobj, { __gobj_name__: `${(0, _yuneta_gobj_js.gobj_name)(gobj)}?${topic_name}` });
15555
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj_topic_form, "EV_LOAD_NODES", data, gobj);
15556
+ }
15542
15557
  break;
15543
15558
  case "create-node":
15544
15559
  case "update-node":
@@ -15704,7 +15719,10 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
15704
15719
  let treedb_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "treedb_name", "", 0);
15705
15720
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
15706
15721
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
15707
- if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) (0, _yuneta_gobj_js.gobj_send_event)(get_gobj_formtable(gobj, topic_name), "EV_LOAD_NODE_CREATED", [node], gobj);
15722
+ if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
15723
+ let gobj_formtable = get_gobj_formtable(gobj, topic_name);
15724
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_LOAD_NODE_CREATED", [node], gobj);
15725
+ }
15708
15726
  return 0;
15709
15727
  }
15710
15728
  /********************************************
@@ -15714,7 +15732,10 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
15714
15732
  let treedb_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "treedb_name", "", 0);
15715
15733
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
15716
15734
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
15717
- if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) (0, _yuneta_gobj_js.gobj_send_event)(get_gobj_formtable(gobj, topic_name), "EV_LOAD_NODE_UPDATED", [node], gobj);
15735
+ if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
15736
+ let gobj_formtable = get_gobj_formtable(gobj, topic_name);
15737
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_LOAD_NODE_UPDATED", [node], gobj);
15738
+ }
15718
15739
  return 0;
15719
15740
  }
15720
15741
  /********************************************
@@ -15724,7 +15745,10 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
15724
15745
  let treedb_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "treedb_name", "", 0);
15725
15746
  let topic_name = (0, _yuneta_gobj_js.kw_get_str)(gobj, kw, "topic_name", "", 0);
15726
15747
  let node = (0, _yuneta_gobj_js.kw_get_dict_value)(gobj, kw, "node", null, 0);
15727
- if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) (0, _yuneta_gobj_js.gobj_send_event)(get_gobj_formtable(gobj, topic_name), "EV_NODE_DELETED", [node], gobj);
15748
+ if (treedb_name === (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "treedb_name")) {
15749
+ let gobj_formtable = get_gobj_formtable(gobj, topic_name);
15750
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj_formtable, "EV_NODE_DELETED", [node], gobj);
15751
+ }
15728
15752
  return 0;
15729
15753
  }
15730
15754
  /********************************************
@@ -15930,7 +15954,7 @@ function create_gclass$5(gclass_name) {
15930
15954
  null
15931
15955
  ]
15932
15956
  ]]];
15933
- __gclass__$5 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
15957
+ const event_types = [
15934
15958
  ["EV_MT_COMMAND_ANSWER", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
15935
15959
  ["EV_TREEDB_NODE_CREATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
15936
15960
  ["EV_TREEDB_NODE_UPDATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
@@ -15951,7 +15975,8 @@ function create_gclass$5(gclass_name) {
15951
15975
  ["EV_BACK_TO_TOPICS", 0],
15952
15976
  ["EV_TRANSPORT_STATE", 0],
15953
15977
  ["EV_TOPIC_SELECTED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS]
15954
- ], states, gmt$5, 0, attrs_table$5, PRIVATE_DATA$5, 0, 0, 0, 0);
15978
+ ];
15979
+ __gclass__$5 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$5, 0, attrs_table$5, PRIVATE_DATA$5, 0, 0, 0, 0);
15955
15980
  if (!__gclass__$5) return -1;
15956
15981
  return 0;
15957
15982
  }
@@ -16081,6 +16106,7 @@ var attrs_table$4 = [
16081
16106
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_paste_button", 0, true, "Button toolbar PASTE"),
16082
16107
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_refresh_button", 0, true, "Button toolbar REFRESH"),
16083
16108
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_search_button", 0, true, "Button toolbar SEARCH"),
16109
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_schema_button", 0, true, "Button toolbar SCHEMA (show the topic's desc)"),
16084
16110
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_in_row_edit_icons", 0, true, "Add a last column with internal EDIT/DELETE icon"),
16085
16111
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "editable", 0, false, "Edit state"),
16086
16112
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_checkbox", 0, true, "Auxiliary first column to select rows"),
@@ -16114,7 +16140,11 @@ var PRIVATE_DATA$4 = {
16114
16140
  topic_name: "",
16115
16141
  tabulator: null,
16116
16142
  form: null,
16117
- form_modal: null
16143
+ form_modal: null,
16144
+ schema_gobj: null,
16145
+ schema_modal: null,
16146
+ cell_json_gobj: null,
16147
+ cell_json_modal: null
16118
16148
  };
16119
16149
  var __gclass__$4 = null;
16120
16150
  function popup_mount_layer(gobj) {
@@ -16153,6 +16183,8 @@ function mt_stop$4(gobj) {
16153
16183
  let shell = yui_shell_of(gobj);
16154
16184
  if (shell) (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
16155
16185
  close_form_dialog(gobj);
16186
+ close_schema_dialog(gobj);
16187
+ close_cell_json_dialog(gobj);
16156
16188
  table__destroy(gobj);
16157
16189
  }
16158
16190
  /***************************************************************
@@ -16160,6 +16192,8 @@ function mt_stop$4(gobj) {
16160
16192
  ***************************************************************/
16161
16193
  function mt_destroy$4(gobj) {
16162
16194
  close_form_dialog(gobj);
16195
+ close_schema_dialog(gobj);
16196
+ close_cell_json_dialog(gobj);
16163
16197
  destroy_ui$1(gobj);
16164
16198
  }
16165
16199
  /************************************************************
@@ -16215,7 +16249,8 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
16215
16249
  async function readClipboard(gobj) {
16216
16250
  try {
16217
16251
  const text = await navigator.clipboard.readText();
16218
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_ROWS", JSON.parse(text), gobj);
16252
+ let kw = JSON.parse(text);
16253
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_ROWS", kw, gobj);
16219
16254
  } catch (error) {
16220
16255
  (0, _yuneta_gobj_js.log_error)(`Failed to read clipboard contents: ${error}`);
16221
16256
  }
@@ -16361,7 +16396,9 @@ function build_ui$4(gobj) {
16361
16396
  let toolbar_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "toolbar_id");
16362
16397
  let $view_toolbar = (0, _yuneta_gobj_js.createElement2)(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
16363
16398
  let with_refresh_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_refresh_button");
16364
- if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_search_button")) {
16399
+ let with_search_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_search_button");
16400
+ let with_schema_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_schema_button");
16401
+ if (with_search_button) {
16365
16402
  let search_id = `${toolbar_id}_search`;
16366
16403
  let $search_box = (0, _yuneta_gobj_js.createElement2)([
16367
16404
  "div",
@@ -16419,6 +16456,33 @@ function build_ui$4(gobj) {
16419
16456
  ]);
16420
16457
  $view_toolbar.appendChild($refresh);
16421
16458
  }
16459
+ if (with_schema_button) {
16460
+ let $schema = (0, _yuneta_gobj_js.createElement2)([
16461
+ "button",
16462
+ {
16463
+ class: "TREEDB_TABLE_SCHEMA button mr-1",
16464
+ title: (0, i18next.t)("schema"),
16465
+ "data-i18n-title": "schema",
16466
+ "aria-label": (0, i18next.t)("schema"),
16467
+ "data-i18n-aria-label": "schema"
16468
+ },
16469
+ [["i", { class: "yi-hexagon-nodes" }], [
16470
+ "span",
16471
+ {
16472
+ class: "is-hidden-mobile",
16473
+ i18n: "schema",
16474
+ style: "padding-left:5px;"
16475
+ },
16476
+ "schema"
16477
+ ]],
16478
+ { "click": (event) => {
16479
+ event.stopPropagation();
16480
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW_SCHEMA", {}, gobj);
16481
+ } }
16482
+ ]);
16483
+ $view_toolbar.appendChild($schema);
16484
+ }
16485
+ let table_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "table_id");
16422
16486
  let $container = (0, _yuneta_gobj_js.createElement2)([
16423
16487
  "div",
16424
16488
  {
@@ -16429,7 +16493,7 @@ function build_ui$4(gobj) {
16429
16493
  class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
16430
16494
  style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
16431
16495
  }], ["div", {
16432
- id: `${(0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "table_id")}`,
16496
+ id: `${table_id}`,
16433
16497
  style: "margin-top:0px !important;"
16434
16498
  }]]
16435
16499
  ]);
@@ -16472,7 +16536,8 @@ function destroy_ui$1(gobj) {
16472
16536
  * columns); leave the rest on the flat shared key.
16473
16537
  ******************************************************************/
16474
16538
  function col_label(col, topic_name) {
16475
- return (0, i18next.t)(topic_name ? [topic_name + "." + col.id, col.id] : [col.id], { defaultValue: col.header || col.id });
16539
+ let keys = topic_name ? [topic_name + "." + col.id, col.id] : [col.id];
16540
+ return (0, i18next.t)(keys, { defaultValue: col.header || col.id });
16476
16541
  }
16477
16542
  /******************************************************************
16478
16543
  * Column-title formatter: render the header as a span carrying
@@ -16534,6 +16599,20 @@ function create_tabulator(gobj) {
16534
16599
  if (col) return transform__treedb_value_2_table_value(gobj, col, value, row, field);
16535
16600
  return "???";
16536
16601
  }
16602
+ function json_cell_click(e, cell) {
16603
+ if (!cell.getElement().querySelector(".JSON_CELL")) return;
16604
+ e.stopPropagation();
16605
+ let pkey = desc.pkey || "id";
16606
+ let row_id = cell.getData()[pkey];
16607
+ if (row_id === void 0 || row_id === null) {
16608
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: row without pkey '${pkey}', cannot open the json of '${cell.getField()}'`);
16609
+ return;
16610
+ }
16611
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW_CELL_JSON", {
16612
+ row_id,
16613
+ col_id: cell.getField()
16614
+ }, gobj);
16615
+ }
16537
16616
  for (let i = 0; i < desc.cols.length; i++) {
16538
16617
  let col = desc.cols[i];
16539
16618
  if (!col.id || col.id[0] === "_") continue;
@@ -16587,7 +16666,10 @@ function create_tabulator(gobj) {
16587
16666
  case "array":
16588
16667
  case "list":
16589
16668
  case "coordinates":
16590
- case "blob": break;
16669
+ case "blob":
16670
+ case "gbuffer":
16671
+ cellClick = json_cell_click;
16672
+ break;
16591
16673
  case "boolean":
16592
16674
  hozAlign = "center";
16593
16675
  vertAlign = "middle";
@@ -16598,7 +16680,6 @@ function create_tabulator(gobj) {
16598
16680
  case "real":
16599
16681
  hozAlign = "right";
16600
16682
  sorter = "number";
16601
- break;
16602
16683
  }
16603
16684
  let colDef = {
16604
16685
  title: col_label(col, (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name")),
@@ -16713,6 +16794,36 @@ function table__destroy(gobj) {
16713
16794
  }
16714
16795
  }
16715
16796
  /************************************************************
16797
+ * Cell of a col holding a JSON document (dict/list/blob/
16798
+ * template/coordinates/…): a one-line truncated preview,
16799
+ * marked as a link because the click opens the whole value
16800
+ * in a viewer (json_cell_click -> EV_SHOW_CELL_JSON).
16801
+ *
16802
+ * An empty document gets no link — there is nothing to open,
16803
+ * and json_cell_click uses its absence to ignore the click.
16804
+ *
16805
+ * Built as a DOM node and not as an HTML string: the preview
16806
+ * is raw record data, so it must never be parsed as markup.
16807
+ ************************************************************/
16808
+ function build_json_cell_preview(value) {
16809
+ if (value === null || value === void 0 || (0, _yuneta_gobj_js.json_size)(value) === 0) return "";
16810
+ let text = JSON.stringify(value);
16811
+ if (text && text.length > 20) text = text.substring(0, 20) + "…";
16812
+ return (0, _yuneta_gobj_js.createElement2)([
16813
+ "a",
16814
+ {
16815
+ class: "JSON_CELL",
16816
+ title: (0, i18next.t)("show json"),
16817
+ "data-i18n-title": "show json"
16818
+ },
16819
+ [["span", { class: "JSON_CELL_ICON icon yi-eye" }], [
16820
+ "span",
16821
+ { class: "JSON_CELL_PREVIEW" },
16822
+ text
16823
+ ]]
16824
+ ]);
16825
+ }
16826
+ /************************************************************
16716
16827
  * Convert a record column value from backend to frontend
16717
16828
  ************************************************************/
16718
16829
  function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
@@ -16734,8 +16845,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16734
16845
  case "coordinates":
16735
16846
  case "blob":
16736
16847
  case "gbuffer":
16737
- value = JSON.stringify(value);
16738
- if (value && value.length > 20) value = value.substring(0, 20) + "…";
16848
+ value = build_json_cell_preview(value);
16739
16849
  break;
16740
16850
  case "enum":
16741
16851
  switch (field_desc.real_type) {
@@ -16743,9 +16853,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16743
16853
  case "object":
16744
16854
  case "dict":
16745
16855
  case "array":
16746
- case "list":
16747
- value = JSON.stringify(value);
16748
- break;
16856
+ case "list": value = JSON.stringify(value);
16749
16857
  }
16750
16858
  break;
16751
16859
  case "hook":
@@ -16762,14 +16870,16 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16762
16870
  break;
16763
16871
  case "fkey":
16764
16872
  let new_value = [];
16765
- if (value) if ((0, _yuneta_gobj_js.is_string)(value)) {
16766
- let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value);
16767
- if (fkey) new_value.push(fkey.id);
16768
- } else if ((0, _yuneta_gobj_js.is_array)(value)) for (let i = 0; i < value.length; i++) {
16769
- let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value[i]);
16770
- if (fkey) new_value.push(fkey.id);
16873
+ if (value) {
16874
+ if ((0, _yuneta_gobj_js.is_string)(value)) {
16875
+ let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value);
16876
+ if (fkey) new_value.push(fkey.id);
16877
+ } else if ((0, _yuneta_gobj_js.is_array)(value)) for (let i = 0; i < value.length; i++) {
16878
+ let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value[i]);
16879
+ if (fkey) new_value.push(fkey.id);
16880
+ }
16881
+ else (0, _yuneta_gobj_js.log_error)("fkey type unsupported: " + JSON.stringify(value));
16771
16882
  }
16772
- else (0, _yuneta_gobj_js.log_error)("fkey type unsupported: " + JSON.stringify(value));
16773
16883
  value = new_value.join(", ");
16774
16884
  break;
16775
16885
  case "now":
@@ -16790,14 +16900,11 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16790
16900
  second: "2-digit",
16791
16901
  hour12: true
16792
16902
  }).format(value) + "</span>";
16793
- break;
16794
16903
  }
16795
16904
  break;
16796
16905
  case "color": break;
16797
16906
  case "image": break;
16798
- default:
16799
- (0, _yuneta_gobj_js.log_error)(`transform__treedb_value_2_table_value() unhandled type '${field_desc.type}' (real_type='${field_desc.real_type}') for field '${field}', topic ${priv.topic_name}`);
16800
- break;
16907
+ default: (0, _yuneta_gobj_js.log_error)(`transform__treedb_value_2_table_value() unhandled type '${field_desc.type}' (real_type='${field_desc.real_type}') for field '${field}', topic ${priv.topic_name}`);
16801
16908
  }
16802
16909
  if (value !== null && value !== void 0 && typeof value === "object" && !(value instanceof Node)) {
16803
16910
  (0, _yuneta_gobj_js.log_error)(`transform__treedb_value_2_table_value() unexpected object value for field '${field}' (type='${field_desc.type}', real_type='${field_desc.real_type}'): ${JSON.stringify(value)}, topic ${priv.topic_name}`);
@@ -16965,6 +17072,171 @@ function close_form_dialog(gobj) {
16965
17072
  teardown_form_child(gobj);
16966
17073
  }
16967
17074
  /************************************************************
17075
+ * Show the topic's SCHEMA: its `desc` — pkey, cols, types,
17076
+ * flags and fkey targets — in the standardized adaptive
17077
+ * dialog, rendered by a C_YUI_JSON child. A viewer and not a
17078
+ * <pre> dump because a forty-column topic is only readable
17079
+ * collapsed and searchable.
17080
+ *
17081
+ * Read-only and offline: the desc is already in this gobj,
17082
+ * so no command is issued and nothing can be edited here.
17083
+ ************************************************************/
17084
+ function open_schema_dialog(gobj) {
17085
+ close_schema_dialog(gobj);
17086
+ let priv = gobj.priv;
17087
+ let desc = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "desc");
17088
+ if (!desc) {
17089
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no desc, no schema to show`);
17090
+ return;
17091
+ }
17092
+ let shell = yui_shell_of(gobj);
17093
+ if (!shell) {
17094
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no shell, cannot open the schema view`);
17095
+ return;
17096
+ }
17097
+ let json_view = (0, _yuneta_gobj_js.gobj_create_pure_child)("schema_" + (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)), "C_YUI_JSON", {}, gobj);
17098
+ if (!json_view) {
17099
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot create the schema viewer`);
17100
+ return;
17101
+ }
17102
+ priv.schema_gobj = json_view;
17103
+ (0, _yuneta_gobj_js.gobj_start)(json_view);
17104
+ let $box = (0, _yuneta_gobj_js.gobj_read_attr)(json_view, "$container");
17105
+ if (!$box) {
17106
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the schema viewer built no $container`);
17107
+ teardown_schema_child(gobj);
17108
+ return;
17109
+ }
17110
+ priv.schema_modal = yui_shell_show_modal(shell, $box, {
17111
+ dialog: true,
17112
+ logical_class: "TREEDB_SCHEMA_SHEET",
17113
+ title_prefix: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"),
17114
+ title: "schema",
17115
+ t: i18next.t,
17116
+ on_close: function() {
17117
+ teardown_schema_child(gobj);
17118
+ }
17119
+ });
17120
+ (0, _yuneta_gobj_js.gobj_send_event)(json_view, "EV_SET_JSON", { json: desc }, gobj);
17121
+ }
17122
+ /************************************************************
17123
+ * Destroy the hosted C_YUI_JSON child. Called from the
17124
+ * schema modal's on_close — the shell has already removed
17125
+ * the dialog DOM and retired its Escape / history entries.
17126
+ ************************************************************/
17127
+ function teardown_schema_child(gobj) {
17128
+ let priv = gobj.priv;
17129
+ if (priv.schema_gobj) {
17130
+ if ((0, _yuneta_gobj_js.gobj_is_running)(priv.schema_gobj)) (0, _yuneta_gobj_js.gobj_stop)(priv.schema_gobj);
17131
+ (0, _yuneta_gobj_js.gobj_destroy)(priv.schema_gobj);
17132
+ priv.schema_gobj = null;
17133
+ }
17134
+ priv.schema_modal = null;
17135
+ }
17136
+ /************************************************************
17137
+ * Close the schema dialog (teardown, or a second open).
17138
+ * Closing the modal runs its on_close, which tears the
17139
+ * viewer child down.
17140
+ ************************************************************/
17141
+ function close_schema_dialog(gobj) {
17142
+ let priv = gobj.priv;
17143
+ if (priv.schema_modal) {
17144
+ let modal = priv.schema_modal;
17145
+ priv.schema_modal = null;
17146
+ modal.close();
17147
+ return;
17148
+ }
17149
+ teardown_schema_child(gobj);
17150
+ }
17151
+ /************************************************************
17152
+ * Show the JSON document held by ONE CELL — the value of a
17153
+ * dict/list/object/array/blob/template/coordinates col — in
17154
+ * the standardized adaptive dialog, rendered by a C_YUI_JSON
17155
+ * child. The cell can only show a 20-char preview; this is
17156
+ * where the value is actually readable (collapsed, searchable).
17157
+ *
17158
+ * Read-only and offline: the record is already in the table,
17159
+ * so no command is issued and nothing can be edited here (the
17160
+ * edit form remains the way to change the value).
17161
+ ************************************************************/
17162
+ function open_cell_json_dialog(gobj, row_id, col_id) {
17163
+ close_cell_json_dialog(gobj);
17164
+ let priv = gobj.priv;
17165
+ let tabulator = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "tabulator");
17166
+ if (!tabulator) {
17167
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no table, no cell to show`);
17168
+ return;
17169
+ }
17170
+ let row = tabulator.getRow(row_id);
17171
+ if (!row) {
17172
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: row '${row_id}' not found in the table`);
17173
+ return;
17174
+ }
17175
+ let value = row.getData()[col_id];
17176
+ if (value === void 0) {
17177
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: row '${row_id}' has no col '${col_id}'`);
17178
+ return;
17179
+ }
17180
+ let shell = yui_shell_of(gobj);
17181
+ if (!shell) {
17182
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no shell, cannot open the cell json`);
17183
+ return;
17184
+ }
17185
+ let json_view = (0, _yuneta_gobj_js.gobj_create_pure_child)("cell_" + (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)), "C_YUI_JSON", {}, gobj);
17186
+ if (!json_view) {
17187
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot create the cell json viewer`);
17188
+ return;
17189
+ }
17190
+ priv.cell_json_gobj = json_view;
17191
+ (0, _yuneta_gobj_js.gobj_start)(json_view);
17192
+ let $box = (0, _yuneta_gobj_js.gobj_read_attr)(json_view, "$container");
17193
+ if (!$box) {
17194
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the cell json viewer built no $container`);
17195
+ teardown_cell_json_child(gobj);
17196
+ return;
17197
+ }
17198
+ priv.cell_json_modal = yui_shell_show_modal(shell, $box, {
17199
+ dialog: true,
17200
+ logical_class: "TREEDB_CELL_JSON_SHEET",
17201
+ title_prefix: String(row_id),
17202
+ title: col_id,
17203
+ t: i18next.t,
17204
+ on_close: function() {
17205
+ teardown_cell_json_child(gobj);
17206
+ }
17207
+ });
17208
+ (0, _yuneta_gobj_js.gobj_send_event)(json_view, "EV_SET_JSON", { json: value }, gobj);
17209
+ }
17210
+ /************************************************************
17211
+ * Destroy the hosted C_YUI_JSON child. Called from the cell
17212
+ * modal's on_close — the shell has already removed the dialog
17213
+ * DOM and retired its Escape / history entries.
17214
+ ************************************************************/
17215
+ function teardown_cell_json_child(gobj) {
17216
+ let priv = gobj.priv;
17217
+ if (priv.cell_json_gobj) {
17218
+ if ((0, _yuneta_gobj_js.gobj_is_running)(priv.cell_json_gobj)) (0, _yuneta_gobj_js.gobj_stop)(priv.cell_json_gobj);
17219
+ (0, _yuneta_gobj_js.gobj_destroy)(priv.cell_json_gobj);
17220
+ priv.cell_json_gobj = null;
17221
+ }
17222
+ priv.cell_json_modal = null;
17223
+ }
17224
+ /************************************************************
17225
+ * Close the cell json dialog (teardown, or a second open).
17226
+ * Closing the modal runs its on_close, which tears the
17227
+ * viewer child down.
17228
+ ************************************************************/
17229
+ function close_cell_json_dialog(gobj) {
17230
+ let priv = gobj.priv;
17231
+ if (priv.cell_json_modal) {
17232
+ let modal = priv.cell_json_modal;
17233
+ priv.cell_json_modal = null;
17234
+ modal.close();
17235
+ return;
17236
+ }
17237
+ teardown_cell_json_child(gobj);
17238
+ }
17239
+ /************************************************************
16968
17240
  * True if the topic's pkey col carries the "rowid" flag.
16969
17241
  ************************************************************/
16970
17242
  function pkey_is_rowid(gobj) {
@@ -17078,16 +17350,16 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
17078
17350
  case "enum":
17079
17351
  switch (field_desc.real_type) {
17080
17352
  case "string":
17081
- if ((0, _yuneta_gobj_js.is_array)(value)) if (value.length > 0) value = value[0];
17082
- else value = "";
17353
+ if ((0, _yuneta_gobj_js.is_array)(value)) {
17354
+ if (value.length > 0) value = value[0];
17355
+ else value = "";
17356
+ }
17083
17357
  break;
17084
17358
  case "object":
17085
17359
  case "dict":
17086
17360
  case "array":
17087
17361
  case "list": break;
17088
- default:
17089
- (0, _yuneta_gobj_js.log_error)("col type unknown 6: " + field_desc.real_type);
17090
- break;
17362
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 6: " + field_desc.real_type);
17091
17363
  }
17092
17364
  break;
17093
17365
  case "now":
@@ -17099,23 +17371,17 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
17099
17371
  case "integer":
17100
17372
  if (value && (0, _yuneta_gobj_js.is_date)(value)) value = value.getTime() / 1e3;
17101
17373
  break;
17102
- default:
17103
- (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17104
- break;
17374
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17105
17375
  }
17106
17376
  break;
17107
17377
  case "color":
17108
17378
  switch (field_desc.real_type) {
17109
17379
  case "string": break;
17110
17380
  case "integer": break;
17111
- default:
17112
- (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17113
- break;
17381
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17114
17382
  }
17115
17383
  break;
17116
- default:
17117
- (0, _yuneta_gobj_js.log_error)("col type unknown 8: " + field_desc.type);
17118
- break;
17384
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 8: " + field_desc.type);
17119
17385
  }
17120
17386
  return value;
17121
17387
  }
@@ -17157,9 +17423,7 @@ function build_fkey_ref(gobj, col, value) {
17157
17423
  refs[topic_name + "^" + v + "^" + hook] = true;
17158
17424
  break;
17159
17425
  case "array":
17160
- case "list":
17161
- refs.push(topic_name + "^" + v + "^" + hook);
17162
- break;
17426
+ case "list": refs.push(topic_name + "^" + v + "^" + hook);
17163
17427
  }
17164
17428
  } else if ((0, _yuneta_gobj_js.is_object)(v)) {
17165
17429
  let topic_name = v.topic_name;
@@ -17172,9 +17436,7 @@ function build_fkey_ref(gobj, col, value) {
17172
17436
  refs[topic_name + "^" + v.id + "^" + hook] = true;
17173
17437
  break;
17174
17438
  case "array":
17175
- case "list":
17176
- refs.push(topic_name + "^" + v.id + "^" + hook);
17177
- break;
17439
+ case "list": refs.push(topic_name + "^" + v.id + "^" + hook);
17178
17440
  }
17179
17441
  } else {
17180
17442
  (0, _yuneta_gobj_js.log_error)("Merde value1: " + v);
@@ -17291,8 +17553,10 @@ function ac_load_nodes(gobj, event, kw, src) {
17291
17553
  return -1;
17292
17554
  }
17293
17555
  let tabulator = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "tabulator");
17294
- if (tabulator) if (tabulator._ready) tabulator.setData(data);
17295
- else tabulator._pendingData = data;
17556
+ if (tabulator) {
17557
+ if (tabulator._ready) tabulator.setData(data);
17558
+ else tabulator._pendingData = data;
17559
+ }
17296
17560
  return 0;
17297
17561
  }
17298
17562
  /************************************************************
@@ -17401,9 +17665,7 @@ function ac_new_row(gobj, event, kw, src) {
17401
17665
  case "template":
17402
17666
  if (col.template) row[col.id] = col.template;
17403
17667
  break;
17404
- default:
17405
- if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
17406
- break;
17668
+ default: if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
17407
17669
  }
17408
17670
  }
17409
17671
  show_create_form(gobj, row);
@@ -17494,7 +17756,8 @@ function ac_paste_rows(gobj, event, kw, src) {
17494
17756
  * fkeys, times and numbers). Route by the form's mode.
17495
17757
  ************************************************************/
17496
17758
  function ac_form_save_record(gobj, event, kw, src) {
17497
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, (0, _yuneta_gobj_js.gobj_read_str_attr)(src, "form_mode") === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
17759
+ let mode = (0, _yuneta_gobj_js.gobj_read_str_attr)(src, "form_mode");
17760
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, mode === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
17498
17761
  topic_name: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"),
17499
17762
  record: kw
17500
17763
  });
@@ -17511,12 +17774,14 @@ function ac_select_rows(gobj, event, kw, src) {
17511
17774
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
17512
17775
  let $button_delete_record = $container.querySelector(`.button-delete-record`);
17513
17776
  let $button_copy_record = $container.querySelector(`.button-copy-record`);
17514
- if ($button_delete_record) if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17515
- $button_delete_record.removeAttribute("disabled");
17516
- $button_copy_record.removeAttribute("disabled");
17517
- } else {
17518
- $button_delete_record.setAttribute("disabled", true);
17519
- $button_copy_record.setAttribute("disabled", true);
17777
+ if ($button_delete_record) {
17778
+ if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17779
+ $button_delete_record.removeAttribute("disabled");
17780
+ $button_copy_record.removeAttribute("disabled");
17781
+ } else {
17782
+ $button_delete_record.setAttribute("disabled", true);
17783
+ $button_copy_record.setAttribute("disabled", true);
17784
+ }
17520
17785
  }
17521
17786
  if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "broadcast_select_rows_event")) (0, _yuneta_gobj_js.gobj_publish_event)(gobj, event, kw);
17522
17787
  return 0;
@@ -17529,12 +17794,14 @@ function ac_unselect_rows(gobj, event, kw, src) {
17529
17794
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
17530
17795
  let $button_delete_record = $container.querySelector(`.button-delete-record`);
17531
17796
  let $button_copy_record = $container.querySelector(`.button-copy-record`);
17532
- if ($button_delete_record) if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17533
- $button_delete_record.removeAttribute("disabled");
17534
- $button_copy_record.removeAttribute("disabled");
17535
- } else {
17536
- $button_delete_record.setAttribute("disabled", true);
17537
- $button_copy_record.setAttribute("disabled", true);
17797
+ if ($button_delete_record) {
17798
+ if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17799
+ $button_delete_record.removeAttribute("disabled");
17800
+ $button_copy_record.removeAttribute("disabled");
17801
+ } else {
17802
+ $button_delete_record.setAttribute("disabled", true);
17803
+ $button_copy_record.setAttribute("disabled", true);
17804
+ }
17538
17805
  }
17539
17806
  if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "broadcast_select_rows_event")) (0, _yuneta_gobj_js.gobj_publish_event)(gobj, event, kw);
17540
17807
  return 0;
@@ -17556,7 +17823,8 @@ function ac_change_locale(gobj, event, kw, src) {
17556
17823
  * };
17557
17824
  ************************************************************/
17558
17825
  function ac_show_hook_data$1(gobj, event, kw, src) {
17559
- let row = (0, _yuneta_gobj_js.kwid_find_one_record)(gobj, (0, _yuneta_gobj_js.gobj_command)((0, _yuneta_gobj_js.gobj_parent)(gobj), "get_topic_data", kw, gobj).data, kw.row_id, null);
17826
+ let webix = (0, _yuneta_gobj_js.gobj_command)((0, _yuneta_gobj_js.gobj_parent)(gobj), "get_topic_data", kw, gobj);
17827
+ let row = (0, _yuneta_gobj_js.kwid_find_one_record)(gobj, webix.data, kw.row_id, null);
17560
17828
  if (row) {
17561
17829
  let cell = row[kw.col_id];
17562
17830
  show_dropdown_popup_menu(gobj, kw.click_x, kw.click_y, cell);
@@ -17571,6 +17839,24 @@ function ac_refresh$1(gobj, event, kw, src) {
17571
17839
  return 0;
17572
17840
  }
17573
17841
  /************************************************************
17842
+ * Show the JSON document of one cell
17843
+ * {
17844
+ * row_id:
17845
+ * col_id:
17846
+ * }
17847
+ ************************************************************/
17848
+ function ac_show_cell_json(gobj, event, kw, src) {
17849
+ open_cell_json_dialog(gobj, kw.row_id, kw.col_id);
17850
+ return 0;
17851
+ }
17852
+ /************************************************************
17853
+ * Show the schema (desc) of this topic
17854
+ ************************************************************/
17855
+ function ac_show_schema(gobj, event, kw, src) {
17856
+ open_schema_dialog(gobj);
17857
+ return 0;
17858
+ }
17859
+ /************************************************************
17574
17860
  * {
17575
17861
  * href: href
17576
17862
  * }
@@ -17674,6 +17960,11 @@ function create_gclass$4(gclass_name) {
17674
17960
  ac_show_hook_data$1,
17675
17961
  null
17676
17962
  ],
17963
+ [
17964
+ "EV_SHOW_CELL_JSON",
17965
+ ac_show_cell_json,
17966
+ null
17967
+ ],
17677
17968
  [
17678
17969
  "EV_CHANGE_LOCALE",
17679
17970
  ac_change_locale,
@@ -17684,6 +17975,11 @@ function create_gclass$4(gclass_name) {
17684
17975
  ac_refresh$1,
17685
17976
  null
17686
17977
  ],
17978
+ [
17979
+ "EV_SHOW_SCHEMA",
17980
+ ac_show_schema,
17981
+ null
17982
+ ],
17687
17983
  [
17688
17984
  "EV_SHOW",
17689
17985
  ac_show$3,
@@ -17695,7 +17991,7 @@ function create_gclass$4(gclass_name) {
17695
17991
  null
17696
17992
  ]
17697
17993
  ]]];
17698
- __gclass__$4 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
17994
+ const event_types = [
17699
17995
  ["EV_LANGUAGE_CHANGED", 0],
17700
17996
  ["EV_LOAD_NODES", 0],
17701
17997
  ["EV_LOAD_NODE_CREATED", 0],
@@ -17710,15 +18006,18 @@ function create_gclass$4(gclass_name) {
17710
18006
  ["EV_SELECT_ROWS", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17711
18007
  ["EV_UNSELECT_ROWS", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17712
18008
  ["EV_SHOW_HOOK_DATA", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
18009
+ ["EV_SHOW_CELL_JSON", 0],
17713
18010
  ["EV_CHANGE_LOCALE", 0],
17714
18011
  ["EV_REFRESH", 0],
18012
+ ["EV_SHOW_SCHEMA", 0],
17715
18013
  ["EV_CREATE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17716
18014
  ["EV_UPDATE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17717
18015
  ["EV_DELETE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17718
18016
  ["EV_REFRESH_TOPIC", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17719
18017
  ["EV_SHOW", 0],
17720
18018
  ["EV_HIDE", 0]
17721
- ], states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
18019
+ ];
18020
+ __gclass__$4 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
17722
18021
  if (!__gclass__$4) return -1;
17723
18022
  return 0;
17724
18023
  }
@@ -17727,6 +18026,7 @@ function create_gclass$4(gclass_name) {
17727
18026
  ***************************************************************/
17728
18027
  function register_c_yui_treedb_topic_with_form() {
17729
18028
  if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_FORM", false)) register_c_yui_form();
18029
+ if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON", false)) register_c_yui_json();
17730
18030
  return create_gclass$4(GCLASS_NAME$4);
17731
18031
  }
17732
18032
  //#endregion
@@ -17921,7 +18221,8 @@ function mt_create$3(gobj) {
17921
18221
  if (!subscriber) subscriber = (0, _yuneta_gobj_js.gobj_parent)(gobj);
17922
18222
  (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
17923
18223
  if (!priv.treedb_name) (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)} -> treedb_name not configured`);
17924
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "canvas_id", (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)) + "-canvas");
18224
+ let canvas_id = (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)) + "-canvas";
18225
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "canvas_id", canvas_id);
17925
18226
  let $container_canvas = build_ui$3(gobj).querySelector(`#${priv.canvas_id}`);
17926
18227
  priv.gobj_nodes_tree = (0, _yuneta_gobj_js.gobj_create_service)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}-g6`, "C_G6_NODES_TREE", {
17927
18228
  $container: $container_canvas,
@@ -18707,8 +19008,10 @@ function ac_mt_command_answer(gobj, event, kw, src) {
18707
19008
  else (0, _yuneta_gobj_js.gobj_send_event)(jv, "EV_SET_JSON", { json: data }, gobj);
18708
19009
  return 0;
18709
19010
  }
18710
- if (result < 0) if (command === "descs") show_load_error(gobj, (0, i18next.t)(comment));
18711
- else yui_shell_show_error(yui_shell_of(gobj), comment, { t: i18next.t });
19011
+ if (result < 0) {
19012
+ if (command === "descs") show_load_error(gobj, (0, i18next.t)(comment));
19013
+ else yui_shell_show_error(yui_shell_of(gobj), comment, { t: i18next.t });
19014
+ }
18712
19015
  switch (command) {
18713
19016
  case "descs":
18714
19017
  if (result >= 0) process_treedb_descs(gobj, data);
@@ -19244,7 +19547,7 @@ function create_gclass$3(gclass_name) {
19244
19547
  null
19245
19548
  ]
19246
19549
  ]]];
19247
- __gclass__$3 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
19550
+ const event_types = [
19248
19551
  ["EV_MT_COMMAND_ANSWER", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
19249
19552
  ["EV_TREEDB_NODE_CREATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
19250
19553
  ["EV_TREEDB_NODE_UPDATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
@@ -19273,7 +19576,8 @@ function create_gclass$3(gclass_name) {
19273
19576
  ["EV_SHOW", 0],
19274
19577
  ["EV_HIDE", 0],
19275
19578
  ["EV_TRANSPORT_STATE", 0]
19276
- ], states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
19579
+ ];
19580
+ __gclass__$3 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
19277
19581
  if (!__gclass__$3) return -1;
19278
19582
  return 0;
19279
19583
  }
@@ -19352,14 +19656,15 @@ function mt_destroy$2(gobj) {
19352
19656
  * Build UI
19353
19657
  ************************************************************/
19354
19658
  function build_ui$2(gobj) {
19355
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", (0, _yuneta_gobj_js.createElement2)([
19659
+ let $container = (0, _yuneta_gobj_js.createElement2)([
19356
19660
  "div",
19357
19661
  {
19358
19662
  class: "C_YUI_TREEDB_SCHEMA TREEDB_SCHEMA_VIEW",
19359
19663
  style: "position:relative; height:100%; min-height:0;"
19360
19664
  },
19361
19665
  []
19362
- ]));
19666
+ ]);
19667
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
19363
19668
  }
19364
19669
  /************************************************************
19365
19670
  * Derive {nodes, edges} from the schema.
@@ -19484,7 +19789,8 @@ function build_graph$1(gobj) {
19484
19789
  priv.graph = graph;
19485
19790
  graph.setTheme(dark ? "dark" : "light");
19486
19791
  graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
19487
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", { node_id: evt && evt.target && evt.target.id }, gobj);
19792
+ let node_id = evt && evt.target && evt.target.id;
19793
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", { node_id }, gobj);
19488
19794
  });
19489
19795
  graph.render().then(() => {
19490
19796
  try {
@@ -23613,7 +23919,6 @@ function segmentToCubic(segment, params) {
23613
23919
  py
23614
23920
  ];
23615
23921
  return ["C"].concat(lineToCubic(px1, py1, px, py));
23616
- default:
23617
23922
  }
23618
23923
  return segment;
23619
23924
  }
@@ -23637,7 +23942,8 @@ function path2Curve(pathInput, needZCommandIndexes) {
23637
23942
  for (var i = 0; i < ii; i += 1) {
23638
23943
  if (path[i]) pathCommand = path[i][0];
23639
23944
  allPathCommands[i] = pathCommand;
23640
- path[i] = segmentToCubic(path[i], params);
23945
+ var curveSegment = segmentToCubic(path[i], params);
23946
+ path[i] = curveSegment;
23641
23947
  fixArc(path, allPathCommands, i);
23642
23948
  ii = path.length;
23643
23949
  if (pathCommand === "Z") zCommandIndexes.push(i);
@@ -23689,20 +23995,22 @@ function segmentLineFactory(x1, y1, x2, y2, distance) {
23689
23995
  x: 0,
23690
23996
  y: 0
23691
23997
  };
23692
- if (typeof distance === "number") if (distance <= 0) point = {
23693
- x: x1,
23694
- y: y1
23695
- };
23696
- else if (distance >= length) point = {
23697
- x: x2,
23698
- y: y2
23699
- };
23700
- else {
23701
- var _a = midPoint([x1, y1], [x2, y2], distance / length);
23702
- point = {
23703
- x: _a[0],
23704
- y: _a[1]
23998
+ if (typeof distance === "number") {
23999
+ if (distance <= 0) point = {
24000
+ x: x1,
24001
+ y: y1
23705
24002
  };
24003
+ else if (distance >= length) point = {
24004
+ x: x2,
24005
+ y: y2
24006
+ };
24007
+ else {
24008
+ var _a = midPoint([x1, y1], [x2, y2], distance / length);
24009
+ point = {
24010
+ x: _a[0],
24011
+ y: _a[1]
24012
+ };
24013
+ }
23706
24014
  }
23707
24015
  return {
23708
24016
  length,
@@ -25258,7 +25566,11 @@ var Rectangle = /*#__PURE__*/ function() {
25258
25566
  value: function toJSON() {}
25259
25567
  }], [{
25260
25568
  key: "fromRect",
25261
- value: function fromRect(rect) {
25569
+ value:
25570
+ /**
25571
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/fromRect_static
25572
+ */
25573
+ function fromRect(rect) {
25262
25574
  return new Rectangle(rect.x, rect.y, rect.width, rect.height);
25263
25575
  }
25264
25576
  }, {
@@ -25348,14 +25660,15 @@ function getEulerFromMat4(out, m) {
25348
25660
  var z;
25349
25661
  var _mat4$getScaling2 = _slicedToArray(getScaling(create$3(), m), 3), sx = _mat4$getScaling2[0], sy = _mat4$getScaling2[1], sz = _mat4$getScaling2[2];
25350
25662
  var y = Math.asin(-m[2] / sx);
25351
- if (y < HALF_PI) if (y > -HALF_PI) {
25352
- x = Math.atan2(m[6] / sy, m[10] / sz);
25353
- z = Math.atan2(m[1] / sx, m[0] / sx);
25663
+ if (y < HALF_PI) {
25664
+ if (y > -HALF_PI) {
25665
+ x = Math.atan2(m[6] / sy, m[10] / sz);
25666
+ z = Math.atan2(m[1] / sx, m[0] / sx);
25667
+ } else {
25668
+ z = 0;
25669
+ x = -Math.atan2(m[4] / sy, m[5] / sy);
25670
+ }
25354
25671
  } else {
25355
- z = 0;
25356
- x = -Math.atan2(m[4] / sy, m[5] / sy);
25357
- }
25358
- else {
25359
25672
  z = 0;
25360
25673
  x = Math.atan2(m[4] / sy, m[5] / sy);
25361
25674
  }
@@ -25422,8 +25735,10 @@ function decompose(mat) {
25422
25735
  var row1y = mat[4];
25423
25736
  var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);
25424
25737
  var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);
25425
- if (row0x * row1y - row0y * row1x < 0) if (row0x < row1y) scalingX = -scalingX;
25426
- else scalingY = -scalingY;
25738
+ if (row0x * row1y - row0y * row1x < 0) {
25739
+ if (row0x < row1y) scalingX = -scalingX;
25740
+ else scalingY = -scalingY;
25741
+ }
25427
25742
  if (scalingX) {
25428
25743
  var invScalingX = 1 / scalingX;
25429
25744
  row0x *= invScalingX;
@@ -26397,9 +26712,10 @@ function updateLocalTransform(transform) {
26397
26712
  var hasRotation = localRotation[3] !== 1 || localRotation[0] !== 0 || localRotation[1] !== 0 || localRotation[2] !== 0;
26398
26713
  var hasScale = localScale[0] !== 1 || localScale[1] !== 1 || localScale[2] !== 1;
26399
26714
  var hasOrigin = origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0;
26400
- if (!hasRotation && !hasScale && !hasOrigin) if (hasPosition) fromTranslation(localTransform, localPosition);
26401
- else identity(localTransform);
26402
- else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
26715
+ if (!hasRotation && !hasScale && !hasOrigin) {
26716
+ if (hasPosition) fromTranslation(localTransform, localPosition);
26717
+ else identity(localTransform);
26718
+ } else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
26403
26719
  }
26404
26720
  transform.localDirtyFlag = false;
26405
26721
  }
@@ -26987,9 +27303,7 @@ var conversionToCanonicalUnitsScaleFactor = function conversionToCanonicalUnitsS
26987
27303
  case UnitType.kGradians:
26988
27304
  factor = .9;
26989
27305
  break;
26990
- case UnitType.kTurns:
26991
- factor = 360;
26992
- break;
27306
+ case UnitType.kTurns: factor = 360;
26993
27307
  }
26994
27308
  return factor;
26995
27309
  };
@@ -27163,9 +27477,10 @@ var CSSKeywordValue = /*#__PURE__*/ function(_CSSStyleValue) {
27163
27477
  var formatInfinityOrNaN = function formatInfinityOrNaN(number) {
27164
27478
  var suffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
27165
27479
  var result = "";
27166
- if (!Number.isFinite(number)) if (number > 0) result = "infinity";
27167
- else result = "-infinity";
27168
- else result = "NaN";
27480
+ if (!Number.isFinite(number)) {
27481
+ if (number > 0) result = "infinity";
27482
+ else result = "-infinity";
27483
+ } else result = "NaN";
27169
27484
  return result += suffix;
27170
27485
  };
27171
27486
  var toCanonicalUnit = function toCanonicalUnit(unit) {
@@ -27734,8 +28049,10 @@ var parseGradient = memoize(function(colorStr) {
27734
28049
  }
27735
28050
  } else if (type === "r") {
27736
28051
  var parsedRadialGradient = parseRadialGradient(colorStr);
27737
- if (parsedRadialGradient) if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
27738
- else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
28052
+ if (parsedRadialGradient) {
28053
+ if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
28054
+ else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
28055
+ }
27739
28056
  } else if (type === "p") return parsePattern(colorStr);
27740
28057
  }
27741
28058
  });
@@ -28152,7 +28469,6 @@ function getPathBBox(segments, lineWidth) {
28152
28469
  default:
28153
28470
  xArr.push(currentPoint[0]);
28154
28471
  yArr.push(currentPoint[1]);
28155
- break;
28156
28472
  }
28157
28473
  if (box$1) {
28158
28474
  segment.box = box$1;
@@ -28327,9 +28643,7 @@ function path2Segments(path) {
28327
28643
  startMovePoint = [params[1], params[2]];
28328
28644
  lastStartMovePointIndex = i;
28329
28645
  break;
28330
- case "A":
28331
- segment.arcParams = getArcParams(currentPoint, params);
28332
- break;
28646
+ case "A": segment.arcParams = getArcParams(currentPoint, params);
28333
28647
  }
28334
28648
  if (command === "Z") {
28335
28649
  currentPoint = startMovePoint;
@@ -29616,10 +29930,12 @@ var parseTransformOrigin = memoize(function(value) {
29616
29930
  if (isString(value)) {
29617
29931
  if (value === "text-anchor") return [getOrCreateUnitValue(0, "px"), getOrCreateUnitValue(0, "px")];
29618
29932
  var values = value.split(" ");
29619
- if (values.length === 1) if (values[0] === "top" || values[0] === "bottom") {
29620
- values[1] = values[0];
29621
- values[0] = "center";
29622
- } else values[1] = "center";
29933
+ if (values.length === 1) {
29934
+ if (values[0] === "top" || values[0] === "bottom") {
29935
+ values[1] = values[0];
29936
+ values[0] = "center";
29937
+ } else values[1] = "center";
29938
+ }
29623
29939
  if (values.length !== 2) return null;
29624
29940
  return [parseLengthOrPercentage(convertKeyword2Percent(values[0])), parseLengthOrPercentage(convertKeyword2Percent(values[1]))];
29625
29941
  }
@@ -30497,7 +30813,14 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/ function() {
30497
30813
  }
30498
30814
  return _createClass(CSSPropertyLengthOrPercentage, [{
30499
30815
  key: "calculator",
30500
- value: function calculator(name, oldParsed, computed, object, runtime) {
30816
+ value:
30817
+ /**
30818
+ * according to parent's bounds
30819
+ *
30820
+ * @example
30821
+ * CSS.percent(50) -> CSS.px(0.5 * parent.width)
30822
+ */
30823
+ function calculator(name, oldParsed, computed, object, runtime) {
30501
30824
  if (isNumber(computed)) return computed;
30502
30825
  if (CSSUnitValue.isRelativeUnit(computed.unit)) {
30503
30826
  if (computed.unit === UnitType.kPercentage) return 0;
@@ -31414,7 +31737,19 @@ var FederatedEvent = /*#__PURE__*/ function() {
31414
31737
  return _createClass(FederatedEvent, [
31415
31738
  {
31416
31739
  key: "name",
31417
- get: function get() {
31740
+ get:
31741
+ /**
31742
+ * The type of event, supports the following:
31743
+ * * pointerdown
31744
+ * * touchstart
31745
+ * * mousedown
31746
+ * * rightdown
31747
+ * * ...
31748
+ */
31749
+ /**
31750
+ * @deprecated
31751
+ */
31752
+ function get() {
31418
31753
  return this.type;
31419
31754
  }
31420
31755
  },
@@ -31480,7 +31815,15 @@ var FederatedEvent = /*#__PURE__*/ function() {
31480
31815
  },
31481
31816
  {
31482
31817
  key: "composedPath",
31483
- value: function composedPath() {
31818
+ value:
31819
+ /**
31820
+ * The propagation path for this event
31821
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
31822
+ *
31823
+ * So composedPath()[0] represents the original target.
31824
+ * @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting
31825
+ */
31826
+ function composedPath() {
31484
31827
  if (this.manager && (!this.path || this.path[0] !== this.target)) this.path = this.target ? this.manager.propagationPath(this.target) : [];
31485
31828
  return this.path;
31486
31829
  }
@@ -31512,7 +31855,12 @@ var FederatedEvent = /*#__PURE__*/ function() {
31512
31855
  },
31513
31856
  {
31514
31857
  key: "initEvent",
31515
- value: function initEvent() {}
31858
+ value:
31859
+ /**
31860
+ * added for compatibility with DOM Event,
31861
+ * deprecated props and methods
31862
+ */
31863
+ function initEvent() {}
31516
31864
  },
31517
31865
  {
31518
31866
  key: "initUIEvent",
@@ -31675,7 +32023,43 @@ var FederatedPointerEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
31675
32023
  return _createClass(FederatedPointerEvent, [
31676
32024
  {
31677
32025
  key: "getCoalescedEvents",
31678
- value: function getCoalescedEvents() {
32026
+ value:
32027
+ /**
32028
+ * The type of pointer that triggered the event.
32029
+ *
32030
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
32031
+ */
32032
+ /**
32033
+ * Pressure applied by the pointing device during the event.
32034
+ *s
32035
+ * A Touch's force property will be represented by this value.
32036
+ *
32037
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
32038
+ */
32039
+ /**
32040
+ * Barrel pressure on a stylus pointer.
32041
+ *
32042
+ * @see https://w3c.github.io/pointerevents/#pointerevent-interface
32043
+ */
32044
+ /**
32045
+ * The angle, in degrees, between the pointer device and the screen.
32046
+ *
32047
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
32048
+ */
32049
+ /**
32050
+ * The angle, in degrees, between the pointer device and the screen.
32051
+ *
32052
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
32053
+ */
32054
+ /**
32055
+ * Twist of a stylus pointer.
32056
+ *
32057
+ * @see https://w3c.github.io/pointerevents/#pointerevent-interface
32058
+ */
32059
+ /**
32060
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents
32061
+ */
32062
+ function getCoalescedEvents() {
31679
32063
  if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") return [this];
31680
32064
  return [];
31681
32065
  }
@@ -31702,7 +32086,15 @@ var FederatedWheelEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
31702
32086
  _inherits(FederatedWheelEvent, _FederatedMouseEvent);
31703
32087
  return _createClass(FederatedWheelEvent, [{
31704
32088
  key: "clone",
31705
- value: function clone() {
32089
+ value:
32090
+ /**
32091
+ * The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,
32092
+ * `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.
32093
+ */
32094
+ /** Horizontal scroll amount */
32095
+ /** Vertical scroll amount */
32096
+ /** z-axis scroll amount. */
32097
+ function clone() {
31706
32098
  return this.manager.cloneWheelEvent(this);
31707
32099
  }
31708
32100
  }]);
@@ -31791,7 +32183,11 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31791
32183
  return _createClass(Node, [
31792
32184
  {
31793
32185
  key: "textContent",
31794
- get: function get() {
32186
+ get:
32187
+ /**
32188
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
32189
+ */
32190
+ function get() {
31795
32191
  var out = "";
31796
32192
  if (this.nodeName === Shape.TEXT) out += this.style.text;
31797
32193
  var _iterator = _createForOfIteratorHelper(this.childNodes), _step;
@@ -31869,7 +32265,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31869
32265
  },
31870
32266
  {
31871
32267
  key: "parent",
31872
- get: function get() {
32268
+ get:
32269
+ /**
32270
+ * @deprecated
32271
+ * @alias parentNode
32272
+ */
32273
+ function get() {
31873
32274
  return this.parentNode;
31874
32275
  }
31875
32276
  },
@@ -31939,7 +32340,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31939
32340
  },
31940
32341
  {
31941
32342
  key: "contain",
31942
- value: function contain(other) {
32343
+ value:
32344
+ /**
32345
+ * @deprecated
32346
+ * @alias contains
32347
+ */
32348
+ function contain(other) {
31943
32349
  return this.contains(other);
31944
32350
  }
31945
32351
  },
@@ -31990,7 +32396,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31990
32396
  return _createClass(EventTarget, [
31991
32397
  {
31992
32398
  key: "on",
31993
- value: function on(type, listener, options) {
32399
+ value:
32400
+ /**
32401
+ * @deprecated
32402
+ * @alias addEventListener
32403
+ */
32404
+ function on(type, listener, options) {
31994
32405
  this.addEventListener(type, listener, options);
31995
32406
  return this;
31996
32407
  }
@@ -32153,7 +32564,11 @@ var OffscreenCanvasCreator = /*#__PURE__*/ function() {
32153
32564
  }
32154
32565
  }], [{
32155
32566
  key: "createCanvas",
32156
- value: function createCanvas() {
32567
+ value:
32568
+ /**
32569
+ * @returns new canvas instance
32570
+ */
32571
+ function createCanvas() {
32157
32572
  try {
32158
32573
  return new window.OffscreenCanvas(0, 0);
32159
32574
  } catch (_unused2) {}
@@ -32776,10 +33191,12 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
32776
33191
  var aabb = this.getTransformedGeometryBounds(element, render, existedAABB);
32777
33192
  element.childNodes.forEach(function(child) {
32778
33193
  var childBounds = _this.getBounds(child, render);
32779
- if (childBounds) if (!aabb) {
32780
- aabb = existedAABB || new AABB();
32781
- aabb.update(childBounds.center, childBounds.halfExtents);
32782
- } else aabb.add(childBounds);
33194
+ if (childBounds) {
33195
+ if (!aabb) {
33196
+ aabb = existedAABB || new AABB();
33197
+ aabb.update(childBounds.center, childBounds.halfExtents);
33198
+ } else aabb.add(childBounds);
33199
+ }
32783
33200
  });
32784
33201
  if (!aabb) aabb = new AABB();
32785
33202
  if (render) {
@@ -32986,12 +33403,14 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
32986
33403
  var mutations = /* @__PURE__ */ new Set();
32987
33404
  canvas.getRoot().forEach(function(item) {
32988
33405
  (item.mutations || []).forEach(function(mutation) {
32989
- if (mutation.type === "attributes" && mutation._boundsChangeData) if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
32990
- var newMutation = _objectSpread2({}, mutation);
32991
- newMutation.target = node;
32992
- mutations.add(newMutation);
32993
- });
32994
- else mutations.add(mutation);
33406
+ if (mutation.type === "attributes" && mutation._boundsChangeData) {
33407
+ if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
33408
+ var newMutation = _objectSpread2({}, mutation);
33409
+ newMutation.target = node;
33410
+ mutations.add(newMutation);
33411
+ });
33412
+ else mutations.add(mutation);
33413
+ }
32995
33414
  });
32996
33415
  item.mutations = void 0;
32997
33416
  });
@@ -33166,7 +33585,15 @@ var TextService = /*#__PURE__*/ function() {
33166
33585
  return _createClass(TextService, [
33167
33586
  {
33168
33587
  key: "measureFont",
33169
- value: function measureFont(font, offscreenCanvas) {
33588
+ value:
33589
+ /**
33590
+ * A global cache for character widths, keyed by font string.
33591
+ * e.g. { '16px Arial': { 'a': 8, 'b': 9 } }
33592
+ */
33593
+ /**
33594
+ * Calculates the ascent, descent and fontSize of a given font-style.
33595
+ */
33596
+ function measureFont(font, offscreenCanvas) {
33170
33597
  if (this.fontMetricsCache[font]) return this.fontMetricsCache[font];
33171
33598
  var properties = {
33172
33599
  ascent: 0,
@@ -33664,7 +34091,18 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33664
34091
  return _createClass(Element, [
33665
34092
  {
33666
34093
  key: "dirty",
33667
- value: function dirty() {
34094
+ value:
34095
+ /**
34096
+ * Marks the element as dirty, indicating it needs re-rendering or relayout.
34097
+ *
34098
+ * @param styleFlag - Whether to update style state (default: true).
34099
+ * When true, sets `renderable.dirty` to true.
34100
+ * @param layoutFlag - Optional. When provided, updates layout-related dirty flags:
34101
+ * - `renderable.boundsDirty`
34102
+ * - `renderable.renderBoundsDirty`
34103
+ * - `geometry.dirty`
34104
+ */
34105
+ function dirty() {
33668
34106
  var styleFlag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
33669
34107
  var layoutFlag = arguments.length > 1 ? arguments[1] : void 0;
33670
34108
  this.renderable.dirty = styleFlag;
@@ -33677,7 +34115,16 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33677
34115
  },
33678
34116
  {
33679
34117
  key: "className",
33680
- get: function get() {
34118
+ get:
34119
+ /**
34120
+ * used with `getElementById()`
34121
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
34122
+ */
34123
+ /**
34124
+ * used in `getElementsByClassName`
34125
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
34126
+ */
34127
+ function get() {
33681
34128
  return this.getAttribute("class") || "";
33682
34129
  },
33683
34130
  set: function set(className) {
@@ -33686,7 +34133,11 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33686
34133
  },
33687
34134
  {
33688
34135
  key: "classList",
33689
- get: function get() {
34136
+ get:
34137
+ /**
34138
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
34139
+ */
34140
+ function get() {
33690
34141
  return this.className.split(" ").filter(function(c) {
33691
34142
  return c !== "";
33692
34143
  });
@@ -33760,8 +34211,10 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33760
34211
  var _this$ownerDocument;
33761
34212
  if (child.destroyed) throw new Error(ERROR_MSG_APPEND_DESTROYED_ELEMENT);
33762
34213
  runtime.sceneGraphService.attach(child, this, index);
33763
- if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
33764
- else this.ownerDocument.defaultView.mountChildren(child);
34214
+ if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) {
34215
+ if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
34216
+ else this.ownerDocument.defaultView.mountChildren(child);
34217
+ }
33765
34218
  if (this.isMutationObserved) {
33766
34219
  insertedEvent.relatedNode = this;
33767
34220
  child.dispatchEvent(insertedEvent);
@@ -34027,13 +34480,22 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
34027
34480
  },
34028
34481
  {
34029
34482
  key: "computedStyleMap",
34030
- value: function computedStyleMap() {
34483
+ value:
34484
+ /**
34485
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
34486
+ * eg. circle.computedStyleMap().get('fill');
34487
+ */
34488
+ function computedStyleMap() {
34031
34489
  return new Map(Object.entries(this.computedStyle));
34032
34490
  }
34033
34491
  },
34034
34492
  {
34035
34493
  key: "getAttributeNames",
34036
- value: function getAttributeNames() {
34494
+ value:
34495
+ /**
34496
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
34497
+ */
34498
+ function getAttributeNames() {
34037
34499
  return Object.keys(this.attributes);
34038
34500
  }
34039
34501
  },
@@ -36677,7 +37139,11 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
36677
37139
  return _createClass(HTMLRenderingPlugin, [
36678
37140
  {
36679
37141
  key: "joinTransformMatrix",
36680
- value: function joinTransformMatrix(matrix) {
37142
+ value:
37143
+ /**
37144
+ * ! The reason for adding `offset` is that the `transform-origin` coordinate system of DOM is the local coordinate system of the element, while the `transform-origin` coordinate system of canvas drawing is the local coordinate system of the element's parent element. At the same time, the `transform` attribute value of the DOM element does not include `transform-origin`.
37145
+ */
37146
+ function joinTransformMatrix(matrix) {
36681
37147
  var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [
36682
37148
  0,
36683
37149
  0,
@@ -36876,18 +37342,20 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
36876
37342
  case "fill":
36877
37343
  var fill = object.parsedStyle.fill;
36878
37344
  var color = "";
36879
- if (isCSSRGB(fill)) if (fill.isNone) color = "transparent";
36880
- else color = object.getAttribute("fill");
36881
- else if (Array.isArray(fill)) color = object.getAttribute("fill");
37345
+ if (isCSSRGB(fill)) {
37346
+ if (fill.isNone) color = "transparent";
37347
+ else color = object.getAttribute("fill");
37348
+ } else if (Array.isArray(fill)) color = object.getAttribute("fill");
36882
37349
  else if (isPattern(fill));
36883
37350
  $el.style.background = color;
36884
37351
  break;
36885
37352
  case "stroke":
36886
37353
  var stroke = object.parsedStyle.stroke;
36887
37354
  var borderColor = "";
36888
- if (isCSSRGB(stroke)) if (stroke.isNone) borderColor = "transparent";
36889
- else borderColor = object.getAttribute("stroke");
36890
- else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
37355
+ if (isCSSRGB(stroke)) {
37356
+ if (stroke.isNone) borderColor = "transparent";
37357
+ else borderColor = object.getAttribute("stroke");
37358
+ } else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
36891
37359
  else if (isPattern(stroke));
36892
37360
  $el.style["border-color"] = borderColor;
36893
37361
  $el.style["border-style"] = "solid";
@@ -37579,8 +38047,10 @@ PERFORMANCE OF THIS SOFTWARE.
37579
38047
  if (classType === CJ) return types.push(lineBreak === "strict" ? NS : ID);
37580
38048
  if (classType === SA) return types.push(AL);
37581
38049
  if (classType === AI) return types.push(AL);
37582
- if (classType === XX) if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
37583
- else return types.push(AL);
38050
+ if (classType === XX) {
38051
+ if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
38052
+ else return types.push(AL);
38053
+ }
37584
38054
  types.push(classType);
37585
38055
  });
37586
38056
  return [
@@ -38242,12 +38712,13 @@ PERFORMANCE OF THIS SOFTWARE.
38242
38712
  } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
38243
38713
  this.consumeBadUrlRemnants();
38244
38714
  return BAD_URL_TOKEN;
38245
- } else if (codePoint === REVERSE_SOLIDUS) if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
38246
- else {
38247
- this.consumeBadUrlRemnants();
38248
- return BAD_URL_TOKEN;
38249
- }
38250
- else value.push(codePoint);
38715
+ } else if (codePoint === REVERSE_SOLIDUS) {
38716
+ if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
38717
+ else {
38718
+ this.consumeBadUrlRemnants();
38719
+ return BAD_URL_TOKEN;
38720
+ }
38721
+ } else value.push(codePoint);
38251
38722
  }
38252
38723
  };
38253
38724
  Tokenizer.prototype.consumeWhiteSpace = function() {
@@ -38991,15 +39462,13 @@ PERFORMANCE OF THIS SOFTWARE.
38991
39462
  ry = Math.max(Math.abs(y), Math.abs(y - height));
38992
39463
  }
38993
39464
  break;
38994
- case 3:
38995
- if (gradient.shape === 0) rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
38996
- else if (gradient.shape === 1) {
38997
- var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
38998
- var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
38999
- rx = distance(cx - x, (cy - y) / c);
39000
- ry = c * rx;
39001
- }
39002
- break;
39465
+ case 3: if (gradient.shape === 0) rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
39466
+ else if (gradient.shape === 1) {
39467
+ var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
39468
+ var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
39469
+ rx = distance(cx - x, (cy - y) / c);
39470
+ ry = c * rx;
39471
+ }
39003
39472
  }
39004
39473
  if (Array.isArray(gradient.size)) {
39005
39474
  rx = getAbsoluteValue(gradient.size[0], width);
@@ -39979,7 +40448,6 @@ PERFORMANCE OF THIS SOFTWARE.
39979
40448
  case 4:
39980
40449
  results.push(accumulator.join(" "));
39981
40450
  accumulator.length = 0;
39982
- break;
39983
40451
  }
39984
40452
  });
39985
40453
  if (accumulator.length) results.push(accumulator.join(" "));
@@ -40188,9 +40656,7 @@ PERFORMANCE OF THIS SOFTWARE.
40188
40656
  case "fill":
40189
40657
  layers.push(0);
40190
40658
  break;
40191
- case "markers":
40192
- layers.push(2);
40193
- break;
40659
+ case "markers": layers.push(2);
40194
40660
  }
40195
40661
  });
40196
40662
  DEFAULT_VALUE.forEach(function(value) {
@@ -40336,20 +40802,18 @@ PERFORMANCE OF THIS SOFTWARE.
40336
40802
  case 0: return descriptor.parse(context, parser.parseComponentValue());
40337
40803
  case 1: return descriptor.parse(context, parser.parseComponentValues());
40338
40804
  case 4: return parser.parseComponentValue();
40339
- case 3:
40340
- switch (descriptor.format) {
40341
- case "angle": return angle.parse(context, parser.parseComponentValue());
40342
- case "color": return color$1.parse(context, parser.parseComponentValue());
40343
- case "image": return image.parse(context, parser.parseComponentValue());
40344
- case "length":
40345
- var length_1 = parser.parseComponentValue();
40346
- return isLength(length_1) ? length_1 : ZERO_LENGTH;
40347
- case "length-percentage":
40348
- var value_1 = parser.parseComponentValue();
40349
- return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
40350
- case "time": return time.parse(context, parser.parseComponentValue());
40351
- }
40352
- break;
40805
+ case 3: switch (descriptor.format) {
40806
+ case "angle": return angle.parse(context, parser.parseComponentValue());
40807
+ case "color": return color$1.parse(context, parser.parseComponentValue());
40808
+ case "image": return image.parse(context, parser.parseComponentValue());
40809
+ case "length":
40810
+ var length_1 = parser.parseComponentValue();
40811
+ return isLength(length_1) ? length_1 : ZERO_LENGTH;
40812
+ case "length-percentage":
40813
+ var value_1 = parser.parseComponentValue();
40814
+ return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
40815
+ case "time": return time.parse(context, parser.parseComponentValue());
40816
+ }
40353
40817
  }
40354
40818
  };
40355
40819
  var elementDebuggerAttribute = "data-html2canvas-debug";
@@ -40834,22 +41298,23 @@ PERFORMANCE OF THIS SOFTWARE.
40834
41298
  var textBounds = [];
40835
41299
  var offset = 0;
40836
41300
  textList.forEach(function(text) {
40837
- if (styles.textDecorationLine.length || text.trim().length > 0) if (FEATURES.SUPPORT_RANGE_BOUNDS) {
40838
- var clientRects = createRange(node, offset, text.length).getClientRects();
40839
- if (clientRects.length > 1) {
40840
- var subSegments = segmentGraphemes(text);
40841
- var subOffset_1 = 0;
40842
- subSegments.forEach(function(subSegment) {
40843
- textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
40844
- subOffset_1 += subSegment.length;
40845
- });
40846
- } else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
40847
- } else {
40848
- var replacementNode = node.splitText(text.length);
40849
- textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
40850
- node = replacementNode;
40851
- }
40852
- else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
41301
+ if (styles.textDecorationLine.length || text.trim().length > 0) {
41302
+ if (FEATURES.SUPPORT_RANGE_BOUNDS) {
41303
+ var clientRects = createRange(node, offset, text.length).getClientRects();
41304
+ if (clientRects.length > 1) {
41305
+ var subSegments = segmentGraphemes(text);
41306
+ var subOffset_1 = 0;
41307
+ subSegments.forEach(function(subSegment) {
41308
+ textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
41309
+ subOffset_1 += subSegment.length;
41310
+ });
41311
+ } else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
41312
+ } else {
41313
+ var replacementNode = node.splitText(text.length);
41314
+ textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
41315
+ node = replacementNode;
41316
+ }
41317
+ } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
40853
41318
  offset += text.length;
40854
41319
  });
40855
41320
  return textBounds;
@@ -41054,9 +41519,7 @@ PERFORMANCE OF THIS SOFTWARE.
41054
41519
  case CHECKBOX:
41055
41520
  _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
41056
41521
  break;
41057
- case RADIO:
41058
- _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
41059
- break;
41522
+ case RADIO: _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
41060
41523
  }
41061
41524
  return _this;
41062
41525
  }
@@ -41110,19 +41573,21 @@ PERFORMANCE OF THIS SOFTWARE.
41110
41573
  for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
41111
41574
  nextNode = childNode.nextSibling;
41112
41575
  if (isTextNode(childNode) && childNode.data.trim().length > 0) parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
41113
- else if (isElementNode(childNode)) if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
41114
- return parseNodeTree(context, childNode, parent, root);
41115
- });
41116
- else {
41117
- var container = createContainer(context, childNode);
41118
- if (container.styles.isVisible()) {
41119
- if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
41120
- else if (createsStackingContext(container.styles)) container.flags |= 2;
41121
- if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
41122
- parent.elements.push(container);
41123
- childNode.slot;
41124
- if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
41125
- else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
41576
+ else if (isElementNode(childNode)) {
41577
+ if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
41578
+ return parseNodeTree(context, childNode, parent, root);
41579
+ });
41580
+ else {
41581
+ var container = createContainer(context, childNode);
41582
+ if (container.styles.isVisible()) {
41583
+ if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
41584
+ else if (createsStackingContext(container.styles)) container.flags |= 2;
41585
+ if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
41586
+ parent.elements.push(container);
41587
+ childNode.slot;
41588
+ if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
41589
+ else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
41590
+ }
41126
41591
  }
41127
41592
  }
41128
41593
  }
@@ -41759,14 +42224,16 @@ PERFORMANCE OF THIS SOFTWARE.
41759
42224
  clonedCanvas.height = canvas.height;
41760
42225
  var ctx = canvas.getContext("2d");
41761
42226
  var clonedCtx = clonedCanvas.getContext("2d");
41762
- if (clonedCtx) if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
41763
- else {
41764
- var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
41765
- if (gl) {
41766
- var attribs = gl.getContextAttributes();
41767
- if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
42227
+ if (clonedCtx) {
42228
+ if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
42229
+ else {
42230
+ var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
42231
+ if (gl) {
42232
+ var attribs = gl.getContextAttributes();
42233
+ if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
42234
+ }
42235
+ clonedCtx.drawImage(canvas, 0, 0);
41768
42236
  }
41769
- clonedCtx.drawImage(canvas, 0, 0);
41770
42237
  }
41771
42238
  return clonedCanvas;
41772
42239
  } catch (e) {
@@ -42095,18 +42562,19 @@ PERFORMANCE OF THIS SOFTWARE.
42095
42562
  var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
42096
42563
  var xhr = new XMLHttpRequest();
42097
42564
  xhr.onload = function() {
42098
- if (xhr.status === 200) if (responseType === "text") resolve(xhr.response);
42099
- else {
42100
- var reader_1 = new FileReader();
42101
- reader_1.addEventListener("load", function() {
42102
- return resolve(reader_1.result);
42103
- }, false);
42104
- reader_1.addEventListener("error", function(e) {
42105
- return reject(e);
42106
- }, false);
42107
- reader_1.readAsDataURL(xhr.response);
42108
- }
42109
- else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
42565
+ if (xhr.status === 200) {
42566
+ if (responseType === "text") resolve(xhr.response);
42567
+ else {
42568
+ var reader_1 = new FileReader();
42569
+ reader_1.addEventListener("load", function() {
42570
+ return resolve(reader_1.result);
42571
+ }, false);
42572
+ reader_1.addEventListener("error", function(e) {
42573
+ return reject(e);
42574
+ }, false);
42575
+ reader_1.readAsDataURL(xhr.response);
42576
+ }
42577
+ } else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
42110
42578
  };
42111
42579
  xhr.onerror = reject;
42112
42580
  var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
@@ -42844,9 +43312,7 @@ PERFORMANCE OF THIS SOFTWARE.
42844
43312
  case 2:
42845
43313
  _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
42846
43314
  break;
42847
- case 3:
42848
- _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
42849
- break;
43315
+ case 3: _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
42850
43316
  }
42851
43317
  });
42852
43318
  }
@@ -42861,7 +43327,6 @@ PERFORMANCE OF THIS SOFTWARE.
42861
43327
  _this.ctx.strokeStyle = "";
42862
43328
  _this.ctx.lineWidth = 0;
42863
43329
  _this.ctx.lineJoin = "miter";
42864
- break;
42865
43330
  }
42866
43331
  });
42867
43332
  });
@@ -42999,9 +43464,7 @@ PERFORMANCE OF THIS SOFTWARE.
42999
43464
  case 1:
43000
43465
  x += bounds.width / 2;
43001
43466
  break;
43002
- case 2:
43003
- x += bounds.width;
43004
- break;
43467
+ case 2: x += bounds.width;
43005
43468
  }
43006
43469
  textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
43007
43470
  this.ctx.save();
@@ -43516,8 +43979,10 @@ PERFORMANCE OF THIS SOFTWARE.
43516
43979
  maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
43517
43980
  spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
43518
43981
  }
43519
- if (useLineDash) if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
43520
- else this.ctx.setLineDash([dashLength, spaceLength]);
43982
+ if (useLineDash) {
43983
+ if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
43984
+ else this.ctx.setLineDash([dashLength, spaceLength]);
43985
+ }
43521
43986
  if (style === 3) {
43522
43987
  this.ctx.lineCap = "round";
43523
43988
  this.ctx.lineWidth = width;
@@ -43652,8 +44117,10 @@ PERFORMANCE OF THIS SOFTWARE.
43652
44117
  Logger.prototype.debug = function() {
43653
44118
  var args = [];
43654
44119
  for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
43655
- if (this.enabled) if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43656
- else this.info.apply(this, args);
44120
+ if (this.enabled) {
44121
+ if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
44122
+ else this.info.apply(this, args);
44123
+ }
43657
44124
  };
43658
44125
  Logger.prototype.getTime = function() {
43659
44126
  return Date.now() - this.start;
@@ -43668,14 +44135,18 @@ PERFORMANCE OF THIS SOFTWARE.
43668
44135
  Logger.prototype.warn = function() {
43669
44136
  var args = [];
43670
44137
  for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
43671
- if (this.enabled) if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43672
- else this.info.apply(this, args);
44138
+ if (this.enabled) {
44139
+ if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
44140
+ else this.info.apply(this, args);
44141
+ }
43673
44142
  };
43674
44143
  Logger.prototype.error = function() {
43675
44144
  var args = [];
43676
44145
  for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
43677
- if (this.enabled) if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43678
- else this.info.apply(this, args);
44146
+ if (this.enabled) {
44147
+ if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
44148
+ else this.info.apply(this, args);
44149
+ }
43679
44150
  };
43680
44151
  Logger.instances = {};
43681
44152
  return Logger;
@@ -43856,7 +44327,20 @@ var Animation = /*#__PURE__*/ function() {
43856
44327
  return _createClass(Animation, [
43857
44328
  {
43858
44329
  key: "pending",
43859
- get: function get() {
44330
+ get:
44331
+ /**
44332
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
44333
+ */
44334
+ /**
44335
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
44336
+ */
44337
+ /**
44338
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
44339
+ */
44340
+ /**
44341
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
44342
+ */
44343
+ function get() {
43860
44344
  return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
43861
44345
  }
43862
44346
  },
@@ -43871,7 +44355,18 @@ var Animation = /*#__PURE__*/ function() {
43871
44355
  },
43872
44356
  {
43873
44357
  key: "ready",
43874
- get: function get() {
44358
+ get:
44359
+ /**
44360
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
44361
+ * @example
44362
+ animation.pause();
44363
+ animation.ready.then(function() {
44364
+ // Displays 'running'
44365
+ alert(animation.playState);
44366
+ });
44367
+ animation.play();
44368
+ */
44369
+ function get() {
43875
44370
  var _this = this;
43876
44371
  if (!this.readyPromise) {
43877
44372
  if (this.timeline.animationsWithPromises.indexOf(this) === -1) this.timeline.animationsWithPromises.push(this);
@@ -44905,8 +45400,10 @@ function normalizeTimingInput(timingInput, forGroup) {
44905
45400
  return makeTiming(timingInput, forGroup);
44906
45401
  }
44907
45402
  function numericTimingToObject(timingInput) {
44908
- if (typeof timingInput === "number") if (isNaN(timingInput)) timingInput = { duration: "auto" };
44909
- else timingInput = { duration: timingInput };
45403
+ if (typeof timingInput === "number") {
45404
+ if (isNaN(timingInput)) timingInput = { duration: "auto" };
45405
+ else timingInput = { duration: timingInput };
45406
+ }
44910
45407
  return timingInput;
44911
45408
  }
44912
45409
  /**
@@ -45215,7 +45712,14 @@ runtime.CameraContribution = /* @__PURE__ */ function(_Camera) {
45215
45712
  return _createClass(AdvancedCamera, [
45216
45713
  {
45217
45714
  key: "rotate",
45218
- value: function rotate(azimuth, elevation, roll) {
45715
+ value:
45716
+ /**
45717
+ * Changes the azimuth and elevation with respect to the current camera axes
45718
+ * @param {Number} azimuth the relative azimuth
45719
+ * @param {Number} elevation the relative elevation
45720
+ * @param {Number} roll the relative roll
45721
+ */
45722
+ function rotate(azimuth, elevation, roll) {
45219
45723
  this.relElevation = getAngle(elevation);
45220
45724
  this.relAzimuth = getAngle(azimuth);
45221
45725
  this.relRoll = getAngle(roll);
@@ -46694,18 +47198,20 @@ function configure_toolbar(gobj) {
46694
47198
  title: (0, i18next.t)("reset zoom")
46695
47199
  }
46696
47200
  ];
46697
- if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_fullscreen")) if (priv.is_fullscreen) items.push({
46698
- id: "g6-icon-fullscreen-exit",
46699
- value: "exit-fullscreen",
46700
- className: "EV_EXIT_FULLSCREEN",
46701
- title: (0, i18next.t)("exit full screen")
46702
- });
46703
- else items.push({
46704
- id: "g6-icon-fullscreen",
46705
- value: "request-fullscreen",
46706
- className: "EV_REQUEST_FULLSCREEN",
46707
- title: (0, i18next.t)("enter full screen")
46708
- });
47201
+ if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_fullscreen")) {
47202
+ if (priv.is_fullscreen) items.push({
47203
+ id: "g6-icon-fullscreen-exit",
47204
+ value: "exit-fullscreen",
47205
+ className: "EV_EXIT_FULLSCREEN",
47206
+ title: (0, i18next.t)("exit full screen")
47207
+ });
47208
+ else items.push({
47209
+ id: "g6-icon-fullscreen",
47210
+ value: "request-fullscreen",
47211
+ className: "EV_REQUEST_FULLSCREEN",
47212
+ title: (0, i18next.t)("enter full screen")
47213
+ });
47214
+ }
46709
47215
  return items;
46710
47216
  },
46711
47217
  onClick: (value) => {
@@ -46728,9 +47234,7 @@ function configure_toolbar(gobj) {
46728
47234
  case "request-fullscreen":
46729
47235
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
46730
47236
  break;
46731
- case "exit-fullscreen":
46732
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
46733
- break;
47237
+ case "exit-fullscreen": (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
46734
47238
  }
46735
47239
  }
46736
47240
  });
@@ -46801,9 +47305,7 @@ function configure_toolbar_edit(gobj) {
46801
47305
  case "redo":
46802
47306
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_HISTORY_REDO", {}, gobj);
46803
47307
  break;
46804
- case "save":
46805
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SAVE_GRAPH", {}, gobj);
46806
- break;
47308
+ case "save": (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SAVE_GRAPH", {}, gobj);
46807
47309
  }
46808
47310
  }
46809
47311
  });
@@ -46844,9 +47346,7 @@ function configure_behaviour(gobj) {
46844
47346
  case "operation":
46845
47347
  priv.edit_mode = false;
46846
47348
  break;
46847
- default:
46848
- (0, _yuneta_gobj_js.log_error)(`operation mode unknown: ${operation_mode}`);
46849
- break;
47349
+ default: (0, _yuneta_gobj_js.log_error)(`operation mode unknown: ${operation_mode}`);
46850
47350
  }
46851
47351
  if (!priv.edit_mode) deselect_node(gobj);
46852
47352
  graph_write_behaviors(gobj, behaviors);
@@ -46881,9 +47381,7 @@ function calculate_hooks_fkeys_counter(desc) {
46881
47381
  case "hook":
46882
47382
  desc.hooks_counter++;
46883
47383
  break;
46884
- case "fkey":
46885
- desc.fkeys_counter++;
46886
- break;
47384
+ case "fkey": desc.fkeys_counter++;
46887
47385
  }
46888
47386
  }
46889
47387
  if (desc.hooks_counter === 0) desc.node_treedb_type = "child";
@@ -46923,7 +47421,6 @@ function build_ports(gobj, desc) {
46923
47421
  stroke: getStrokeColor(desc.color)
46924
47422
  };
46925
47423
  top_ports.push(port);
46926
- break;
46927
47424
  }
46928
47425
  }
46929
47426
  for (let i = 0; i < top_ports.length; i++) top_ports[i].placement = [.5, 0];
@@ -47118,13 +47615,15 @@ function collect_fkey_refs(desc, record) {
47118
47615
  let col = cols[i];
47119
47616
  if (!col.fkey) continue;
47120
47617
  let fkeys = record[col.id];
47121
- if (fkeys) if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) {
47122
- let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys[j]);
47123
- if (key) refs.add(i + " " + key);
47124
- }
47125
- else {
47126
- let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys);
47127
- if (key) refs.add(i + " " + key);
47618
+ if (fkeys) {
47619
+ if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) {
47620
+ let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys[j]);
47621
+ if (key) refs.add(i + " " + key);
47622
+ }
47623
+ else {
47624
+ let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys);
47625
+ if (key) refs.add(i + " " + key);
47626
+ }
47128
47627
  }
47129
47628
  }
47130
47629
  return refs;
@@ -47140,8 +47639,10 @@ function draw_links(gobj, desc, record, initial_load) {
47140
47639
  let col = cols[i];
47141
47640
  if (!col.fkey) continue;
47142
47641
  let fkeys = record[col.id];
47143
- if (fkeys) if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) draw_link(gobj, topic_name, record_id, col, fkeys[j], initial_load);
47144
- else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
47642
+ if (fkeys) {
47643
+ if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) draw_link(gobj, topic_name, record_id, col, fkeys[j], initial_load);
47644
+ else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
47645
+ }
47145
47646
  }
47146
47647
  }
47147
47648
  /************************************************************
@@ -47251,8 +47752,10 @@ function clear_links(gobj, desc, record, verbose) {
47251
47752
  let col = cols[i];
47252
47753
  if (!col.fkey) continue;
47253
47754
  let fkeys = record[col.id];
47254
- if (fkeys) if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) clear_link(gobj, topic_name, record_id, col, fkeys[j], verbose);
47255
- else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
47755
+ if (fkeys) {
47756
+ if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) clear_link(gobj, topic_name, record_id, col, fkeys[j], verbose);
47757
+ else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
47758
+ }
47256
47759
  }
47257
47760
  }
47258
47761
  /************************************************************
@@ -47349,7 +47852,7 @@ function save_geometry(gobj) {
47349
47852
  let origin = (0, _yuneta_gobj_js.gobj_read_str_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "node_uuid");
47350
47853
  for (const [topic_name, properties] of Object.entries(priv._graph_properties)) {
47351
47854
  properties.__origin__ = origin;
47352
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", {
47855
+ let kw_update = {
47353
47856
  treedb_name: priv.treedb_name,
47354
47857
  topic_name: "__graphs__",
47355
47858
  record: {
@@ -47363,7 +47866,8 @@ function save_geometry(gobj) {
47363
47866
  autolink: false,
47364
47867
  create: true
47365
47868
  }
47366
- });
47869
+ };
47870
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", kw_update);
47367
47871
  }
47368
47872
  }
47369
47873
  /************************************************************
@@ -47374,7 +47878,7 @@ function save_topic_graph_properties(gobj, topic_name) {
47374
47878
  let properties = priv._graph_properties[topic_name];
47375
47879
  if (!properties) return;
47376
47880
  properties.__origin__ = (0, _yuneta_gobj_js.gobj_read_str_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "node_uuid");
47377
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", {
47881
+ let kw_update = {
47378
47882
  treedb_name: priv.treedb_name,
47379
47883
  topic_name: "__graphs__",
47380
47884
  record: {
@@ -47388,7 +47892,8 @@ function save_topic_graph_properties(gobj, topic_name) {
47388
47892
  autolink: false,
47389
47893
  create: true
47390
47894
  }
47391
- });
47895
+ };
47896
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", kw_update);
47392
47897
  }
47393
47898
  /************************************************************
47394
47899
  * Pause/resume history recording.
@@ -47577,19 +48082,17 @@ function graph_add_plugin(gobj, plugin_key, options) {
47577
48082
  }
47578
48083
  plugin = graph_get_plugin(gobj, plugin_key);
47579
48084
  switch (plugin_key) {
47580
- case "history":
47581
- if (plugin) {
47582
- plugin.on(_antv_g6.HistoryEvent.CHANGE, () => {
47583
- update_history_buttons(gobj);
47584
- });
47585
- graph.updatePlugin({
47586
- key: plugin_key,
47587
- beforeAddCommand: () => {
47588
- return !priv._history_paused;
47589
- }
47590
- });
47591
- }
47592
- break;
48085
+ case "history": if (plugin) {
48086
+ plugin.on(_antv_g6.HistoryEvent.CHANGE, () => {
48087
+ update_history_buttons(gobj);
48088
+ });
48089
+ graph.updatePlugin({
48090
+ key: plugin_key,
48091
+ beforeAddCommand: () => {
48092
+ return !priv._history_paused;
48093
+ }
48094
+ });
48095
+ }
47593
48096
  }
47594
48097
  }
47595
48098
  function graph_remove_plugin(gobj, plugin_key) {
@@ -49628,9 +50131,7 @@ function handle_context_menu_click(gobj, value) {
49628
50131
  case "resize_all_ports":
49629
50132
  copy_size_to_ports(gobj, false);
49630
50133
  break;
49631
- case "resize_topic_ports":
49632
- copy_size_to_ports(gobj, true);
49633
- break;
50134
+ case "resize_topic_ports": copy_size_to_ports(gobj, true);
49634
50135
  }
49635
50136
  }
49636
50137
  /************************************************************
@@ -50418,7 +50919,7 @@ function create_gclass$1(gclass_name) {
50418
50919
  null
50419
50920
  ]
50420
50921
  ]]];
50421
- __gclass__$1 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
50922
+ const event_types = [
50422
50923
  ["EV_DESCS", 0],
50423
50924
  ["EV_CLEAR_DATA", 0],
50424
50925
  ["EV_LOAD_DATA", 0],
@@ -50455,7 +50956,8 @@ function create_gclass$1(gclass_name) {
50455
50956
  ["EV_HIDE", 0],
50456
50957
  ["EV_RESIZE", 0],
50457
50958
  ["EV_THEME", 0]
50458
- ], states, gmt$1, 0, attrs_table$1, PRIVATE_DATA$1, 0, 0, 0, _yuneta_gobj_js.gclass_flag_t.gcflag_manual_start);
50959
+ ];
50960
+ __gclass__$1 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt$1, 0, attrs_table$1, PRIVATE_DATA$1, 0, 0, 0, _yuneta_gobj_js.gclass_flag_t.gcflag_manual_start);
50459
50961
  if (!__gclass__$1) return -1;
50460
50962
  return 0;
50461
50963
  }
@@ -50606,22 +51108,22 @@ var YUI_ROLLING = {
50606
51108
  },
50607
51109
  "6h": {
50608
51110
  id: "6h",
50609
- secs: 6 * 3600,
51111
+ secs: 21600,
50610
51112
  label: "last 6h"
50611
51113
  },
50612
51114
  "24h": {
50613
51115
  id: "24h",
50614
- secs: 24 * 3600,
51116
+ secs: 86400,
50615
51117
  label: "last 24h"
50616
51118
  },
50617
51119
  "7d": {
50618
51120
  id: "7d",
50619
- secs: 168 * 3600,
51121
+ secs: 604800,
50620
51122
  label: "last 7 days"
50621
51123
  },
50622
51124
  "30d": {
50623
51125
  id: "30d",
50624
- secs: 720 * 3600,
51126
+ secs: 2592e3,
50625
51127
  label: "last 30 days"
50626
51128
  }
50627
51129
  };
@@ -51984,7 +52486,8 @@ function ac_set_mode(gobj, event, kw, src) {
51984
52486
  *
51985
52487
  ***************************************************************/
51986
52488
  function ac_prev(gobj, event, kw, src) {
51987
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "anchor", period_shift(cur_mode(gobj).spec, (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "anchor"), -1));
52489
+ let mode = cur_mode(gobj);
52490
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "anchor", period_shift(mode.spec, (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "anchor"), -1));
51988
52491
  close_calendar(gobj);
51989
52492
  repaint(gobj);
51990
52493
  publish_period(gobj);
@@ -51994,7 +52497,8 @@ function ac_prev(gobj, event, kw, src) {
51994
52497
  *
51995
52498
  ***************************************************************/
51996
52499
  function ac_next(gobj, event, kw, src) {
51997
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "anchor", period_shift(cur_mode(gobj).spec, (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "anchor"), 1));
52500
+ let mode = cur_mode(gobj);
52501
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "anchor", period_shift(mode.spec, (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "anchor"), 1));
51998
52502
  close_calendar(gobj);
51999
52503
  repaint(gobj);
52000
52504
  publish_period(gobj);
@@ -52172,7 +52676,7 @@ function create_gclass(gclass_name) {
52172
52676
  null
52173
52677
  ]
52174
52678
  ]]];
52175
- __gclass__ = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
52679
+ const event_types = [
52176
52680
  ["EV_SET_MODE", 0],
52177
52681
  ["EV_PREV", 0],
52178
52682
  ["EV_NEXT", 0],
@@ -52183,7 +52687,8 @@ function create_gclass(gclass_name) {
52183
52687
  ["EV_REFRESH", 0],
52184
52688
  ["EV_LANGUAGE_CHANGED", 0],
52185
52689
  ["EV_PERIOD_CHANGED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT]
52186
- ], states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
52690
+ ];
52691
+ __gclass__ = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
52187
52692
  if (!__gclass__) return -1;
52188
52693
  return 0;
52189
52694
  }
@@ -52283,8 +52788,8 @@ function traffic_now() {
52283
52788
  function traffic_size(n) {
52284
52789
  n = Number(n) || 0;
52285
52790
  if (n < 1024) return n + " B";
52286
- if (n < 1024 * 1024) return (n / 1024).toFixed(1) + " KB";
52287
- return (n / (1024 * 1024)).toFixed(1) + " MB";
52791
+ if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
52792
+ return (n / 1048576).toFixed(1) + " MB";
52288
52793
  }
52289
52794
  /************************************************************
52290
52795
  * Seconds-since-epoch → ISO string, or null if not a plausible
@@ -52367,7 +52872,8 @@ function set_output_route(v) {
52367
52872
  refresh_dev_chrome();
52368
52873
  }
52369
52874
  function toggle_pref(key, def) {
52370
- (0, _yuneta_gobj_js.kw_set_local_storage_value)(key, dev_num(key, def) ? 0 : 1);
52875
+ let v = dev_num(key, def) ? 0 : 1;
52876
+ (0, _yuneta_gobj_js.kw_set_local_storage_value)(key, v);
52371
52877
  rerender_all();
52372
52878
  refresh_dev_chrome();
52373
52879
  }
@@ -53627,7 +54133,7 @@ function apply_dev_traces() {
53627
54133
  function setup_dev(self, show) {
53628
54134
  if (show) {
53629
54135
  ensure_dev_style();
53630
- (0, _yuneta_gobj_js.gobj_start)((0, _yuneta_gobj_js.gobj_create_service)("Developer-Window", "C_YUI_WINDOW", {
54136
+ let win = (0, _yuneta_gobj_js.gobj_create_service)("Developer-Window", "C_YUI_WINDOW", {
53631
54137
  $parent: document.getElementById("top-layer") || null,
53632
54138
  subscriber: null,
53633
54139
  showMax: true,
@@ -53644,7 +54150,8 @@ function setup_dev(self, show) {
53644
54150
  on_close: function() {
53645
54151
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("open_developer_window", 0);
53646
54152
  }
53647
- }, self));
54153
+ }, self);
54154
+ (0, _yuneta_gobj_js.gobj_start)(win);
53648
54155
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("open_developer_window", 1);
53649
54156
  setTimeout(() => {
53650
54157
  refresh_dev_chrome();
@@ -53748,7 +54255,8 @@ function setup_frontend_view(self) {
53748
54255
  (0, _yuneta_gobj_js.log_error)("yui_frontend_view: cannot create the frontend-view window");
53749
54256
  return null;
53750
54257
  }
53751
- let $tree = (0, _yuneta_gobj_js.gobj_read_attr)((0, _yuneta_gobj_js.gobj_create_pure_child)("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win), "$container");
54258
+ let tree = (0, _yuneta_gobj_js.gobj_create_pure_child)("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win);
54259
+ let $tree = (0, _yuneta_gobj_js.gobj_read_attr)(tree, "$container");
53752
54260
  if (!$tree) {
53753
54261
  (0, _yuneta_gobj_js.log_error)("yui_frontend_view: C_YUI_GOBJ_TREE_JS without $container");
53754
54262
  return win;