@yuneta/gobj-ui 7.23.4 → 7.23.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.4",
3
+ "version": "7.23.6",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -24,6 +24,7 @@ import {
24
24
  sdata_flag_t,
25
25
  gclass_flag_t,
26
26
  gclass_create,
27
+ gclass_find_by_name,
27
28
  log_error,
28
29
  log_warning,
29
30
  trace_msg,
@@ -7633,6 +7634,12 @@ function create_gclass(gclass_name)
7633
7634
  ***************************************************************************/
7634
7635
  function register_c_g6_nodes_tree()
7635
7636
  {
7637
+ /* Idempotent: C_YUI_TREEDB_GRAPH auto-registers this engine, so an
7638
+ * app that also registers it explicitly (in either order) must not
7639
+ * trip "GClass ALREADY created". */
7640
+ if(gclass_find_by_name(GCLASS_NAME, false)) {
7641
+ return 0;
7642
+ }
7636
7643
  return create_gclass(GCLASS_NAME);
7637
7644
  }
7638
7645
 
@@ -550,8 +550,7 @@ function make_toolbar(gobj)
550
550
  * console shows this graph and the JSON one side by side, so the
551
551
  * drawings have to be the same drawings.
552
552
  */
553
- center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide)
554
- .concat(yui_graph_fold_items(gobj, toolbar_wide));
553
+ center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide);
555
554
  center_items.push(yui_graph_refresh_item(gobj, toolbar_wide));
556
555
 
557
556
  /*
@@ -584,6 +583,12 @@ function make_toolbar(gobj)
584
583
  priv.$layout_select = $select;
585
584
  right_items.push($select);
586
585
 
586
+ /* Fold on the RIGHT, past the layout picker — where the JSON graph
587
+ * already put it. The camera is what the middle is for: the fold
588
+ * pair changes the DOCUMENT, not the view of it, and sitting in the
589
+ * middle it read as two more camera buttons. */
590
+ right_items.push(...yui_graph_fold_items(gobj, toolbar_wide));
591
+
587
592
  const $toolbar = yui_toolbar({}, [
588
593
  ['div', {class: 'yui-horizontal-toolbar-section left'}, left_items],
589
594
  ['div', {class: 'yui-horizontal-toolbar-section center'}, center_items],
@@ -78,6 +78,7 @@ import {
78
78
  } from "@yuneta/gobj-js";
79
79
 
80
80
  import {yui_toolbar} from "./yui_toolbar.js";
81
+ import {register_c_g6_nodes_tree} from "./c_g6_nodes_tree.js";
81
82
  import {
82
83
  removeChildElements,
83
84
  disableElements,
@@ -2594,6 +2595,17 @@ function create_gclass(gclass_name)
2594
2595
  ***************************************************************************/
2595
2596
  function register_c_yui_treedb_graph()
2596
2597
  {
2598
+ if(gclass_find_by_name(GCLASS_NAME, false)) {
2599
+ return 0;
2600
+ }
2601
+ /* This view hosts a C_G6_NODES_TREE child — the graph ENGINE — and
2602
+ * creates it BY NAME. Without its gclass the view builds fine, the
2603
+ * child does not, and the failure lands as "GClass not registered"
2604
+ * from inside a component the host never named. Same arrangement
2605
+ * C_YUI_JSON makes for C_YUI_JSON_GRAPH. */
2606
+ if(!gclass_find_by_name("C_G6_NODES_TREE", false)) {
2607
+ register_c_g6_nodes_tree();
2608
+ }
2597
2609
  return create_gclass(GCLASS_NAME);
2598
2610
  }
2599
2611