@yuneta/gobj-ui 5.11.1 → 5.12.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,9 @@ 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
16118
16146
  };
16119
16147
  var __gclass__$4 = null;
16120
16148
  function popup_mount_layer(gobj) {
@@ -16153,6 +16181,7 @@ function mt_stop$4(gobj) {
16153
16181
  let shell = yui_shell_of(gobj);
16154
16182
  if (shell) (0, _yuneta_gobj_js.gobj_unsubscribe_event)(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
16155
16183
  close_form_dialog(gobj);
16184
+ close_schema_dialog(gobj);
16156
16185
  table__destroy(gobj);
16157
16186
  }
16158
16187
  /***************************************************************
@@ -16160,6 +16189,7 @@ function mt_stop$4(gobj) {
16160
16189
  ***************************************************************/
16161
16190
  function mt_destroy$4(gobj) {
16162
16191
  close_form_dialog(gobj);
16192
+ close_schema_dialog(gobj);
16163
16193
  destroy_ui$1(gobj);
16164
16194
  }
16165
16195
  /************************************************************
@@ -16215,7 +16245,8 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
16215
16245
  async function readClipboard(gobj) {
16216
16246
  try {
16217
16247
  const text = await navigator.clipboard.readText();
16218
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_ROWS", JSON.parse(text), gobj);
16248
+ let kw = JSON.parse(text);
16249
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_PASTE_ROWS", kw, gobj);
16219
16250
  } catch (error) {
16220
16251
  (0, _yuneta_gobj_js.log_error)(`Failed to read clipboard contents: ${error}`);
16221
16252
  }
@@ -16361,7 +16392,9 @@ function build_ui$4(gobj) {
16361
16392
  let toolbar_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "toolbar_id");
16362
16393
  let $view_toolbar = (0, _yuneta_gobj_js.createElement2)(["div", { class: "TREEDB_TABLE_TOOLS is-flex is-align-items-center" }]);
16363
16394
  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")) {
16395
+ let with_search_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_search_button");
16396
+ let with_schema_button = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_schema_button");
16397
+ if (with_search_button) {
16365
16398
  let search_id = `${toolbar_id}_search`;
16366
16399
  let $search_box = (0, _yuneta_gobj_js.createElement2)([
16367
16400
  "div",
@@ -16419,6 +16452,33 @@ function build_ui$4(gobj) {
16419
16452
  ]);
16420
16453
  $view_toolbar.appendChild($refresh);
16421
16454
  }
16455
+ if (with_schema_button) {
16456
+ let $schema = (0, _yuneta_gobj_js.createElement2)([
16457
+ "button",
16458
+ {
16459
+ class: "TREEDB_TABLE_SCHEMA button mr-1",
16460
+ title: (0, i18next.t)("schema"),
16461
+ "data-i18n-title": "schema",
16462
+ "aria-label": (0, i18next.t)("schema"),
16463
+ "data-i18n-aria-label": "schema"
16464
+ },
16465
+ [["i", { class: "yi-hexagon-nodes" }], [
16466
+ "span",
16467
+ {
16468
+ class: "is-hidden-mobile",
16469
+ i18n: "schema",
16470
+ style: "padding-left:5px;"
16471
+ },
16472
+ "schema"
16473
+ ]],
16474
+ { "click": (event) => {
16475
+ event.stopPropagation();
16476
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SHOW_SCHEMA", {}, gobj);
16477
+ } }
16478
+ ]);
16479
+ $view_toolbar.appendChild($schema);
16480
+ }
16481
+ let table_id = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "table_id");
16422
16482
  let $container = (0, _yuneta_gobj_js.createElement2)([
16423
16483
  "div",
16424
16484
  {
@@ -16429,7 +16489,7 @@ function build_ui$4(gobj) {
16429
16489
  class: "TREEDB_TABLE_TOOLBAR toolbar_tabulator_table m-1",
16430
16490
  style: "display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap;"
16431
16491
  }], ["div", {
16432
- id: `${(0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "table_id")}`,
16492
+ id: `${table_id}`,
16433
16493
  style: "margin-top:0px !important;"
16434
16494
  }]]
16435
16495
  ]);
@@ -16472,7 +16532,8 @@ function destroy_ui$1(gobj) {
16472
16532
  * columns); leave the rest on the flat shared key.
16473
16533
  ******************************************************************/
16474
16534
  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 });
16535
+ let keys = topic_name ? [topic_name + "." + col.id, col.id] : [col.id];
16536
+ return (0, i18next.t)(keys, { defaultValue: col.header || col.id });
16476
16537
  }
16477
16538
  /******************************************************************
16478
16539
  * Column-title formatter: render the header as a span carrying
@@ -16598,7 +16659,6 @@ function create_tabulator(gobj) {
16598
16659
  case "real":
16599
16660
  hozAlign = "right";
16600
16661
  sorter = "number";
16601
- break;
16602
16662
  }
16603
16663
  let colDef = {
16604
16664
  title: col_label(col, (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name")),
@@ -16743,9 +16803,7 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16743
16803
  case "object":
16744
16804
  case "dict":
16745
16805
  case "array":
16746
- case "list":
16747
- value = JSON.stringify(value);
16748
- break;
16806
+ case "list": value = JSON.stringify(value);
16749
16807
  }
16750
16808
  break;
16751
16809
  case "hook":
@@ -16762,14 +16820,16 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16762
16820
  break;
16763
16821
  case "fkey":
16764
16822
  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);
16823
+ if (value) {
16824
+ if ((0, _yuneta_gobj_js.is_string)(value)) {
16825
+ let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value);
16826
+ if (fkey) new_value.push(fkey.id);
16827
+ } else if ((0, _yuneta_gobj_js.is_array)(value)) for (let i = 0; i < value.length; i++) {
16828
+ let fkey = (0, _yuneta_gobj_js.treedb_decoder_fkey)(col, value[i]);
16829
+ if (fkey) new_value.push(fkey.id);
16830
+ }
16831
+ else (0, _yuneta_gobj_js.log_error)("fkey type unsupported: " + JSON.stringify(value));
16771
16832
  }
16772
- else (0, _yuneta_gobj_js.log_error)("fkey type unsupported: " + JSON.stringify(value));
16773
16833
  value = new_value.join(", ");
16774
16834
  break;
16775
16835
  case "now":
@@ -16790,14 +16850,11 @@ function transform__treedb_value_2_table_value(gobj, col, value, row, field) {
16790
16850
  second: "2-digit",
16791
16851
  hour12: true
16792
16852
  }).format(value) + "</span>";
16793
- break;
16794
16853
  }
16795
16854
  break;
16796
16855
  case "color": break;
16797
16856
  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;
16857
+ 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
16858
  }
16802
16859
  if (value !== null && value !== void 0 && typeof value === "object" && !(value instanceof Node)) {
16803
16860
  (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 +17022,83 @@ function close_form_dialog(gobj) {
16965
17022
  teardown_form_child(gobj);
16966
17023
  }
16967
17024
  /************************************************************
17025
+ * Show the topic's SCHEMA: its `desc` — pkey, cols, types,
17026
+ * flags and fkey targets — in the standardized adaptive
17027
+ * dialog, rendered by a C_YUI_JSON child. A viewer and not a
17028
+ * <pre> dump because a forty-column topic is only readable
17029
+ * collapsed and searchable.
17030
+ *
17031
+ * Read-only and offline: the desc is already in this gobj,
17032
+ * so no command is issued and nothing can be edited here.
17033
+ ************************************************************/
17034
+ function open_schema_dialog(gobj) {
17035
+ close_schema_dialog(gobj);
17036
+ let priv = gobj.priv;
17037
+ let desc = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "desc");
17038
+ if (!desc) {
17039
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no desc, no schema to show`);
17040
+ return;
17041
+ }
17042
+ let shell = yui_shell_of(gobj);
17043
+ if (!shell) {
17044
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: no shell, cannot open the schema view`);
17045
+ return;
17046
+ }
17047
+ 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);
17048
+ if (!json_view) {
17049
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: cannot create the schema viewer`);
17050
+ return;
17051
+ }
17052
+ priv.schema_gobj = json_view;
17053
+ (0, _yuneta_gobj_js.gobj_start)(json_view);
17054
+ let $box = (0, _yuneta_gobj_js.gobj_read_attr)(json_view, "$container");
17055
+ if (!$box) {
17056
+ (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the schema viewer built no $container`);
17057
+ teardown_schema_child(gobj);
17058
+ return;
17059
+ }
17060
+ priv.schema_modal = yui_shell_show_modal(shell, $box, {
17061
+ dialog: true,
17062
+ logical_class: "TREEDB_SCHEMA_SHEET",
17063
+ title_prefix: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"),
17064
+ title: "schema",
17065
+ t: i18next.t,
17066
+ on_close: function() {
17067
+ teardown_schema_child(gobj);
17068
+ }
17069
+ });
17070
+ (0, _yuneta_gobj_js.gobj_send_event)(json_view, "EV_SET_JSON", { json: desc }, gobj);
17071
+ }
17072
+ /************************************************************
17073
+ * Destroy the hosted C_YUI_JSON child. Called from the
17074
+ * schema modal's on_close — the shell has already removed
17075
+ * the dialog DOM and retired its Escape / history entries.
17076
+ ************************************************************/
17077
+ function teardown_schema_child(gobj) {
17078
+ let priv = gobj.priv;
17079
+ if (priv.schema_gobj) {
17080
+ if ((0, _yuneta_gobj_js.gobj_is_running)(priv.schema_gobj)) (0, _yuneta_gobj_js.gobj_stop)(priv.schema_gobj);
17081
+ (0, _yuneta_gobj_js.gobj_destroy)(priv.schema_gobj);
17082
+ priv.schema_gobj = null;
17083
+ }
17084
+ priv.schema_modal = null;
17085
+ }
17086
+ /************************************************************
17087
+ * Close the schema dialog (teardown, or a second open).
17088
+ * Closing the modal runs its on_close, which tears the
17089
+ * viewer child down.
17090
+ ************************************************************/
17091
+ function close_schema_dialog(gobj) {
17092
+ let priv = gobj.priv;
17093
+ if (priv.schema_modal) {
17094
+ let modal = priv.schema_modal;
17095
+ priv.schema_modal = null;
17096
+ modal.close();
17097
+ return;
17098
+ }
17099
+ teardown_schema_child(gobj);
17100
+ }
17101
+ /************************************************************
16968
17102
  * True if the topic's pkey col carries the "rowid" flag.
16969
17103
  ************************************************************/
