@yuneta/gobj-ui 7.23.66 → 7.23.67

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
@@ -1248,12 +1248,15 @@ a level or two, with a count on every cut.
1248
1248
  `antv-dagre` keeps the top-down reading, so the layout picker is also the
1249
1249
  direction picker. A layout change turns the ports of every card in place.
1250
1250
  - **The find and the topic focus search the RECORDS**, not the cards, and open
1251
- the path down to what they find — at most one **page** of hidden matches
1252
- each, because a single letter matches half the treedb and the graph's
1253
- per-topic route (`.../graph/devices`) is a focus on `devices` that lands on
1254
- every load: revealing a whole topic there opened 563 groups of a 6400-record
1255
- treedb before anybody had touched anything. The count reported is of all the
1256
- matches.
1251
+ the path down to what they find. The find reveals at most one **page** of
1252
+ hidden matches (a single letter matches half the treedb); the count reported
1253
+ is of all of them. The topic focus depends on who asks: a click on the
1254
+ **legend** reveals the **whole topic** (`reveal: "all"` on
1255
+ `EV_SET_FOCUS_TOPIC`) — *show me these* means all of them — while the graph's
1256
+ per-topic **route** (`.../graph/devices` is a focus on `devices`) gets one
1257
+ page, because it lands on every load, and revealing a whole topic there
1258
+ opened 563 groups of a 6400-record treedb before anybody had touched
1259
+ anything.
1257
1260
  - **Edition and the saved geometry are untouched by folding.** Only the cards
1258
1261
  on screen are read when the graph is saved; a folded card keeps the entry it
1259
1262
  had in `__graphs__`. A card on its default size grows by the pill row when it
