@yuneta/gobj-ui 7.23.176 → 7.23.177
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/dist/gobj-ui.cjs.js +34 -3
- package/dist/gobj-ui.es.js +34 -3
- package/package.json +1 -1
- package/src/yui_dev.js +69 -3
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -76448,7 +76448,12 @@ function ensure_dev_style() {
|
|
|
76448
76448
|
.dir-in .TRAFFIC_ARROW, .dir-in .TRAFFIC_EVENT { color: #059669; }
|
|
76449
76449
|
.dir-err .TRAFFIC_ARROW, .dir-err .TRAFFIC_EVENT { color: #dc2626; }
|
|
76450
76450
|
.TRAFFIC_META { margin-left: auto; opacity: 0.6; font-size: 11px; white-space: nowrap; }
|
|
76451
|
-
|
|
76451
|
+
/* The indent of a nested block is NOT a hover effect: it used to be given
|
|
76452
|
+
only on .TRAFFIC_ENTRY:hover, so moving the cursor across the log made
|
|
76453
|
+
every payload under it jump 16px sideways and reflow. A payload being
|
|
76454
|
+
read must not move because the pointer passed over it.
|
|
76455
|
+
(No backticks in here: this stylesheet is a template literal.) */
|
|
76456
|
+
.TRAFFIC_KW { margin: 2px 0 0 16px; }
|
|
76452
76457
|
.TRAFFIC_FULL { margin: 4px 0 0 16px; padding: 6px 8px; font-family: monospace; font-size: 11px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.04); border-radius: 4px; overflow-x: auto; }
|
|
76453
76458
|
.TRAFFIC_ROW { display: flex; gap: 6px; align-items: baseline; }
|
|
76454
76459
|
.TRAFFIC_BULLET { opacity: 0.45; flex: 0 0 auto; }
|
|
@@ -76562,6 +76567,29 @@ function traffic_scalar_row(key, value) {
|
|
|
76562
76567
|
]
|
|
76563
76568
|
];
|
|
76564
76569
|
}
|
|
76570
|
+
var PREVIEW_MAX_KEYS = 4;
|
|
76571
|
+
var PREVIEW_MAX_CHARS = 90;
|
|
76572
|
+
var PREVIEW_MAX_VALUE = 28;
|
|
76573
|
+
function preview_scalar(v) {
|
|
76574
|
+
if (v === null) return "null";
|
|
76575
|
+
if (typeof v === "string") return "\"" + (v.length > PREVIEW_MAX_VALUE ? v.slice(0, PREVIEW_MAX_VALUE) + "…" : v) + "\"";
|
|
76576
|
+
if (typeof v === "object") return Array.isArray(v) ? "[…]" : "{…}";
|
|
76577
|
+
return String(v);
|
|
76578
|
+
}
|
|
76579
|
+
function object_preview(obj, count) {
|
|
76580
|
+
let keys = Object.keys(obj);
|
|
76581
|
+
let parts = [];
|
|
76582
|
+
let used = 0;
|
|
76583
|
+
for (let k of keys) {
|
|
76584
|
+
if (parts.length >= PREVIEW_MAX_KEYS) break;
|
|
76585
|
+
let part = k + ": " + preview_scalar(obj[k]);
|
|
76586
|
+
if (parts.length > 0 && used + part.length > PREVIEW_MAX_CHARS) break;
|
|
76587
|
+
parts.push(part);
|
|
76588
|
+
used += part.length + 2;
|
|
76589
|
+
}
|
|
76590
|
+
if (parts.length < count) parts.push("…");
|
|
76591
|
+
return "{" + parts.join(", ") + "}";
|
|
76592
|
+
}
|
|
76565
76593
|
/************************************************************
|
|
76566
76594
|
* One field of any type. Scalars → a bullet row; objects and
|
|
76567
76595
|
* arrays → a collapsed <details> so metadata / nested payloads
|
|
@@ -76592,7 +76620,7 @@ function traffic_value_node(key, value) {
|
|
|
76592
76620
|
]
|
|
76593
76621
|
]
|
|
76594
76622
|
];
|
|
76595
|
-
let hint = is_arr ? `[${count}]` :
|
|
76623
|
+
let hint = is_arr ? `[${count}]` : object_preview(value, count);
|
|
76596
76624
|
return [
|
|
76597
76625
|
"details",
|
|
76598
76626
|
{ class: "TRAFFIC_NEST" },
|
|
@@ -76612,7 +76640,10 @@ function traffic_value_node(key, value) {
|
|
|
76612
76640
|
],
|
|
76613
76641
|
[
|
|
76614
76642
|
"span",
|
|
76615
|
-
{
|
|
76643
|
+
{
|
|
76644
|
+
class: "TRAFFIC_NEST_HINT",
|
|
76645
|
+
title: `${count}`
|
|
76646
|
+
},
|
|
76616
76647
|
hint
|
|
76617
76648
|
]
|
|
76618
76649
|
]
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -76443,7 +76443,12 @@ function ensure_dev_style() {
|
|
|
76443
76443
|
.dir-in .TRAFFIC_ARROW, .dir-in .TRAFFIC_EVENT { color: #059669; }
|
|
76444
76444
|
.dir-err .TRAFFIC_ARROW, .dir-err .TRAFFIC_EVENT { color: #dc2626; }
|
|
76445
76445
|
.TRAFFIC_META { margin-left: auto; opacity: 0.6; font-size: 11px; white-space: nowrap; }
|
|
76446
|
-
|
|
76446
|
+
/* The indent of a nested block is NOT a hover effect: it used to be given
|
|
76447
|
+
only on .TRAFFIC_ENTRY:hover, so moving the cursor across the log made
|
|
76448
|
+
every payload under it jump 16px sideways and reflow. A payload being
|
|
76449
|
+
read must not move because the pointer passed over it.
|
|
76450
|
+
(No backticks in here: this stylesheet is a template literal.) */
|
|
76451
|
+
.TRAFFIC_KW { margin: 2px 0 0 16px; }
|
|
76447
76452
|
.TRAFFIC_FULL { margin: 4px 0 0 16px; padding: 6px 8px; font-family: monospace; font-size: 11px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.04); border-radius: 4px; overflow-x: auto; }
|
|
76448
76453
|
.TRAFFIC_ROW { display: flex; gap: 6px; align-items: baseline; }
|
|
76449
76454
|
.TRAFFIC_BULLET { opacity: 0.45; flex: 0 0 auto; }
|
|
@@ -76557,6 +76562,29 @@ function traffic_scalar_row(key, value) {
|
|
|
76557
76562
|
]
|
|
76558
76563
|
];
|
|
76559
76564
|
}
|
|
76565
|
+
var PREVIEW_MAX_KEYS = 4;
|
|
76566
|
+
var PREVIEW_MAX_CHARS = 90;
|
|
76567
|
+
var PREVIEW_MAX_VALUE = 28;
|
|
76568
|
+
function preview_scalar(v) {
|
|
76569
|
+
if (v === null) return "null";
|
|
76570
|
+
if (typeof v === "string") return "\"" + (v.length > PREVIEW_MAX_VALUE ? v.slice(0, PREVIEW_MAX_VALUE) + "…" : v) + "\"";
|
|
76571
|
+
if (typeof v === "object") return Array.isArray(v) ? "[…]" : "{…}";
|
|
76572
|
+
return String(v);
|
|
76573
|
+
}
|
|
76574
|
+
function object_preview(obj, count) {
|
|
76575
|
+
let keys = Object.keys(obj);
|
|
76576
|
+
let parts = [];
|
|
76577
|
+
let used = 0;
|
|
76578
|
+
for (let k of keys) {
|
|
76579
|
+
if (parts.length >= PREVIEW_MAX_KEYS) break;
|
|
76580
|
+
let part = k + ": " + preview_scalar(obj[k]);
|
|
76581
|
+
if (parts.length > 0 && used + part.length > PREVIEW_MAX_CHARS) break;
|
|
76582
|
+
parts.push(part);
|
|
76583
|
+
used += part.length + 2;
|
|
76584
|
+
}
|
|
76585
|
+
if (parts.length < count) parts.push("…");
|
|
76586
|
+
return "{" + parts.join(", ") + "}";
|
|
76587
|
+
}
|
|
76560
76588
|
/************************************************************
|
|
76561
76589
|
* One field of any type. Scalars → a bullet row; objects and
|
|
76562
76590
|
* arrays → a collapsed <details> so metadata / nested payloads
|
|
@@ -76587,7 +76615,7 @@ function traffic_value_node(key, value) {
|
|
|
76587
76615
|
]
|
|
76588
76616
|
]
|
|
76589
76617
|
];
|
|
76590
|
-
let hint = is_arr ? `[${count}]` :
|
|
76618
|
+
let hint = is_arr ? `[${count}]` : object_preview(value, count);
|
|
76591
76619
|
return [
|
|
76592
76620
|
"details",
|
|
76593
76621
|
{ class: "TRAFFIC_NEST" },
|
|
@@ -76607,7 +76635,10 @@ function traffic_value_node(key, value) {
|
|
|
76607
76635
|
],
|
|
76608
76636
|
[
|
|
76609
76637
|
"span",
|
|
76610
|
-
{
|
|
76638
|
+
{
|
|
76639
|
+
class: "TRAFFIC_NEST_HINT",
|
|
76640
|
+
title: `${count}`
|
|
76641
|
+
},
|
|
76611
76642
|
hint
|
|
76612
76643
|
]
|
|
76613
76644
|
]
|
package/package.json
CHANGED
package/src/yui_dev.js
CHANGED
|
@@ -468,7 +468,12 @@ function ensure_dev_style()
|
|
|
468
468
|
.dir-in .TRAFFIC_ARROW, .dir-in .TRAFFIC_EVENT { color: #059669; }
|
|
469
469
|
.dir-err .TRAFFIC_ARROW, .dir-err .TRAFFIC_EVENT { color: #dc2626; }
|
|
470
470
|
.TRAFFIC_META { margin-left: auto; opacity: 0.6; font-size: 11px; white-space: nowrap; }
|
|
471
|
-
|
|
471
|
+
/* The indent of a nested block is NOT a hover effect: it used to be given
|
|
472
|
+
only on .TRAFFIC_ENTRY:hover, so moving the cursor across the log made
|
|
473
|
+
every payload under it jump 16px sideways and reflow. A payload being
|
|
474
|
+
read must not move because the pointer passed over it.
|
|
475
|
+
(No backticks in here: this stylesheet is a template literal.) */
|
|
476
|
+
.TRAFFIC_KW { margin: 2px 0 0 16px; }
|
|
472
477
|
.TRAFFIC_FULL { margin: 4px 0 0 16px; padding: 6px 8px; font-family: monospace; font-size: 11px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.04); border-radius: 4px; overflow-x: auto; }
|
|
473
478
|
.TRAFFIC_ROW { display: flex; gap: 6px; align-items: baseline; }
|
|
474
479
|
.TRAFFIC_BULLET { opacity: 0.45; flex: 0 0 auto; }
|
|
@@ -570,6 +575,67 @@ function traffic_scalar_row(key, value)
|
|
|
570
575
|
]];
|
|
571
576
|
}
|
|
572
577
|
|
|
578
|
+
/* What a FOLDED object says about itself, the way a browser console says it:
|
|
579
|
+
* its first fields rather than a count. `{5}` is true and tells the reader
|
|
580
|
+
* nothing -- a list of twelve column descriptors was twelve identical `{5}`,
|
|
581
|
+
* and finding the one for `tags` meant opening them one at a time. The
|
|
582
|
+
* console prints `Object { header: "id", fillspace: 18, … }` and that is the
|
|
583
|
+
* idea copied here.
|
|
584
|
+
*
|
|
585
|
+
* Strings are QUOTED, unlike the expanded rows: in one line of several
|
|
586
|
+
* fields the quotes are what separate a value from the next key.
|
|
587
|
+
* A nested container is not entered -- it says `{…}` / `[…]` -- because a
|
|
588
|
+
* preview that recursed would be as long as the thing it previews.
|
|
589
|
+
*
|
|
590
|
+
* The count is not lost: it stays in the tooltip, for an object whose first
|
|
591
|
+
* fields do not fit. */
|
|
592
|
+
const PREVIEW_MAX_KEYS = 4;
|
|
593
|
+
const PREVIEW_MAX_CHARS = 90;
|
|
594
|
+
const PREVIEW_MAX_VALUE = 28;
|
|
595
|
+
|
|
596
|
+
function preview_scalar(v)
|
|
597
|
+
{
|
|
598
|
+
if(v === null) {
|
|
599
|
+
return "null";
|
|
600
|
+
}
|
|
601
|
+
if(typeof v === "string") {
|
|
602
|
+
let text = (v.length > PREVIEW_MAX_VALUE) ?
|
|
603
|
+
v.slice(0, PREVIEW_MAX_VALUE) + "…" : v;
|
|
604
|
+
return '"' + text + '"';
|
|
605
|
+
}
|
|
606
|
+
if(typeof v === "object") {
|
|
607
|
+
return Array.isArray(v) ? "[…]" : "{…}";
|
|
608
|
+
}
|
|
609
|
+
return String(v);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function object_preview(obj, count)
|
|
613
|
+
{
|
|
614
|
+
let keys = Object.keys(obj);
|
|
615
|
+
let parts = [];
|
|
616
|
+
let used = 0;
|
|
617
|
+
|
|
618
|
+
for(let k of keys) {
|
|
619
|
+
if(parts.length >= PREVIEW_MAX_KEYS) {
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
let part = k + ": " + preview_scalar(obj[k]);
|
|
623
|
+
/* Stop at the width, but never with an empty preview: one field
|
|
624
|
+
too wide still says more than a number. */
|
|
625
|
+
if(parts.length > 0 && used + part.length > PREVIEW_MAX_CHARS) {
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
parts.push(part);
|
|
629
|
+
used += part.length + 2;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if(parts.length < count) {
|
|
633
|
+
parts.push("…");
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
return "{" + parts.join(", ") + "}";
|
|
637
|
+
}
|
|
638
|
+
|
|
573
639
|
/************************************************************
|
|
574
640
|
* One field of any type. Scalars → a bullet row; objects and
|
|
575
641
|
* arrays → a collapsed <details> so metadata / nested payloads
|
|
@@ -591,12 +657,12 @@ function traffic_value_node(key, value)
|
|
|
591
657
|
]];
|
|
592
658
|
}
|
|
593
659
|
|
|
594
|
-
let hint = is_arr ? `[${count}]` :
|
|
660
|
+
let hint = is_arr ? `[${count}]` : object_preview(value, count);
|
|
595
661
|
return ['details', {class: 'TRAFFIC_NEST'}, [
|
|
596
662
|
['summary', {}, [
|
|
597
663
|
['span', {class: 'TRAFFIC_BULLET'}, '▸'],
|
|
598
664
|
['span', {class: 'TRAFFIC_NEST_KEY'}, key],
|
|
599
|
-
['span', {class: 'TRAFFIC_NEST_HINT'}, hint],
|
|
665
|
+
['span', {class: 'TRAFFIC_NEST_HINT', title: `${count}`}, hint],
|
|
600
666
|
]],
|
|
601
667
|
['div', {class: 'TRAFFIC_KW'}, traffic_bullets(value)],
|
|
602
668
|
]];
|