16970
17104
  function pkey_is_rowid(gobj) {
@@ -17078,16 +17212,16 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
17078
17212
  case "enum":
17079
17213
  switch (field_desc.real_type) {
17080
17214
  case "string":
17081
- if ((0, _yuneta_gobj_js.is_array)(value)) if (value.length > 0) value = value[0];
17082
- else value = "";
17215
+ if ((0, _yuneta_gobj_js.is_array)(value)) {
17216
+ if (value.length > 0) value = value[0];
17217
+ else value = "";
17218
+ }
17083
17219
  break;
17084
17220
  case "object":
17085
17221
  case "dict":
17086
17222
  case "array":
17087
17223
  case "list": break;
17088
- default:
17089
- (0, _yuneta_gobj_js.log_error)("col type unknown 6: " + field_desc.real_type);
17090
- break;
17224
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 6: " + field_desc.real_type);
17091
17225
  }
17092
17226
  break;
17093
17227
  case "now":
@@ -17099,23 +17233,17 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
17099
17233
  case "integer":
17100
17234
  if (value && (0, _yuneta_gobj_js.is_date)(value)) value = value.getTime() / 1e3;
17101
17235
  break;
17102
- default:
17103
- (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17104
- break;
17236
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17105
17237
  }
17106
17238
  break;
17107
17239
  case "color":
17108
17240
  switch (field_desc.real_type) {
17109
17241
  case "string": break;
17110
17242
  case "integer": break;
17111
- default:
17112
- (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17113
- break;
17243
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 7: " + field_desc.real_type);
17114
17244
  }
17115
17245
  break;
17116
- default:
17117
- (0, _yuneta_gobj_js.log_error)("col type unknown 8: " + field_desc.type);
17118
- break;
17246
+ default: (0, _yuneta_gobj_js.log_error)("col type unknown 8: " + field_desc.type);
17119
17247
  }
17120
17248
  return value;
17121
17249
  }
@@ -17157,9 +17285,7 @@ function build_fkey_ref(gobj, col, value) {
17157
17285
  refs[topic_name + "^" + v + "^" + hook] = true;
17158
17286
  break;
17159
17287
  case "array":
17160
- case "list":
17161
- refs.push(topic_name + "^" + v + "^" + hook);
17162
- break;
17288
+ case "list": refs.push(topic_name + "^" + v + "^" + hook);
17163
17289
  }
17164
17290
  } else if ((0, _yuneta_gobj_js.is_object)(v)) {
17165
17291
  let topic_name = v.topic_name;
@@ -17172,9 +17298,7 @@ function build_fkey_ref(gobj, col, value) {
17172
17298
  refs[topic_name + "^" + v.id + "^" + hook] = true;
17173
17299
  break;
17174
17300
  case "array":
17175
- case "list":
17176
- refs.push(topic_name + "^" + v.id + "^" + hook);
17177
- break;
17301
+ case "list": refs.push(topic_name + "^" + v.id + "^" + hook);
17178
17302
  }
17179
17303
  } else {
17180
17304
  (0, _yuneta_gobj_js.log_error)("Merde value1: " + v);
@@ -17291,8 +17415,10 @@ function ac_load_nodes(gobj, event, kw, src) {
17291
17415
  return -1;
17292
17416
  }
17293
17417
  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;
17418
+ if (tabulator) {
17419
+ if (tabulator._ready) tabulator.setData(data);
17420
+ else tabulator._pendingData = data;
17421
+ }
17296
17422
  return 0;
17297
17423
  }
17298
17424
  /************************************************************
@@ -17401,9 +17527,7 @@ function ac_new_row(gobj, event, kw, src) {
17401
17527
  case "template":
17402
17528
  if (col.template) row[col.id] = col.template;
17403
17529
  break;
17404
- default:
17405
- if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
17406
- break;
17530
+ default: if (field_desc.default_value !== void 0) row[col.id] = field_desc.default_value;
17407
17531
  }
17408
17532
  }
17409
17533
  show_create_form(gobj, row);
@@ -17494,7 +17618,8 @@ function ac_paste_rows(gobj, event, kw, src) {
17494
17618
  * fkeys, times and numbers). Route by the form's mode.
17495
17619
  ************************************************************/
17496
17620
  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", {
17621
+ let mode = (0, _yuneta_gobj_js.gobj_read_str_attr)(src, "form_mode");
17622
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, mode === "create" ? "EV_CREATE_RECORD" : "EV_UPDATE_RECORD", {
17498
17623
  topic_name: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "topic_name"),
17499
17624
  record: kw
17500
17625
  });
@@ -17511,12 +17636,14 @@ function ac_select_rows(gobj, event, kw, src) {
17511
17636
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
17512
17637
  let $button_delete_record = $container.querySelector(`.button-delete-record`);
17513
17638
  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);
17639
+ if ($button_delete_record) {
17640
+ if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17641
+ $button_delete_record.removeAttribute("disabled");
17642
+ $button_copy_record.removeAttribute("disabled");
17643
+ } else {
17644
+ $button_delete_record.setAttribute("disabled", true);
17645
+ $button_copy_record.setAttribute("disabled", true);
17646
+ }
17520
17647
  }
17521
17648
  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
17649
  return 0;
@@ -17529,12 +17656,14 @@ function ac_unselect_rows(gobj, event, kw, src) {
17529
17656
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
17530
17657
  let $button_delete_record = $container.querySelector(`.button-delete-record`);
17531
17658
  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);
17659
+ if ($button_delete_record) {
17660
+ if (tabulator.getSelectedData().length && (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "editable")) {
17661
+ $button_delete_record.removeAttribute("disabled");
17662
+ $button_copy_record.removeAttribute("disabled");
17663
+ } else {
17664
+ $button_delete_record.setAttribute("disabled", true);
17665
+ $button_copy_record.setAttribute("disabled", true);
17666
+ }
17538
17667
  }
17539
17668
  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
17669
  return 0;
@@ -17556,7 +17685,8 @@ function ac_change_locale(gobj, event, kw, src) {
17556
17685
  * };
17557
17686
  ************************************************************/
17558
17687
  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);
