@yuneta/gobj-ui 7.19.0 → 7.19.2

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.
@@ -57017,6 +57017,19 @@ function refresh_minimap(gobj) {
57017
57017
  graph_add_plugin(gobj, "minimap", {
57018
57018
  size: [200, 140],
57019
57019
  position: "bottom-left",
57020
+ containerStyle: {
57021
+ top: "auto",
57022
+ bottom: "12px",
57023
+ left: "12px",
57024
+ background: "var(--bulma-scheme-main, #fff)",
57025
+ border: "1px solid var(--bulma-border-weak, #ddd)",
57026
+ borderRadius: "6px",
57027
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
57028
+ },
57029
+ maskStyle: {
57030
+ border: "2px solid var(--bulma-link, #3b82f6)",
57031
+ background: "rgba(59, 130, 246, 0.12)"
57032
+ },
57020
57033
  shape: (id, element_type, element) => {
57021
57034
  if (element_type !== "node") return element;
57022
57035
  try {
@@ -57004,6 +57004,19 @@ function refresh_minimap(gobj) {
57004
57004
  graph_add_plugin(gobj, "minimap", {
57005
57005
  size: [200, 140],
57006
57006
  position: "bottom-left",
57007
+ containerStyle: {
57008
+ top: "auto",
57009
+ bottom: "12px",
57010
+ left: "12px",
57011
+ background: "var(--bulma-scheme-main, #fff)",
57012
+ border: "1px solid var(--bulma-border-weak, #ddd)",
57013
+ borderRadius: "6px",
57014
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
57015
+ },
57016
+ maskStyle: {
57017
+ border: "2px solid var(--bulma-link, #3b82f6)",
57018
+ background: "rgba(59, 130, 246, 0.12)"
57019
+ },
57007
57020
  shape: (id, element_type, element) => {
57008
57021
  if (element_type !== "node") return element;
57009
57022
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.19.0",
3
+ "version": "7.19.2",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -5166,6 +5166,43 @@ function refresh_minimap(gobj)
5166
5166
  {
5167
5167
  size: [200, 140],
5168
5168
  position: "bottom-left",
5169
+ /*
5170
+ * The anchor has to be CSS, not the pixels G6 computes.
5171
+ *
5172
+ * `createPluginCanvas` turns `position` into `left`/`top`
5173
+ * in PIXELS, once, from the canvas size at creation
5174
+ * (`xRatio * (W - width)`). The container then grows --
5175
+ * full screen, a window resize, a panel closing -- and the
5176
+ * minimap stays at the `top` it was given: measured going
5177
+ * full screen, `top` was still `511px` over a container
5178
+ * that had become 768 tall, which put it floating halfway
5179
+ * up the left edge, on top of the graph it is there to
5180
+ * explain.
5181
+ *
5182
+ * `containerStyle` is merged AFTER those pixels, so
5183
+ * `top: auto` + `bottom` is a real anchor the browser
5184
+ * keeps for every size the container ever takes.
5185
+ *
5186
+ * And it follows the theme: G6's default is a `#fff` box
5187
+ * with a `#ddd` border in BOTH themes, which over a
5188
+ * near-black canvas is the brightest thing on screen.
5189
+ */
5190
+ containerStyle: {
5191
+ top: "auto",
5192
+ bottom: "12px",
5193
+ left: "12px",
5194
+ background: "var(--bulma-scheme-main, #fff)",
5195
+ border: "1px solid var(--bulma-border-weak, #ddd)",
5196
+ borderRadius: "6px",
5197
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
5198
+ },
5199
+ /* The viewport rectangle: G6 washes it in black, which is
5200
+ * invisible over a dark minimap. A link-coloured outline
5201
+ * reads on both. */
5202
+ maskStyle: {
5203
+ border: "2px solid var(--bulma-link, #3b82f6)",
5204
+ background: "rgba(59, 130, 246, 0.12)",
5205
+ },
5169
5206
  shape: (id, element_type, element) => {
5170
5207
  if(element_type !== "node") {
5171
5208
  return element; /* edges clone themselves fine */
package/src/lib_graph.css CHANGED
@@ -30,6 +30,36 @@
30
30
  * G6 injects `:not(:root):fullscreen::backdrop { background: transparent }`
31
31
  * with lower specificity, so class + pseudo-class wins without !important.
32
32
  */
33
+ /*
34
+ * A shift+click on a card must SELECT THE CARD, not smear a text
35
+ * selection across the graph.
36
+ *
37
+ * Shift+click is the browser's own "extend the text selection"
38
+ * gesture, and the cards are DOM. So the moment shift+click came to
39
+ * mean something here, marking three nodes also painted their labels
40
+ * blue -- and the wash stayed until the next click somewhere else.
41
+ * The canvas is a canvas: nothing in it is prose.
42
+ *
43
+ * Except what IS there to be read or typed into. The popovers this
44
+ * gclass appends to the same container carry record data an operator
45
+ * may well want to copy, and inputs need a caret.
46
+ */
47
+ .graph-container {
48
+ -webkit-user-select: none;
49
+ user-select: none;
50
+ }
51
+ .graph-container input,
52
+ .graph-container textarea,
53
+ .graph-container select,
54
+ .graph-container [contenteditable],
55
+ .graph-container .g6-confirm-popover,
56
+ .graph-container .g6-create-popover,
57
+ .graph-container .g6-node-popover,
58
+ .graph-container .g6-edge-popover {
59
+ -webkit-user-select: text;
60
+ user-select: text;
61
+ }
62
+
33
63
  .graph-container:fullscreen {
34
64
  background-color: var(--bulma-background, #fff);
35
65
  }
@@ -95,6 +125,17 @@
95
125
  min-width: 20px;
96
126
  }
97
127
  .g6-toolbar.g6-toolbar-large .g6-toolbar-text {
128
+ /*
129
+ * The click has to land on the ITEM, not on this.
130
+ *
131
+ * G6's toolbar fires `onClick` only when the pressed element's own
132
+ * class list contains `g6-toolbar-item` -- which is why its CSS
133
+ * gives the icon `<svg>` `pointer-events: none`. A text glyph
134
+ * needs the same rule for the same reason: without it the press
135
+ * lands on this span, the class does not match, and the button is
136
+ * simply dead. `1:1` shipped that way.
137
+ */
138
+ pointer-events: none;
98
139
  display: block;
99
140
  line-height: 20px;
100
141
  font-size: 0.8125rem;