@yuneta/gobj-ui 7.23.91 → 7.23.93

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
@@ -1257,7 +1257,14 @@ a level or two, with a count on every cut.
1257
1257
  their children. **`fold_page_size`** (default `24`) is how many children of
1258
1258
  one hook are shown at a time; the rest is a **`+N` chip** at the end of the
1259
1259
  page that opens the next one. Both are attrs of `C_YUI_TREEDB_GRAPH`,
1260
- forwarded to the engine.
1260
+ forwarded to the engine — and since `7.23.93` so are the seven the engine
1261
+ had always had and no host could reach, because this view is what creates
1262
+ the engine and an option it does not forward is an option that does not
1263
+ exist: **`minimap_min_nodes`** (default `30`), **`with_gridline`**,
1264
+ **`with_fullscreen`**, **`with_toolbar`**, **`toolbar_position`**
1265
+ (`right-top`), **`confirm_delete_node`** and **`confirm_unlink_edge`**. The
1266
+ defaults repeat the engine's, so a host that says nothing gets what it got
1267
+ before.
1261
1268
  - **A pill per hook on the card** — `▸ devices 142` folded, `▾ devices 24/142`
1262
1269
  open on a page — in the colour of the child topic, the same colour its hook
1263
1270
  port wears. Tapping it opens or folds that hook, and the card stays where it
@@ -58981,7 +58981,8 @@ function auto_layout(gobj) {
58981
58981
  * card is a rectangle anyway.
58982
58982
  ************************************************************/
58983
58983
  function refresh_minimap(gobj) {
58984
- let graph = gobj.priv.graph;
58984
+ let priv = gobj.priv;
58985
+ let graph = priv.graph;
58985
58986
  if (!graph) return;
58986
58987
  let threshold = (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "minimap_min_nodes");
58987
58988
  let n = 0;
@@ -59004,12 +59005,12 @@ function refresh_minimap(gobj) {
59004
59005
  bottom: "12px",
59005
59006
  left: "12px",
59006
59007
  background: "var(--bulma-scheme-main, #fff)",
59007
- border: "1px solid var(--bulma-border-weak, #ddd)",
59008
+ border: "1px solid var(--bulma-text-weak, #94a3b8)",
59008
59009
  borderRadius: "6px",
59009
59010
  boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
59010
59011
  },
59011
59012
  maskStyle: {
59012
- border: "2px solid var(--bulma-link, #3b82f6)",
59013
+ border: "2px solid var(--bulma-link-on-scheme, var(--bulma-link, #3b82f6))",
59013
59014
  background: "rgba(59, 130, 246, 0.12)"
59014
59015
  },
59015
59016
  shape: (id, element_type, element) => {
@@ -59017,8 +59018,8 @@ function refresh_minimap(gobj) {
59017
59018
  try {
59018
59019
  let nd = graph.getNodeData(id);
59019
59020
  let size = nd && nd.style && nd.style.size || [120, 60];
59020
- let color = nd && nd.data && nd.data.desc && nd.data.desc.color || "#94a3b8";
59021
- if (is_more_node(nd)) color = "rgba(148, 163, 184, 0.35)";
59021
+ let color = port_rim(nd && nd.data && nd.data.desc && nd.data.desc.color || "#94a3b8", priv.theme);
59022
+ if (is_more_node(nd)) color = priv.theme === "dark" ? "rgba(148, 163, 184, 0.60)" : "rgba(71, 85, 105, 0.65)";
59022
59023
  return new Rect({ style: {
59023
59024
  x: -size[0] / 2,
59024
59025
  y: -size[1] / 2,
@@ -60863,6 +60864,10 @@ function ac_theme$1(gobj, event, kw, src) {
60863
60864
  refresh_default_edges_theme(gobj, theme);
60864
60865
  refresh_port_rims(gobj, theme);
60865
60866
  repaint_more_chips(gobj);
60867
+ if (graph_get_plugin(gobj, "minimap")) {
60868
+ graph_remove_plugin(gobj, "minimap");
60869
+ refresh_minimap(gobj);
60870
+ }
60866
60871
  graph_draw(gobj).then(() => {
60867
60872
  update_history_buttons(gobj);
60868
60873
  });
@@ -61881,6 +61886,13 @@ var attrs_table$3 = [
61881
61886
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_treedb_tables", 0, false, "Include treedb tables"),
61882
61887
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "expand_depth", 0, 2, "Levels of the treedb open when it loads: 1 = the roots alone, 2 = the roots and their children. Forwarded to the G6 child"),
61883
61888
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "fold_page_size", 0, 24, "Children of one hook shown per page in the graph; a `+N` chip opens the next page. Forwarded to the G6 child"),
61889
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "minimap_min_nodes", 0, 30, "Show the minimap from this many nodes on (0 = never). Forwarded to the G6 child"),
61890
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_gridline", 0, true, "Draw the grid under the graph. Forwarded to the G6 child"),
61891
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_fullscreen", 0, true, "Offer the full-screen button. Forwarded to the G6 child"),
61892
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "with_toolbar", 0, true, "Float the camera toolbar over the canvas. Forwarded to the G6 child"),
61893
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "toolbar_position", 0, "right-top", "Where that toolbar floats: top-left, top-right, bottom-left, bottom-right, left-top, right-top. Forwarded to the G6 child"),
61894
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "confirm_delete_node", 0, true, "Ask before deleting a node. Forwarded to the G6 child"),
61895
+ (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_BOOLEAN, "confirm_unlink_edge", 0, true, "Ask before unlinking an edge. Forwarded to the G6 child"),
61884
61896
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "operation_mode", _yuneta_gobj_js.sdata_flag_t.SDF_PERSIST, "reading", "Current operation mode (internal behaviour or role). Changed by the user trough the gui."),
61885
61897
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_STRING, "layout", _yuneta_gobj_js.sdata_flag_t.SDF_PERSIST, "", "Current graph layout. User preference. Changed by the user through the gui."),
61886
61898
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_LIST, "hidden_topics", _yuneta_gobj_js.sdata_flag_t.SDF_PERSIST, "[]", "Topics hidden from the graph (legend). User preference, per treedb"),
@@ -61964,6 +61976,13 @@ function mt_create$3(gobj) {
61964
61976
  fkey_port_position: "top",
61965
61977
  expand_depth: (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "expand_depth"),
61966
61978
  fold_page_size: (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "fold_page_size"),
61979
+ minimap_min_nodes: (0, _yuneta_gobj_js.gobj_read_integer_attr)(gobj, "minimap_min_nodes"),
61980
+ with_gridline: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_gridline"),
61981
+ with_fullscreen: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_fullscreen"),
61982
+ with_toolbar: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "with_toolbar"),
61983
+ toolbar_position: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "toolbar_position"),
61984
+ confirm_delete_node: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "confirm_delete_node"),
61985
+ confirm_unlink_edge: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "confirm_unlink_edge"),
61967
61986
  hidden_topics: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "hidden_topics") || [],