17688
+ let webix = (0, _yuneta_gobj_js.gobj_command)((0, _yuneta_gobj_js.gobj_parent)(gobj), "get_topic_data", kw, gobj);
17689
+ let row = (0, _yuneta_gobj_js.kwid_find_one_record)(gobj, webix.data, kw.row_id, null);
17560
17690
  if (row) {
17561
17691
  let cell = row[kw.col_id];
17562
17692
  show_dropdown_popup_menu(gobj, kw.click_x, kw.click_y, cell);
@@ -17571,6 +17701,13 @@ function ac_refresh$1(gobj, event, kw, src) {
17571
17701
  return 0;
17572
17702
  }
17573
17703
  /************************************************************
17704
+ * Show the schema (desc) of this topic
17705
+ ************************************************************/
17706
+ function ac_show_schema(gobj, event, kw, src) {
17707
+ open_schema_dialog(gobj);
17708
+ return 0;
17709
+ }
17710
+ /************************************************************
17574
17711
  * {
17575
17712
  * href: href
17576
17713
  * }
@@ -17684,6 +17821,11 @@ function create_gclass$4(gclass_name) {
17684
17821
  ac_refresh$1,
17685
17822
  null
17686
17823
  ],
17824
+ [
17825
+ "EV_SHOW_SCHEMA",
17826
+ ac_show_schema,
17827
+ null
17828
+ ],
17687
17829
  [
17688
17830
  "EV_SHOW",
17689
17831
  ac_show$3,
@@ -17695,7 +17837,7 @@ function create_gclass$4(gclass_name) {
17695
17837
  null
17696
17838
  ]
17697
17839
  ]]];
17698
- __gclass__$4 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
17840
+ const event_types = [
17699
17841
  ["EV_LANGUAGE_CHANGED", 0],
17700
17842
  ["EV_LOAD_NODES", 0],
17701
17843
  ["EV_LOAD_NODE_CREATED", 0],
@@ -17712,13 +17854,15 @@ function create_gclass$4(gclass_name) {
17712
17854
  ["EV_SHOW_HOOK_DATA", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17713
17855
  ["EV_CHANGE_LOCALE", 0],
17714
17856
  ["EV_REFRESH", 0],
17857
+ ["EV_SHOW_SCHEMA", 0],
17715
17858
  ["EV_CREATE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17716
17859
  ["EV_UPDATE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17717
17860
  ["EV_DELETE_RECORD", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17718
17861
  ["EV_REFRESH_TOPIC", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT],
17719
17862
  ["EV_SHOW", 0],
17720
17863
  ["EV_HIDE", 0]
17721
- ], states, gmt$4, 0, attrs_table$4, PRIVATE_DATA$4, 0, 0, 0, 0);
17864
+ ];
17865
+ __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
17866
  if (!__gclass__$4) return -1;
17723
17867
  return 0;
17724
17868
  }
@@ -17727,6 +17871,7 @@ function create_gclass$4(gclass_name) {
17727
17871
  ***************************************************************/
17728
17872
  function register_c_yui_treedb_topic_with_form() {
17729
17873
  if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_FORM", false)) register_c_yui_form();
17874
+ if (!(0, _yuneta_gobj_js.gclass_find_by_name)("C_YUI_JSON", false)) register_c_yui_json();
17730
17875
  return create_gclass$4(GCLASS_NAME$4);
17731
17876
  }
17732
17877
  //#endregion
@@ -17921,7 +18066,8 @@ function mt_create$3(gobj) {
17921
18066
  if (!subscriber) subscriber = (0, _yuneta_gobj_js.gobj_parent)(gobj);
17922
18067
  (0, _yuneta_gobj_js.gobj_subscribe_event)(gobj, null, {}, subscriber);
17923
18068
  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");
18069
+ let canvas_id = (0, _yuneta_gobj_js.clean_name)((0, _yuneta_gobj_js.gobj_name)(gobj)) + "-canvas";
18070
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "canvas_id", canvas_id);
17925
18071
  let $container_canvas = build_ui$3(gobj).querySelector(`#${priv.canvas_id}`);
17926
18072
  priv.gobj_nodes_tree = (0, _yuneta_gobj_js.gobj_create_service)(`${(0, _yuneta_gobj_js.gobj_name)(gobj)}-g6`, "C_G6_NODES_TREE", {
17927
18073
  $container: $container_canvas,
@@ -18707,8 +18853,10 @@ function ac_mt_command_answer(gobj, event, kw, src) {
18707
18853
  else (0, _yuneta_gobj_js.gobj_send_event)(jv, "EV_SET_JSON", { json: data }, gobj);
18708
18854
  return 0;
18709
18855
  }
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 });
18856
+ if (result < 0) {
18857
+ if (command === "descs") show_load_error(gobj, (0, i18next.t)(comment));
18858
+ else yui_shell_show_error(yui_shell_of(gobj), comment, { t: i18next.t });
18859
+ }
18712
18860
  switch (command) {
18713
18861
  case "descs":
18714
18862
  if (result >= 0) process_treedb_descs(gobj, data);
@@ -19244,7 +19392,7 @@ function create_gclass$3(gclass_name) {
19244
19392
  null
19245
19393
  ]
19246
19394
  ]]];
19247
- __gclass__$3 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
19395
+ const event_types = [
19248
19396
  ["EV_MT_COMMAND_ANSWER", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
19249
19397
  ["EV_TREEDB_NODE_CREATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
19250
19398
  ["EV_TREEDB_NODE_UPDATED", _yuneta_gobj_js.event_flag_t.EVF_PUBLIC_EVENT],
@@ -19273,7 +19421,8 @@ function create_gclass$3(gclass_name) {
19273
19421
  ["EV_SHOW", 0],
19274
19422
  ["EV_HIDE", 0],
19275
19423
  ["EV_TRANSPORT_STATE", 0]
19276
- ], states, gmt$3, 0, attrs_table$3, PRIVATE_DATA$3, 0, 0, 0, 0);
19424
+ ];
19425
+ __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
19426
  if (!__gclass__$3) return -1;
19278
19427
  return 0;
19279
19428
  }
@@ -19352,14 +19501,15 @@ function mt_destroy$2(gobj) {
19352
19501
  * Build UI
19353
19502
  ************************************************************/
19354
19503
  function build_ui$2(gobj) {
19355
- (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", (0, _yuneta_gobj_js.createElement2)([
19504
+ let $container = (0, _yuneta_gobj_js.createElement2)([
19356
19505
  "div",
19357
19506
  {
19358
19507
  class: "C_YUI_TREEDB_SCHEMA TREEDB_SCHEMA_VIEW",
19359
19508
  style: "position:relative; height:100%; min-height:0;"
19360
19509
  },
19361
19510
  []
19362
- ]));
19511
+ ]);
19512
+ (0, _yuneta_gobj_js.gobj_write_attr)(gobj, "$container", $container);
19363
19513
  }
19364
19514
  /************************************************************
19365
19515
  * Derive {nodes, edges} from the schema.
@@ -19484,7 +19634,8 @@ function build_graph$1(gobj) {
19484
19634
  priv.graph = graph;
19485
19635
  graph.setTheme(dark ? "dark" : "light");
19486
19636
  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);
19637
+ let node_id = evt && evt.target && evt.target.id;
19638
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_NODE_CLICK", { node_id }, gobj);
19488
19639
  });
19489
19640
  graph.render().then(() => {
19490
19641
  try {
@@ -23613,7 +23764,6 @@ function segmentToCubic(segment, params) {
23613
23764
  py
23614
23765
  ];
23615
23766
  return ["C"].concat(lineToCubic(px1, py1, px, py));
23616
- default:
23617
23767
  }
23618
23768
  return segment;
23619
23769
  }
@@ -23637,7 +23787,8 @@ function path2Curve(pathInput, needZCommandIndexes) {
23637
23787
  for (var i = 0; i < ii; i += 1) {
23638
23788
  if (path[i]) pathCommand = path[i][0];
23639
23789
  allPathCommands[i] = pathCommand;
23640
- path[i] = segmentToCubic(path[i], params);
23790
+ var curveSegment = segmentToCubic(path[i], params);
23791
+ path[i] = curveSegment;
23641
23792
  fixArc(path, allPathCommands, i);
23642
23793
  ii = path.length;
23643
23794
  if (pathCommand === "Z") zCommandIndexes.push(i);
@@ -23689,20 +23840,22 @@ function segmentLineFactory(x1, y1, x2, y2, distance) {
23689
23840
  x: 0,
23690
23841
  y: 0
23691
23842
  };
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]
23843
+ if (typeof distance === "number") {
23844
+ if (distance <= 0) point = {
23845
+ x: x1,
23846
+ y: y1
23847
+ };
23848
+ else if (distance >= length) point = {
23849
+ x: x2,
23850
+ y: y2
23705
23851
  };
23852
+ else {
23853
+ var _a = midPoint([x1, y1], [x2, y2], distance / length);
23854
+ point = {
23855
+ x: _a[0],
23856
+ y: _a[1]
23857
+ };
23858
+ }
23706
23859
  }
23707
23860
  return {
23708
23861
  length,
@@ -25258,7 +25411,11 @@ var Rectangle = /*#__PURE__*/ function() {
25258
25411
  value: function toJSON() {}
25259
25412
  }], [{
25260
25413
  key: "fromRect",
25261
- value: function fromRect(rect) {
25414
+ value:
25415
+ /**
25416
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/fromRect_static
25417
+ */
25418
+ function fromRect(rect) {
25262
25419
  return new Rectangle(rect.x, rect.y, rect.width, rect.height);
25263
25420
  }
25264
25421
  }, {
@@ -25348,14 +25505,15 @@ function getEulerFromMat4(out, m) {
25348
25505
  var z;
25349
25506
  var _mat4$getScaling2 = _slicedToArray(getScaling(create$3(), m), 3), sx = _mat4$getScaling2[0], sy = _mat4$getScaling2[1], sz = _mat4$getScaling2[2];
25350
25507
  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);
25508
+ if (y < HALF_PI) {
25509
+ if (y > -HALF_PI) {
25510
+ x = Math.atan2(m[6] / sy, m[10] / sz);
25511
+ z = Math.atan2(m[1] / sx, m[0] / sx);
25512
+ } else {
25513
+ z = 0;
25514
+ x = -Math.atan2(m[4] / sy, m[5] / sy);
25515
+ }
25354
25516
  } else {
25355
- z = 0;
25356
- x = -Math.atan2(m[4] / sy, m[5] / sy);
25357
- }
25358
- else {
25359
25517
  z = 0;
25360
25518
  x = Math.atan2(m[4] / sy, m[5] / sy);
25361
25519
  }
@@ -25422,8 +25580,10 @@ function decompose(mat) {
25422
25580
  var row1y = mat[4];
25423
25581
  var scalingX = Math.sqrt(row0x * row0x + row0y * row0y);
25424
25582
  var scalingY = Math.sqrt(row1x * row1x + row1y * row1y);
25425
- if (row0x * row1y - row0y * row1x < 0) if (row0x < row1y) scalingX = -scalingX;
25426
- else scalingY = -scalingY;
25583
+ if (row0x * row1y - row0y * row1x < 0) {
25584
+ if (row0x < row1y) scalingX = -scalingX;
25585
+ else scalingY = -scalingY;
25586
+ }
25427
25587
  if (scalingX) {
25428
25588
  var invScalingX = 1 / scalingX;
25429
25589
  row0x *= invScalingX;
@@ -26397,9 +26557,10 @@ function updateLocalTransform(transform) {
26397
26557
  var hasRotation = localRotation[3] !== 1 || localRotation[0] !== 0 || localRotation[1] !== 0 || localRotation[2] !== 0;
26398
26558
  var hasScale = localScale[0] !== 1 || localScale[1] !== 1 || localScale[2] !== 1;
26399
26559
  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);
26560
+ if (!hasRotation && !hasScale && !hasOrigin) {
26561
+ if (hasPosition) fromTranslation(localTransform, localPosition);
26562
+ else identity(localTransform);
26563
+ } else fromRotationTranslationScaleOrigin(localTransform, localRotation, localPosition, localScale, origin);
26403
26564
  }
26404
26565
  transform.localDirtyFlag = false;
26405
26566
  }
@@ -26987,9 +27148,7 @@ var conversionToCanonicalUnitsScaleFactor = function conversionToCanonicalUnitsS
26987
27148
  case UnitType.kGradians:
26988
27149
  factor = .9;
26989
27150
  break;
26990
- case UnitType.kTurns:
26991
- factor = 360;
26992
- break;
27151
+ case UnitType.kTurns: factor = 360;
26993
27152
  }
26994
27153
  return factor;
26995
27154
  };
@@ -27163,9 +27322,10 @@ var CSSKeywordValue = /*#__PURE__*/ function(_CSSStyleValue) {
27163
27322
  var formatInfinityOrNaN = function formatInfinityOrNaN(number) {
27164
27323
  var suffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
27165
27324
  var result = "";
27166
- if (!Number.isFinite(number)) if (number > 0) result = "infinity";
27167
- else result = "-infinity";
27168
- else result = "NaN";
27325
+ if (!Number.isFinite(number)) {
27326
+ if (number > 0) result = "infinity";
27327
+ else result = "-infinity";
27328
+ } else result = "NaN";
27169
27329
  return result += suffix;
27170
27330
  };
27171
27331
  var toCanonicalUnit = function toCanonicalUnit(unit) {
@@ -27734,8 +27894,10 @@ var parseGradient = memoize(function(colorStr) {
27734
27894
  }
27735
27895
  } else if (type === "r") {
27736
27896
  var parsedRadialGradient = parseRadialGradient(colorStr);
27737
- if (parsedRadialGradient) if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
27738
- else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
27897
+ if (parsedRadialGradient) {
27898
+ if (isString(parsedRadialGradient)) colorStr = parsedRadialGradient;
27899
+ else return [new CSSGradientValue(GradientType.RadialGradient, parsedRadialGradient)];
27900
+ }
27739
27901
  } else if (type === "p") return parsePattern(colorStr);
27740
27902
  }
27741
27903
  });
