@yuneta/gobj-ui 7.23.6 → 7.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -459,10 +459,11 @@ written in every editor that offers it and never drawn. Fold is the chevron
459
459
  pair, from the lazy tree viewer's own toolbar. The readout hangs off G6's
460
460
  `aftertransform`, the one hook that also covers the wheel.
461
461
 
462
- Both graph toolbars are arranged the same way (`7.23.6`): camera and refresh in
463
- the centre, layout picker and the fold pair on the right. The middle is the
464
- camera — a fold changes the DOCUMENT, not the view of it, and among the camera
465
- buttons it read as two more of them.
462
+ Both graph toolbars are arranged the same way (`7.23.7`): the **global**
463
+ expand/collapse leftmost, ahead of the find box; camera and refresh in the
464
+ centre; the layout picker on the right. The **per-node** fold is a different
465
+ control and lives elsewhere — on the right of each card's own header, last,
466
+ where the gobj tree puts its `+N` / `−`.
466
467
 
467
468
  The graph carries **its own** toolbar, a **layout picker**
468
469
  (`EV_CHANGE_LAYOUT {layout}`: `vertical tree`, `dagre top-down`,
@@ -9912,7 +9912,7 @@ function destroy_ui$6(gobj) {
9912
9912
  function make_toolbar$3(gobj) {
9913
9913
  let priv = gobj.priv;
9914
9914
  let toolbar_wide = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "wide");
9915
- let left_items = [[
9915
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide).concat([[
9916
9916
  "div",
9917
9917
  {
9918
9918
  class: "JSON_GRAPH_FIND control has-icons-left",
@@ -9954,7 +9954,7 @@ function make_toolbar$3(gobj) {
9954
9954
  { i18n: "matches" },
9955
9955
  "matches"
9956
9956
  ]]
9957
- ]];
9957
+ ]]);
9958
9958
  let center_items = [];
9959
9959
  center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide);
9960
9960
  center_items.push(yui_graph_refresh_item(gobj, toolbar_wide));
@@ -9989,7 +9989,7 @@ function make_toolbar$3(gobj) {
9989
9989
  evt.stopPropagation();
9990
9990
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_CHANGE_LAYOUT", { layout: evt.target.value }, gobj);
9991
9991
  } }
