@yuneta/gobj-ui 7.23.106 → 7.23.108

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
  },
@@ -56082,8 +56083,13 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
56082
56083
  let labels = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "node_labels");
56083
56084
  let figure = node_figure_of(gobj, desc, geometry || {});
56084
56085
  let paint = node_paint_of(gobj, desc, geometry);
56085
- let stroke = paint.stroke;
56086
- let line_width = Math.max(paint.lineWidth, 1.5);
56086
+ let fill = dark ? mix_colors(paint.fill, .25, "#2c3542") : mix_colors(paint.fill, .1, "#ffffff");
56087
+ let stroke = dark ? mix_colors(paint.fill, .85, "#ffffff") : paint.fill;
56088
+ let line_width = 2;
56089
+ if (paint.stroke !== getStrokeColor(paint.fill)) {
56090
+ stroke = paint.stroke;
56091
+ line_width = Math.max(paint.lineWidth, 2);
56092
+ }
56087
56093
  if (f.selected) {
56088
56094
  stroke = SELECT_RING;
56089
56095
  line_width = 3;
@@ -56101,7 +56107,7 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
56101
56107
  let style = {
56102
56108
  size: [side, side],
56103
56109
  radius: figure === "square" ? Math.round(side / 5) : 0,
56104
- fill: paint.fill,
56110
+ fill,
56105
56111
  stroke,
56106
56112
  lineWidth: line_width,
56107
56113
  lineDash: dash,
@@ -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
  },
@@ -56077,8 +56078,13 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
56077
56078
  let labels = gobj_read_bool_attr(gobj, "node_labels");
56078
56079
  let figure = node_figure_of(gobj, desc, geometry || {});
56079
56080
  let paint = node_paint_of(gobj, desc, geometry);
56080
- let stroke = paint.stroke;
56081
- let line_width = Math.max(paint.lineWidth, 1.5);
56081
+ let fill = dark ? mix_colors(paint.fill, .25, "#2c3542") : mix_colors(paint.fill, .1, "#ffffff");
56082
+ let stroke = dark ? mix_colors(paint.fill, .85, "#ffffff") : paint.fill;
56083
+ let line_width = 2;
56084
+ if (paint.stroke !== getStrokeColor(paint.fill)) {
56085
+ stroke = paint.stroke;
56086
+ line_width = Math.max(paint.lineWidth, 2);
56087
+ }
56082
56088
  if (f.selected) {
56083
56089
  stroke = SELECT_RING;
56084
56090
  line_width = 3;
@@ -56096,7 +56102,7 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
56096
56102
  let style = {
56097
56103
  size: [side, side],
56098
56104
  radius: figure === "square" ? Math.round(side / 5) : 0,
56099
- fill: paint.fill,
56105
+ fill,
56100
56106
  stroke,
56101
56107
  lineWidth: line_width,
56102
56108
  lineDash: dash,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.106",
3
+ "version": "7.23.108",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -2456,8 +2456,29 @@ function figure_shape_of(gobj, desc, record, geometry, flags)
2456
2456
  let figure = node_figure_of(gobj, desc, geometry || {});
2457
2457
  let paint = node_paint_of(gobj, desc, geometry);
2458
2458
 
2459
- let stroke = paint.stroke;
2460
- let line_width = Math.max(paint.lineWidth, 1.5);
2459
+ /* THE SAME PAINT AS THE CARD, and that is the point: a card, a
2460
+ * pill and a figure are one record drawn at three sizes, so they
2461
+ * cannot wear two different colour languages. The card is html and
2462
+ * writes `color-mix()`; a canvas shape cannot, so the same mix is
2463
+ * computed here -- with `mix_colors()`, which is in this file
2464
+ * already and for this very reason (the ports).
2465
+ *
2466
+ * It also gives the figure an EDGE. It used to be the raw topic
2467
+ * colour filled, ringed by `getStrokeColor()` -- the same colour
2468
+ * darkened 20%, which measures 1.4:1 against its own fill: not a
2469
+ * border, a ramp, and a fan of them reads as a blurred picture.
2470
+ * Tint inside, vivid colour around it, and the canto is there. */
2471
+ let fill = dark? mix_colors(paint.fill, 0.25, "#2c3542")
2472
+ : mix_colors(paint.fill, 0.10, "#ffffff");
2473
+ let stroke = dark? mix_colors(paint.fill, 0.85, "#ffffff") : paint.fill;
2474
+ let line_width = 2;
2475
+ /* A paint somebody CHOSE (a node's or a topic's own, saved in
2476
+ * `__graphs__`) is not ours to reinterpret: it comes through as
2477
+ * it was chosen. */
2478
+ if(paint.stroke !== getStrokeColor(paint.fill)) {
2479
+ stroke = paint.stroke;
2480
+ line_width = Math.max(paint.lineWidth, 2);
2481
+ }
2461
2482
  if(f.selected) {
2462
2483
  stroke = SELECT_RING;
2463
2484
  line_width = 3;
@@ -2480,7 +2501,7 @@ function figure_shape_of(gobj, desc, record, geometry, flags)
2480
2501
  let style = {
2481
2502
  size: [side, side],
2482
2503
  radius: (figure === 'square')? Math.round(side / 5) : 0,
2483
- fill: paint.fill,
2504
+ fill: fill,
2484
2505
  stroke: stroke,
2485
2506
  lineWidth: line_width,
2486
2507
  lineDash: dash,
@@ -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
  ]