@yuneta/gobj-ui 7.23.86 → 7.23.88

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.
@@ -10293,6 +10293,35 @@ function register_c_yui_uplot() {
10293
10293
  }
10294
10294
  //#endregion
10295
10295
  //#region src/yui_toolbar.js
10296
+ /************************************************************
10297
+ * ONE size for every glyph of a view's toolbar, in `rem`.
10298
+ *
10299
+ * It lives here because it belongs to the TOOLBAR and not to
10300
+ * any one view: it was born in the graph rows (7.23.86) and the
10301
+ * JSON viewer beside them still drew 16px, which is the same
10302
+ * drift one level up.
10303
+ *
10304
+ * `rem` and not `em` is the whole lesson: `em` is measured
10305
+ * against the button, so one declaration draws three icons --
10306
+ * `1.5em` is 24px in a plain button, 18px in an `is-small`
10307
+ * chip, and a labelled button that declares nothing keeps the
10308
+ * inherited 16px. `rem` is measured against the page, so a
10309
+ * chip deliberately shorter than a button still carries the
10310
+ * same glyph.
10311
+ *
10312
+ * 20px against a row's 16px text: an icon-only button is
10313
+ * legible at half its 40px height, and beside a label the
10314
+ * glyph reads as a marker rather than as a second word. The
10315
+ * app BAR is a different band and keeps its own, bigger size
10316
+ * (`.yui-toolbar-item .icon`, 1.35rem on 44px items).
10317
+ ************************************************************/
10318
+ var YUI_TOOLBAR_ICON_SIZE = "1.25rem";
10319
+ function yui_toolbar_icon(icon_class, extra_style) {
10320
+ return ["i", {
10321
+ class: icon_class,
10322
+ style: `font-size:${YUI_TOOLBAR_ICON_SIZE}; line-height:1; color:inherit;` + (extra_style || "")
10323
+ }];
10324
+ }
10296
10325
  function yui_toolbar(attrs = {}, items = []) {
10297
10326
  function arrow_button(side, icon, label) {
10298
10327
  return [
@@ -10555,30 +10584,6 @@ function getPointPosition(count, index, margin = .2) {
10555
10584
  * All Rights Reserved.
10556
10585
  ***********************************************************************/
10557
10586
  /************************************************************
10558
- * ONE size for every glyph of a graph's toolbar ROW, in
10559
- * `rem` and not `em`.
10560
- *
10561
- * In `em` the same declaration draws three different icons:
10562
- * `1.5em` is 24px inside a plain button, 18px inside an
10563
- * `is-small` one, and a labelled button left its icon at the
10564
- * inherited 16px -- so one row held 16px, 18px and 24px
10565
- * glyphs and looked like three toolbars pushed together.
10566
- * `rem` is measured against the page, so a chip that is
10567
- * deliberately shorter than a button still carries the same
10568
- * glyph.
10569
- *
10570
- * 20px against the row's 16px text: an icon-only button is
10571
- * legible at half its 40px height, and beside a label the
10572
- * glyph reads as a marker rather than as a second word.
10573
- ************************************************************/
10574
- var YUI_GRAPH_ICON_SIZE = "1.25rem";
10575
- function yui_graph_icon(icon_class, extra_style) {
10576
- return ["i", {
10577
- class: icon_class,
10578
- style: `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;` + (extra_style || "")
10579
- }];
10580
- }
10581
- /************************************************************
10582
10587
  * One icon button that fires `event_name`.
10583
10588
  ************************************************************/
10584
10589
  function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
@@ -10596,7 +10601,7 @@ function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
10596
10601
  "aria-label": t(label_key),
10597
10602
  "data-i18n-aria-label": label_key
10598
10603
  },
10599
- yui_graph_icon(icon, extra_style),
10604
+ yui_toolbar_icon(icon, extra_style),
10600
10605
  { click: (evt) => {
10601
10606
  evt.stopPropagation();
10602
10607
  gobj_send_event(gobj, event_name, { evt }, gobj);
@@ -11386,7 +11391,7 @@ var attrs_table$13 = [
11386
11391
  SDATA(data_type_t.DTP_JSON, "json_data", 0, null, "JSON data to visualize"),
11387
11392
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Container element"),
11388
11393
  SDATA(data_type_t.DTP_STRING, "canvas_id", 0, "", "Canvas ID"),
11389
- SDATA(data_type_t.DTP_STRING, "wide", 0, "36px", "Height of header"),
11394
+ SDATA(data_type_t.DTP_STRING, "wide", 0, "40px", "Height of header. 40px and not 36: it is what an untouched Bulma control measures, so the find box stood 4px taller than every button beside it, and it is what the third graph of the family (C_YUI_TREEDB_GRAPH) uses"),
11390
11395
  SDATA(data_type_t.DTP_STRING, "layout", 0, "json-tree", "Layout key (see LAYOUTS)"),
11391
11396
  SDATA_END()
11392
11397
  ];
@@ -11689,7 +11694,7 @@ function make_toolbar$5(gobj) {
11689
11694
  [$find_input, [
11690
11695
  "span",
11691
11696
  { class: "icon is-left" },
11692
- [yui_graph_icon("yi-magnifying-glass")]
11697
+ [yui_toolbar_icon("yi-magnifying-glass")]
11693
11698
  ]]
11694
11699
  ]);
11695
11700
  attach_clear($find_control, $find_input);
@@ -11723,19 +11728,23 @@ function make_toolbar$5(gobj) {
11723
11728
  ];
11724
11729
  });
11725
11730
  let right_items = [createElement2([
11726
- "select",
11731
+ "div",
11727
11732
  {
11728
- class: "JSON_GRAPH_LAYOUT select",
11729
- style: {
11730
- height: toolbar_wide,
11731
- "margin-left": "0.5em"
11732
- },
11733
- title: t("layout"),
11734
- "data-i18n-title": "layout",
11735
- "aria-label": t("layout"),
11736
- "data-i18n-aria-label": "layout"
11733
+ class: "select",
11734
+ style: { "margin-left": "0.5em" }
11737
11735
  },
11738
- options,
11736
+ [[
11737
+ "select",
11738
+ {
11739
+ class: "JSON_GRAPH_LAYOUT",
11740
+ style: { height: toolbar_wide },
11741
+ title: t("layout"),
11742
+ "data-i18n-title": "layout",
11743
+ "aria-label": t("layout"),
11744
+ "data-i18n-aria-label": "layout"
11745
+ },
11746
+ options
11747
+ ]],
11739
11748
  { change: (evt) => {
11740
11749
  evt.stopPropagation();
11741
11750
  gobj_send_event(gobj, "EV_CHANGE_LAYOUT", { layout: evt.target.value }, gobj);
@@ -13215,7 +13224,7 @@ function make_toolbar$4(gobj) {
13215
13224
  [$search_input, [
13216
13225
  "span",
13217
13226
  { class: "icon is-left" },
13218
- [["i", { class: "yi-magnifying-glass" }]]
13227
+ [yui_toolbar_icon("yi-magnifying-glass")]
13219
13228
  ]]
13220
13229
  ]);
13221
13230
  left_items.push(icon_button$1(gobj, "yi-chevron-right", "EV_EXPAND_ALL", "expand loaded"), icon_button$1(gobj, "yi-chevron-right", "EV_COLLAPSE_ALL", "collapse all"));
@@ -13265,7 +13274,7 @@ function icon_button$1(gobj, icon, event_name, label_key) {
13265
13274
  [[
13266
13275
  "span",
13267
13276
  { class: "icon" },
13268
- [["i", { class: icon }]]
13277
+ [yui_toolbar_icon(icon)]
13269
13278
  ]],
13270
13279
  { click: function(evt) {
13271
13280
  evt.stopPropagation();
@@ -13302,7 +13311,7 @@ function view_mode_switch$1(gobj) {
13302
13311
  [[
13303
13312
  "span",
13304
13313
  { class: "icon" },
13305
- [["i", { class: v.icon }]]
13314
+ [yui_toolbar_icon(v.icon)]
13306
13315
  ]],
13307
13316
  { click: function(evt) {
13308
13317
  evt.stopPropagation();
@@ -17478,7 +17487,7 @@ var attrs_table$9 = [
17478
17487
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
17479
17488
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Container element"),
17480
17489
  SDATA(data_type_t.DTP_STRING, "canvas_id", 0, "", "Canvas ID"),
17481
- SDATA(data_type_t.DTP_STRING, "wide", 0, "36px", "Height of header"),
17490
+ SDATA(data_type_t.DTP_STRING, "wide", 0, "40px", "Height of header. 40px and not 36: it is what an untouched Bulma control measures, so the find box stood 4px taller than every button beside it, and it is what the third graph of the family (C_YUI_TREEDB_GRAPH) uses"),
17482
17491
  SDATA(data_type_t.DTP_STRING, "layout", 0, "vertical-compact", "Current layout key"),
17483
17492
  SDATA(data_type_t.DTP_INTEGER, "collapse_threshold", 0, 10, "Auto-collapse a node whose direct children exceed this number. 0 disables auto-collapse."),
17484
17493
  SDATA_END()
@@ -18131,7 +18140,7 @@ function make_find_items(gobj) {
18131
18140
  [$find_input, [
18132
18141
  "span",
18133
18142
  { class: "icon is-left" },
18134
- [yui_graph_icon("yi-magnifying-glass")]
18143
+ [yui_toolbar_icon("yi-magnifying-glass")]
18135
18144
  ]]
18136
18145
  ]);
18137
18146
  attach_clear($find_control, $find_input);
@@ -18201,24 +18210,31 @@ function make_toolbar$1(gobj) {
18201
18210
  LAYOUTS[key].label
18202
18211
  ]);
18203
18212
  }
18204
- let $select = createElement2([
18205
- "select",
18213
+ let $wrap = createElement2([
18214
+ "div",
18206
18215
  {
18207
18216
  class: "select",
18208
- style: {
18209
- height: toolbar_wide,
18210
- "margin-left": "0.5em"
18211
- },
18212
- title: t("layout")
18217
+ style: { "margin-left": "0.5em" }
18213
18218
  },
18214
- options,
18219
+ [[
18220
+ "select",
18221
+ {
18222
+ class: "GOBJ_TREE_LAYOUT",
18223
+ style: { height: toolbar_wide },
18224
+ title: t("layout"),
18225
+ "data-i18n-title": "layout",
18226
+ "aria-label": t("layout"),
18227
+ "data-i18n-aria-label": "layout"
18228
+ },
18229
+ options
18230
+ ]],
18215
18231
  { change: (evt) => {
18216
18232
  let value = evt.target.value;
18217
18233
  gobj_send_event(gobj, "EV_CHANGE_LAYOUT", { layout: value }, gobj);
18218
18234
  } }
18219
18235
  ]);
18220
- priv.$layout_select = $select;
18221
- right_items.push($select);
18236
+ priv.$layout_select = $wrap.querySelector("select");
18237
+ right_items.push($wrap);
18222
18238
  const $toolbar = yui_toolbar({}, [
18223
18239
  [
18224
18240
  "div",
@@ -21368,7 +21384,7 @@ function build_ui$6(gobj) {
21368
21384
  [[
21369
21385
  "span",
21370
21386
  { class: "icon" },
21371
- [["i", { class: "yi-arrow-left" }]]
21387
+ [yui_toolbar_icon("yi-arrow-left")]
21372
21388
  ], [
21373
21389
  "span",
21374
21390
  { i18n: "topics" },
@@ -21391,7 +21407,7 @@ function build_ui$6(gobj) {
21391
21407
  [[
21392
21408
  "span",
21393
21409
  { class: "icon" },
21394
- [["i", { class: "yi-hexagon-nodes" }]]
21410
+ [yui_toolbar_icon("yi-hexagon-nodes")]
21395
21411
  ], [
21396
21412
  "span",
21397
21413
  { i18n: "schema" },
@@ -21412,7 +21428,7 @@ function build_ui$6(gobj) {
21412
21428
  [[
21413
21429
  "span",
21414
21430
  { class: "icon" },
21415
- [["i", { class: "yi-cloudversify" }]]
21431
+ [yui_toolbar_icon("yi-cloudversify")]
21416
21432
  ], [
21417
21433
  "span",
21418
21434
  { class: "TREEDB_TOPICS_SOURCE_URL" },
@@ -21432,7 +21448,7 @@ function build_ui$6(gobj) {
21432
21448
  [[
21433
21449
  "span",
21434
21450
  { class: "icon" },
21435
- [["i", { class: "yi-eye" }]]
21451
+ [yui_toolbar_icon("yi-eye")]
21436
21452
  ], [
21437
21453
  "span",
21438
21454
  { i18n: "raw json" },
@@ -24052,7 +24068,7 @@ function build_ui$5(gobj) {
24052
24068
  id: ``,
24053
24069
  class: "button button-edit-record mr-1"
24054
24070
  },
24055
- [["i", { class: "yi-pen" }], [
24071
+ [yui_toolbar_icon("yi-pen"), [
24056
24072
  "span",
24057
24073
  {
24058
24074
  class: "is-hidden-mobile",
@@ -24075,7 +24091,7 @@ function build_ui$5(gobj) {
24075
24091
  class: "button button-new-record mr-1",
24076
24092
  disabled: true
24077
24093
  },
24078
- [["i", { class: "yi-plus" }], [
24094
+ [yui_toolbar_icon("yi-plus"), [
24079
24095
  "span",
24080
24096
  {
24081
24097
  class: "is-hidden-mobile",
@@ -24099,7 +24115,7 @@ function build_ui$5(gobj) {
24099
24115
  class: "button button-delete-record mr-1",
24100
24116
  disabled: true
24101
24117
  },
24102
- [["i", { class: "yi-trash" }], [
24118
+ [yui_toolbar_icon("yi-trash"), [
24103
24119
  "span",
24104
24120
  {
24105
24121
  class: "is-hidden-mobile",
@@ -24123,7 +24139,7 @@ function build_ui$5(gobj) {
24123
24139
  class: "button button-copy-record mr-1",
24124
24140
  disabled: true
24125
24141
  },
24126
- [["i", { class: "yi-copy" }], [
24142
+ [yui_toolbar_icon("yi-copy"), [
24127
24143
  "span",
24128
24144
  {
24129
24145
  class: "is-hidden-mobile",
@@ -24147,7 +24163,7 @@ function build_ui$5(gobj) {
24147
24163
  class: "button button-paste-record mr-1",
24148
24164
  disabled: true
24149
24165
  },
24150
- [["i", { class: "yi-paste" }], [
24166
+ [yui_toolbar_icon("yi-paste"), [
24151
24167
  "span",
24152
24168
  {
24153
24169
  class: "is-hidden-mobile",
@@ -24188,7 +24204,7 @@ function build_ui$5(gobj) {
24188
24204
  }], [
24189
24205
  "span",
24190
24206
  { class: "icon is-left" },
24191
- [["i", { class: "yi-magnifying-glass" }]]
24207
+ [yui_toolbar_icon("yi-magnifying-glass")]
24192
24208
  ]]
24193
24209
  ]);
24194
24210
  let $search_input = $search_box.querySelector(`#${search_id}`);
@@ -24206,7 +24222,7 @@ function build_ui$5(gobj) {
24206
24222
  title: t("refresh"),
24207
24223
  "data-i18n-title": "refresh"
24208
24224
  },
24209
- [["i", { class: "yi-arrows-rotate" }], [
24225
+ [yui_toolbar_icon("yi-arrows-rotate"), [
24210
24226
  "span",
24211
24227
  {
24212
24228
  class: "is-hidden-mobile",
@@ -24232,7 +24248,7 @@ function build_ui$5(gobj) {
24232
24248
  "aria-label": t("schema"),
24233
24249
  "data-i18n-aria-label": "schema"
24234
24250
  },
24235
- [["i", { class: "yi-hexagon-nodes" }], [
24251
+ [yui_toolbar_icon("yi-hexagon-nodes"), [
24236
24252
  "span",
24237
24253
  {
24238
24254
  class: "is-hidden-mobile",
@@ -24258,7 +24274,7 @@ function build_ui$5(gobj) {
24258
24274
  "aria-label": t("columns"),
24259
24275
  "data-i18n-aria-label": "columns"
24260
24276
  },
24261
- [["i", { class: "yi-table" }], [
24277
+ [yui_toolbar_icon("yi-table"), [
24262
24278
  "span",
24263
24279
  {
24264
24280
  class: "is-hidden-mobile",
@@ -24284,7 +24300,7 @@ function build_ui$5(gobj) {
24284
24300
  "aria-label": t("export"),
24285
24301
  "data-i18n-aria-label": "export"
24286
24302
  },
24287
- [["i", { class: "yi-download" }], [
24303
+ [yui_toolbar_icon("yi-download"), [
24288
24304
  "span",
24289
24305
  {
24290
24306
  class: "is-hidden-mobile",
@@ -61939,7 +61955,7 @@ function build_ui$3(gobj) {
61939
61955
  "div",
61940
61956
  {
61941
61957
  class: "GRAPH_LEGEND is-flex-grow-0",
61942
- style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.2rem;"
61958
+ style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.9rem;"
61943
61959
  },
61944
61960
  []
61945
61961
  ],
@@ -62098,7 +62114,7 @@ function node_shape_items(gobj, wide) {
62098
62114
  "data-i18n-aria-label": key,
62099
62115
  "aria-pressed": "false"
62100
62116
  },
62101
- yui_graph_icon(NODE_MODE_ICONS[mode]),
62117
+ yui_toolbar_icon(NODE_MODE_ICONS[mode]),
62102
62118
  { click: (evt) => {
62103
62119
  evt.stopPropagation();
62104
62120
  gobj_send_event(gobj, "EV_SET_NODE_MODE", { node_mode: mode }, gobj);
@@ -62120,7 +62136,7 @@ function node_shape_items(gobj, wide) {
62120
62136
  "data-i18n-aria-label": "node labels",
62121
62137
  "aria-pressed": "false"
62122
62138
  },
62123
- yui_graph_icon("yi-font"),
62139
+ yui_toolbar_icon("yi-font"),
62124
62140
  { click: (evt) => {
62125
62141
  evt.stopPropagation();
62126
62142
  gobj_send_event(gobj, "EV_TOGGLE_NODE_LABELS", {}, gobj);
@@ -62214,7 +62230,7 @@ function make_toolbar(gobj) {
62214
62230
  [
62215
62231
  "button",
62216
62232
  { class: "GRAPH_REFRESH button" },
62217
- [yui_graph_icon("yi-arrows-rotate"), [
62233
+ [yui_toolbar_icon("yi-arrows-rotate"), [
62218
62234
  "span",
62219
62235
  {
62220
62236
  class: "is-hidden-mobile",
@@ -62239,7 +62255,7 @@ function make_toolbar(gobj) {
62239
62255
  "data-i18n-title": "raw json",
62240
62256
  "data-i18n-aria-label": "raw json"
62241
62257
  },
62242
- [yui_graph_icon("yi-eye"), [
62258
+ [yui_toolbar_icon("yi-eye"), [
62243
62259
  "span",
62244
62260
  {
62245
62261
  class: "is-hidden-mobile",
@@ -62284,7 +62300,7 @@ function make_toolbar(gobj) {
62284
62300
  [$find_input, [
62285
62301
  "span",
62286
62302
  { class: "icon is-left" },
62287
- [yui_graph_icon("yi-magnifying-glass")]
62303
+ [yui_toolbar_icon("yi-magnifying-glass")]
62288
62304
  ]]
62289
62305
  ]);
62290
62306
  attach_clear($find_control, $find_input);
@@ -63253,9 +63269,11 @@ function ac_set_operation_mode(gobj, event, kw, src) {
63253
63269
  * card's graph icon travels — as EV_TOPIC_SELECTED, which the host turns
63254
63270
  * into the URL, so what you are looking at stays linkable.
63255
63271
  ************************************************************/
63256
- var LEGEND_GLYPH_STYLE = `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;`;
63272
+ var LEGEND_GLYPH_STYLE = `font-size:${YUI_TOOLBAR_ICON_SIZE}; line-height:1; color:inherit;`;
63257
63273
  var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
63258
- var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
63274
+ var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem; opacity:.8;";
63275
+ var LEGEND_MAIN_NAME_STYLE = "font-size:1rem; line-height:1.2; font-weight:700;";
63276
+ var LEGEND_STAR_MAIN_STYLE = LEGEND_GLYPH_STYLE + " color:var(--bulma-warning-on-scheme, var(--bulma-warning, #ffdd57));";
63259
63277
  function refresh_legend(gobj) {
63260
63278
  let priv = gobj.priv;
63261
63279
  let $container = gobj_read_attr(gobj, "$container");
@@ -63281,20 +63299,20 @@ function refresh_legend(gobj) {
63281
63299
  "span",
63282
63300
  {
63283
63301
  class: "GRAPH_LEGEND_NAME",
63284
- style: LEGEND_NAME_STYLE + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
63302
+ style: (is_main ? LEGEND_MAIN_NAME_STYLE : LEGEND_NAME_STYLE) + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
63285
63303
  },
63286
63304
  topic_name
63287
63305
  ], [
63288
63306
  "span",
63289
63307
  {
63290
- class: "GRAPH_LEGEND_COUNT has-text-grey",
63308
+ class: "GRAPH_LEGEND_COUNT",
63291
63309
  style: LEGEND_COUNT_STYLE
63292
63310
  },
63293
63311
  hidden ? `${entry.total}` : `${entry.visible}/${entry.total}`
63294
63312
  ]);
63295
63313
  let body_key = is_main ? "main topic" : hidden ? "show topic" : "hide topic";
63296
63314
  let body_attrs = {
63297
- class: "GRAPH_LEGEND_ITEM button is-small" + (focused ? " GRAPH_LEGEND_FOCUSED" : "") + (is_main ? " GRAPH_LEGEND_MAIN" : ""),
63315
+ class: "GRAPH_LEGEND_ITEM button" + (focused ? " GRAPH_LEGEND_FOCUSED" : "") + (is_main ? " GRAPH_LEGEND_MAIN" : ""),
63298
63316
  type: "button",
63299
63317
  style: "gap:0; flex:0 0 auto;" + (focused ? " box-shadow: inset 0 0 0 2px var(--bulma-text, #2e333d);" : ""),
63300
63318
  title: t(body_key),
@@ -63302,8 +63320,15 @@ function refresh_legend(gobj) {
63302
63320
  "aria-label": topic_name,
63303
63321
  "aria-pressed": hidden ? "false" : "true"
63304
63322
  };
63305
- if (is_main) body_attrs.disabled = "disabled";
63306
- let $body = createElement2([
63323
+ let $body;
63324
+ if (is_main) {
63325
+ delete body_attrs["aria-pressed"];
63326
+ $body = createElement2([
63327
+ "div",
63328
+ body_attrs,
63329
+ controls
63330
+ ]);
63331
+ } else $body = createElement2([
63307
63332
  "button",
63308
63333
  body_attrs,
63309
63334
  controls,
@@ -63319,9 +63344,9 @@ function refresh_legend(gobj) {
63319
63344
  if (is_main && state.main_chosen) extras.push([
63320
63345
  "button",
63321
63346
  {
63322
- class: "GRAPH_LEGEND_STAR button is-small pressed_state",
63347
+ class: "GRAPH_LEGEND_STAR button pressed_state",
63323
63348
  type: "button",
63324
- style: "padding:0 .4rem;",
63349
+ style: "padding:0 .5rem;",
63325
63350
  title: t("main topic"),
63326
63351
  "data-i18n-title": "main topic",
63327
63352
  "aria-label": t("main topic"),
@@ -63330,7 +63355,7 @@ function refresh_legend(gobj) {
63330
63355
  },
63331
63356
  [[
63332
63357
  "span",
63333
- { style: LEGEND_GLYPH_STYLE },
63358
+ { style: LEGEND_STAR_MAIN_STYLE },
63334
63359
  "★"
63335
63360
  ]],
63336
63361
  { click: (evt) => {
@@ -63344,23 +63369,23 @@ function refresh_legend(gobj) {
63344
63369
  else if (is_main) extras.push([
63345
63370
  "span",
63346
63371
  {
63347
- class: "GRAPH_LEGEND_STAR button is-small is-static",
63348
- style: "padding:0 .4rem;",
63372
+ class: "GRAPH_LEGEND_STAR button",
63373
+ style: "padding:0 .5rem; cursor:default;",
63349
63374
  title: t("main topic"),
63350
63375
  "data-i18n-title": "main topic"
63351
63376
  },
63352
63377
  [[
63353
63378
  "span",
63354
- { style: LEGEND_GLYPH_STYLE },
63379
+ { style: LEGEND_STAR_MAIN_STYLE },
63355
63380
  "★"
63356
63381
  ]]
63357
63382
  ]);
63358
63383
  else if (!hidden) extras.push([
63359
63384
  "button",
63360
63385
  {
63361
- class: "GRAPH_LEGEND_STAR button is-small",
63386
+ class: "GRAPH_LEGEND_STAR button",
63362
63387
  type: "button",
63363
- style: "padding:0 .4rem;",
63388
+ style: "padding:0 .5rem;",
63364
63389
  title: t("main topic"),
63365
63390
  "data-i18n-title": "main topic",
63366
63391
  "aria-label": t("main topic"),
@@ -63382,9 +63407,9 @@ function refresh_legend(gobj) {
63382
63407
  if (!hidden && entry.linked && entry.loose > 0) extras.push([
63383
63408
  "button",
63384
63409
  {
63385
- class: "GRAPH_LEGEND_LOOSE button is-small" + (entry.loose_shown ? " pressed_state" : ""),
63410
+ class: "GRAPH_LEGEND_LOOSE button" + (entry.loose_shown ? " pressed_state" : ""),
63386
63411
  type: "button",
63387
- style: "padding:0 .45rem;",
63412
+ style: "padding:0 .55rem;",
63388
63413
  title: t("loose records"),
63389
63414
  "data-i18n-title": "loose records",
63390
63415
  "aria-label": t("loose records"),
@@ -63403,9 +63428,9 @@ function refresh_legend(gobj) {
63403
63428
  if (!hidden) extras.push([
63404
63429
  "button",
63405
63430
  {
63406
- class: "GRAPH_LEGEND_FOCUS button is-small" + (focused ? " pressed_state" : ""),
63431
+ class: "GRAPH_LEGEND_FOCUS button" + (focused ? " pressed_state" : ""),
63407
63432
  type: "button",
63408
- style: "padding:0 .4rem;",
63433
+ style: "padding:0 .5rem;",
63409
63434
  title: t("highlight topic"),
63410
63435
  "data-i18n-title": "highlight topic",
63411
63436
  "aria-label": t("highlight topic"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.86",
3
+ "version": "7.23.88",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -54,7 +54,7 @@ import {
54
54
  } from "./yui_gclass_view.js";
55
55
  import {yui_shell_of} from "./c_yui_shell.js";
56
56
 
57
- import {yui_toolbar} from "./yui_toolbar.js";
57
+ import {yui_toolbar, yui_toolbar_icon} from "./yui_toolbar.js";
58
58
  import {attach_clear} from "./yui_inputs.js";
59
59
  import {
60
60
  yui_graph_camera_items,
@@ -62,7 +62,6 @@ import {
62
62
  yui_graph_update_anchor,
63
63
  yui_graph_center_on,
64
64
  yui_graph_fold_items,
65
- yui_graph_icon,
66
65
  yui_graph_refresh_item,
67
66
  yui_graph_update_zoom,
68
67
  } from "./yui_graph_camera.js";
@@ -99,7 +98,7 @@ SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Container eleme
99
98
  SDATA(data_type_t.DTP_STRING, "canvas_id", 0, "", "Canvas ID"),
100
99
 
101
100
  /*---------------- Graph Settings ----------------*/
102
- SDATA(data_type_t.DTP_STRING, "wide", 0, "36px", "Height of header"),
101
+ SDATA(data_type_t.DTP_STRING, "wide", 0, "40px", "Height of header. 40px and not 36: it is what an untouched Bulma control measures, so the find box stood 4px taller than every button beside it, and it is what the third graph of the family (C_YUI_TREEDB_GRAPH) uses"),
103
102
  SDATA(data_type_t.DTP_STRING, "layout", 0, "vertical-compact", "Current layout key"),
104
103
  SDATA(data_type_t.DTP_INTEGER, "collapse_threshold", 0, 10, "Auto-collapse a node whose direct children exceed this number. 0 disables auto-collapse."),
105
104
 
@@ -907,7 +906,7 @@ function make_find_items(gobj)
907
906
  style: 'margin-left:.5rem; margin-right:.5rem; ' +
908
907
  'max-width:12rem; min-width:7rem;'}, [
909
908
  $find_input,
910
- ['span', {class: 'icon is-left'}, [yui_graph_icon('yi-magnifying-glass')]]
909
+ ['span', {class: 'icon is-left'}, [yui_toolbar_icon('yi-magnifying-glass')]]
911
910
  ]]);
912
911
  attach_clear($find_control, $find_input);
913
912
 
@@ -1019,23 +1018,27 @@ function make_toolbar(gobj)
1019
1018
  options.push(['option', opt_attrs, LAYOUTS[key].label]);
1020
1019
  }
1021
1020
 
1022
- let $select = createElement2(
1023
- ['select', {
1024
- class: 'select',
1025
- style: {height: toolbar_wide, "margin-left": "0.5em"},
1026
- title: t("layout"),
1027
- },
1028
- options,
1029
- {
1030
- change: (evt) => {
1031
- let value = evt.target.value;
1032
- gobj_send_event(gobj, "EV_CHANGE_LAYOUT", {layout: value}, gobj);
1033
- }
1021
+ /* `.select` on the WRAPPER and not on the control: Bulma styles
1022
+ * `.select select`, so the class on the `<select>` itself matched
1023
+ * nothing and the box kept the browser's 13.3px font in a row of
1024
+ * 16px controls. */
1025
+ let $wrap = createElement2(
1026
+ ['div', {class: 'select', style: {"margin-left": "0.5em"}}, [
1027
+ ['select', {
1028
+ class: 'GOBJ_TREE_LAYOUT',
1029
+ style: {height: toolbar_wide},
1030
+ title: t("layout"), 'data-i18n-title': "layout",
1031
+ 'aria-label': t("layout"), 'data-i18n-aria-label': "layout",
1032
+ }, options]
1033
+ ], {
1034
+ change: (evt) => {
1035
+ let value = evt.target.value;
1036
+ gobj_send_event(gobj, "EV_CHANGE_LAYOUT", {layout: value}, gobj);
1034
1037
  }
1035
- ]
1038
+ }]
1036
1039
  );
1037
- priv.$layout_select = $select;
1038
- right_items.push($select);
1040
+ priv.$layout_select = $wrap.querySelector("select");
1041
+ right_items.push($wrap);
1039
1042
 
1040
1043
  const $toolbar = yui_toolbar({}, [
1041
1044
  ['div', {class: 'yui-horizontal-toolbar-section left'}, left_items],
package/src/c_yui_json.js CHANGED
@@ -102,7 +102,7 @@ import {
102
102
  container_label,
103
103
  } from "./json_view_helpers.js";
104
104
 
105
- import {yui_toolbar} from "./yui_toolbar.js";
105
+ import {yui_toolbar, yui_toolbar_icon} from "./yui_toolbar.js";
106
106
  import {register_c_yui_json_graph} from "./c_yui_json_graph.js";
107
107
  import {attach_clear} from "./yui_inputs.js";
108
108
 
@@ -388,7 +388,7 @@ function make_toolbar(gobj)
388
388
  ['div', {class: 'control has-icons-left JSON_SEARCH_CONTROL',
389
389
  style: 'max-width:22em;'}, [
390
390
  $search_input,
391
- ['span', {class: 'icon is-left'}, [['i', {class: 'yi-magnifying-glass'}]]]
391
+ ['span', {class: 'icon is-left'}, [yui_toolbar_icon('yi-magnifying-glass')]]
392
392
  ]]);
393
393
  /* The GLOBAL fold leads the row, ahead of the find box — the same
394
394
  * place both graphs put theirs. It opens the whole document; the
@@ -426,7 +426,7 @@ function icon_button(gobj, icon, event_name, label_key)
426
426
  return ['button', {class: `button ${event_name}`, style: 'width:2.5em;',
427
427
  title: t(label_key), 'data-i18n-title': label_key,
428
428
  'aria-label': t(label_key), 'data-i18n-aria-label': label_key}, [
429
- ['span', {class: 'icon'}, [['i', {class: icon}]]]
429
+ ['span', {class: 'icon'}, [yui_toolbar_icon(icon)]]
430
430
  ], {
431
431
  click: function(evt) {
432
432
  evt.stopPropagation();
@@ -452,7 +452,7 @@ function view_mode_switch(gobj)
452
452
  type: 'button', style: 'width:2.5em;',
453
453
  title: label, 'data-i18n-title': v.key,
454
454
  'aria-label': label, 'data-i18n-aria-label': v.key}, [
455
- ['span', {class: 'icon'}, [['i', {class: v.icon}]]]
455
+ ['span', {class: 'icon'}, [yui_toolbar_icon(v.icon)]]
456
456
  ], {
457
457
  click: function(evt) {
458
458
  evt.stopPropagation();