9992
- ])].concat(yui_graph_fold_items(gobj, toolbar_wide));
9992
+ ])];
9993
9993
  const $toolbar = yui_toolbar({}, [
9994
9994
  [
9995
9995
  "div",
@@ -10098,6 +10098,11 @@ function build_cell_html(key, value, type, dark, matched) {
10098
10098
  * innerHTML string, so there is no other way to hang a
10099
10099
  * handler on it.
10100
10100
  *
10101
+ * On the RIGHT of the header, and last, where the gobj tree
10102
+ * puts its own — with a spacer of the same width on the left
10103
+ * so the label stays centred on its own axis instead of
10104
+ * drifting by the width of a chip that only some cards have.
10105
+ *
10101
10106
  * A filled CHIP, the same one the gobj tree draws
10102
10107
  * (`c_yui_gobj_tree_js.js`, render_toggle_html): background,
10103
10108
  * border, radius, and `+N` / `−` rather than a triangle. It
@@ -10111,8 +10116,9 @@ function build_cell_html(key, value, type, dark, matched) {
10111
10116
  * where it could carry no i18n key and would sit in English
10112
10117
  * forever. `+3` and `−` need no language.
10113
10118
  ************************************************************/
10119
+ var FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
10114
10120
  function fold_toggle_html(path, foldable, folded, branches, colors) {
10115
- if (!foldable) return `<span style="width:24px; flex:0 0 auto;"></span>`;
10121
+ if (!foldable) return FOLD_SPACER;
10116
10122
  let label = folded ? "+" + branches : "&#8722;";
10117
10123
  return `<span data-fold-path="${(0, _yuneta_gobj_js.escapeHtml)(path)}" style="
10118
10124
  flex: 0 0 auto;
@@ -10243,7 +10249,7 @@ function build_json_nodes(gobj, path, kw, nodes, edges, parent_id) {
10243
10249
  display: flex;
10244
10250
  align-items: center;
10245
10251
  gap: 6px;
10246
- ">${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}<span style="flex:1 1 auto; text-align:center;">${(0, _yuneta_gobj_js.escapeHtml)(label)}</span></div>
10252
+ ">${FOLD_SPACER}<span style="flex:1 1 auto; text-align:center;">${(0, _yuneta_gobj_js.escapeHtml)(label)}</span>${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}</div>
10247
10253
  ${content_html}
10248
10254
  </div>`;
10249
10255
  let node = {
@@ -12606,7 +12612,7 @@ function make_toolbar$1(gobj) {
12606
12612
  let priv = gobj.priv;
12607
12613
  let toolbar_wide = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "wide");
12608
12614
  let current_layout = (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "layout");
12609
- let left_items = [];
12615
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide);
12610
12616
  let center_items = [];
12611
12617
  let right_items = [];
12612
12618
  center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide);
@@ -12639,7 +12645,6 @@ function make_toolbar$1(gobj) {
12639
12645
  ]);
12640
12646
  priv.$layout_select = $select;
12641
12647
  right_items.push($select);
12642
- right_items.push(...yui_graph_fold_items(gobj, toolbar_wide));
12643
12648
  const $toolbar = yui_toolbar({}, [
12644
12649
  [
12645
12650
  "div",
@@ -9907,7 +9907,7 @@ function destroy_ui$6(gobj) {
9907
9907
  function make_toolbar$3(gobj) {
9908
9908
  let priv = gobj.priv;
9909
9909
  let toolbar_wide = gobj_read_attr(gobj, "wide");
9910
- let left_items = [[
9910
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide).concat([[
9911
9911
  "div",
9912
9912
  {
9913
9913
  class: "JSON_GRAPH_FIND control has-icons-left",
@@ -9949,7 +9949,7 @@ function make_toolbar$3(gobj) {
9949
9949
  { i18n: "matches" },
9950
9950
  "matches"
9951
9951
  ]]
9952
- ]];
9952
+ ]]);
9953
9953
  let center_items = [];
9954
9954
  center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide);
9955
9955
  center_items.push(yui_graph_refresh_item(gobj, toolbar_wide));
@@ -9984,7 +9984,7 @@ function make_toolbar$3(gobj) {
9984
9984
  evt.stopPropagation();
9985
9985
  gobj_send_event(gobj, "EV_CHANGE_LAYOUT", { layout: evt.target.value }, gobj);
9986
9986
  } }
9987
- ])].concat(yui_graph_fold_items(gobj, toolbar_wide));
9987
+ ])];
9988
9988
  const $toolbar = yui_toolbar({}, [
9989
9989
  [
9990
9990
  "div",
@@ -10093,6 +10093,11 @@ function build_cell_html(key, value, type, dark, matched) {
10093
10093
  * innerHTML string, so there is no other way to hang a
10094
10094
  * handler on it.
10095
10095
  *
10096
+ * On the RIGHT of the header, and last, where the gobj tree
10097
+ * puts its own — with a spacer of the same width on the left
10098
+ * so the label stays centred on its own axis instead of
10099
+ * drifting by the width of a chip that only some cards have.
10100
+ *
10096
10101
  * A filled CHIP, the same one the gobj tree draws
10097
10102
  * (`c_yui_gobj_tree_js.js`, render_toggle_html): background,
10098
10103
  * border, radius, and `+N` / `−` rather than a triangle. It
@@ -10106,8 +10111,9 @@ function build_cell_html(key, value, type, dark, matched) {
10106
10111
  * where it could carry no i18n key and would sit in English
10107
10112
  * forever. `+3` and `−` need no language.
10108
10113
  ************************************************************/
10114
+ var FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
10109
10115
  function fold_toggle_html(path, foldable, folded, branches, colors) {
10110
- if (!foldable) return `<span style="width:24px; flex:0 0 auto;"></span>`;
10116
+ if (!foldable) return FOLD_SPACER;
10111
10117
  let label = folded ? "+" + branches : "&#8722;";
10112
10118
  return `<span data-fold-path="${escapeHtml(path)}" style="
10113
10119
  flex: 0 0 auto;
@@ -10238,7 +10244,7 @@ function build_json_nodes(gobj, path, kw, nodes, edges, parent_id) {
10238
10244
  display: flex;
10239
10245
  align-items: center;
10240
10246
  gap: 6px;
10241
- ">${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}<span style="flex:1 1 auto; text-align:center;">${escapeHtml(label)}</span></div>
10247
+ ">${FOLD_SPACER}<span style="flex:1 1 auto; text-align:center;">${escapeHtml(label)}</span>${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}</div>
10242
10248
  ${content_html}
10243
10249
  </div>`;
10244
10250
  let node = {
@@ -12601,7 +12607,7 @@ function make_toolbar$1(gobj) {
12601
12607
  let priv = gobj.priv;
12602
12608
  let toolbar_wide = gobj_read_attr(gobj, "wide");
12603
12609
  let current_layout = gobj_read_str_attr(gobj, "layout");
12604
- let left_items = [];
12610
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide);
12605
12611
  let center_items = [];
12606
12612
  let right_items = [];
12607
12613
  center_items = yui_graph_camera_items(gobj, priv.graph, toolbar_wide);
@@ -12634,7 +12640,6 @@ function make_toolbar$1(gobj) {
12634
12640
  ]);
12635
12641
  priv.$layout_select = $select;
12636
12642
  right_items.push($select);
12637
- right_items.push(...yui_graph_fold_items(gobj, toolbar_wide));
12638
12643
  const $toolbar = yui_toolbar({}, [
12639
12644
  [
12640
12645
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.6",
3
+ "version": "7.23.7",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -537,7 +537,11 @@ function make_toolbar(gobj)
537
537
  let toolbar_wide = gobj_read_attr(gobj, "wide");
538
538
  let current_layout = gobj_read_str_attr(gobj, "layout");
539
539
 
540
- let left_items = [];
540
+ /* The GLOBAL fold opens the whole tree; it is not a camera control
541
+ * and not a per-node one, so it sits on its own at the left — ahead
542
+ * of a find box where the toolbar has one. The per-node handles
543
+ * live inside the cards, on the right of each header. */
544
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide);
541
545
  let center_items = [];
542
546
  let right_items = [];
543
547
 
@@ -583,12 +587,6 @@ function make_toolbar(gobj)
583
587
  priv.$layout_select = $select;
584
588
  right_items.push($select);
585
589
 
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
-
592
590
  const $toolbar = yui_toolbar({}, [
593
591
  ['div', {class: 'yui-horizontal-toolbar-section left'}, left_items],
594
592
  ['div', {class: 'yui-horizontal-toolbar-section center'}, center_items],
@@ -478,7 +478,7 @@ function make_toolbar(gobj)
478
478
  * looks the same whether nothing matched or the match was already
479
479
  * on screen.
480
480
  */
481
- let left_items = [
481
+ let left_items = yui_graph_fold_items(gobj, toolbar_wide).concat([
482
482
  ['div', {class: 'JSON_GRAPH_FIND control has-icons-left',
483
483
  style: 'margin-right:.5rem; max-width:12rem; min-width:7rem;'}, [
484
484
  ['input', {
@@ -523,7 +523,7 @@ function make_toolbar(gobj)
523
523
  ['span', {class: 'JSON_GRAPH_FIND_COUNT'}, ''],
524
524
  ['span', {i18n: 'matches'}, 'matches']
525
525
  ]]
526
- ];
526
+ ]);
527
527
  let center_items = [];
528
528
 
529
529
  /*
@@ -573,8 +573,7 @@ function make_toolbar(gobj)
573
573
  }]
574
574
  );
575
575
 
576
- let right_items = [$layout_select].concat(
577
- yui_graph_fold_items(gobj, toolbar_wide));
576
+ let right_items = [$layout_select];
578
577
 
579
578
  const $toolbar = yui_toolbar({}, [
580
579
  ['div', {class: 'yui-horizontal-toolbar-section left'}, left_items],
@@ -731,6 +730,11 @@ function build_cell_html(key, value, type, dark, matched)
731
730
  * innerHTML string, so there is no other way to hang a
732
731
  * handler on it.
733
732
  *
733
+ * On the RIGHT of the header, and last, where the gobj tree
734
+ * puts its own — with a spacer of the same width on the left
735
+ * so the label stays centred on its own axis instead of
736
+ * drifting by the width of a chip that only some cards have.
737
+ *
734
738
  * A filled CHIP, the same one the gobj tree draws
735
739
  * (`c_yui_gobj_tree_js.js`, render_toggle_html): background,
736
740
  * border, radius, and `+N` / `−` rather than a triangle. It
@@ -744,12 +748,12 @@ function build_cell_html(key, value, type, dark, matched)
744
748
  * where it could carry no i18n key and would sit in English
745
749
  * forever. `+3` and `−` need no language.
746
750
  ************************************************************/
751
+ const FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
752
+
747
753
  function fold_toggle_html(path, foldable, folded, branches, colors)
748
754
  {
749
755
  if(!foldable) {
750
- /* A spacer the width of the chip, so the label of a leaf card
751
- * stays on the same axis as the label of a foldable one. */
752
- return `<span style="width:24px; flex:0 0 auto;"></span>`;
756
+ return FOLD_SPACER;
753
757
  }
754
758
 
755
759
  let label = folded? ("+" + branches): "&#8722;"; /* +N / − */
@@ -940,7 +944,7 @@ function build_json_nodes(gobj, path, kw, nodes, edges, parent_id)
940
944
  display: flex;
941
945
  align-items: center;
942
946
  gap: 6px;
943
- ">${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}<span style="flex:1 1 auto; text-align:center;">${escapeHtml(label)}</span></div>
947
+ ">${FOLD_SPACER}<span style="flex:1 1 auto; text-align:center;">${escapeHtml(label)}</span>${fold_toggle_html(path, foldable, folded, pending_complex.length, colors)}</div>
944
948
  ${content_html}
945
949
  </div>`;
946
950