@yuneta/gobj-ui 7.23.107 → 7.23.109

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.
@@ -3112,10 +3112,11 @@ function yui_shell_show_modal(shell, content, opts) {
3112
3112
  }]);
3113
3113
  }
3114
3114
  let logical = opts && opts.logical_class || "";
3115
+ let wide = !!(opts && opts.wide);
3115
3116
  let $modal = (0, _yuneta_gobj_js.createElement2)([
3116
3117
  "div",
3117
3118
  {
3118
- class: "MODAL" + (logical ? " " + logical : "") + " modal yui-modal" + (dialog ? " yui-dialog" : "") + " is-active",
3119
+ class: "MODAL" + (logical ? " " + logical : "") + " modal yui-modal" + (dialog ? " yui-dialog" : "") + (dialog && wide ? " yui-dialog-wide" : "") + " is-active",
3119
3120
  role: "dialog",
3120
3121
  "aria-modal": "true"
3121
3122
  },
@@ -10765,6 +10766,51 @@ function yui_graph_update_zoom($container, graph) {
10765
10766
  $readout.textContent = yui_graph_zoom_text(graph);
10766
10767
  }
10767
10768
  /************************************************************
10769
+ * THE WHEEL SCROLLS; CTRL + WHEEL ZOOMS. In every graph.
10770
+ *
10771
+ * The vocabulary of a camera is one vocabulary or it is
10772
+ * nothing: this file exists because the three graphs of the
10773
+ * library were each naming the same gestures differently, and
10774
+ * the wheel was the last one left -- `C_G6_NODES_TREE` scrolled
10775
+ * with it since 7.23.75 while the json graph and the gobj tree
10776
+ * went on zooming.
10777
+ *
10778
+ * Why scroll and not zoom: a graph of many nodes is taller than
10779
+ * the screen, and a wheel that zoomed made it a thing to be
10780
+ * looked at from afar or read through a keyhole -- never
10781
+ * scrolled, which is what a wheel does on a map and on every
10782
+ * page. Zoom is Ctrl + wheel (what a trackpad pinch arrives
10783
+ * as), the toolbar's +/-, and the two-finger pinch.
10784
+ *
10785
+ * Two things this pair has learnt, both the hard way:
10786
+ *
10787
+ * - `enable` on the scroll is what keeps the two apart, and the
10788
+ * two must name the SAME key or the gesture falls between
10789
+ * them: the scroll once stood aside for Meta as well while
10790
+ * the zoom listened for Control alone, so Cmd + wheel neither
10791
+ * scrolled nor zoomed. It is ONE key because a G6 `trigger`
10792
+ * is a CHORD, not a list of alternatives -- `Shortcut.match()`
10793
+ * compares the held keys to the bound ones as a SET.
10794
+ * - `animation: false` on the zoom. The house rule first
10795
+ * (nothing here slides), and then the anchor: `aftertransform`
10796
+ * fires while G6's 200ms easing is still running, so a
10797
+ * re-centring measured a camera that was still moving --
10798
+ * passes of -272, +411, +183, oscillating because the ground
10799
+ * moved between two reads.
10800
+ ************************************************************/
10801
+ function yui_graph_camera_behaviors() {
10802
+ return [{
10803
+ type: "scroll-canvas",
10804
+ key: "scroll-canvas",
10805
+ enable: (event) => !(event && event.ctrlKey)
10806
+ }, {
10807
+ type: "zoom-canvas",
10808
+ key: "zoom-canvas",
10809
+ trigger: ["Control"],
10810
+ animation: false
10811
+ }];
10812
+ }
10813
+ /************************************************************
10768
10814
  * The camera cluster: zoom in, zoom out, readout, fit,
10769
10815
  * actual size. Returns createElement2 specs, in order.
10770
10816
  *
@@ -12053,16 +12099,13 @@ function build_cell_html(key, value, type, dark, matched, fold) {
12053
12099
  * forever. `+3` and `−` need no language.
12054
12100
  ************************************************************/
12055
12101
  var FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
12056
- var ZOOM_CANVAS$1 = {
12057
- type: "zoom-canvas",
12058
- animation: false
12059
- };
12102
+ var CAMERA$1 = yui_graph_camera_behaviors();
12060
12103
  var BEHAVIORS_READING$1 = [
12061
12104
  "drag-canvas",
12062
- ZOOM_CANVAS$1,
12105
+ ...CAMERA$1,
12063
12106
  "drag-element"
12064
12107
  ];
12065
- var BEHAVIORS_PICKING$1 = ["drag-canvas", ZOOM_CANVAS$1];
12108
+ var BEHAVIORS_PICKING$1 = ["drag-canvas", ...CAMERA$1];
12066
12109
  var CARD_HEADER_H$1 = 24;
12067
12110
  var CARD_ROW_H$1 = 22;
12068
12111
  var H_GAP = 60;
@@ -17627,16 +17670,13 @@ var attrs_table$9 = [
17627
17670
  (0, _yuneta_gobj_js.SDATA)(_yuneta_gobj_js.data_type_t.DTP_INTEGER, "collapse_threshold", 0, 10, "Auto-collapse a node whose direct children exceed this number. 0 disables auto-collapse."),
17628
17671
  (0, _yuneta_gobj_js.SDATA_END)()
17629
17672
  ];
17630
- var ZOOM_CANVAS = {
17631
- type: "zoom-canvas",
17632
- animation: false
17633
- };
17673
+ var CAMERA = yui_graph_camera_behaviors();
17634
17674
  var BEHAVIORS_READING = [
17635
17675
  "drag-canvas",
17636
- ZOOM_CANVAS,
17676
+ ...CAMERA,
17637
17677
  "drag-element"
17638
17678
  ];
17639
- var BEHAVIORS_PICKING = ["drag-canvas", ZOOM_CANVAS];
17679
+ var BEHAVIORS_PICKING = ["drag-canvas", ...CAMERA];
17640
17680
  var VIEW_STORE_PREFIX = "yui_gobj_tree_view:";
17641
17681
  function view_store_key(gobj) {
17642
17682
  return VIEW_STORE_PREFIX + (0, _yuneta_gobj_js.gobj_name)(gobj);
@@ -55730,38 +55770,16 @@ function build_ports(gobj, desc) {
55730
55770
  ************************************************************/
55731
55771
  var LR_LAYOUTS = ["dagre"];
55732
55772
  /************************************************************
55733
- * The camera behaviors every operation mode shares.
55734
- *
55735
- * The wheel SCROLLS, as it does on a map and on every page: a
55736
- * graph of many nodes is taller than the screen, and a wheel
55737
- * that zoomed instead made it a thing to be looked at from afar
55738
- * or read through a keyhole -- never scrolled. Zoom is Ctrl +
55739
- * wheel (which is also what a trackpad pinch arrives as), the
55740
- * toolbar's +/-, and the two-finger pinch of g6_touch_gestures.
55741
- * `enable` on the scroll keeps the two apart: a Ctrl wheel is
55742
- * the zoom's, so the scroll stands aside for it.
55743
- *
55744
- * And the two have to name the SAME key, or the gesture falls
55745
- * between them: the scroll stood aside for Meta as well, while
55746
- * the zoom listened for Control alone, so Cmd + wheel neither
55747
- * scrolled nor zoomed. It is ONE key and not two because a G6
55748
- * `trigger` is a CHORD, not a list of alternatives -- its
55749
- * `Shortcut.match()` compares the held keys to the bound ones
55750
- * as a SET, so ["Control", "Meta"] means both keys down at
55751
- * once. Control it is, on every platform: it is what a
55752
- * trackpad pinch arrives as, so a Mac keeps its pinch and
55753
- * gains nothing to press by mistake.
55773
+ * The camera behaviors every operation mode shares: the wheel
55774
+ * SCROLLS and Ctrl + wheel zooms.
55775
+ *
55776
+ * Written in `yui_graph_camera.js` now, with the reasoning and
55777
+ * the two traps, so the json graph and the gobj tree speak it
55778
+ * too. It was the last gesture of the camera that this graph
55779
+ * said one way and its siblings another.
55754
55780
  ************************************************************/
55755
55781
  function camera_behaviors() {
55756
- return [{
55757
- type: "scroll-canvas",
55758
- key: "scroll-canvas",
55759
- enable: (event) => !(event && event.ctrlKey)
55760
- }, {
55761
- type: "zoom-canvas",
55762
- key: "zoom-canvas",
55763
- trigger: ["Control"]
55764
- }];
55782
+ return yui_graph_camera_behaviors();
55765
55783
  }
55766
55784
  function layout_direction(gobj) {
55767
55785
  return (0, _yuneta_gobj_js.str_in_list)(LR_LAYOUTS, gobj.priv.layout) ? "LR" : "TB";
@@ -3107,10 +3107,11 @@ function yui_shell_show_modal(shell, content, opts) {
3107
3107
  }]);
3108
3108
  }
3109
3109
  let logical = opts && opts.logical_class || "";
3110
+ let wide = !!(opts && opts.wide);
3110
3111
  let $modal = createElement2([
3111
3112
  "div",
3112
3113
  {
3113
- class: "MODAL" + (logical ? " " + logical : "") + " modal yui-modal" + (dialog ? " yui-dialog" : "") + " is-active",
3114
+ class: "MODAL" + (logical ? " " + logical : "") + " modal yui-modal" + (dialog ? " yui-dialog" : "") + (dialog && wide ? " yui-dialog-wide" : "") + " is-active",
3114
3115
  role: "dialog",
3115
3116
  "aria-modal": "true"
3116
3117
  },
@@ -10760,6 +10761,51 @@ function yui_graph_update_zoom($container, graph) {
10760
10761
  $readout.textContent = yui_graph_zoom_text(graph);
10761
10762
  }
10762
10763
  /************************************************************
10764
+ * THE WHEEL SCROLLS; CTRL + WHEEL ZOOMS. In every graph.
10765
+ *
10766
+ * The vocabulary of a camera is one vocabulary or it is
10767
+ * nothing: this file exists because the three graphs of the
10768
+ * library were each naming the same gestures differently, and
10769
+ * the wheel was the last one left -- `C_G6_NODES_TREE` scrolled
10770
+ * with it since 7.23.75 while the json graph and the gobj tree
10771
+ * went on zooming.
10772
+ *
10773
+ * Why scroll and not zoom: a graph of many nodes is taller than
10774
+ * the screen, and a wheel that zoomed made it a thing to be
10775
+ * looked at from afar or read through a keyhole -- never
10776
+ * scrolled, which is what a wheel does on a map and on every
10777
+ * page. Zoom is Ctrl + wheel (what a trackpad pinch arrives
10778
+ * as), the toolbar's +/-, and the two-finger pinch.
10779
+ *
10780
+ * Two things this pair has learnt, both the hard way:
10781
+ *
10782
+ * - `enable` on the scroll is what keeps the two apart, and the
10783
+ * two must name the SAME key or the gesture falls between
10784
+ * them: the scroll once stood aside for Meta as well while
10785
+ * the zoom listened for Control alone, so Cmd + wheel neither
10786
+ * scrolled nor zoomed. It is ONE key because a G6 `trigger`
10787
+ * is a CHORD, not a list of alternatives -- `Shortcut.match()`
10788
+ * compares the held keys to the bound ones as a SET.
10789
+ * - `animation: false` on the zoom. The house rule first
10790
+ * (nothing here slides), and then the anchor: `aftertransform`
10791
+ * fires while G6's 200ms easing is still running, so a
10792
+ * re-centring measured a camera that was still moving --
10793
+ * passes of -272, +411, +183, oscillating because the ground
10794
+ * moved between two reads.
10795
+ ************************************************************/
10796
+ function yui_graph_camera_behaviors() {
10797
+ return [{
10798
+ type: "scroll-canvas",
10799
+ key: "scroll-canvas",
10800
+ enable: (event) => !(event && event.ctrlKey)
10801
+ }, {
10802
+ type: "zoom-canvas",
10803
+ key: "zoom-canvas",
10804
+ trigger: ["Control"],
10805
+ animation: false
10806
+ }];
10807
+ }
10808
+ /************************************************************
10763
10809
  * The camera cluster: zoom in, zoom out, readout, fit,
10764
10810
  * actual size. Returns createElement2 specs, in order.
10765
10811
  *
@@ -12048,16 +12094,13 @@ function build_cell_html(key, value, type, dark, matched, fold) {
12048
12094
  * forever. `+3` and `−` need no language.
12049
12095
  ************************************************************/
12050
12096
  var FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
12051
- var ZOOM_CANVAS$1 = {
12052
- type: "zoom-canvas",
12053
- animation: false
12054
- };
12097
+ var CAMERA$1 = yui_graph_camera_behaviors();
12055
12098
  var BEHAVIORS_READING$1 = [
12056
12099
  "drag-canvas",
12057
- ZOOM_CANVAS$1,
12100
+ ...CAMERA$1,
12058
12101
  "drag-element"
12059
12102
  ];
12060
- var BEHAVIORS_PICKING$1 = ["drag-canvas", ZOOM_CANVAS$1];
12103
+ var BEHAVIORS_PICKING$1 = ["drag-canvas", ...CAMERA$1];
12061
12104
  var CARD_HEADER_H$1 = 24;
12062
12105
  var CARD_ROW_H$1 = 22;
12063
12106
  var H_GAP = 60;
@@ -17622,16 +17665,13 @@ var attrs_table$9 = [
17622
17665
  SDATA(data_type_t.DTP_INTEGER, "collapse_threshold", 0, 10, "Auto-collapse a node whose direct children exceed this number. 0 disables auto-collapse."),
17623
17666
  SDATA_END()
17624
17667
  ];
17625
- var ZOOM_CANVAS = {
17626
- type: "zoom-canvas",
17627
- animation: false
17628
- };
17668
+ var CAMERA = yui_graph_camera_behaviors();
17629
17669
  var BEHAVIORS_READING = [
17630
17670
  "drag-canvas",
17631
- ZOOM_CANVAS,
17671
+ ...CAMERA,
17632
17672
  "drag-element"
17633
17673
  ];
17634
- var BEHAVIORS_PICKING = ["drag-canvas", ZOOM_CANVAS];
17674
+ var BEHAVIORS_PICKING = ["drag-canvas", ...CAMERA];
17635
17675
  var VIEW_STORE_PREFIX = "yui_gobj_tree_view:";
17636
17676
  function view_store_key(gobj) {
17637
17677
  return VIEW_STORE_PREFIX + gobj_name(gobj);
@@ -55725,38 +55765,16 @@ function build_ports(gobj, desc) {
55725
55765
  ************************************************************/
55726
55766
  var LR_LAYOUTS = ["dagre"];
55727
55767
  /************************************************************
55728
- * The camera behaviors every operation mode shares.
55729
- *
55730
- * The wheel SCROLLS, as it does on a map and on every page: a
55731
- * graph of many nodes is taller than the screen, and a wheel
55732
- * that zoomed instead made it a thing to be looked at from afar
55733
- * or read through a keyhole -- never scrolled. Zoom is Ctrl +
55734
- * wheel (which is also what a trackpad pinch arrives as), the
55735
- * toolbar's +/-, and the two-finger pinch of g6_touch_gestures.
55736
- * `enable` on the scroll keeps the two apart: a Ctrl wheel is
55737
- * the zoom's, so the scroll stands aside for it.
55738
- *
55739
- * And the two have to name the SAME key, or the gesture falls
55740
- * between them: the scroll stood aside for Meta as well, while
55741
- * the zoom listened for Control alone, so Cmd + wheel neither
55742
- * scrolled nor zoomed. It is ONE key and not two because a G6
55743
- * `trigger` is a CHORD, not a list of alternatives -- its
55744
- * `Shortcut.match()` compares the held keys to the bound ones
55745
- * as a SET, so ["Control", "Meta"] means both keys down at
55746
- * once. Control it is, on every platform: it is what a
55747
- * trackpad pinch arrives as, so a Mac keeps its pinch and
55748
- * gains nothing to press by mistake.
55768
+ * The camera behaviors every operation mode shares: the wheel
55769
+ * SCROLLS and Ctrl + wheel zooms.
55770
+ *
55771
+ * Written in `yui_graph_camera.js` now, with the reasoning and
55772
+ * the two traps, so the json graph and the gobj tree speak it
55773
+ * too. It was the last gesture of the camera that this graph
55774
+ * said one way and its siblings another.
55749
55775
  ************************************************************/
55750
55776
  function camera_behaviors() {
55751
- return [{
55752
- type: "scroll-canvas",
55753
- key: "scroll-canvas",
55754
- enable: (event) => !(event && event.ctrlKey)
55755
- }, {
55756
- type: "zoom-canvas",
55757
- key: "zoom-canvas",
55758
- trigger: ["Control"]
55759
- }];
55777
+ return yui_graph_camera_behaviors();
55760
55778
  }
55761
55779
  function layout_direction(gobj) {
55762
55780
  return str_in_list(LR_LAYOUTS, gobj.priv.layout) ? "LR" : "TB";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.107",
3
+ "version": "7.23.109",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -110,6 +110,7 @@ import {delete_impact} from "./delete_impact.js";
110
110
  import {
111
111
  yui_graph_center_on,
112
112
  yui_graph_viewport_of,
113
+ yui_graph_camera_behaviors,
113
114
  yui_graph_place_at,
114
115
  } from "./yui_graph_camera.js";
115
116
  import {
@@ -1955,42 +1956,17 @@ function build_ports(gobj, desc)
1955
1956
  const LR_LAYOUTS = ["dagre"];
1956
1957
 
1957
1958
  /************************************************************
1958
- * The camera behaviors every operation mode shares.
1959
+ * The camera behaviors every operation mode shares: the wheel
1960
+ * SCROLLS and Ctrl + wheel zooms.
1959
1961
  *
1960
- * The wheel SCROLLS, as it does on a map and on every page: a
1961
- * graph of many nodes is taller than the screen, and a wheel
1962
- * that zoomed instead made it a thing to be looked at from afar
1963
- * or read through a keyhole -- never scrolled. Zoom is Ctrl +
1964
- * wheel (which is also what a trackpad pinch arrives as), the
1965
- * toolbar's +/-, and the two-finger pinch of g6_touch_gestures.
1966
- * `enable` on the scroll keeps the two apart: a Ctrl wheel is
1967
- * the zoom's, so the scroll stands aside for it.
1968
- *
1969
- * And the two have to name the SAME key, or the gesture falls
1970
- * between them: the scroll stood aside for Meta as well, while
1971
- * the zoom listened for Control alone, so Cmd + wheel neither
1972
- * scrolled nor zoomed. It is ONE key and not two because a G6
1973
- * `trigger` is a CHORD, not a list of alternatives -- its
1974
- * `Shortcut.match()` compares the held keys to the bound ones
1975
- * as a SET, so ["Control", "Meta"] means both keys down at
1976
- * once. Control it is, on every platform: it is what a
1977
- * trackpad pinch arrives as, so a Mac keeps its pinch and
1978
- * gains nothing to press by mistake.
1962
+ * Written in `yui_graph_camera.js` now, with the reasoning and
1963
+ * the two traps, so the json graph and the gobj tree speak it
1964
+ * too. It was the last gesture of the camera that this graph
1965
+ * said one way and its siblings another.
1979
1966
  ************************************************************/
1980
1967
  function camera_behaviors()
1981
1968
  {
1982
- return [
1983
- {
1984
- type: "scroll-canvas",
1985
- key: "scroll-canvas",
1986
- enable: (event) => !(event && event.ctrlKey),
1987
- },
1988
- {
1989
- type: "zoom-canvas",
1990
- key: "zoom-canvas",
1991
- trigger: ["Control"],
1992
- },
1993
- ];
1969
+ return yui_graph_camera_behaviors();
1994
1970
  }
1995
1971
 
1996
1972
  function layout_direction(gobj)
@@ -58,6 +58,7 @@ 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,
61
+ yui_graph_camera_behaviors,
61
62
  yui_graph_anchor_item,
62
63
  yui_graph_update_anchor,
63
64
  yui_graph_center_on,
@@ -130,10 +131,15 @@ SDATA_END()
130
131
  * reads the easing had moved the ground. With the zoom instantaneous
131
132
  * the camera is still by the time anything measures it.
132
133
  */
133
- const ZOOM_CANVAS = {type: 'zoom-canvas', animation: false};
134
-
135
- const BEHAVIORS_READING = ['drag-canvas', ZOOM_CANVAS, 'drag-element'];
136
- const BEHAVIORS_PICKING = ['drag-canvas', ZOOM_CANVAS];
134
+ /* The wheel SCROLLS and Ctrl + wheel zooms, like every other graph
135
+ * of the library: the pair, and the reasoning, live in
136
+ * `yui_graph_camera.js`. This view used to zoom on a bare wheel --
137
+ * the same gesture meaning two different things in two graphs a
138
+ * reader has open side by side. */
139
+ const CAMERA = yui_graph_camera_behaviors();
140
+
141
+ const BEHAVIORS_READING = ['drag-canvas', ...CAMERA, 'drag-element'];
142
+ const BEHAVIORS_PICKING = ['drag-canvas', ...CAMERA];
137
143
 
138
144
  /*
139
145
  * Where this view is remembered between visits.
@@ -51,6 +51,7 @@ import {yui_toolbar, yui_toolbar_icon} from "./yui_toolbar.js";
51
51
  import {attach_clear} from "./yui_inputs.js";
52
52
  import {
53
53
  yui_graph_camera_items,
54
+ yui_graph_camera_behaviors,
54
55
  yui_graph_anchor_item,
55
56
  yui_graph_update_anchor,
56
57
  yui_graph_center_on,
@@ -978,10 +979,15 @@ const FOLD_SPACER = `<span style="width:24px; flex:0 0 auto;"></span>`;
978
979
  * reads the easing had moved the ground. With the zoom instantaneous
979
980
  * the camera is still by the time anything measures it.
980
981
  */
981
- const ZOOM_CANVAS = {type: 'zoom-canvas', animation: false};
982
-
983
- const BEHAVIORS_READING = ['drag-canvas', ZOOM_CANVAS, 'drag-element'];
984
- const BEHAVIORS_PICKING = ['drag-canvas', ZOOM_CANVAS];
982
+ /* The wheel SCROLLS and Ctrl + wheel zooms, like every other graph
983
+ * of the library: the pair, and the reasoning, live in
984
+ * `yui_graph_camera.js`. This view used to zoom on a bare wheel --
985
+ * the same gesture meaning two different things in two graphs a
986
+ * reader has open side by side. */
987
+ const CAMERA = yui_graph_camera_behaviors();
988
+
989
+ const BEHAVIORS_READING = ['drag-canvas', ...CAMERA, 'drag-element'];
990
+ const BEHAVIORS_PICKING = ['drag-canvas', ...CAMERA];
985
991
 
986
992
  /*
987
993
  * The card's geometry, in ONE place.
@@ -755,6 +755,12 @@ textarea::placeholder {
755
755
  overflow: hidden;
756
756
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
757
757
  }
758
+ /* A dialog holding a DOCUMENT (`opts.wide`): a json viewer, a record, a
759
+ * log. The cap above is a width for a question with two buttons. */
760
+ .yui-dialog.yui-dialog-wide .yui-dialog-content {
761
+ max-width: 1000px;
762
+ }
763
+
758
764
  .yui-dialog-header {
759
765
  display: flex;
760
766
  align-items: center;
@@ -263,9 +263,18 @@ export function yui_shell_show_modal(shell, content, opts)
263
263
  * only this tells one popup from another in the Inspector or a selector. */
264
264
  let logical = (opts && opts.logical_class) || "";
265
265
 
266
+ /* `opts.wide`: a dialog that holds a DOCUMENT and not a form. The
267
+ * 640px of the standard card is a width for a question with two
268
+ * buttons; a json viewer, a log or a record read in it wraps every
269
+ * long value and pushes its own toolbar behind a scroll arrow. It
270
+ * only lifts the desktop cap -- on mobile a dialog is a full-screen
271
+ * sheet already, and the media query below still wins. */
272
+ let wide = !!(opts && opts.wide);
273
+
266
274
  let $modal = createElement2(
267
275
  ["div", {class: "MODAL" + (logical ? " " + logical : "") +
268
- " modal yui-modal" + (dialog ? " yui-dialog" : "") + " is-active",
276
+ " modal yui-modal" + (dialog ? " yui-dialog" : "") +
277
+ (dialog && wide ? " yui-dialog-wide" : "") + " is-active",
269
278
  role: "dialog", "aria-modal": "true"},
270
279
  modal_children
271
280
  ]
@@ -99,6 +99,56 @@ export function yui_graph_update_zoom($container, graph)
99
99
  $readout.textContent = yui_graph_zoom_text(graph);
100
100
  }
101
101
 
102
+ /************************************************************
103
+ * THE WHEEL SCROLLS; CTRL + WHEEL ZOOMS. In every graph.
104
+ *
105
+ * The vocabulary of a camera is one vocabulary or it is
106
+ * nothing: this file exists because the three graphs of the
107
+ * library were each naming the same gestures differently, and
108
+ * the wheel was the last one left -- `C_G6_NODES_TREE` scrolled
109
+ * with it since 7.23.75 while the json graph and the gobj tree
110
+ * went on zooming.
111
+ *
112
+ * Why scroll and not zoom: a graph of many nodes is taller than
113
+ * the screen, and a wheel that zoomed made it a thing to be
114
+ * looked at from afar or read through a keyhole -- never
115
+ * scrolled, which is what a wheel does on a map and on every
116
+ * page. Zoom is Ctrl + wheel (what a trackpad pinch arrives
117
+ * as), the toolbar's +/-, and the two-finger pinch.
118
+ *
119
+ * Two things this pair has learnt, both the hard way:
120
+ *
121
+ * - `enable` on the scroll is what keeps the two apart, and the
122
+ * two must name the SAME key or the gesture falls between
123
+ * them: the scroll once stood aside for Meta as well while
124
+ * the zoom listened for Control alone, so Cmd + wheel neither
125
+ * scrolled nor zoomed. It is ONE key because a G6 `trigger`
126
+ * is a CHORD, not a list of alternatives -- `Shortcut.match()`
127
+ * compares the held keys to the bound ones as a SET.
128
+ * - `animation: false` on the zoom. The house rule first
129
+ * (nothing here slides), and then the anchor: `aftertransform`
130
+ * fires while G6's 200ms easing is still running, so a
131
+ * re-centring measured a camera that was still moving --
132
+ * passes of -272, +411, +183, oscillating because the ground
133
+ * moved between two reads.
134
+ ************************************************************/
135
+ export function yui_graph_camera_behaviors()
136
+ {
137
+ return [
138
+ {
139
+ type: "scroll-canvas",
140
+ key: "scroll-canvas",
141
+ enable: (event) => !(event && event.ctrlKey),
142
+ },
143
+ {
144
+ type: "zoom-canvas",
145
+ key: "zoom-canvas",
146
+ trigger: ["Control"],
147
+ animation: false,
148
+ },
149
+ ];
150
+ }
151
+
102
152
  /************************************************************
103
153
  * The camera cluster: zoom in, zoom out, readout, fit,
104
154
  * actual size. Returns createElement2 specs, in order.