@@ -28152,7 +28314,6 @@ function getPathBBox(segments, lineWidth) {
28152
28314
  default:
28153
28315
  xArr.push(currentPoint[0]);
28154
28316
  yArr.push(currentPoint[1]);
28155
- break;
28156
28317
  }
28157
28318
  if (box$1) {
28158
28319
  segment.box = box$1;
@@ -28327,9 +28488,7 @@ function path2Segments(path) {
28327
28488
  startMovePoint = [params[1], params[2]];
28328
28489
  lastStartMovePointIndex = i;
28329
28490
  break;
28330
- case "A":
28331
- segment.arcParams = getArcParams(currentPoint, params);
28332
- break;
28491
+ case "A": segment.arcParams = getArcParams(currentPoint, params);
28333
28492
  }
28334
28493
  if (command === "Z") {
28335
28494
  currentPoint = startMovePoint;
@@ -29616,10 +29775,12 @@ var parseTransformOrigin = memoize(function(value) {
29616
29775
  if (isString(value)) {
29617
29776
  if (value === "text-anchor") return [getOrCreateUnitValue(0, "px"), getOrCreateUnitValue(0, "px")];
29618
29777
  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";
29778
+ if (values.length === 1) {
29779
+ if (values[0] === "top" || values[0] === "bottom") {
29780
+ values[1] = values[0];
29781
+ values[0] = "center";
29782
+ } else values[1] = "center";
29783
+ }
29623
29784
  if (values.length !== 2) return null;
29624
29785
  return [parseLengthOrPercentage(convertKeyword2Percent(values[0])), parseLengthOrPercentage(convertKeyword2Percent(values[1]))];
29625
29786
  }
@@ -30497,7 +30658,14 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/ function() {
30497
30658
  }
30498
30659
  return _createClass(CSSPropertyLengthOrPercentage, [{
30499
30660
  key: "calculator",
30500
- value: function calculator(name, oldParsed, computed, object, runtime) {
30661
+ value:
30662
+ /**
30663
+ * according to parent's bounds
30664
+ *
30665
+ * @example
30666
+ * CSS.percent(50) -> CSS.px(0.5 * parent.width)
30667
+ */
30668
+ function calculator(name, oldParsed, computed, object, runtime) {
30501
30669
  if (isNumber(computed)) return computed;
30502
30670
  if (CSSUnitValue.isRelativeUnit(computed.unit)) {
30503
30671
  if (computed.unit === UnitType.kPercentage) return 0;
@@ -31414,7 +31582,19 @@ var FederatedEvent = /*#__PURE__*/ function() {
31414
31582
  return _createClass(FederatedEvent, [
31415
31583
  {
31416
31584
  key: "name",
31417
- get: function get() {
31585
+ get:
31586
+ /**
31587
+ * The type of event, supports the following:
31588
+ * * pointerdown
31589
+ * * touchstart
31590
+ * * mousedown
31591
+ * * rightdown
31592
+ * * ...
31593
+ */
31594
+ /**
31595
+ * @deprecated
31596
+ */
31597
+ function get() {
31418
31598
  return this.type;
31419
31599
  }
31420
31600
  },
@@ -31480,7 +31660,15 @@ var FederatedEvent = /*#__PURE__*/ function() {
31480
31660
  },
31481
31661
  {
31482
31662
  key: "composedPath",
31483
- value: function composedPath() {
31663
+ value:
31664
+ /**
31665
+ * The propagation path for this event
31666
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Event/composedPath
31667
+ *
31668
+ * So composedPath()[0] represents the original target.
31669
+ * @see https://polymer-library.polymer-project.org/3.0/docs/devguide/events#retargeting
31670
+ */
31671
+ function composedPath() {
31484
31672
  if (this.manager && (!this.path || this.path[0] !== this.target)) this.path = this.target ? this.manager.propagationPath(this.target) : [];
31485
31673
  return this.path;
31486
31674
  }
@@ -31512,7 +31700,12 @@ var FederatedEvent = /*#__PURE__*/ function() {
31512
31700
  },
31513
31701
  {
31514
31702
  key: "initEvent",
31515
- value: function initEvent() {}
31703
+ value:
31704
+ /**
31705
+ * added for compatibility with DOM Event,
31706
+ * deprecated props and methods
31707
+ */
31708
+ function initEvent() {}
31516
31709
  },
31517
31710
  {
31518
31711
  key: "initUIEvent",
@@ -31675,7 +31868,43 @@ var FederatedPointerEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
31675
31868
  return _createClass(FederatedPointerEvent, [
31676
31869
  {
31677
31870
  key: "getCoalescedEvents",
31678
- value: function getCoalescedEvents() {
31871
+ value:
31872
+ /**
31873
+ * The type of pointer that triggered the event.
31874
+ *
31875
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
31876
+ */
31877
+ /**
31878
+ * Pressure applied by the pointing device during the event.
31879
+ *s
31880
+ * A Touch's force property will be represented by this value.
31881
+ *
31882
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
31883
+ */
31884
+ /**
31885
+ * Barrel pressure on a stylus pointer.
31886
+ *
31887
+ * @see https://w3c.github.io/pointerevents/#pointerevent-interface
31888
+ */
31889
+ /**
31890
+ * The angle, in degrees, between the pointer device and the screen.
31891
+ *
31892
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
31893
+ */
31894
+ /**
31895
+ * The angle, in degrees, between the pointer device and the screen.
31896
+ *
31897
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
31898
+ */
31899
+ /**
31900
+ * Twist of a stylus pointer.
31901
+ *
31902
+ * @see https://w3c.github.io/pointerevents/#pointerevent-interface
31903
+ */
31904
+ /**
31905
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents
31906
+ */
31907
+ function getCoalescedEvents() {
31679
31908
  if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") return [this];
31680
31909
  return [];
31681
31910
  }
@@ -31702,7 +31931,15 @@ var FederatedWheelEvent = /*#__PURE__*/ function(_FederatedMouseEvent) {
31702
31931
  _inherits(FederatedWheelEvent, _FederatedMouseEvent);
31703
31932
  return _createClass(FederatedWheelEvent, [{
31704
31933
  key: "clone",
31705
- value: function clone() {
31934
+ value:
31935
+ /**
31936
+ * The units of `deltaX`, `deltaY`, and `deltaZ`. This is one of `DOM_DELTA_LINE`,
31937
+ * `DOM_DELTA_PAGE`, `DOM_DELTA_PIXEL`.
31938
+ */
31939
+ /** Horizontal scroll amount */
31940
+ /** Vertical scroll amount */
31941
+ /** z-axis scroll amount. */
31942
+ function clone() {
31706
31943
  return this.manager.cloneWheelEvent(this);
31707
31944
  }
31708
31945
  }]);
@@ -31791,7 +32028,11 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31791
32028
  return _createClass(Node, [
31792
32029
  {
31793
32030
  key: "textContent",
31794
- get: function get() {
32031
+ get:
32032
+ /**
32033
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
32034
+ */
32035
+ function get() {
31795
32036
  var out = "";
31796
32037
  if (this.nodeName === Shape.TEXT) out += this.style.text;
31797
32038
  var _iterator = _createForOfIteratorHelper(this.childNodes), _step;
@@ -31869,7 +32110,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31869
32110
  },
31870
32111
  {
31871
32112
  key: "parent",
31872
- get: function get() {
32113
+ get:
32114
+ /**
32115
+ * @deprecated
32116
+ * @alias parentNode
32117
+ */
32118
+ function get() {
31873
32119
  return this.parentNode;
31874
32120
  }
31875
32121
  },
@@ -31939,7 +32185,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31939
32185
  },
31940
32186
  {
31941
32187
  key: "contain",
31942
- value: function contain(other) {
32188
+ value:
32189
+ /**
32190
+ * @deprecated
32191
+ * @alias contains
32192
+ */
32193
+ function contain(other) {
31943
32194
  return this.contains(other);
31944
32195
  }
31945
32196
  },
@@ -31990,7 +32241,12 @@ var Node$1 = /*#__PURE__*/ function(_EventTarget) {
31990
32241
  return _createClass(EventTarget, [
31991
32242
  {
31992
32243
  key: "on",
31993
- value: function on(type, listener, options) {
32244
+ value:
32245
+ /**
32246
+ * @deprecated
32247
+ * @alias addEventListener
32248
+ */
32249
+ function on(type, listener, options) {
31994
32250
  this.addEventListener(type, listener, options);
31995
32251
  return this;
31996
32252
  }
@@ -32153,7 +32409,11 @@ var OffscreenCanvasCreator = /*#__PURE__*/ function() {
32153
32409
  }
32154
32410
  }], [{
32155
32411
  key: "createCanvas",
32156
- value: function createCanvas() {
32412
+ value:
32413
+ /**
32414
+ * @returns new canvas instance
32415
+ */
32416
+ function createCanvas() {
32157
32417
  try {
32158
32418
  return new window.OffscreenCanvas(0, 0);
32159
32419
  } catch (_unused2) {}
@@ -32776,10 +33036,12 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
32776
33036
  var aabb = this.getTransformedGeometryBounds(element, render, existedAABB);
32777
33037
  element.childNodes.forEach(function(child) {
32778
33038
  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);
33039
+ if (childBounds) {
33040
+ if (!aabb) {
33041
+ aabb = existedAABB || new AABB();
33042
+ aabb.update(childBounds.center, childBounds.halfExtents);
33043
+ } else aabb.add(childBounds);
33044
+ }
32783
33045
  });
32784
33046
  if (!aabb) aabb = new AABB();
32785
33047
  if (render) {
@@ -32986,12 +33248,14 @@ var DefaultSceneGraphService = /*#__PURE__*/ function() {
32986
33248
  var mutations = /* @__PURE__ */ new Set();
32987
33249
  canvas.getRoot().forEach(function(item) {
32988
33250
  (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);
33251
+ if (mutation.type === "attributes" && mutation._boundsChangeData) {
33252
+ if (mutation._boundsChangeData.affectChildren) item.forEach(function(node) {
33253
+ var newMutation = _objectSpread2({}, mutation);
33254
+ newMutation.target = node;
33255
+ mutations.add(newMutation);
33256
+ });
33257
+ else mutations.add(mutation);
33258
+ }
32995
33259
  });
32996
33260
  item.mutations = void 0;
32997
33261
  });
@@ -33166,7 +33430,15 @@ var TextService = /*#__PURE__*/ function() {
33166
33430
  return _createClass(TextService, [
33167
33431
  {
33168
33432
  key: "measureFont",
33169
- value: function measureFont(font, offscreenCanvas) {
33433
+ value:
33434
+ /**
33435
+ * A global cache for character widths, keyed by font string.
33436
+ * e.g. { '16px Arial': { 'a': 8, 'b': 9 } }
33437
+ */
33438
+ /**
33439
+ * Calculates the ascent, descent and fontSize of a given font-style.
33440
+ */
33441
+ function measureFont(font, offscreenCanvas) {
33170
33442
  if (this.fontMetricsCache[font]) return this.fontMetricsCache[font];
33171
33443
  var properties = {
33172
33444
  ascent: 0,
@@ -33664,7 +33936,18 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33664
33936
  return _createClass(Element, [
33665
33937
  {
33666
33938
  key: "dirty",
33667
- value: function dirty() {
33939
+ value:
33940
+ /**
33941
+ * Marks the element as dirty, indicating it needs re-rendering or relayout.
33942
+ *
33943
+ * @param styleFlag - Whether to update style state (default: true).
33944
+ * When true, sets `renderable.dirty` to true.
33945
+ * @param layoutFlag - Optional. When provided, updates layout-related dirty flags:
33946
+ * - `renderable.boundsDirty`
33947
+ * - `renderable.renderBoundsDirty`
33948
+ * - `geometry.dirty`
33949
+ */
33950
+ function dirty() {
33668
33951
  var styleFlag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
33669
33952
  var layoutFlag = arguments.length > 1 ? arguments[1] : void 0;
33670
33953
  this.renderable.dirty = styleFlag;
@@ -33677,7 +33960,16 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33677
33960
  },
33678
33961
  {
33679
33962
  key: "className",
33680
- get: function get() {
33963
+ get:
33964
+ /**
33965
+ * used with `getElementById()`
33966
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
33967
+ */
33968
+ /**
33969
+ * used in `getElementsByClassName`
33970
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
33971
+ */
33972
+ function get() {
33681
33973
  return this.getAttribute("class") || "";
33682
33974
  },
33683
33975
  set: function set(className) {
@@ -33686,7 +33978,11 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33686
33978
  },
33687
33979
  {
33688
33980
  key: "classList",
33689
- get: function get() {
33981
+ get:
33982
+ /**
33983
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
33984
+ */
33985
+ function get() {
33690
33986
  return this.className.split(" ").filter(function(c) {
33691
33987
  return c !== "";
33692
33988
  });
@@ -33760,8 +34056,10 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
33760
34056
  var _this$ownerDocument;
33761
34057
  if (child.destroyed) throw new Error(ERROR_MSG_APPEND_DESTROYED_ELEMENT);
33762
34058
  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);
34059
+ if ((_this$ownerDocument = this.ownerDocument) !== null && _this$ownerDocument !== void 0 && _this$ownerDocument.defaultView) {
34060
+ if (!isInFragment(this) && child.nodeName === Shape.FRAGMENT) this.ownerDocument.defaultView.mountFragment(child);
34061
+ else this.ownerDocument.defaultView.mountChildren(child);
34062
+ }
33765
34063
  if (this.isMutationObserved) {
33766
34064
  insertedEvent.relatedNode = this;
33767
34065
  child.dispatchEvent(insertedEvent);
@@ -34027,13 +34325,22 @@ var Element$1 = /*#__PURE__*/ function(_Node) {
34027
34325
  },
34028
34326
  {
34029
34327
  key: "computedStyleMap",
34030
- value: function computedStyleMap() {
34328
+ value:
34329
+ /**
34330
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
34331
+ * eg. circle.computedStyleMap().get('fill');
34332
+ */
34333
+ function computedStyleMap() {
34031
34334
  return new Map(Object.entries(this.computedStyle));
34032
34335
  }
34033
34336
  },
34034
34337
  {
34035
34338
  key: "getAttributeNames",
34036
- value: function getAttributeNames() {
34339
+ value:
34340
+ /**
34341
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames
34342
+ */
34343
+ function getAttributeNames() {
34037
34344
  return Object.keys(this.attributes);
34038
34345
  }
34039
34346
  },
@@ -36677,7 +36984,11 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
36677
36984
  return _createClass(HTMLRenderingPlugin, [
36678
36985
  {
36679
36986
  key: "joinTransformMatrix",
36680
- value: function joinTransformMatrix(matrix) {
36987
+ value:
36988
+ /**
36989
+ * ! 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`.
36990
+ */
36991
+ function joinTransformMatrix(matrix) {
36681
36992
  var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [
36682
36993
  0,
36683
36994
  0,
@@ -36876,18 +37187,20 @@ var HTMLRenderingPlugin = /*#__PURE__*/ function() {
36876
37187
  case "fill":
36877
37188
  var fill = object.parsedStyle.fill;
36878
37189
  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");
37190
+ if (isCSSRGB(fill)) {
37191
+ if (fill.isNone) color = "transparent";
37192
+ else color = object.getAttribute("fill");
37193
+ } else if (Array.isArray(fill)) color = object.getAttribute("fill");
36882
37194
  else if (isPattern(fill));
36883
37195
  $el.style.background = color;
36884
37196
  break;
36885
37197
  case "stroke":
36886
37198
  var stroke = object.parsedStyle.stroke;
36887
37199
  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");
37200
+ if (isCSSRGB(stroke)) {
37201
+ if (stroke.isNone) borderColor = "transparent";
37202
+ else borderColor = object.getAttribute("stroke");
37203
+ } else if (Array.isArray(stroke)) borderColor = object.getAttribute("stroke");
36891
37204
  else if (isPattern(stroke));
36892
37205
  $el.style["border-color"] = borderColor;
36893
37206
  $el.style["border-style"] = "solid";
@@ -37579,8 +37892,10 @@ PERFORMANCE OF THIS SOFTWARE.
37579
37892
  if (classType === CJ) return types.push(lineBreak === "strict" ? NS : ID);
37580
37893
  if (classType === SA) return types.push(AL);
37581
37894
  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);
37895
+ if (classType === XX) {
37896
+ if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) return types.push(ID);
37897
+ else return types.push(AL);
37898
+ }
37584
37899
  types.push(classType);
37585
37900
  });
37586
37901
  return [
@@ -38242,12 +38557,13 @@ PERFORMANCE OF THIS SOFTWARE.
38242
38557
  } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
38243
38558
  this.consumeBadUrlRemnants();
38244
38559
  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);
38560
+ } else if (codePoint === REVERSE_SOLIDUS) {
38561
+ if (isValidEscape(codePoint, this.peekCodePoint(0))) value.push(this.consumeEscapedCodePoint());
38562
+ else {
38563
+ this.consumeBadUrlRemnants();
38564
+ return BAD_URL_TOKEN;
38565
+ }
38566
+ } else value.push(codePoint);
38251
38567
  }
38252
38568
  };
38253
38569
  Tokenizer.prototype.consumeWhiteSpace = function() {
@@ -38991,15 +39307,13 @@ PERFORMANCE OF THIS SOFTWARE.
38991
39307
  ry = Math.max(Math.abs(y), Math.abs(y - height));
38992
39308
  }
38993
39309
  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;
39310
+ 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));
39311
+ else if (gradient.shape === 1) {
39312
+ var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
39313
+ var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
39314
+ rx = distance(cx - x, (cy - y) / c);
39315
+ ry = c * rx;
39316
+ }
39003
39317
  }
39004
39318
  if (Array.isArray(gradient.size)) {
39005
39319
  rx = getAbsoluteValue(gradient.size[0], width);
@@ -39979,7 +40293,6 @@ PERFORMANCE OF THIS SOFTWARE.
39979
40293
  case 4:
39980
40294
  results.push(accumulator.join(" "));
39981
40295
  accumulator.length = 0;
39982
- break;
39983
40296
  }
39984
40297
  });
39985
40298
  if (accumulator.length) results.push(accumulator.join(" "));
@@ -40188,9 +40501,7 @@ PERFORMANCE OF THIS SOFTWARE.
40188
40501
  case "fill":
40189
40502
  layers.push(0);
40190
40503
  break;
40191
- case "markers":
40192
- layers.push(2);
40193
- break;
40504
+ case "markers": layers.push(2);
40194
40505
  }
40195
40506
  });
40196
40507
  DEFAULT_VALUE.forEach(function(value) {
@@ -40336,20 +40647,18 @@ PERFORMANCE OF THIS SOFTWARE.
40336
40647
  case 0: return descriptor.parse(context, parser.parseComponentValue());
40337
40648
  case 1: return descriptor.parse(context, parser.parseComponentValues());
40338
40649
  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;
40650
+ case 3: switch (descriptor.format) {
40651
+ case "angle": return angle.parse(context, parser.parseComponentValue());
40652
+ case "color": return color$1.parse(context, parser.parseComponentValue());
40653
+ case "image": return image.parse(context, parser.parseComponentValue());
40654
+ case "length":
40655
+ var length_1 = parser.parseComponentValue();
40656
+ return isLength(length_1) ? length_1 : ZERO_LENGTH;
40657
+ case "length-percentage":
40658
+ var value_1 = parser.parseComponentValue();
40659
+ return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
40660
+ case "time": return time.parse(context, parser.parseComponentValue());
40661
+ }
40353
40662
  }
40354
40663
  };
40355
40664
  var elementDebuggerAttribute = "data-html2canvas-debug";
@@ -40834,22 +41143,23 @@ PERFORMANCE OF THIS SOFTWARE.
40834
41143
  var textBounds = [];
40835
41144
  var offset = 0;
40836
41145
  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);
41146
+ if (styles.textDecorationLine.length || text.trim().length > 0) {
41147
+ if (FEATURES.SUPPORT_RANGE_BOUNDS) {
41148
+ var clientRects = createRange(node, offset, text.length).getClientRects();
41149
+ if (clientRects.length > 1) {
41150
+ var subSegments = segmentGraphemes(text);
41151
+ var subOffset_1 = 0;
41152
+ subSegments.forEach(function(subSegment) {
41153
+ textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
41154
+ subOffset_1 += subSegment.length;
41155
+ });
41156
+ } else textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
41157
+ } else {
41158
+ var replacementNode = node.splitText(text.length);
41159
+ textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
41160
+ node = replacementNode;
41161
+ }
41162
+ } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) node = node.splitText(text.length);
40853
41163
  offset += text.length;
40854
41164
  });
40855
41165
  return textBounds;
@@ -41054,9 +41364,7 @@ PERFORMANCE OF THIS SOFTWARE.
41054
41364
  case CHECKBOX:
41055
41365
  _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
41056
41366
  break;
41057
- case RADIO:
41058
- _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
41059
- break;
41367
+ case RADIO: _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
41060
41368
  }
41061
41369
  return _this;
41062
41370
  }
@@ -41110,19 +41418,21 @@ PERFORMANCE OF THIS SOFTWARE.
41110
41418
  for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
41111
41419
  nextNode = childNode.nextSibling;
41112
41420
  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);
41421
+ else if (isElementNode(childNode)) {
41422
+ if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach(function(childNode) {
41423
+ return parseNodeTree(context, childNode, parent, root);
41424
+ });
41425
+ else {
41426
+ var container = createContainer(context, childNode);
41427
+ if (container.styles.isVisible()) {
41428
+ if (createsRealStackingContext(childNode, container, root)) container.flags |= 4;
41429
+ else if (createsStackingContext(container.styles)) container.flags |= 2;
41430
+ if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.flags |= 8;
41431
+ parent.elements.push(container);
41432
+ childNode.slot;
41433
+ if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
41434
+ else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
41435
+ }
41126
41436
  }
41127
41437
  }
41128
41438
  }
@@ -41759,14 +42069,16 @@ PERFORMANCE OF THIS SOFTWARE.
41759
42069
  clonedCanvas.height = canvas.height;
41760
42070
  var ctx = canvas.getContext("2d");
41761
42071
  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);
42072
+ if (clonedCtx) {
42073
+ if (!this.options.allowTaint && ctx) clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
42074
+ else {
42075
+ var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl");
42076
+ if (gl) {
42077
+ var attribs = gl.getContextAttributes();
42078
+ 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);
42079
+ }
42080
+ clonedCtx.drawImage(canvas, 0, 0);
41768
42081
  }
41769
- clonedCtx.drawImage(canvas, 0, 0);
41770
42082
  }
41771
42083
  return clonedCanvas;
41772
42084
  } catch (e) {
@@ -42095,18 +42407,19 @@ PERFORMANCE OF THIS SOFTWARE.
42095
42407
  var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
42096
42408
  var xhr = new XMLHttpRequest();
42097
42409
  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);
42410
+ if (xhr.status === 200) {
42411
+ if (responseType === "text") resolve(xhr.response);
42412
+ else {
42413
+ var reader_1 = new FileReader();
42414
+ reader_1.addEventListener("load", function() {
42415
+ return resolve(reader_1.result);
42416
+ }, false);
42417
+ reader_1.addEventListener("error", function(e) {
42418
+ return reject(e);
42419
+ }, false);
42420
+ reader_1.readAsDataURL(xhr.response);
42421
+ }
42422
+ } else reject("Failed to proxy resource " + key + " with status code " + xhr.status);
42110
42423
  };
42111
42424
  xhr.onerror = reject;
42112
42425
  var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
@@ -42844,9 +43157,7 @@ PERFORMANCE OF THIS SOFTWARE.
42844
43157
  case 2:
42845
43158
  _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
42846
43159
  break;
42847
- case 3:
42848
- _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
42849
- break;
43160
+ case 3: _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
42850
43161
  }
42851
43162
  });
42852
43163
  }
@@ -42861,7 +43172,6 @@ PERFORMANCE OF THIS SOFTWARE.
42861
43172
  _this.ctx.strokeStyle = "";
42862
43173
  _this.ctx.lineWidth = 0;
42863
43174
  _this.ctx.lineJoin = "miter";
42864
- break;
42865
43175
  }
42866
43176
  });
42867
43177
  });
@@ -42999,9 +43309,7 @@ PERFORMANCE OF THIS SOFTWARE.
42999
43309
  case 1:
43000
43310
  x += bounds.width / 2;
43001
43311
  break;
43002
- case 2:
43003
- x += bounds.width;
43004
- break;
43312
+ case 2: x += bounds.width;
43005
43313
  }
43006
43314
  textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
43007
43315
  this.ctx.save();
@@ -43516,8 +43824,10 @@ PERFORMANCE OF THIS SOFTWARE.
43516
43824
  maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
43517
43825
  spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
43518
43826
  }
43519
- if (useLineDash) if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
43520
- else this.ctx.setLineDash([dashLength, spaceLength]);
43827
+ if (useLineDash) {
43828
+ if (style === 3) this.ctx.setLineDash([0, dashLength + spaceLength]);
43829
+ else this.ctx.setLineDash([dashLength, spaceLength]);
43830
+ }
43521
43831
  if (style === 3) {
43522
43832
  this.ctx.lineCap = "round";
43523
43833
  this.ctx.lineWidth = width;
@@ -43652,8 +43962,10 @@ PERFORMANCE OF THIS SOFTWARE.
43652
43962
  Logger.prototype.debug = function() {
43653
43963
  var args = [];
43654
43964
  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);
43965
+ if (this.enabled) {
43966
+ if (typeof window !== "undefined" && window.console && typeof console.debug === "function") console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43967
+ else this.info.apply(this, args);
43968
+ }
43657
43969
  };
43658
43970
  Logger.prototype.getTime = function() {
43659
43971
  return Date.now() - this.start;
@@ -43668,14 +43980,18 @@ PERFORMANCE OF THIS SOFTWARE.
43668
43980
  Logger.prototype.warn = function() {
43669
43981
  var args = [];
43670
43982
  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);
43983
+ if (this.enabled) {
43984
+ if (typeof window !== "undefined" && window.console && typeof console.warn === "function") console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43985
+ else this.info.apply(this, args);
43986
+ }
43673
43987
  };
43674
43988
  Logger.prototype.error = function() {
43675
43989
  var args = [];
43676
43990
  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);
43991
+ if (this.enabled) {
43992
+ if (typeof window !== "undefined" && window.console && typeof console.error === "function") console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
43993
+ else this.info.apply(this, args);
43994
+ }
43679
43995
  };
43680
43996
  Logger.instances = {};
43681
43997
  return Logger;
@@ -43856,7 +44172,20 @@ var Animation = /*#__PURE__*/ function() {
43856
44172
  return _createClass(Animation, [
43857
44173
  {
43858
44174
  key: "pending",
43859
- get: function get() {
44175
+ get:
44176
+ /**
44177
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect
44178
+ */
44179
+ /**
44180
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline
44181
+ */
44182
+ /**
44183
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/id
44184
+ */
44185
+ /**
44186
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending
44187
+ */
44188
+ function get() {
43860
44189
  return this._startTime === null && !this._paused && this.playbackRate !== 0 || this.currentTimePending;
43861
44190
  }
43862
44191
  },
@@ -43871,7 +44200,18 @@ var Animation = /*#__PURE__*/ function() {
43871
44200
  },
43872
44201
  {
43873
44202
  key: "ready",
43874
- get: function get() {
44203
+ get:
44204
+ /**
44205
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready
44206
+ * @example
44207
+ animation.pause();
44208
+ animation.ready.then(function() {
44209
+ // Displays 'running'
44210
+ alert(animation.playState);
44211
+ });
44212
+ animation.play();
44213
+ */
44214
+ function get() {
43875
44215
  var _this = this;
43876
44216
  if (!this.readyPromise) {
43877
44217
  if (this.timeline.animationsWithPromises.indexOf(this) === -1) this.timeline.animationsWithPromises.push(this);
@@ -44905,8 +45245,10 @@ function normalizeTimingInput(timingInput, forGroup) {
44905
45245
  return makeTiming(timingInput, forGroup);
44906
45246
  }
44907
45247
  function numericTimingToObject(timingInput) {
44908
- if (typeof timingInput === "number") if (isNaN(timingInput)) timingInput = { duration: "auto" };
44909
- else timingInput = { duration: timingInput };
45248
+ if (typeof timingInput === "number") {
45249
+ if (isNaN(timingInput)) timingInput = { duration: "auto" };
45250
+ else timingInput = { duration: timingInput };
45251
+ }
44910
45252
  return timingInput;
44911
45253
  }
44912
45254
  /**
@@ -45215,7 +45557,14 @@ runtime.CameraContribution = /* @__PURE__ */ function(_Camera) {
45215
45557
  return _createClass(AdvancedCamera, [
45216
45558
  {
45217
45559
  key: "rotate",
45218
- value: function rotate(azimuth, elevation, roll) {
45560
+ value:
45561
+ /**
45562
+ * Changes the azimuth and elevation with respect to the current camera axes
45563
+ * @param {Number} azimuth the relative azimuth
45564
+ * @param {Number} elevation the relative elevation
45565
+ * @param {Number} roll the relative roll
45566
+ */
45567
+ function rotate(azimuth, elevation, roll) {
45219
45568
  this.relElevation = getAngle(elevation);
45220
45569
  this.relAzimuth = getAngle(azimuth);
45221
45570
  this.relRoll = getAngle(roll);
@@ -46694,18 +47043,20 @@ function configure_toolbar(gobj) {
46694
47043
  title: (0, i18next.t)("reset zoom")
46695
47044
  }
46696
47045
  ];
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
- });
47046
+ if ((0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_fullscreen")) {
47047
+ if (priv.is_fullscreen) items.push({
47048
+ id: "g6-icon-fullscreen-exit",
47049
+ value: "exit-fullscreen",
47050
+ className: "EV_EXIT_FULLSCREEN",
47051
+ title: (0, i18next.t)("exit full screen")
47052
+ });
47053
+ else items.push({
47054
+ id: "g6-icon-fullscreen",
47055
+ value: "request-fullscreen",
47056
+ className: "EV_REQUEST_FULLSCREEN",
47057
+ title: (0, i18next.t)("enter full screen")
47058
+ });
47059
+ }
46709
47060
  return items;
46710
47061
  },
46711
47062
  onClick: (value) => {
@@ -46728,9 +47079,7 @@ function configure_toolbar(gobj) {
46728
47079
  case "request-fullscreen":
46729
47080
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
46730
47081
  break;
46731
- case "exit-fullscreen":
46732
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
46733
- break;
47082
+ case "exit-fullscreen": (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
46734
47083
  }
46735
47084
  }
46736
47085
  });
@@ -46801,9 +47150,7 @@ function configure_toolbar_edit(gobj) {
46801
47150
  case "redo":
46802
47151
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_HISTORY_REDO", {}, gobj);
46803
47152
  break;
46804
- case "save":
46805
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SAVE_GRAPH", {}, gobj);
46806
- break;
47153
+ case "save": (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SAVE_GRAPH", {}, gobj);
46807
47154
  }
46808
47155
  }
46809
47156
  });
@@ -46844,9 +47191,7 @@ function configure_behaviour(gobj) {
46844
47191
  case "operation":
46845
47192
  priv.edit_mode = false;
46846
47193
  break;
46847
- default:
46848
- (0, _yuneta_gobj_js.log_error)(`operation mode unknown: ${operation_mode}`);
46849
- break;
47194
+ default: (0, _yuneta_gobj_js.log_error)(`operation mode unknown: ${operation_mode}`);
46850
47195
  }
46851
47196
  if (!priv.edit_mode) deselect_node(gobj);
46852
47197
  graph_write_behaviors(gobj, behaviors);
@@ -46881,9 +47226,7 @@ function calculate_hooks_fkeys_counter(desc) {
46881
47226
  case "hook":
46882
47227
  desc.hooks_counter++;
46883
47228
  break;
46884
- case "fkey":
46885
- desc.fkeys_counter++;
46886
- break;
47229
+ case "fkey": desc.fkeys_counter++;
46887
47230
  }
46888
47231
  }
46889
47232
  if (desc.hooks_counter === 0) desc.node_treedb_type = "child";
@@ -46923,7 +47266,6 @@ function build_ports(gobj, desc) {
46923
47266
  stroke: getStrokeColor(desc.color)
46924
47267
  };
46925
47268
  top_ports.push(port);
46926
- break;
46927
47269
  }
46928
47270
  }
46929
47271
  for (let i = 0; i < top_ports.length; i++) top_ports[i].placement = [.5, 0];
@@ -47118,13 +47460,15 @@ function collect_fkey_refs(desc, record) {
47118
47460
  let col = cols[i];
47119
47461
  if (!col.fkey) continue;
47120
47462
  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);
47463
+ if (fkeys) {
47464
+ if ((0, _yuneta_gobj_js.is_array)(fkeys)) for (let j = 0; j < fkeys.length; j++) {
47465
+ let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys[j]);
47466
+ if (key) refs.add(i + " " + key);
47467
+ }
47468
+ else {
47469
+ let key = (0, _yuneta_gobj_js.treedb_encoder_fkey)(col, fkeys);
47470
+ if (key) refs.add(i + " " + key);
47471
+ }
47128
47472
  }
47129
47473
  }
47130
47474
  return refs;
@@ -47140,8 +47484,10 @@ function draw_links(gobj, desc, record, initial_load) {
47140
47484
  let col = cols[i];
47141
47485
  if (!col.fkey) continue;
47142
47486
  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);
47487
+ if (fkeys) {
47488
+ 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);
47489
+ else draw_link(gobj, topic_name, record_id, col, fkeys, initial_load);
47490
+ }
47145
47491
  }
47146
47492
  }
47147
47493
  /************************************************************
@@ -47251,8 +47597,10 @@ function clear_links(gobj, desc, record, verbose) {
47251
47597
  let col = cols[i];
47252
47598
  if (!col.fkey) continue;
47253
47599
  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);
47600
+ if (fkeys) {
47601
+ 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);
47602
+ else clear_link(gobj, topic_name, record_id, col, fkeys, verbose);
47603
+ }
47256
47604
  }
47257
47605
  }
47258
47606
  /************************************************************
@@ -47349,7 +47697,7 @@ function save_geometry(gobj) {
47349
47697
  let origin = (0, _yuneta_gobj_js.gobj_read_str_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "node_uuid");
47350
47698
  for (const [topic_name, properties] of Object.entries(priv._graph_properties)) {
47351
47699
  properties.__origin__ = origin;
47352
- (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", {
47700
+ let kw_update = {
47353
47701
  treedb_name: priv.treedb_name,
47354
47702
  topic_name: "__graphs__",
47355
47703
  record: {
@@ -47363,7 +47711,8 @@ function save_geometry(gobj) {
47363
47711
  autolink: false,
47364
47712
  create: true
47365
47713
  }
47366
- });
47714
+ };
47715
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", kw_update);
47367
47716
  }
47368
47717
  }
47369
47718
  /************************************************************
@@ -47374,7 +47723,7 @@ function save_topic_graph_properties(gobj, topic_name) {
47374
47723
  let properties = priv._graph_properties[topic_name];
47375
47724
  if (!properties) return;
47376
47725
  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", {
47726
+ let kw_update = {
47378
47727
  treedb_name: priv.treedb_name,
47379
47728
  topic_name: "__graphs__",
47380
47729
  record: {
@@ -47388,7 +47737,8 @@ function save_topic_graph_properties(gobj, topic_name) {
47388
47737
  autolink: false,
47389
47738
  create: true
47390
47739
  }
47391
- });
47740
+ };
47741
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_UPDATE_NODE", kw_update);
47392
47742
  }
47393
47743
  /************************************************************
47394
47744
  * Pause/resume history recording.
@@ -47577,19 +47927,17 @@ function graph_add_plugin(gobj, plugin_key, options) {
47577
47927
  }
47578
47928
  plugin = graph_get_plugin(gobj, plugin_key);
47579
47929
  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;
47930
+ case "history": if (plugin) {
47931
+ plugin.on(_antv_g6.HistoryEvent.CHANGE, () => {
47932
+ update_history_buttons(gobj);
47933
+ });
47934
+ graph.updatePlugin({
47935
+ key: plugin_key,
47936
+ beforeAddCommand: () => {
47937
+ return !priv._history_paused;
47938
+ }
47939
+ });
47940
+ }
47593
47941
  }
47594
47942
  }
47595
47943
  function graph_remove_plugin(gobj, plugin_key) {
@@ -49628,9 +49976,7 @@ function handle_context_menu_click(gobj, value) {
49628
49976
  case "resize_all_ports":
49629
49977
  copy_size_to_ports(gobj, false);
49630
49978
  break;
49631
- case "resize_topic_ports":
49632
- copy_size_to_ports(gobj, true);
49633
- break;
49979
+ case "resize_topic_ports": copy_size_to_ports(gobj, true);
49634
49980
  }
49635
49981
  }
49636
49982
  /************************************************************
@@ -50418,7 +50764,7 @@ function create_gclass$1(gclass_name) {
50418
50764
  null
50419
50765
  ]
50420
50766
  ]]];
50421
- __gclass__$1 = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
50767
+ const event_types = [
50422
50768
  ["EV_DESCS", 0],
50423
50769
  ["EV_CLEAR_DATA", 0],
50424
50770
  ["EV_LOAD_DATA", 0],
@@ -50455,7 +50801,8 @@ function create_gclass$1(gclass_name) {
50455
50801
  ["EV_HIDE", 0],
50456
50802
  ["EV_RESIZE", 0],
50457
50803
  ["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);
50804
+ ];
50805
+ __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
50806
  if (!__gclass__$1) return -1;
50460
50807
  return 0;
50461
50808
  }
@@ -50606,22 +50953,22 @@ var YUI_ROLLING = {
50606
50953
  },
50607
50954
  "6h": {
50608
50955
  id: "6h",
50609
- secs: 6 * 3600,
50956
+ secs: 21600,
50610
50957
  label: "last 6h"
50611
50958
  },
50612
50959
  "24h": {
50613
50960
  id: "24h",
50614
- secs: 24 * 3600,
50961
+ secs: 86400,
50615
50962
  label: "last 24h"
50616
50963
  },
50617
50964
  "7d": {
50618
50965
  id: "7d",
50619
- secs: 168 * 3600,
50966
+ secs: 604800,
50620
50967
  label: "last 7 days"
50621
50968
  },
50622
50969
  "30d": {
50623
50970
  id: "30d",
50624
- secs: 720 * 3600,
50971
+ secs: 2592e3,
50625
50972
  label: "last 30 days"
50626
50973
  }
50627
50974
  };
@@ -51984,7 +52331,8 @@ function ac_set_mode(gobj, event, kw, src) {
51984
52331
  *
51985
52332
  ***************************************************************/
51986
52333
  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));
52334
+ let mode = cur_mode(gobj);
52335
+ (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
52336
  close_calendar(gobj);
51989
52337
  repaint(gobj);
51990
52338
  publish_period(gobj);
@@ -51994,7 +52342,8 @@ function ac_prev(gobj, event, kw, src) {
51994
52342
  *
51995
52343
  ***************************************************************/
51996
52344
  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));
52345
+ let mode = cur_mode(gobj);
52346
+ (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
52347
  close_calendar(gobj);
51999
52348
  repaint(gobj);
52000
52349
  publish_period(gobj);
@@ -52172,7 +52521,7 @@ function create_gclass(gclass_name) {
52172
52521
  null
52173
52522
  ]
52174
52523
  ]]];
52175
- __gclass__ = (0, _yuneta_gobj_js.gclass_create)(gclass_name, [
52524
+ const event_types = [
52176
52525
  ["EV_SET_MODE", 0],
52177
52526
  ["EV_PREV", 0],
52178
52527
  ["EV_NEXT", 0],
@@ -52183,7 +52532,8 @@ function create_gclass(gclass_name) {
52183
52532
  ["EV_REFRESH", 0],
52184
52533
  ["EV_LANGUAGE_CHANGED", 0],
52185
52534
  ["EV_PERIOD_CHANGED", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT]
52186
- ], states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
52535
+ ];
52536
+ __gclass__ = (0, _yuneta_gobj_js.gclass_create)(gclass_name, event_types, states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, 0);
52187
52537
  if (!__gclass__) return -1;
52188
52538
  return 0;
52189
52539
  }
@@ -52283,8 +52633,8 @@ function traffic_now() {
52283
52633
  function traffic_size(n) {
52284
52634
  n = Number(n) || 0;
52285
52635
  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";
52636
+ if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
52637
+ return (n / 1048576).toFixed(1) + " MB";
52288
52638
  }
52289
52639
  /************************************************************
52290
52640
  * Seconds-since-epoch → ISO string, or null if not a plausible
@@ -52367,7 +52717,8 @@ function set_output_route(v) {
52367
52717
  refresh_dev_chrome();
52368
52718
  }
52369
52719
  function toggle_pref(key, def) {
52370
- (0, _yuneta_gobj_js.kw_set_local_storage_value)(key, dev_num(key, def) ? 0 : 1);
52720
+ let v = dev_num(key, def) ? 0 : 1;
52721
+ (0, _yuneta_gobj_js.kw_set_local_storage_value)(key, v);
52371
52722
  rerender_all();
52372
52723
  refresh_dev_chrome();
52373
52724
  }
@@ -53627,7 +53978,7 @@ function apply_dev_traces() {
53627
53978
  function setup_dev(self, show) {
53628
53979
  if (show) {
53629
53980
  ensure_dev_style();
53630
- (0, _yuneta_gobj_js.gobj_start)((0, _yuneta_gobj_js.gobj_create_service)("Developer-Window", "C_YUI_WINDOW", {
53981
+ let win = (0, _yuneta_gobj_js.gobj_create_service)("Developer-Window", "C_YUI_WINDOW", {
53631
53982
  $parent: document.getElementById("top-layer") || null,
53632
53983
  subscriber: null,
53633
53984
  showMax: true,
@@ -53644,7 +53995,8 @@ function setup_dev(self, show) {
53644
53995
  on_close: function() {
53645
53996
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("open_developer_window", 0);
53646
53997
  }
53647
- }, self));
53998
+ }, self);
53999
+ (0, _yuneta_gobj_js.gobj_start)(win);
53648
54000
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("open_developer_window", 1);
53649
54001
  setTimeout(() => {
53650
54002
  refresh_dev_chrome();
@@ -53748,7 +54100,8 @@ function setup_frontend_view(self) {
53748
54100
  (0, _yuneta_gobj_js.log_error)("yui_frontend_view: cannot create the frontend-view window");
53749
54101
  return null;
53750
54102
  }
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");
54103
+ let tree = (0, _yuneta_gobj_js.gobj_create_pure_child)("frontend_view_tree", "C_YUI_GOBJ_TREE_JS", {}, win);
54104
+ let $tree = (0, _yuneta_gobj_js.gobj_read_attr)(tree, "$container");
53752
54105
  if (!$tree) {
53753
54106
  (0, _yuneta_gobj_js.log_error)("yui_frontend_view: C_YUI_GOBJ_TREE_JS without $container");
53754
54107
  return win;