@@ -54172,6 +54172,7 @@ var PRIVATE_DATA$4 = {
54172
54172
  selection_mode: false,
54173
54173
  _selected_paint_ids: [],
54174
54174
  _pending_focus_topic: null,
54175
+ _pending_focus_all: false,
54175
54176
  _pending_find: null,
54176
54177
  _layout_asked: "",
54177
54178
  _nodes_total: 0,
@@ -55661,10 +55662,11 @@ async function graph_fit_selection(gobj, ids) {
55661
55662
  * once the data loads (see ac_load_data). Guarded end-to-end — a
55662
55663
  * missing G6 API or an unknown topic logs and no-ops, never throws.
55663
55664
  ************************************************************/
55664
- function graph_focus_topic(gobj, topic) {
55665
+ function graph_focus_topic(gobj, topic, reveal_all) {
55665
55666
  let priv = gobj.priv;
55666
55667
  if (!priv.graph || !priv.graph_rendered || !priv._fold_model) {
55667
55668
  priv._pending_focus_topic = topic;
55669
+ priv._pending_focus_all = !!reveal_all;
55668
55670
  return;
55669
55671
  }
55670
55672
  let model = priv._fold_model;
@@ -55677,7 +55679,7 @@ function graph_focus_topic(gobj, topic) {
55677
55679
  let revealed = 0;
55678
55680
  for (let key of keys) {
55679
55681
  if (visible.has(key)) continue;
55680
- if (revealed >= state.page_size) break;
55682
+ if (!reveal_all && revealed >= state.page_size) break;
55681
55683
  fold_reveal(model, state, key);
55682
55684
  revealed++;
55683
55685
  }
@@ -59036,8 +59038,10 @@ function ac_load_data(gobj, event, kw, src) {
59036
59038
  sync_history_plugin(gobj);
59037
59039
  if (priv._pending_focus_topic !== null) {
59038
59040
  let ft = priv._pending_focus_topic;
59041
+ let all = priv._pending_focus_all;
59039
59042
  priv._pending_focus_topic = null;
59040
- graph_focus_topic(gobj, ft);
59043
+ priv._pending_focus_all = false;
59044
+ graph_focus_topic(gobj, ft, all);
59041
59045
  }
59042
59046
  if (priv._pending_find !== null) {
59043
59047
  let term = priv._pending_find;
@@ -59353,7 +59357,7 @@ function ac_zoom_selection(gobj, event, kw, src) {
59353
59357
  return 0;
59354
59358
  }
59355
59359
  function ac_focus_topic(gobj, event, kw, src) {
59356
- graph_focus_topic(gobj, kw && kw.topic);
59360
+ graph_focus_topic(gobj, kw && kw.topic, !!(kw && kw.reveal === "all"));
59357
59361
  return 0;
59358
59362
  }
59359
59363
  /************************************************************
@@ -61516,7 +61520,10 @@ function ac_legend_topic(gobj, event, kw, src) {
61516
61520
  return -1;
61517
61521
  }
61518
61522
  let next = priv.focus_topic === topic ? "" : topic;
61519
- (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SET_FOCUS_TOPIC", { topic: next }, gobj);
61523
+ (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SET_FOCUS_TOPIC", {
61524
+ topic: next,
61525
+ reveal: "all"
61526
+ }, gobj);
61520
61527
  (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_TOPIC_SELECTED", { topic: next });
61521
61528
  return 0;
61522
61529
  }
@@ -61579,7 +61586,10 @@ function ac_find_result(gobj, event, kw, src) {
61579
61586
  function ac_set_focus_topic(gobj, event, kw, src) {
61580
61587
  let priv = gobj.priv;
61581
61588
  priv.focus_topic = kw && kw.topic || "";
61582
- if (priv.gobj_nodes_tree) (0, _yuneta_gobj_js.gobj_send_event)(priv.gobj_nodes_tree, "EV_FOCUS_TOPIC", { topic: priv.focus_topic }, gobj);
61589
+ if (priv.gobj_nodes_tree) (0, _yuneta_gobj_js.gobj_send_event)(priv.gobj_nodes_tree, "EV_FOCUS_TOPIC", {
61590
+ topic: priv.focus_topic,
61591
+ reveal: kw && kw.reveal || "page"
61592
+ }, gobj);
61583
61593
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
61584
61594
  let $legend = $container ? $container.querySelector(".GRAPH_LEGEND") : null;
61585
61595
  if ($legend && !$legend.classList.contains("is-hidden")) refresh_legend(gobj);
@@ -54167,6 +54167,7 @@ var PRIVATE_DATA$4 = {
54167
54167
  selection_mode: false,
54168
54168
  _selected_paint_ids: [],
54169
54169
  _pending_focus_topic: null,
54170
+ _pending_focus_all: false,
54170
54171
  _pending_find: null,
54171
54172
  _layout_asked: "",
54172
54173
  _nodes_total: 0,
@@ -55656,10 +55657,11 @@ async function graph_fit_selection(gobj, ids) {
55656
55657
  * once the data loads (see ac_load_data). Guarded end-to-end — a
55657
55658
  * missing G6 API or an unknown topic logs and no-ops, never throws.
55658
55659
  ************************************************************/
55659
- function graph_focus_topic(gobj, topic) {
55660
+ function graph_focus_topic(gobj, topic, reveal_all) {
55660
55661
  let priv = gobj.priv;
55661
55662
  if (!priv.graph || !priv.graph_rendered || !priv._fold_model) {
55662
55663
  priv._pending_focus_topic = topic;
55664
+ priv._pending_focus_all = !!reveal_all;
55663
55665
  return;
55664
55666
  }
55665
55667
  let model = priv._fold_model;
@@ -55672,7 +55674,7 @@ function graph_focus_topic(gobj, topic) {
55672
55674
  let revealed = 0;
55673
55675
  for (let key of keys) {
55674
55676
  if (visible.has(key)) continue;
55675
- if (revealed >= state.page_size) break;
55677
+ if (!reveal_all && revealed >= state.page_size) break;
55676
55678
  fold_reveal(model, state, key);
55677
55679
  revealed++;
55678
55680
  }
@@ -59031,8 +59033,10 @@ function ac_load_data(gobj, event, kw, src) {
59031
59033
  sync_history_plugin(gobj);
59032
59034
  if (priv._pending_focus_topic !== null) {
59033
59035
  let ft = priv._pending_focus_topic;
59036
+ let all = priv._pending_focus_all;
59034
59037
  priv._pending_focus_topic = null;
59035
- graph_focus_topic(gobj, ft);
59038
+ priv._pending_focus_all = false;
59039
+ graph_focus_topic(gobj, ft, all);
59036
59040
  }
59037
59041
  if (priv._pending_find !== null) {
59038
59042
  let term = priv._pending_find;
@@ -59348,7 +59352,7 @@ function ac_zoom_selection(gobj, event, kw, src) {
59348
59352
  return 0;
59349
59353
  }
59350
59354
  function ac_focus_topic(gobj, event, kw, src) {
59351
- graph_focus_topic(gobj, kw && kw.topic);
59355
+ graph_focus_topic(gobj, kw && kw.topic, !!(kw && kw.reveal === "all"));
59352
59356
  return 0;
59353
59357
  }
59354
59358
  /************************************************************
@@ -61511,7 +61515,10 @@ function ac_legend_topic(gobj, event, kw, src) {
61511
61515
  return -1;
61512
61516
  }
61513
61517
  let next = priv.focus_topic === topic ? "" : topic;
61514
- gobj_send_event(gobj, "EV_SET_FOCUS_TOPIC", { topic: next }, gobj);
61518
+ gobj_send_event(gobj, "EV_SET_FOCUS_TOPIC", {
61519
+ topic: next,
61520
+ reveal: "all"
61521
+ }, gobj);
61515
61522
  gobj_publish_event(gobj, "EV_TOPIC_SELECTED", { topic: next });
61516
61523
  return 0;
61517
61524
  }
@@ -61574,7 +61581,10 @@ function ac_find_result(gobj, event, kw, src) {
61574
61581
  function ac_set_focus_topic(gobj, event, kw, src) {
61575
61582
  let priv = gobj.priv;
61576
61583
  priv.focus_topic = kw && kw.topic || "";
61577
- if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_FOCUS_TOPIC", { topic: priv.focus_topic }, gobj);
61584
+ if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_FOCUS_TOPIC", {
61585
+ topic: priv.focus_topic,
61586
+ reveal: kw && kw.reveal || "page"
61587
+ }, gobj);
61578
61588
  let $container = gobj_read_attr(gobj, "$container");
61579
61589
  let $legend = $container ? $container.querySelector(".GRAPH_LEGEND") : null;
61580
61590
  if ($legend && !$legend.classList.contains("is-hidden")) refresh_legend(gobj);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.66",
3
+ "version": "7.23.67",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -420,6 +420,7 @@ let PRIVATE_DATA = {
420
420
  // itself; this is what is on screen, and
421
421
  // it exists to diff the repaint)
422
422
  _pending_focus_topic: null, // focus requested before data was loaded
423
+ _pending_focus_all: false, // ...and whether it reveals the whole topic
423
424
  _pending_find: null, // find requested before data was loaded
424
425
  _layout_asked: "", // layout the host asked for at create (see mt_create)
425
426
  _nodes_total: 0, // records of the treedb (auto_layout)
@@ -2850,12 +2851,13 @@ async function graph_fit_selection(gobj, ids)
2850
2851
  * once the data loads (see ac_load_data). Guarded end-to-end — a
2851
2852
  * missing G6 API or an unknown topic logs and no-ops, never throws.
2852
2853
  ************************************************************/
2853
- function graph_focus_topic(gobj, topic)
2854
+ function graph_focus_topic(gobj, topic, reveal_all)
2854
2855
  {
2855
2856
  let priv = gobj.priv;
2856
2857
  let graph = priv.graph;
2857
2858
  if(!graph || !priv.graph_rendered || !priv._fold_model) {
2858
2859
  priv._pending_focus_topic = topic;
2860
+ priv._pending_focus_all = !!reveal_all;
2859
2861
  return;
2860
2862
  }
2861
2863
 
@@ -2863,11 +2865,13 @@ function graph_focus_topic(gobj, topic)
2863
2865
  let state = priv._fold_state;
2864
2866
 
2865
2867
  /* "Show me these": the ones on screen are highlighted, and the
2866
- * hidden ones are opened up to -- ONE PAGE of them, the same cap
2867
- * the find has. The graph's per-topic route lands here on every
2868
- * load (`.../graph/devices` is a focus on `devices`), and
2868
+ * hidden ones are opened up to. How many depends on who asks.
2869
+ * A click on the LEGEND (`reveal_all`) means every record of the
2870
+ * topic, however deep it is folded away. The graph's per-topic
2871
+ * ROUTE lands here on every load (`.../graph/devices` is a focus
2872
+ * on `devices`) and gets ONE PAGE, the same cap the find has:
2869
2873
  * revealing a whole topic on landing opened 563 groups of a
2870
- * 6400-record treedb: the pile, back, before anybody touched
2874
+ * 6400-record treedb -- the pile, back, before anybody touched
2871
2875
  * anything. */
2872
2876
  let keys = [];
2873
2877
  if(!empty_string(topic)) {
@@ -2885,7 +2889,7 @@ function graph_focus_topic(gobj, topic)
2885
2889
  if(visible.has(key)) {
2886
2890
  continue;
2887
2891
  }
2888
- if(revealed >= state.page_size) {
2892
+ if(!reveal_all && revealed >= state.page_size) {
2889
2893
  break;
2890
2894
  }
2891
2895
  fold_reveal(model, state, key);
@@ -8025,8 +8029,10 @@ function ac_load_data(gobj, event, kw, src)
8025
8029
  * requested before the data was ready (deep link). */
8026
8030
  if(priv._pending_focus_topic !== null) {
8027
8031
  let ft = priv._pending_focus_topic;
8032
+ let all = priv._pending_focus_all;
8028
8033
  priv._pending_focus_topic = null;
8029
- graph_focus_topic(gobj, ft);
8034
+ priv._pending_focus_all = false;
8035
+ graph_focus_topic(gobj, ft, all);
8030
8036
  }
8031
8037
  if(priv._pending_find !== null) {
8032
8038
  let term = priv._pending_find;
@@ -8526,7 +8532,7 @@ function ac_zoom_selection(gobj, event, kw, src)
8526
8532
 
8527
8533
  function ac_focus_topic(gobj, event, kw, src)
8528
8534
  {
8529
- graph_focus_topic(gobj, kw && kw.topic);
8535
+ graph_focus_topic(gobj, kw && kw.topic, !!(kw && kw.reveal === "all"));
8530
8536
  return 0;
8531
8537
  }
8532
8538
 
@@ -2435,7 +2435,12 @@ function ac_legend_topic(gobj, event, kw, src)
2435
2435
  * DEDUPED: a legend that only announced moved the URL and focused
2436
2436
  * nothing. This is the same contract the topics view keeps, where
2437
2437
  * clicking a topic shows it and says so. */
2438
- gobj_send_event(gobj, "EV_SET_FOCUS_TOPIC", {topic: next}, gobj);
2438
+ /* `reveal: "all"`: a click on the legend is "show me these", and
2439
+ * these means every record of the topic, however deep it is folded
2440
+ * away. The route that lands on a topic sends no `reveal` and gets
2441
+ * one page -- it fires on every load, and a whole topic there is
2442
+ * the pile back before anybody touched anything. */
2443
+ gobj_send_event(gobj, "EV_SET_FOCUS_TOPIC", {topic: next, reveal: "all"}, gobj);
2439
2444
  gobj_publish_event(gobj, "EV_TOPIC_SELECTED", {topic: next});
2440
2445
  return 0;
2441
2446
  }
@@ -2536,7 +2541,7 @@ function ac_set_focus_topic(gobj, event, kw, src)
2536
2541
  gobj_send_event(
2537
2542
  priv.gobj_nodes_tree,
2538
2543
  "EV_FOCUS_TOPIC",
2539
- {topic: priv.focus_topic},
2544
+ {topic: priv.focus_topic, reveal: (kw && kw.reveal) || "page"},
2540
2545
  gobj
2541
2546
  );
2542
2547
  }