61968
61987
  main_topic: (0, _yuneta_gobj_js.gobj_read_str_attr)(gobj, "main_topic") || "",
61969
61988
  loose_topics: (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "loose_topics") || [],
@@ -58976,7 +58976,8 @@ function auto_layout(gobj) {
58976
58976
  * card is a rectangle anyway.
58977
58977
  ************************************************************/
58978
58978
  function refresh_minimap(gobj) {
58979
- let graph = gobj.priv.graph;
58979
+ let priv = gobj.priv;
58980
+ let graph = priv.graph;
58980
58981
  if (!graph) return;
58981
58982
  let threshold = gobj_read_integer_attr(gobj, "minimap_min_nodes");
58982
58983
  let n = 0;
@@ -58999,12 +59000,12 @@ function refresh_minimap(gobj) {
58999
59000
  bottom: "12px",
59000
59001
  left: "12px",
59001
59002
  background: "var(--bulma-scheme-main, #fff)",
59002
- border: "1px solid var(--bulma-border-weak, #ddd)",
59003
+ border: "1px solid var(--bulma-text-weak, #94a3b8)",
59003
59004
  borderRadius: "6px",
59004
59005
  boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
59005
59006
  },
59006
59007
  maskStyle: {
59007
- border: "2px solid var(--bulma-link, #3b82f6)",
59008
+ border: "2px solid var(--bulma-link-on-scheme, var(--bulma-link, #3b82f6))",
59008
59009
  background: "rgba(59, 130, 246, 0.12)"
59009
59010
  },
59010
59011
  shape: (id, element_type, element) => {
@@ -59012,8 +59013,8 @@ function refresh_minimap(gobj) {
59012
59013
  try {
59013
59014
  let nd = graph.getNodeData(id);
59014
59015
  let size = nd && nd.style && nd.style.size || [120, 60];
59015
- let color = nd && nd.data && nd.data.desc && nd.data.desc.color || "#94a3b8";
59016
- if (is_more_node(nd)) color = "rgba(148, 163, 184, 0.35)";
59016
+ let color = port_rim(nd && nd.data && nd.data.desc && nd.data.desc.color || "#94a3b8", priv.theme);
59017
+ if (is_more_node(nd)) color = priv.theme === "dark" ? "rgba(148, 163, 184, 0.60)" : "rgba(71, 85, 105, 0.65)";
59017
59018
  return new Rect({ style: {
59018
59019
  x: -size[0] / 2,
59019
59020
  y: -size[1] / 2,
@@ -60858,6 +60859,10 @@ function ac_theme$1(gobj, event, kw, src) {
60858
60859
  refresh_default_edges_theme(gobj, theme);
60859
60860
  refresh_port_rims(gobj, theme);
60860
60861
  repaint_more_chips(gobj);
60862
+ if (graph_get_plugin(gobj, "minimap")) {
60863
+ graph_remove_plugin(gobj, "minimap");
60864
+ refresh_minimap(gobj);
60865
+ }
60861
60866
  graph_draw(gobj).then(() => {
60862
60867
  update_history_buttons(gobj);
60863
60868
  });
@@ -61876,6 +61881,13 @@ var attrs_table$3 = [
61876
61881
  SDATA(data_type_t.DTP_BOOLEAN, "with_treedb_tables", 0, false, "Include treedb tables"),
61877
61882
  SDATA(data_type_t.DTP_INTEGER, "expand_depth", 0, 2, "Levels of the treedb open when it loads: 1 = the roots alone, 2 = the roots and their children. Forwarded to the G6 child"),
61878
61883
  SDATA(data_type_t.DTP_INTEGER, "fold_page_size", 0, 24, "Children of one hook shown per page in the graph; a `+N` chip opens the next page. Forwarded to the G6 child"),
61884
+ SDATA(data_type_t.DTP_INTEGER, "minimap_min_nodes", 0, 30, "Show the minimap from this many nodes on (0 = never). Forwarded to the G6 child"),
61885
+ SDATA(data_type_t.DTP_BOOLEAN, "with_gridline", 0, true, "Draw the grid under the graph. Forwarded to the G6 child"),
61886
+ SDATA(data_type_t.DTP_BOOLEAN, "with_fullscreen", 0, true, "Offer the full-screen button. Forwarded to the G6 child"),
61887
+ SDATA(data_type_t.DTP_BOOLEAN, "with_toolbar", 0, true, "Float the camera toolbar over the canvas. Forwarded to the G6 child"),
61888
+ SDATA(data_type_t.DTP_STRING, "toolbar_position", 0, "right-top", "Where that toolbar floats: top-left, top-right, bottom-left, bottom-right, left-top, right-top. Forwarded to the G6 child"),
61889
+ SDATA(data_type_t.DTP_BOOLEAN, "confirm_delete_node", 0, true, "Ask before deleting a node. Forwarded to the G6 child"),
61890
+ SDATA(data_type_t.DTP_BOOLEAN, "confirm_unlink_edge", 0, true, "Ask before unlinking an edge. Forwarded to the G6 child"),
61879
61891
  SDATA(data_type_t.DTP_STRING, "operation_mode", sdata_flag_t.SDF_PERSIST, "reading", "Current operation mode (internal behaviour or role). Changed by the user trough the gui."),
61880
61892
  SDATA(data_type_t.DTP_STRING, "layout", sdata_flag_t.SDF_PERSIST, "", "Current graph layout. User preference. Changed by the user through the gui."),
61881
61893
  SDATA(data_type_t.DTP_LIST, "hidden_topics", sdata_flag_t.SDF_PERSIST, "[]", "Topics hidden from the graph (legend). User preference, per treedb"),
@@ -61959,6 +61971,13 @@ function mt_create$3(gobj) {
61959
61971
  fkey_port_position: "top",
61960
61972
  expand_depth: gobj_read_integer_attr(gobj, "expand_depth"),
61961
61973
  fold_page_size: gobj_read_integer_attr(gobj, "fold_page_size"),
61974
+ minimap_min_nodes: gobj_read_integer_attr(gobj, "minimap_min_nodes"),
61975
+ with_gridline: gobj_read_bool_attr(gobj, "with_gridline"),
61976
+ with_fullscreen: gobj_read_bool_attr(gobj, "with_fullscreen"),
61977
+ with_toolbar: gobj_read_bool_attr(gobj, "with_toolbar"),
61978
+ toolbar_position: gobj_read_str_attr(gobj, "toolbar_position"),
61979
+ confirm_delete_node: gobj_read_bool_attr(gobj, "confirm_delete_node"),
61980
+ confirm_unlink_edge: gobj_read_bool_attr(gobj, "confirm_unlink_edge"),
61962
61981
  hidden_topics: gobj_read_attr(gobj, "hidden_topics") || [],
61963
61982
  main_topic: gobj_read_str_attr(gobj, "main_topic") || "",
61964
61983
  loose_topics: gobj_read_attr(gobj, "loose_topics") || [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.91",
3
+ "version": "7.23.93",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -6985,7 +6985,16 @@ function refresh_minimap(gobj)
6985
6985
  bottom: "12px",
6986
6986
  left: "12px",
6987
6987
  background: "var(--bulma-scheme-main, #fff)",
6988
- border: "1px solid var(--bulma-border-weak, #ddd)",
6988
+ /* A mid grey and not a `--bulma-border-*` token: those
6989
+ * are made for a line INSIDE a surface, and this one has
6990
+ * to separate a floating panel from the CANVAS behind
6991
+ * it -- which is near-black in one scheme and white in
6992
+ * the other. `border-weak` was 1.43:1 over the dark
6993
+ * canvas and 1.18 over the light one; every border token
6994
+ * fails at least one of them. This one is 4.6 on both.
6995
+ * (The box-shadow below separates it only where there
6996
+ * is light to cast a shadow on.) */
6997
+ border: "1px solid var(--bulma-text-weak, #94a3b8)",
6989
6998
  borderRadius: "6px",
6990
6999
  boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
6991
7000
  },
@@ -6993,7 +7002,7 @@ function refresh_minimap(gobj)
6993
7002
  * invisible over a dark minimap. A link-coloured outline
6994
7003
  * reads on both. */
6995
7004
  maskStyle: {
6996
- border: "2px solid var(--bulma-link, #3b82f6)",
7005
+ border: "2px solid var(--bulma-link-on-scheme, var(--bulma-link, #3b82f6))",
6997
7006
  background: "rgba(59, 130, 246, 0.12)",
6998
7007
  },
6999
7008
  shape: (id, element_type, element) => {
@@ -7003,12 +7012,24 @@ function refresh_minimap(gobj)
7003
7012
  try {
7004
7013
  let nd = graph.getNodeData(id);
7005
7014
  let size = (nd && nd.style && nd.style.size) || [120, 60];
7006
- let color = (nd && nd.data && nd.data.desc && nd.data.desc.color)
7007
- || "#94a3b8";
7015
+ /* The topic's colour PUSHED TOWARDS THE SURFACE, the
7016
+ * same treatment a port's rim takes: a block here is
7017
+ * the topic colour on the panel's own background, and
7018
+ * on the light scheme the palette's yellow was 1.61:1
7019
+ * on white -- a minimap whose content could not be
7020
+ * told from its paper. 3.80 in light, 9.11 in dark. */
7021
+ let color = port_rim(
7022
+ (nd && nd.data && nd.data.desc && nd.data.desc.color) || "#94a3b8",
7023
+ priv.theme
7024
+ );
7008
7025
  if(is_more_node(nd)) {
7009
- /* A `+N` chip is a cut, not a card: a faint
7010
- * mark at that scale. */
7011
- color = "rgba(148, 163, 184, 0.35)";
7026
+ /* A `+N` chip is a cut, not a card: quieter than a
7027
+ * block, and still visible. The slate had to become
7028
+ * a DARK slate on a white panel -- raising the alpha
7029
+ * of the light one only ever reached 1.86. */
7030
+ color = (priv.theme === "dark")
7031
+ ? "rgba(148, 163, 184, 0.60)" /* 3.35:1 */
7032
+ : "rgba(71, 85, 105, 0.65)"; /* 3.19:1 */
7012
7033
  }
7013
7034
  return new RectGeometry({
7014
7035
  style: {
@@ -9809,6 +9830,14 @@ function ac_theme(gobj, event, kw, src)
9809
9830
  refresh_port_rims(gobj, theme);
9810
9831
  repaint_more_chips(gobj);
9811
9832
 
9833
+ /* The minimap paints its blocks from the theme (see its `shape`),
9834
+ * and it is created ONCE: rebuilt, or it keeps the colours of the
9835
+ * scheme it was born in. */
9836
+ if(graph_get_plugin(gobj, "minimap")) {
9837
+ graph_remove_plugin(gobj, "minimap");
9838
+ refresh_minimap(gobj);
9839
+ }
9840
+
9812
9841
  graph_draw(gobj).then(() => {
9813
9842
  // Restore toolbar icon states lost when G6 re-renders the DOM
9814
9843
  update_history_buttons(gobj);
@@ -115,6 +115,19 @@ SDATA(data_type_t.DTP_BOOLEAN, "with_treedb_tables",0, false, "Include treedb
115
115
  SDATA(data_type_t.DTP_INTEGER, "expand_depth", 0, 2, "Levels of the treedb open when it loads: 1 = the roots alone, 2 = the roots and their children. Forwarded to the G6 child"),
116
116
  SDATA(data_type_t.DTP_INTEGER, "fold_page_size", 0, 24, "Children of one hook shown per page in the graph; a `+N` chip opens the next page. Forwarded to the G6 child"),
117
117
 
118
+ /*---------------- Forwarded to the G6 child (its own defaults) ----------------*/
119
+ /* Options the ENGINE has always had and no host could reach: this view
120
+ * creates the child, so an option it does not forward is an option that
121
+ * does not exist. The defaults repeat the child's -- a host that says
122
+ * nothing gets exactly what it got before. */
123
+ SDATA(data_type_t.DTP_INTEGER, "minimap_min_nodes", 0, 30, "Show the minimap from this many nodes on (0 = never). Forwarded to the G6 child"),
124
+ SDATA(data_type_t.DTP_BOOLEAN, "with_gridline", 0, true, "Draw the grid under the graph. Forwarded to the G6 child"),
125
+ SDATA(data_type_t.DTP_BOOLEAN, "with_fullscreen", 0, true, "Offer the full-screen button. Forwarded to the G6 child"),
126
+ SDATA(data_type_t.DTP_BOOLEAN, "with_toolbar", 0, true, "Float the camera toolbar over the canvas. Forwarded to the G6 child"),
127
+ SDATA(data_type_t.DTP_STRING, "toolbar_position", 0, "right-top", "Where that toolbar floats: top-left, top-right, bottom-left, bottom-right, left-top, right-top. Forwarded to the G6 child"),
128
+ SDATA(data_type_t.DTP_BOOLEAN, "confirm_delete_node", 0, true, "Ask before deleting a node. Forwarded to the G6 child"),
129
+ SDATA(data_type_t.DTP_BOOLEAN, "confirm_unlink_edge", 0, true, "Ask before unlinking an edge. Forwarded to the G6 child"),
130
+
118
131
  /*---------------- User last selections ----------------*/
119
132
  SDATA(data_type_t.DTP_STRING, "operation_mode", sdata_flag_t.SDF_PERSIST, "reading", "Current operation mode (internal behaviour or role). Changed by the user trough the gui."),
120
133
  SDATA(data_type_t.DTP_STRING, "layout", sdata_flag_t.SDF_PERSIST, "", "Current graph layout. User preference. Changed by the user through the gui."),
@@ -256,6 +269,13 @@ function mt_create(gobj)
256
269
  fkey_port_position: "top",
257
270
  expand_depth: gobj_read_integer_attr(gobj, "expand_depth"),
258
271
  fold_page_size: gobj_read_integer_attr(gobj, "fold_page_size"),
272
+ minimap_min_nodes: gobj_read_integer_attr(gobj, "minimap_min_nodes"),
273
+ with_gridline: gobj_read_bool_attr(gobj, "with_gridline"),
274
+ with_fullscreen: gobj_read_bool_attr(gobj, "with_fullscreen"),
275
+ with_toolbar: gobj_read_bool_attr(gobj, "with_toolbar"),
276
+ toolbar_position: gobj_read_str_attr(gobj, "toolbar_position"),
277
+ confirm_delete_node: gobj_read_bool_attr(gobj, "confirm_delete_node"),
278
+ confirm_unlink_edge: gobj_read_bool_attr(gobj, "confirm_unlink_edge"),
259
279
  hidden_topics: gobj_read_attr(gobj, "hidden_topics") || [],
260
280
  main_topic: gobj_read_str_attr(gobj, "main_topic") || "",
261
281
  loose_topics: gobj_read_attr(gobj, "loose_topics") || [],